aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sky2.c
diff options
context:
space:
mode:
authorstephen hemminger <shemminger@vyatta.com>2010-02-12 01:58:01 -0500
committerDavid S. Miller <davem@davemloft.net>2010-02-12 19:21:01 -0500
commit44dde56d37787cbad2e867a41fe87d6b0aa37fc8 (patch)
tree6d4c29aaa54afbf07938a7d31e3dc56f2f16c9be /drivers/net/sky2.c
parent87b09f1f25cd1e01d7c50bf423c7fe33027d7511 (diff)
sky2: jumbo packet changes
Change how FIFO is programmed in jumbo mode (to match vendor driver). Mostly cosmetic, the only register change is that the bits 22,23 are not programemd used. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/sky2.c')
-rw-r--r--drivers/net/sky2.c36
1 files changed, 14 insertions, 22 deletions
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index 249484220a5f..8a87e16e732f 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -798,29 +798,15 @@ static void sky2_set_tx_stfwd(struct sky2_hw *hw, unsigned port)
798 hw->chip_rev != CHIP_REV_YU_EX_A0) || 798 hw->chip_rev != CHIP_REV_YU_EX_A0) ||
799 hw->chip_id >= CHIP_ID_YUKON_FE_P) { 799 hw->chip_id >= CHIP_ID_YUKON_FE_P) {
800 /* Yukon-Extreme B0 and further Extreme devices */ 800 /* Yukon-Extreme B0 and further Extreme devices */
801 /* enable Store & Forward mode for TX */ 801 sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T), TX_STFW_ENA);
802 } else if (dev->mtu > ETH_DATA_LEN) {
803 /* set Tx GMAC FIFO Almost Empty Threshold */
804 sky2_write32(hw, SK_REG(port, TX_GMF_AE_THR),
805 (ECU_JUMBO_WM << 16) | ECU_AE_THR);
802 806
803 if (dev->mtu <= ETH_DATA_LEN) 807 sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T), TX_STFW_DIS);
804 sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T), 808 } else
805 TX_JUMBO_DIS | TX_STFW_ENA); 809 sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T), TX_STFW_ENA);
806
807 else
808 sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T),
809 TX_JUMBO_ENA| TX_STFW_ENA);
810 } else {
811 if (dev->mtu <= ETH_DATA_LEN)
812 sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T), TX_STFW_ENA);
813 else {
814 /* set Tx GMAC FIFO Almost Empty Threshold */
815 sky2_write32(hw, SK_REG(port, TX_GMF_AE_THR),
816 (ECU_JUMBO_WM << 16) | ECU_AE_THR);
817
818 sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T), TX_STFW_DIS);
819
820 /* Can't do offload because of lack of store/forward */
821 dev->features &= ~(NETIF_F_TSO | NETIF_F_SG | NETIF_F_ALL_CSUM);
822 }
823 }
824} 810}
825 811
826static void sky2_mac_init(struct sky2_hw *hw, unsigned port) 812static void sky2_mac_init(struct sky2_hw *hw, unsigned port)
@@ -2206,14 +2192,20 @@ static int sky2_change_mtu(struct net_device *dev, int new_mtu)
2206 u16 ctl, mode; 2192 u16 ctl, mode;
2207 u32 imask; 2193 u32 imask;
2208 2194
2195 /* MTU size outside the spec */
2209 if (new_mtu < ETH_ZLEN || new_mtu > ETH_JUMBO_MTU) 2196 if (new_mtu < ETH_ZLEN || new_mtu > ETH_JUMBO_MTU)
2210 return -EINVAL; 2197 return -EINVAL;
2211 2198
2199 /* MTU > 1500 on yukon FE and FE+ not allowed */
2212 if (new_mtu > ETH_DATA_LEN && 2200 if (new_mtu > ETH_DATA_LEN &&
2213 (hw->chip_id == CHIP_ID_YUKON_FE || 2201 (hw->chip_id == CHIP_ID_YUKON_FE ||
2214 hw->chip_id == CHIP_ID_YUKON_FE_P)) 2202 hw->chip_id == CHIP_ID_YUKON_FE_P))
2215 return -EINVAL; 2203 return -EINVAL;
2216 2204
2205 /* TSO, etc on Yukon Ultra and MTU > 1500 not supported */
2206 if (new_mtu > ETH_DATA_LEN && hw->chip_id == CHIP_ID_YUKON_EC_U)
2207 dev->features &= ~(NETIF_F_TSO|NETIF_F_SG|NETIF_F_ALL_CSUM);
2208
2217 if (!netif_running(dev)) { 2209 if (!netif_running(dev)) {
2218 dev->mtu = new_mtu; 2210 dev->mtu = new_mtu;
2219 return 0; 2211 return 0;