aboutsummaryrefslogtreecommitdiffstats
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
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>
-rw-r--r--drivers/net/sky2.c36
-rw-r--r--drivers/net/sky2.h8
2 files changed, 18 insertions, 26 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;
diff --git a/drivers/net/sky2.h b/drivers/net/sky2.h
index 54cb303443e0..a5e182dd9819 100644
--- a/drivers/net/sky2.h
+++ b/drivers/net/sky2.h
@@ -1895,14 +1895,14 @@ enum {
1895 1895
1896/* TX_GMF_CTRL_T 32 bit Tx GMAC FIFO Control/Test */ 1896/* TX_GMF_CTRL_T 32 bit Tx GMAC FIFO Control/Test */
1897enum { 1897enum {
1898 TX_STFW_DIS = 1<<31,/* Disable Store & Forward (Yukon-EC Ultra) */ 1898 TX_STFW_DIS = 1<<31,/* Disable Store & Forward */
1899 TX_STFW_ENA = 1<<30,/* Enable Store & Forward (Yukon-EC Ultra) */ 1899 TX_STFW_ENA = 1<<30,/* Enable Store & Forward */
1900 1900
1901 TX_VLAN_TAG_ON = 1<<25,/* enable VLAN tagging */ 1901 TX_VLAN_TAG_ON = 1<<25,/* enable VLAN tagging */
1902 TX_VLAN_TAG_OFF = 1<<24,/* disable VLAN tagging */ 1902 TX_VLAN_TAG_OFF = 1<<24,/* disable VLAN tagging */
1903 1903
1904 TX_JUMBO_ENA = 1<<23,/* PCI Jumbo Mode enable (Yukon-EC Ultra) */ 1904 TX_PCI_JUM_ENA = 1<<23,/* PCI Jumbo Mode enable */
1905 TX_JUMBO_DIS = 1<<22,/* PCI Jumbo Mode enable (Yukon-EC Ultra) */ 1905 TX_PCI_JUM_DIS = 1<<22,/* PCI Jumbo Mode enable */
1906 1906
1907 GMF_WSP_TST_ON = 1<<18,/* Write Shadow Pointer Test On */ 1907 GMF_WSP_TST_ON = 1<<18,/* Write Shadow Pointer Test On */
1908 GMF_WSP_TST_OFF = 1<<17,/* Write Shadow Pointer Test Off */ 1908 GMF_WSP_TST_OFF = 1<<17,/* Write Shadow Pointer Test Off */