diff options
author | Arjan van de Ven <arjan@linux.intel.com> | 2006-12-12 08:06:23 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-02-05 16:58:45 -0500 |
commit | 1d39ed565cfcc7c4fe586de621aef495c4f94ffb (patch) | |
tree | af3280a25eb796385c851dc7b83e82f0ff38f1ac /drivers/net | |
parent | 6d24998f07588ca83ce04e60af5a79e805df7532 (diff) |
remove NETIF_F_TSO ifdefery
Remove the NETIF_F_TSO #ifdef-ery in drivers/net; this was
for old-old-2.4 compat (even current 2.4 has NETIF_F_TSO)
but it's time to get rid of it by now.
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/bnx2.c | 12 | ||||
-rw-r--r-- | drivers/net/e1000/e1000.h | 6 | ||||
-rw-r--r-- | drivers/net/e1000/e1000_ethtool.c | 6 | ||||
-rw-r--r-- | drivers/net/e1000/e1000_main.c | 26 | ||||
-rw-r--r-- | drivers/net/forcedeth.c | 6 | ||||
-rw-r--r-- | drivers/net/ixgb/ixgb.h | 2 | ||||
-rw-r--r-- | drivers/net/ixgb/ixgb_ethtool.c | 6 | ||||
-rw-r--r-- | drivers/net/ixgb/ixgb_main.c | 4 | ||||
-rw-r--r-- | drivers/net/myri10ge/myri10ge.c | 10 | ||||
-rw-r--r-- | drivers/net/s2io.c | 8 | ||||
-rw-r--r-- | drivers/net/tg3.c | 32 |
11 files changed, 3 insertions, 115 deletions
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index ee7b75b976b5..8e96154be031 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c | |||
@@ -39,12 +39,10 @@ | |||
39 | #include <linux/if_vlan.h> | 39 | #include <linux/if_vlan.h> |
40 | #define BCM_VLAN 1 | 40 | #define BCM_VLAN 1 |
41 | #endif | 41 | #endif |
42 | #ifdef NETIF_F_TSO | ||
43 | #include <net/ip.h> | 42 | #include <net/ip.h> |
44 | #include <net/tcp.h> | 43 | #include <net/tcp.h> |
45 | #include <net/checksum.h> | 44 | #include <net/checksum.h> |
46 | #define BCM_TSO 1 | 45 | #define BCM_TSO 1 |
47 | #endif | ||
48 | #include <linux/workqueue.h> | 46 | #include <linux/workqueue.h> |
49 | #include <linux/crc32.h> | 47 | #include <linux/crc32.h> |
50 | #include <linux/prefetch.h> | 48 | #include <linux/prefetch.h> |
@@ -1728,7 +1726,7 @@ bnx2_tx_int(struct bnx2 *bp) | |||
1728 | 1726 | ||
1729 | tx_buf = &bp->tx_buf_ring[sw_ring_cons]; | 1727 | tx_buf = &bp->tx_buf_ring[sw_ring_cons]; |
1730 | skb = tx_buf->skb; | 1728 | skb = tx_buf->skb; |
1731 | #ifdef BCM_TSO | 1729 | |
1732 | /* partial BD completions possible with TSO packets */ | 1730 | /* partial BD completions possible with TSO packets */ |
1733 | if (skb_is_gso(skb)) { | 1731 | if (skb_is_gso(skb)) { |
1734 | u16 last_idx, last_ring_idx; | 1732 | u16 last_idx, last_ring_idx; |
@@ -1744,7 +1742,7 @@ bnx2_tx_int(struct bnx2 *bp) | |||
1744 | break; | 1742 | break; |
1745 | } | 1743 | } |
1746 | } | 1744 | } |
1747 | #endif | 1745 | |
1748 | pci_unmap_single(bp->pdev, pci_unmap_addr(tx_buf, mapping), | 1746 | pci_unmap_single(bp->pdev, pci_unmap_addr(tx_buf, mapping), |
1749 | skb_headlen(skb), PCI_DMA_TODEVICE); | 1747 | skb_headlen(skb), PCI_DMA_TODEVICE); |
1750 | 1748 | ||
@@ -4514,7 +4512,6 @@ bnx2_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
4514 | vlan_tag_flags |= | 4512 | vlan_tag_flags |= |
4515 | (TX_BD_FLAGS_VLAN_TAG | (vlan_tx_tag_get(skb) << 16)); | 4513 | (TX_BD_FLAGS_VLAN_TAG | (vlan_tx_tag_get(skb) << 16)); |
4516 | } | 4514 | } |
4517 | #ifdef BCM_TSO | ||
4518 | if ((mss = skb_shinfo(skb)->gso_size) && | 4515 | if ((mss = skb_shinfo(skb)->gso_size) && |
4519 | (skb->len > (bp->dev->mtu + ETH_HLEN))) { | 4516 | (skb->len > (bp->dev->mtu + ETH_HLEN))) { |
4520 | u32 tcp_opt_len, ip_tcp_len; | 4517 | u32 tcp_opt_len, ip_tcp_len; |
@@ -4547,7 +4544,6 @@ bnx2_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
4547 | } | 4544 | } |
4548 | } | 4545 | } |
4549 | else | 4546 | else |
4550 | #endif | ||
4551 | { | 4547 | { |
4552 | mss = 0; | 4548 | mss = 0; |
4553 | } | 4549 | } |
@@ -5544,10 +5540,8 @@ static const struct ethtool_ops bnx2_ethtool_ops = { | |||
5544 | .set_tx_csum = ethtool_op_set_tx_csum, | 5540 | .set_tx_csum = ethtool_op_set_tx_csum, |
5545 | .get_sg = ethtool_op_get_sg, | 5541 | .get_sg = ethtool_op_get_sg, |
5546 | .set_sg = ethtool_op_set_sg, | 5542 | .set_sg = ethtool_op_set_sg, |
5547 | #ifdef BCM_TSO | ||
5548 | .get_tso = ethtool_op_get_tso, | 5543 | .get_tso = ethtool_op_get_tso, |
5549 | .set_tso = bnx2_set_tso, | 5544 | .set_tso = bnx2_set_tso, |
5550 | #endif | ||
5551 | .self_test_count = bnx2_self_test_count, | 5545 | .self_test_count = bnx2_self_test_count, |
5552 | .self_test = bnx2_self_test, | 5546 | .self_test = bnx2_self_test, |
5553 | .get_strings = bnx2_get_strings, | 5547 | .get_strings = bnx2_get_strings, |
@@ -6104,9 +6098,7 @@ bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
6104 | #ifdef BCM_VLAN | 6098 | #ifdef BCM_VLAN |
6105 | dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; | 6099 | dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; |
6106 | #endif | 6100 | #endif |
6107 | #ifdef BCM_TSO | ||
6108 | dev->features |= NETIF_F_TSO | NETIF_F_TSO_ECN; | 6101 | dev->features |= NETIF_F_TSO | NETIF_F_TSO_ECN; |
6109 | #endif | ||
6110 | 6102 | ||
6111 | netif_carrier_off(bp->dev); | 6103 | netif_carrier_off(bp->dev); |
6112 | 6104 | ||
diff --git a/drivers/net/e1000/e1000.h b/drivers/net/e1000/e1000.h index 8e7acb08d9a3..689f158a469e 100644 --- a/drivers/net/e1000/e1000.h +++ b/drivers/net/e1000/e1000.h | |||
@@ -59,17 +59,13 @@ | |||
59 | #include <linux/capability.h> | 59 | #include <linux/capability.h> |
60 | #include <linux/in.h> | 60 | #include <linux/in.h> |
61 | #include <linux/ip.h> | 61 | #include <linux/ip.h> |
62 | #ifdef NETIF_F_TSO6 | ||
63 | #include <linux/ipv6.h> | 62 | #include <linux/ipv6.h> |
64 | #endif | ||
65 | #include <linux/tcp.h> | 63 | #include <linux/tcp.h> |
66 | #include <linux/udp.h> | 64 | #include <linux/udp.h> |
67 | #include <net/pkt_sched.h> | 65 | #include <net/pkt_sched.h> |
68 | #include <linux/list.h> | 66 | #include <linux/list.h> |
69 | #include <linux/reboot.h> | 67 | #include <linux/reboot.h> |
70 | #ifdef NETIF_F_TSO | ||
71 | #include <net/checksum.h> | 68 | #include <net/checksum.h> |
72 | #endif | ||
73 | #include <linux/mii.h> | 69 | #include <linux/mii.h> |
74 | #include <linux/ethtool.h> | 70 | #include <linux/ethtool.h> |
75 | #include <linux/if_vlan.h> | 71 | #include <linux/if_vlan.h> |
@@ -347,9 +343,7 @@ struct e1000_adapter { | |||
347 | boolean_t have_msi; | 343 | boolean_t have_msi; |
348 | #endif | 344 | #endif |
349 | /* to not mess up cache alignment, always add to the bottom */ | 345 | /* to not mess up cache alignment, always add to the bottom */ |
350 | #ifdef NETIF_F_TSO | ||
351 | boolean_t tso_force; | 346 | boolean_t tso_force; |
352 | #endif | ||
353 | boolean_t smart_power_down; /* phy smart power down */ | 347 | boolean_t smart_power_down; /* phy smart power down */ |
354 | boolean_t quad_port_a; | 348 | boolean_t quad_port_a; |
355 | unsigned long flags; | 349 | unsigned long flags; |
diff --git a/drivers/net/e1000/e1000_ethtool.c b/drivers/net/e1000/e1000_ethtool.c index fb96c87f9e56..44ebc72962dc 100644 --- a/drivers/net/e1000/e1000_ethtool.c +++ b/drivers/net/e1000/e1000_ethtool.c | |||
@@ -338,7 +338,6 @@ e1000_set_tx_csum(struct net_device *netdev, uint32_t data) | |||
338 | return 0; | 338 | return 0; |
339 | } | 339 | } |
340 | 340 | ||
341 | #ifdef NETIF_F_TSO | ||
342 | static int | 341 | static int |
343 | e1000_set_tso(struct net_device *netdev, uint32_t data) | 342 | e1000_set_tso(struct net_device *netdev, uint32_t data) |
344 | { | 343 | { |
@@ -352,18 +351,15 @@ e1000_set_tso(struct net_device *netdev, uint32_t data) | |||
352 | else | 351 | else |
353 | netdev->features &= ~NETIF_F_TSO; | 352 | netdev->features &= ~NETIF_F_TSO; |
354 | 353 | ||
355 | #ifdef NETIF_F_TSO6 | ||
356 | if (data) | 354 | if (data) |
357 | netdev->features |= NETIF_F_TSO6; | 355 | netdev->features |= NETIF_F_TSO6; |
358 | else | 356 | else |
359 | netdev->features &= ~NETIF_F_TSO6; | 357 | netdev->features &= ~NETIF_F_TSO6; |
360 | #endif | ||
361 | 358 | ||
362 | DPRINTK(PROBE, INFO, "TSO is %s\n", data ? "Enabled" : "Disabled"); | 359 | DPRINTK(PROBE, INFO, "TSO is %s\n", data ? "Enabled" : "Disabled"); |
363 | adapter->tso_force = TRUE; | 360 | adapter->tso_force = TRUE; |
364 | return 0; | 361 | return 0; |
365 | } | 362 | } |
366 | #endif /* NETIF_F_TSO */ | ||
367 | 363 | ||
368 | static uint32_t | 364 | static uint32_t |
369 | e1000_get_msglevel(struct net_device *netdev) | 365 | e1000_get_msglevel(struct net_device *netdev) |
@@ -1971,10 +1967,8 @@ static const struct ethtool_ops e1000_ethtool_ops = { | |||
1971 | .set_tx_csum = e1000_set_tx_csum, | 1967 | .set_tx_csum = e1000_set_tx_csum, |
1972 | .get_sg = ethtool_op_get_sg, | 1968 | .get_sg = ethtool_op_get_sg, |
1973 | .set_sg = ethtool_op_set_sg, | 1969 | .set_sg = ethtool_op_set_sg, |
1974 | #ifdef NETIF_F_TSO | ||
1975 | .get_tso = ethtool_op_get_tso, | 1970 | .get_tso = ethtool_op_get_tso, |
1976 | .set_tso = e1000_set_tso, | 1971 | .set_tso = e1000_set_tso, |
1977 | #endif | ||
1978 | .self_test_count = e1000_diag_test_count, | 1972 | .self_test_count = e1000_diag_test_count, |
1979 | .self_test = e1000_diag_test, | 1973 | .self_test = e1000_diag_test, |
1980 | .get_strings = e1000_get_strings, | 1974 | .get_strings = e1000_get_strings, |
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index 2035ca4dc119..222fcd2d10de 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c | |||
@@ -990,16 +990,12 @@ e1000_probe(struct pci_dev *pdev, | |||
990 | netdev->features &= ~NETIF_F_HW_VLAN_FILTER; | 990 | netdev->features &= ~NETIF_F_HW_VLAN_FILTER; |
991 | } | 991 | } |
992 | 992 | ||
993 | #ifdef NETIF_F_TSO | ||
994 | if ((adapter->hw.mac_type >= e1000_82544) && | 993 | if ((adapter->hw.mac_type >= e1000_82544) && |
995 | (adapter->hw.mac_type != e1000_82547)) | 994 | (adapter->hw.mac_type != e1000_82547)) |
996 | netdev->features |= NETIF_F_TSO; | 995 | netdev->features |= NETIF_F_TSO; |
997 | 996 | ||
998 | #ifdef NETIF_F_TSO6 | ||
999 | if (adapter->hw.mac_type > e1000_82547_rev_2) | 997 | if (adapter->hw.mac_type > e1000_82547_rev_2) |
1000 | netdev->features |= NETIF_F_TSO6; | 998 | netdev->features |= NETIF_F_TSO6; |
1001 | #endif | ||
1002 | #endif | ||
1003 | if (pci_using_dac) | 999 | if (pci_using_dac) |
1004 | netdev->features |= NETIF_F_HIGHDMA; | 1000 | netdev->features |= NETIF_F_HIGHDMA; |
1005 | 1001 | ||
@@ -2626,7 +2622,6 @@ e1000_watchdog(unsigned long data) | |||
2626 | E1000_WRITE_REG(&adapter->hw, TARC0, tarc0); | 2622 | E1000_WRITE_REG(&adapter->hw, TARC0, tarc0); |
2627 | } | 2623 | } |
2628 | 2624 | ||
2629 | #ifdef NETIF_F_TSO | ||
2630 | /* disable TSO for pcie and 10/100 speeds, to avoid | 2625 | /* disable TSO for pcie and 10/100 speeds, to avoid |
2631 | * some hardware issues */ | 2626 | * some hardware issues */ |
2632 | if (!adapter->tso_force && | 2627 | if (!adapter->tso_force && |
@@ -2637,22 +2632,17 @@ e1000_watchdog(unsigned long data) | |||
2637 | DPRINTK(PROBE,INFO, | 2632 | DPRINTK(PROBE,INFO, |
2638 | "10/100 speed: disabling TSO\n"); | 2633 | "10/100 speed: disabling TSO\n"); |
2639 | netdev->features &= ~NETIF_F_TSO; | 2634 | netdev->features &= ~NETIF_F_TSO; |
2640 | #ifdef NETIF_F_TSO6 | ||
2641 | netdev->features &= ~NETIF_F_TSO6; | 2635 | netdev->features &= ~NETIF_F_TSO6; |
2642 | #endif | ||
2643 | break; | 2636 | break; |
2644 | case SPEED_1000: | 2637 | case SPEED_1000: |
2645 | netdev->features |= NETIF_F_TSO; | 2638 | netdev->features |= NETIF_F_TSO; |
2646 | #ifdef NETIF_F_TSO6 | ||
2647 | netdev->features |= NETIF_F_TSO6; | 2639 | netdev->features |= NETIF_F_TSO6; |
2648 | #endif | ||
2649 | break; | 2640 | break; |
2650 | default: | 2641 | default: |
2651 | /* oops */ | 2642 | /* oops */ |
2652 | break; | 2643 | break; |
2653 | } | 2644 | } |
2654 | } | 2645 | } |
2655 | #endif | ||
2656 | 2646 | ||
2657 | /* enable transmits in the hardware, need to do this | 2647 | /* enable transmits in the hardware, need to do this |
2658 | * after setting TARC0 */ | 2648 | * after setting TARC0 */ |
@@ -2882,7 +2872,6 @@ static int | |||
2882 | e1000_tso(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring, | 2872 | e1000_tso(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring, |
2883 | struct sk_buff *skb) | 2873 | struct sk_buff *skb) |
2884 | { | 2874 | { |
2885 | #ifdef NETIF_F_TSO | ||
2886 | struct e1000_context_desc *context_desc; | 2875 | struct e1000_context_desc *context_desc; |
2887 | struct e1000_buffer *buffer_info; | 2876 | struct e1000_buffer *buffer_info; |
2888 | unsigned int i; | 2877 | unsigned int i; |
@@ -2911,7 +2900,6 @@ e1000_tso(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring, | |||
2911 | 0); | 2900 | 0); |
2912 | cmd_length = E1000_TXD_CMD_IP; | 2901 | cmd_length = E1000_TXD_CMD_IP; |
2913 | ipcse = skb->h.raw - skb->data - 1; | 2902 | ipcse = skb->h.raw - skb->data - 1; |
2914 | #ifdef NETIF_F_TSO6 | ||
2915 | } else if (skb->protocol == htons(ETH_P_IPV6)) { | 2903 | } else if (skb->protocol == htons(ETH_P_IPV6)) { |
2916 | skb->nh.ipv6h->payload_len = 0; | 2904 | skb->nh.ipv6h->payload_len = 0; |
2917 | skb->h.th->check = | 2905 | skb->h.th->check = |
@@ -2921,7 +2909,6 @@ e1000_tso(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring, | |||
2921 | IPPROTO_TCP, | 2909 | IPPROTO_TCP, |
2922 | 0); | 2910 | 0); |
2923 | ipcse = 0; | 2911 | ipcse = 0; |
2924 | #endif | ||
2925 | } | 2912 | } |
2926 | ipcss = skb->nh.raw - skb->data; | 2913 | ipcss = skb->nh.raw - skb->data; |
2927 | ipcso = (void *)&(skb->nh.iph->check) - (void *)skb->data; | 2914 | ipcso = (void *)&(skb->nh.iph->check) - (void *)skb->data; |
@@ -2954,8 +2941,6 @@ e1000_tso(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring, | |||
2954 | 2941 | ||
2955 | return TRUE; | 2942 | return TRUE; |
2956 | } | 2943 | } |
2957 | #endif | ||
2958 | |||
2959 | return FALSE; | 2944 | return FALSE; |
2960 | } | 2945 | } |
2961 | 2946 | ||
@@ -3013,7 +2998,6 @@ e1000_tx_map(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring, | |||
3013 | while (len) { | 2998 | while (len) { |
3014 | buffer_info = &tx_ring->buffer_info[i]; | 2999 | buffer_info = &tx_ring->buffer_info[i]; |
3015 | size = min(len, max_per_txd); | 3000 | size = min(len, max_per_txd); |
3016 | #ifdef NETIF_F_TSO | ||
3017 | /* Workaround for Controller erratum -- | 3001 | /* Workaround for Controller erratum -- |
3018 | * descriptor for non-tso packet in a linear SKB that follows a | 3002 | * descriptor for non-tso packet in a linear SKB that follows a |
3019 | * tso gets written back prematurely before the data is fully | 3003 | * tso gets written back prematurely before the data is fully |
@@ -3028,7 +3012,6 @@ e1000_tx_map(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring, | |||
3028 | * in TSO mode. Append 4-byte sentinel desc */ | 3012 | * in TSO mode. Append 4-byte sentinel desc */ |
3029 | if (unlikely(mss && !nr_frags && size == len && size > 8)) | 3013 | if (unlikely(mss && !nr_frags && size == len && size > 8)) |
3030 | size -= 4; | 3014 | size -= 4; |
3031 | #endif | ||
3032 | /* work-around for errata 10 and it applies | 3015 | /* work-around for errata 10 and it applies |
3033 | * to all controllers in PCI-X mode | 3016 | * to all controllers in PCI-X mode |
3034 | * The fix is to make sure that the first descriptor of a | 3017 | * The fix is to make sure that the first descriptor of a |
@@ -3070,12 +3053,10 @@ e1000_tx_map(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring, | |||
3070 | while (len) { | 3053 | while (len) { |
3071 | buffer_info = &tx_ring->buffer_info[i]; | 3054 | buffer_info = &tx_ring->buffer_info[i]; |
3072 | size = min(len, max_per_txd); | 3055 | size = min(len, max_per_txd); |
3073 | #ifdef NETIF_F_TSO | ||
3074 | /* Workaround for premature desc write-backs | 3056 | /* Workaround for premature desc write-backs |
3075 | * in TSO mode. Append 4-byte sentinel desc */ | 3057 | * in TSO mode. Append 4-byte sentinel desc */ |
3076 | if (unlikely(mss && f == (nr_frags-1) && size == len && size > 8)) | 3058 | if (unlikely(mss && f == (nr_frags-1) && size == len && size > 8)) |
3077 | size -= 4; | 3059 | size -= 4; |
3078 | #endif | ||
3079 | /* Workaround for potential 82544 hang in PCI-X. | 3060 | /* Workaround for potential 82544 hang in PCI-X. |
3080 | * Avoid terminating buffers within evenly-aligned | 3061 | * Avoid terminating buffers within evenly-aligned |
3081 | * dwords. */ | 3062 | * dwords. */ |
@@ -3300,7 +3281,6 @@ e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
3300 | if (adapter->hw.mac_type >= e1000_82571) | 3281 | if (adapter->hw.mac_type >= e1000_82571) |
3301 | max_per_txd = 8192; | 3282 | max_per_txd = 8192; |
3302 | 3283 | ||
3303 | #ifdef NETIF_F_TSO | ||
3304 | mss = skb_shinfo(skb)->gso_size; | 3284 | mss = skb_shinfo(skb)->gso_size; |
3305 | /* The controller does a simple calculation to | 3285 | /* The controller does a simple calculation to |
3306 | * make sure there is enough room in the FIFO before | 3286 | * make sure there is enough room in the FIFO before |
@@ -3354,16 +3334,10 @@ e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
3354 | if ((mss) || (skb->ip_summed == CHECKSUM_PARTIAL)) | 3334 | if ((mss) || (skb->ip_summed == CHECKSUM_PARTIAL)) |
3355 | count++; | 3335 | count++; |
3356 | count++; | 3336 | count++; |
3357 | #else | ||
3358 | if (skb->ip_summed == CHECKSUM_PARTIAL) | ||
3359 | count++; | ||
3360 | #endif | ||
3361 | 3337 | ||
3362 | #ifdef NETIF_F_TSO | ||
3363 | /* Controller Erratum workaround */ | 3338 | /* Controller Erratum workaround */ |
3364 | if (!skb->data_len && tx_ring->last_tx_tso && !skb_is_gso(skb)) | 3339 | if (!skb->data_len && tx_ring->last_tx_tso && !skb_is_gso(skb)) |
3365 | count++; | 3340 | count++; |
3366 | #endif | ||
3367 | 3341 | ||
3368 | count += TXD_USE_COUNT(len, max_txd_pwr); | 3342 | count += TXD_USE_COUNT(len, max_txd_pwr); |
3369 | 3343 | ||
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c index 93f2b7a22160..60441e5638fe 100644 --- a/drivers/net/forcedeth.c +++ b/drivers/net/forcedeth.c | |||
@@ -1576,12 +1576,10 @@ static int nv_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1576 | 1576 | ||
1577 | np->tx_skbuff[nr] = skb; | 1577 | np->tx_skbuff[nr] = skb; |
1578 | 1578 | ||
1579 | #ifdef NETIF_F_TSO | ||
1580 | if (skb_is_gso(skb)) | 1579 | if (skb_is_gso(skb)) |
1581 | tx_flags_extra = NV_TX2_TSO | (skb_shinfo(skb)->gso_size << NV_TX2_TSO_SHIFT); | 1580 | tx_flags_extra = NV_TX2_TSO | (skb_shinfo(skb)->gso_size << NV_TX2_TSO_SHIFT); |
1582 | else | 1581 | else |
1583 | #endif | 1582 | tx_flags_extra = skb->ip_summed == CHECKSUM_PARTIAL ? |
1584 | tx_flags_extra = skb->ip_summed == CHECKSUM_PARTIAL ? | ||
1585 | NV_TX2_CHECKSUM_L3 | NV_TX2_CHECKSUM_L4 : 0; | 1583 | NV_TX2_CHECKSUM_L3 | NV_TX2_CHECKSUM_L4 : 0; |
1586 | 1584 | ||
1587 | /* vlan tag */ | 1585 | /* vlan tag */ |
@@ -4475,9 +4473,7 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i | |||
4475 | np->rx_csum = 1; | 4473 | np->rx_csum = 1; |
4476 | np->txrxctl_bits |= NVREG_TXRXCTL_RXCHECK; | 4474 | np->txrxctl_bits |= NVREG_TXRXCTL_RXCHECK; |
4477 | dev->features |= NETIF_F_HW_CSUM | NETIF_F_SG; | 4475 | dev->features |= NETIF_F_HW_CSUM | NETIF_F_SG; |
4478 | #ifdef NETIF_F_TSO | ||
4479 | dev->features |= NETIF_F_TSO; | 4476 | dev->features |= NETIF_F_TSO; |
4480 | #endif | ||
4481 | } | 4477 | } |
4482 | 4478 | ||
4483 | np->vlanctl_bits = 0; | 4479 | np->vlanctl_bits = 0; |
diff --git a/drivers/net/ixgb/ixgb.h b/drivers/net/ixgb/ixgb.h index f4aba4355b19..cf30a1059ce0 100644 --- a/drivers/net/ixgb/ixgb.h +++ b/drivers/net/ixgb/ixgb.h | |||
@@ -61,9 +61,7 @@ | |||
61 | #include <net/pkt_sched.h> | 61 | #include <net/pkt_sched.h> |
62 | #include <linux/list.h> | 62 | #include <linux/list.h> |
63 | #include <linux/reboot.h> | 63 | #include <linux/reboot.h> |
64 | #ifdef NETIF_F_TSO | ||
65 | #include <net/checksum.h> | 64 | #include <net/checksum.h> |
66 | #endif | ||
67 | 65 | ||
68 | #include <linux/ethtool.h> | 66 | #include <linux/ethtool.h> |
69 | #include <linux/if_vlan.h> | 67 | #include <linux/if_vlan.h> |
diff --git a/drivers/net/ixgb/ixgb_ethtool.c b/drivers/net/ixgb/ixgb_ethtool.c index 82c044d6e08a..d6628bd9590a 100644 --- a/drivers/net/ixgb/ixgb_ethtool.c +++ b/drivers/net/ixgb/ixgb_ethtool.c | |||
@@ -82,10 +82,8 @@ static struct ixgb_stats ixgb_gstrings_stats[] = { | |||
82 | {"tx_restart_queue", IXGB_STAT(restart_queue) }, | 82 | {"tx_restart_queue", IXGB_STAT(restart_queue) }, |
83 | {"rx_long_length_errors", IXGB_STAT(stats.roc)}, | 83 | {"rx_long_length_errors", IXGB_STAT(stats.roc)}, |
84 | {"rx_short_length_errors", IXGB_STAT(stats.ruc)}, | 84 | {"rx_short_length_errors", IXGB_STAT(stats.ruc)}, |
85 | #ifdef NETIF_F_TSO | ||
86 | {"tx_tcp_seg_good", IXGB_STAT(stats.tsctc)}, | 85 | {"tx_tcp_seg_good", IXGB_STAT(stats.tsctc)}, |
87 | {"tx_tcp_seg_failed", IXGB_STAT(stats.tsctfc)}, | 86 | {"tx_tcp_seg_failed", IXGB_STAT(stats.tsctfc)}, |
88 | #endif | ||
89 | {"rx_flow_control_xon", IXGB_STAT(stats.xonrxc)}, | 87 | {"rx_flow_control_xon", IXGB_STAT(stats.xonrxc)}, |
90 | {"rx_flow_control_xoff", IXGB_STAT(stats.xoffrxc)}, | 88 | {"rx_flow_control_xoff", IXGB_STAT(stats.xoffrxc)}, |
91 | {"tx_flow_control_xon", IXGB_STAT(stats.xontxc)}, | 89 | {"tx_flow_control_xon", IXGB_STAT(stats.xontxc)}, |
@@ -240,7 +238,6 @@ ixgb_set_tx_csum(struct net_device *netdev, uint32_t data) | |||
240 | return 0; | 238 | return 0; |
241 | } | 239 | } |
242 | 240 | ||
243 | #ifdef NETIF_F_TSO | ||
244 | static int | 241 | static int |
245 | ixgb_set_tso(struct net_device *netdev, uint32_t data) | 242 | ixgb_set_tso(struct net_device *netdev, uint32_t data) |
246 | { | 243 | { |
@@ -250,7 +247,6 @@ ixgb_set_tso(struct net_device *netdev, uint32_t data) | |||
250 | netdev->features &= ~NETIF_F_TSO; | 247 | netdev->features &= ~NETIF_F_TSO; |
251 | return 0; | 248 | return 0; |
252 | } | 249 | } |
253 | #endif /* NETIF_F_TSO */ | ||
254 | 250 | ||
255 | static uint32_t | 251 | static uint32_t |
256 | ixgb_get_msglevel(struct net_device *netdev) | 252 | ixgb_get_msglevel(struct net_device *netdev) |
@@ -722,10 +718,8 @@ static const struct ethtool_ops ixgb_ethtool_ops = { | |||
722 | .set_sg = ethtool_op_set_sg, | 718 | .set_sg = ethtool_op_set_sg, |
723 | .get_msglevel = ixgb_get_msglevel, | 719 | .get_msglevel = ixgb_get_msglevel, |
724 | .set_msglevel = ixgb_set_msglevel, | 720 | .set_msglevel = ixgb_set_msglevel, |
725 | #ifdef NETIF_F_TSO | ||
726 | .get_tso = ethtool_op_get_tso, | 721 | .get_tso = ethtool_op_get_tso, |
727 | .set_tso = ixgb_set_tso, | 722 | .set_tso = ixgb_set_tso, |
728 | #endif | ||
729 | .get_strings = ixgb_get_strings, | 723 | .get_strings = ixgb_get_strings, |
730 | .phys_id = ixgb_phys_id, | 724 | .phys_id = ixgb_phys_id, |
731 | .get_stats_count = ixgb_get_stats_count, | 725 | .get_stats_count = ixgb_get_stats_count, |
diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c index a083a9189230..51bd7e8ff0d6 100644 --- a/drivers/net/ixgb/ixgb_main.c +++ b/drivers/net/ixgb/ixgb_main.c | |||
@@ -456,9 +456,7 @@ ixgb_probe(struct pci_dev *pdev, | |||
456 | NETIF_F_HW_VLAN_TX | | 456 | NETIF_F_HW_VLAN_TX | |
457 | NETIF_F_HW_VLAN_RX | | 457 | NETIF_F_HW_VLAN_RX | |
458 | NETIF_F_HW_VLAN_FILTER; | 458 | NETIF_F_HW_VLAN_FILTER; |
459 | #ifdef NETIF_F_TSO | ||
460 | netdev->features |= NETIF_F_TSO; | 459 | netdev->features |= NETIF_F_TSO; |
461 | #endif | ||
462 | #ifdef NETIF_F_LLTX | 460 | #ifdef NETIF_F_LLTX |
463 | netdev->features |= NETIF_F_LLTX; | 461 | netdev->features |= NETIF_F_LLTX; |
464 | #endif | 462 | #endif |
@@ -1176,7 +1174,6 @@ ixgb_watchdog(unsigned long data) | |||
1176 | static int | 1174 | static int |
1177 | ixgb_tso(struct ixgb_adapter *adapter, struct sk_buff *skb) | 1175 | ixgb_tso(struct ixgb_adapter *adapter, struct sk_buff *skb) |
1178 | { | 1176 | { |
1179 | #ifdef NETIF_F_TSO | ||
1180 | struct ixgb_context_desc *context_desc; | 1177 | struct ixgb_context_desc *context_desc; |
1181 | unsigned int i; | 1178 | unsigned int i; |
1182 | uint8_t ipcss, ipcso, tucss, tucso, hdr_len; | 1179 | uint8_t ipcss, ipcso, tucss, tucso, hdr_len; |
@@ -1233,7 +1230,6 @@ ixgb_tso(struct ixgb_adapter *adapter, struct sk_buff *skb) | |||
1233 | 1230 | ||
1234 | return 1; | 1231 | return 1; |
1235 | } | 1232 | } |
1236 | #endif | ||
1237 | 1233 | ||
1238 | return 0; | 1234 | return 0; |
1239 | } | 1235 | } |
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c index 61cbd4a60446..030924fb1ab3 100644 --- a/drivers/net/myri10ge/myri10ge.c +++ b/drivers/net/myri10ge/myri10ge.c | |||
@@ -1412,10 +1412,8 @@ static const struct ethtool_ops myri10ge_ethtool_ops = { | |||
1412 | .set_tx_csum = ethtool_op_set_tx_hw_csum, | 1412 | .set_tx_csum = ethtool_op_set_tx_hw_csum, |
1413 | .get_sg = ethtool_op_get_sg, | 1413 | .get_sg = ethtool_op_get_sg, |
1414 | .set_sg = ethtool_op_set_sg, | 1414 | .set_sg = ethtool_op_set_sg, |
1415 | #ifdef NETIF_F_TSO | ||
1416 | .get_tso = ethtool_op_get_tso, | 1415 | .get_tso = ethtool_op_get_tso, |
1417 | .set_tso = ethtool_op_set_tso, | 1416 | .set_tso = ethtool_op_set_tso, |
1418 | #endif | ||
1419 | .get_strings = myri10ge_get_strings, | 1417 | .get_strings = myri10ge_get_strings, |
1420 | .get_stats_count = myri10ge_get_stats_count, | 1418 | .get_stats_count = myri10ge_get_stats_count, |
1421 | .get_ethtool_stats = myri10ge_get_ethtool_stats, | 1419 | .get_ethtool_stats = myri10ge_get_ethtool_stats, |
@@ -1975,13 +1973,11 @@ again: | |||
1975 | mss = 0; | 1973 | mss = 0; |
1976 | max_segments = MXGEFW_MAX_SEND_DESC; | 1974 | max_segments = MXGEFW_MAX_SEND_DESC; |
1977 | 1975 | ||
1978 | #ifdef NETIF_F_TSO | ||
1979 | if (skb->len > (dev->mtu + ETH_HLEN)) { | 1976 | if (skb->len > (dev->mtu + ETH_HLEN)) { |
1980 | mss = skb_shinfo(skb)->gso_size; | 1977 | mss = skb_shinfo(skb)->gso_size; |
1981 | if (mss != 0) | 1978 | if (mss != 0) |
1982 | max_segments = MYRI10GE_MAX_SEND_DESC_TSO; | 1979 | max_segments = MYRI10GE_MAX_SEND_DESC_TSO; |
1983 | } | 1980 | } |
1984 | #endif /*NETIF_F_TSO */ | ||
1985 | 1981 | ||
1986 | if ((unlikely(avail < max_segments))) { | 1982 | if ((unlikely(avail < max_segments))) { |
1987 | /* we are out of transmit resources */ | 1983 | /* we are out of transmit resources */ |
@@ -2013,7 +2009,6 @@ again: | |||
2013 | 2009 | ||
2014 | cum_len = 0; | 2010 | cum_len = 0; |
2015 | 2011 | ||
2016 | #ifdef NETIF_F_TSO | ||
2017 | if (mss) { /* TSO */ | 2012 | if (mss) { /* TSO */ |
2018 | /* this removes any CKSUM flag from before */ | 2013 | /* this removes any CKSUM flag from before */ |
2019 | flags = (MXGEFW_FLAGS_TSO_HDR | MXGEFW_FLAGS_FIRST); | 2014 | flags = (MXGEFW_FLAGS_TSO_HDR | MXGEFW_FLAGS_FIRST); |
@@ -2029,7 +2024,6 @@ again: | |||
2029 | * the checksum by parsing the header. */ | 2024 | * the checksum by parsing the header. */ |
2030 | pseudo_hdr_offset = mss; | 2025 | pseudo_hdr_offset = mss; |
2031 | } else | 2026 | } else |
2032 | #endif /*NETIF_F_TSO */ | ||
2033 | /* Mark small packets, and pad out tiny packets */ | 2027 | /* Mark small packets, and pad out tiny packets */ |
2034 | if (skb->len <= MXGEFW_SEND_SMALL_SIZE) { | 2028 | if (skb->len <= MXGEFW_SEND_SMALL_SIZE) { |
2035 | flags |= MXGEFW_FLAGS_SMALL; | 2029 | flags |= MXGEFW_FLAGS_SMALL; |
@@ -2097,7 +2091,6 @@ again: | |||
2097 | seglen = len; | 2091 | seglen = len; |
2098 | flags_next = flags & ~MXGEFW_FLAGS_FIRST; | 2092 | flags_next = flags & ~MXGEFW_FLAGS_FIRST; |
2099 | cum_len_next = cum_len + seglen; | 2093 | cum_len_next = cum_len + seglen; |
2100 | #ifdef NETIF_F_TSO | ||
2101 | if (mss) { /* TSO */ | 2094 | if (mss) { /* TSO */ |
2102 | (req - rdma_count)->rdma_count = rdma_count + 1; | 2095 | (req - rdma_count)->rdma_count = rdma_count + 1; |
2103 | 2096 | ||
@@ -2124,7 +2117,6 @@ again: | |||
2124 | (small * MXGEFW_FLAGS_SMALL); | 2117 | (small * MXGEFW_FLAGS_SMALL); |
2125 | } | 2118 | } |
2126 | } | 2119 | } |
2127 | #endif /* NETIF_F_TSO */ | ||
2128 | req->addr_high = high_swapped; | 2120 | req->addr_high = high_swapped; |
2129 | req->addr_low = htonl(low); | 2121 | req->addr_low = htonl(low); |
2130 | req->pseudo_hdr_offset = htons(pseudo_hdr_offset); | 2122 | req->pseudo_hdr_offset = htons(pseudo_hdr_offset); |
@@ -2161,14 +2153,12 @@ again: | |||
2161 | } | 2153 | } |
2162 | 2154 | ||
2163 | (req - rdma_count)->rdma_count = rdma_count; | 2155 | (req - rdma_count)->rdma_count = rdma_count; |
2164 | #ifdef NETIF_F_TSO | ||
2165 | if (mss) | 2156 | if (mss) |
2166 | do { | 2157 | do { |
2167 | req--; | 2158 | req--; |
2168 | req->flags |= MXGEFW_FLAGS_TSO_LAST; | 2159 | req->flags |= MXGEFW_FLAGS_TSO_LAST; |
2169 | } while (!(req->flags & (MXGEFW_FLAGS_TSO_CHOP | | 2160 | } while (!(req->flags & (MXGEFW_FLAGS_TSO_CHOP | |
2170 | MXGEFW_FLAGS_FIRST))); | 2161 | MXGEFW_FLAGS_FIRST))); |
2171 | #endif | ||
2172 | idx = ((count - 1) + tx->req) & tx->mask; | 2162 | idx = ((count - 1) + tx->req) & tx->mask; |
2173 | tx->info[idx].last = 1; | 2163 | tx->info[idx].last = 1; |
2174 | if (tx->wc_fifo == NULL) | 2164 | if (tx->wc_fifo == NULL) |
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c index 1dd66b8ea0fa..36937cb1fd66 100644 --- a/drivers/net/s2io.c +++ b/drivers/net/s2io.c | |||
@@ -3887,12 +3887,10 @@ static int s2io_xmit(struct sk_buff *skb, struct net_device *dev) | |||
3887 | } | 3887 | } |
3888 | 3888 | ||
3889 | offload_type = s2io_offload_type(skb); | 3889 | offload_type = s2io_offload_type(skb); |
3890 | #ifdef NETIF_F_TSO | ||
3891 | if (offload_type & (SKB_GSO_TCPV4 | SKB_GSO_TCPV6)) { | 3890 | if (offload_type & (SKB_GSO_TCPV4 | SKB_GSO_TCPV6)) { |
3892 | txdp->Control_1 |= TXD_TCP_LSO_EN; | 3891 | txdp->Control_1 |= TXD_TCP_LSO_EN; |
3893 | txdp->Control_1 |= TXD_TCP_LSO_MSS(s2io_tcp_mss(skb)); | 3892 | txdp->Control_1 |= TXD_TCP_LSO_MSS(s2io_tcp_mss(skb)); |
3894 | } | 3893 | } |
3895 | #endif | ||
3896 | if (skb->ip_summed == CHECKSUM_PARTIAL) { | 3894 | if (skb->ip_summed == CHECKSUM_PARTIAL) { |
3897 | txdp->Control_2 |= | 3895 | txdp->Control_2 |= |
3898 | (TXD_TX_CKO_IPV4_EN | TXD_TX_CKO_TCP_EN | | 3896 | (TXD_TX_CKO_IPV4_EN | TXD_TX_CKO_TCP_EN | |
@@ -5750,10 +5748,8 @@ static const struct ethtool_ops netdev_ethtool_ops = { | |||
5750 | .set_tx_csum = s2io_ethtool_op_set_tx_csum, | 5748 | .set_tx_csum = s2io_ethtool_op_set_tx_csum, |
5751 | .get_sg = ethtool_op_get_sg, | 5749 | .get_sg = ethtool_op_get_sg, |
5752 | .set_sg = ethtool_op_set_sg, | 5750 | .set_sg = ethtool_op_set_sg, |
5753 | #ifdef NETIF_F_TSO | ||
5754 | .get_tso = s2io_ethtool_op_get_tso, | 5751 | .get_tso = s2io_ethtool_op_get_tso, |
5755 | .set_tso = s2io_ethtool_op_set_tso, | 5752 | .set_tso = s2io_ethtool_op_set_tso, |
5756 | #endif | ||
5757 | .get_ufo = ethtool_op_get_ufo, | 5753 | .get_ufo = ethtool_op_get_ufo, |
5758 | .set_ufo = ethtool_op_set_ufo, | 5754 | .set_ufo = ethtool_op_set_ufo, |
5759 | .self_test_count = s2io_ethtool_self_test_count, | 5755 | .self_test_count = s2io_ethtool_self_test_count, |
@@ -6978,12 +6974,8 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre) | |||
6978 | dev->features |= NETIF_F_SG | NETIF_F_IP_CSUM; | 6974 | dev->features |= NETIF_F_SG | NETIF_F_IP_CSUM; |
6979 | if (sp->high_dma_flag == TRUE) | 6975 | if (sp->high_dma_flag == TRUE) |
6980 | dev->features |= NETIF_F_HIGHDMA; | 6976 | dev->features |= NETIF_F_HIGHDMA; |
6981 | #ifdef NETIF_F_TSO | ||
6982 | dev->features |= NETIF_F_TSO; | 6977 | dev->features |= NETIF_F_TSO; |
6983 | #endif | ||
6984 | #ifdef NETIF_F_TSO6 | ||
6985 | dev->features |= NETIF_F_TSO6; | 6978 | dev->features |= NETIF_F_TSO6; |
6986 | #endif | ||
6987 | if (sp->device_type & XFRAME_II_DEVICE) { | 6979 | if (sp->device_type & XFRAME_II_DEVICE) { |
6988 | dev->features |= NETIF_F_UFO; | 6980 | dev->features |= NETIF_F_UFO; |
6989 | dev->features |= NETIF_F_HW_CSUM; | 6981 | dev->features |= NETIF_F_HW_CSUM; |
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index f4bf62c2a7a5..135c0987deae 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
@@ -58,11 +58,7 @@ | |||
58 | #define TG3_VLAN_TAG_USED 0 | 58 | #define TG3_VLAN_TAG_USED 0 |
59 | #endif | 59 | #endif |
60 | 60 | ||
61 | #ifdef NETIF_F_TSO | ||
62 | #define TG3_TSO_SUPPORT 1 | 61 | #define TG3_TSO_SUPPORT 1 |
63 | #else | ||
64 | #define TG3_TSO_SUPPORT 0 | ||
65 | #endif | ||
66 | 62 | ||
67 | #include "tg3.h" | 63 | #include "tg3.h" |
68 | 64 | ||
@@ -3873,7 +3869,6 @@ static int tg3_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
3873 | 3869 | ||
3874 | entry = tp->tx_prod; | 3870 | entry = tp->tx_prod; |
3875 | base_flags = 0; | 3871 | base_flags = 0; |
3876 | #if TG3_TSO_SUPPORT != 0 | ||
3877 | mss = 0; | 3872 | mss = 0; |
3878 | if (skb->len > (tp->dev->mtu + ETH_HLEN) && | 3873 | if (skb->len > (tp->dev->mtu + ETH_HLEN) && |
3879 | (mss = skb_shinfo(skb)->gso_size) != 0) { | 3874 | (mss = skb_shinfo(skb)->gso_size) != 0) { |
@@ -3906,11 +3901,6 @@ static int tg3_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
3906 | } | 3901 | } |
3907 | else if (skb->ip_summed == CHECKSUM_PARTIAL) | 3902 | else if (skb->ip_summed == CHECKSUM_PARTIAL) |
3908 | base_flags |= TXD_FLAG_TCPUDP_CSUM; | 3903 | base_flags |= TXD_FLAG_TCPUDP_CSUM; |
3909 | #else | ||
3910 | mss = 0; | ||
3911 | if (skb->ip_summed == CHECKSUM_PARTIAL) | ||
3912 | base_flags |= TXD_FLAG_TCPUDP_CSUM; | ||
3913 | #endif | ||
3914 | #if TG3_VLAN_TAG_USED | 3904 | #if TG3_VLAN_TAG_USED |
3915 | if (tp->vlgrp != NULL && vlan_tx_tag_present(skb)) | 3905 | if (tp->vlgrp != NULL && vlan_tx_tag_present(skb)) |
3916 | base_flags |= (TXD_FLAG_VLAN | | 3906 | base_flags |= (TXD_FLAG_VLAN | |
@@ -3970,7 +3960,6 @@ out_unlock: | |||
3970 | return NETDEV_TX_OK; | 3960 | return NETDEV_TX_OK; |
3971 | } | 3961 | } |
3972 | 3962 | ||
3973 | #if TG3_TSO_SUPPORT != 0 | ||
3974 | static int tg3_start_xmit_dma_bug(struct sk_buff *, struct net_device *); | 3963 | static int tg3_start_xmit_dma_bug(struct sk_buff *, struct net_device *); |
3975 | 3964 | ||
3976 | /* Use GSO to workaround a rare TSO bug that may be triggered when the | 3965 | /* Use GSO to workaround a rare TSO bug that may be triggered when the |
@@ -4002,7 +3991,6 @@ tg3_tso_bug_end: | |||
4002 | 3991 | ||
4003 | return NETDEV_TX_OK; | 3992 | return NETDEV_TX_OK; |
4004 | } | 3993 | } |
4005 | #endif | ||
4006 | 3994 | ||
4007 | /* hard_start_xmit for devices that have the 4G bug and/or 40-bit bug and | 3995 | /* hard_start_xmit for devices that have the 4G bug and/or 40-bit bug and |
4008 | * support TG3_FLG2_HW_TSO_1 or firmware TSO only. | 3996 | * support TG3_FLG2_HW_TSO_1 or firmware TSO only. |
@@ -4036,7 +4024,6 @@ static int tg3_start_xmit_dma_bug(struct sk_buff *skb, struct net_device *dev) | |||
4036 | base_flags = 0; | 4024 | base_flags = 0; |
4037 | if (skb->ip_summed == CHECKSUM_PARTIAL) | 4025 | if (skb->ip_summed == CHECKSUM_PARTIAL) |
4038 | base_flags |= TXD_FLAG_TCPUDP_CSUM; | 4026 | base_flags |= TXD_FLAG_TCPUDP_CSUM; |
4039 | #if TG3_TSO_SUPPORT != 0 | ||
4040 | mss = 0; | 4027 | mss = 0; |
4041 | if (skb->len > (tp->dev->mtu + ETH_HLEN) && | 4028 | if (skb->len > (tp->dev->mtu + ETH_HLEN) && |
4042 | (mss = skb_shinfo(skb)->gso_size) != 0) { | 4029 | (mss = skb_shinfo(skb)->gso_size) != 0) { |
@@ -4091,9 +4078,6 @@ static int tg3_start_xmit_dma_bug(struct sk_buff *skb, struct net_device *dev) | |||
4091 | } | 4078 | } |
4092 | } | 4079 | } |
4093 | } | 4080 | } |
4094 | #else | ||
4095 | mss = 0; | ||
4096 | #endif | ||
4097 | #if TG3_VLAN_TAG_USED | 4081 | #if TG3_VLAN_TAG_USED |
4098 | if (tp->vlgrp != NULL && vlan_tx_tag_present(skb)) | 4082 | if (tp->vlgrp != NULL && vlan_tx_tag_present(skb)) |
4099 | base_flags |= (TXD_FLAG_VLAN | | 4083 | base_flags |= (TXD_FLAG_VLAN | |
@@ -5329,7 +5313,6 @@ static int tg3_load_5701_a0_firmware_fix(struct tg3 *tp) | |||
5329 | return 0; | 5313 | return 0; |
5330 | } | 5314 | } |
5331 | 5315 | ||
5332 | #if TG3_TSO_SUPPORT != 0 | ||
5333 | 5316 | ||
5334 | #define TG3_TSO_FW_RELEASE_MAJOR 0x1 | 5317 | #define TG3_TSO_FW_RELEASE_MAJOR 0x1 |
5335 | #define TG3_TSO_FW_RELASE_MINOR 0x6 | 5318 | #define TG3_TSO_FW_RELASE_MINOR 0x6 |
@@ -5906,7 +5889,6 @@ static int tg3_load_tso_firmware(struct tg3 *tp) | |||
5906 | return 0; | 5889 | return 0; |
5907 | } | 5890 | } |
5908 | 5891 | ||
5909 | #endif /* TG3_TSO_SUPPORT != 0 */ | ||
5910 | 5892 | ||
5911 | /* tp->lock is held. */ | 5893 | /* tp->lock is held. */ |
5912 | static void __tg3_set_mac_addr(struct tg3 *tp) | 5894 | static void __tg3_set_mac_addr(struct tg3 *tp) |
@@ -6120,7 +6102,6 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy) | |||
6120 | tw32(BUFMGR_DMA_DESC_POOL_ADDR, NIC_SRAM_DMA_DESC_POOL_BASE); | 6102 | tw32(BUFMGR_DMA_DESC_POOL_ADDR, NIC_SRAM_DMA_DESC_POOL_BASE); |
6121 | tw32(BUFMGR_DMA_DESC_POOL_SIZE, NIC_SRAM_DMA_DESC_POOL_SIZE); | 6103 | tw32(BUFMGR_DMA_DESC_POOL_SIZE, NIC_SRAM_DMA_DESC_POOL_SIZE); |
6122 | } | 6104 | } |
6123 | #if TG3_TSO_SUPPORT != 0 | ||
6124 | else if (tp->tg3_flags2 & TG3_FLG2_TSO_CAPABLE) { | 6105 | else if (tp->tg3_flags2 & TG3_FLG2_TSO_CAPABLE) { |
6125 | int fw_len; | 6106 | int fw_len; |
6126 | 6107 | ||
@@ -6135,7 +6116,6 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy) | |||
6135 | tw32(BUFMGR_MB_POOL_SIZE, | 6116 | tw32(BUFMGR_MB_POOL_SIZE, |
6136 | NIC_SRAM_MBUF_POOL_SIZE5705 - fw_len - 0xa00); | 6117 | NIC_SRAM_MBUF_POOL_SIZE5705 - fw_len - 0xa00); |
6137 | } | 6118 | } |
6138 | #endif | ||
6139 | 6119 | ||
6140 | if (tp->dev->mtu <= ETH_DATA_LEN) { | 6120 | if (tp->dev->mtu <= ETH_DATA_LEN) { |
6141 | tw32(BUFMGR_MB_RDMA_LOW_WATER, | 6121 | tw32(BUFMGR_MB_RDMA_LOW_WATER, |
@@ -6337,10 +6317,8 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy) | |||
6337 | if (tp->tg3_flags2 & TG3_FLG2_PCI_EXPRESS) | 6317 | if (tp->tg3_flags2 & TG3_FLG2_PCI_EXPRESS) |
6338 | rdmac_mode |= RDMAC_MODE_FIFO_LONG_BURST; | 6318 | rdmac_mode |= RDMAC_MODE_FIFO_LONG_BURST; |
6339 | 6319 | ||
6340 | #if TG3_TSO_SUPPORT != 0 | ||
6341 | if (tp->tg3_flags2 & TG3_FLG2_HW_TSO) | 6320 | if (tp->tg3_flags2 & TG3_FLG2_HW_TSO) |
6342 | rdmac_mode |= (1 << 27); | 6321 | rdmac_mode |= (1 << 27); |
6343 | #endif | ||
6344 | 6322 | ||
6345 | /* Receive/send statistics. */ | 6323 | /* Receive/send statistics. */ |
6346 | if (tp->tg3_flags2 & TG3_FLG2_5750_PLUS) { | 6324 | if (tp->tg3_flags2 & TG3_FLG2_5750_PLUS) { |
@@ -6511,10 +6489,8 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy) | |||
6511 | tw32(RCVBDI_MODE, RCVBDI_MODE_ENABLE | RCVBDI_MODE_RCB_ATTN_ENAB); | 6489 | tw32(RCVBDI_MODE, RCVBDI_MODE_ENABLE | RCVBDI_MODE_RCB_ATTN_ENAB); |
6512 | tw32(RCVDBDI_MODE, RCVDBDI_MODE_ENABLE | RCVDBDI_MODE_INV_RING_SZ); | 6490 | tw32(RCVDBDI_MODE, RCVDBDI_MODE_ENABLE | RCVDBDI_MODE_INV_RING_SZ); |
6513 | tw32(SNDDATAI_MODE, SNDDATAI_MODE_ENABLE); | 6491 | tw32(SNDDATAI_MODE, SNDDATAI_MODE_ENABLE); |
6514 | #if TG3_TSO_SUPPORT != 0 | ||
6515 | if (tp->tg3_flags2 & TG3_FLG2_HW_TSO) | 6492 | if (tp->tg3_flags2 & TG3_FLG2_HW_TSO) |
6516 | tw32(SNDDATAI_MODE, SNDDATAI_MODE_ENABLE | 0x8); | 6493 | tw32(SNDDATAI_MODE, SNDDATAI_MODE_ENABLE | 0x8); |
6517 | #endif | ||
6518 | tw32(SNDBDI_MODE, SNDBDI_MODE_ENABLE | SNDBDI_MODE_ATTN_ENABLE); | 6494 | tw32(SNDBDI_MODE, SNDBDI_MODE_ENABLE | SNDBDI_MODE_ATTN_ENABLE); |
6519 | tw32(SNDBDS_MODE, SNDBDS_MODE_ENABLE | SNDBDS_MODE_ATTN_ENABLE); | 6495 | tw32(SNDBDS_MODE, SNDBDS_MODE_ENABLE | SNDBDS_MODE_ATTN_ENABLE); |
6520 | 6496 | ||
@@ -6524,13 +6500,11 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy) | |||
6524 | return err; | 6500 | return err; |
6525 | } | 6501 | } |
6526 | 6502 | ||
6527 | #if TG3_TSO_SUPPORT != 0 | ||
6528 | if (tp->tg3_flags2 & TG3_FLG2_TSO_CAPABLE) { | 6503 | if (tp->tg3_flags2 & TG3_FLG2_TSO_CAPABLE) { |
6529 | err = tg3_load_tso_firmware(tp); | 6504 | err = tg3_load_tso_firmware(tp); |
6530 | if (err) | 6505 | if (err) |
6531 | return err; | 6506 | return err; |
6532 | } | 6507 | } |
6533 | #endif | ||
6534 | 6508 | ||
6535 | tp->tx_mode = TX_MODE_ENABLE; | 6509 | tp->tx_mode = TX_MODE_ENABLE; |
6536 | tw32_f(MAC_TX_MODE, tp->tx_mode); | 6510 | tw32_f(MAC_TX_MODE, tp->tx_mode); |
@@ -8062,7 +8036,6 @@ static void tg3_set_msglevel(struct net_device *dev, u32 value) | |||
8062 | tp->msg_enable = value; | 8036 | tp->msg_enable = value; |
8063 | } | 8037 | } |
8064 | 8038 | ||
8065 | #if TG3_TSO_SUPPORT != 0 | ||
8066 | static int tg3_set_tso(struct net_device *dev, u32 value) | 8039 | static int tg3_set_tso(struct net_device *dev, u32 value) |
8067 | { | 8040 | { |
8068 | struct tg3 *tp = netdev_priv(dev); | 8041 | struct tg3 *tp = netdev_priv(dev); |
@@ -8081,7 +8054,6 @@ static int tg3_set_tso(struct net_device *dev, u32 value) | |||
8081 | } | 8054 | } |
8082 | return ethtool_op_set_tso(dev, value); | 8055 | return ethtool_op_set_tso(dev, value); |
8083 | } | 8056 | } |
8084 | #endif | ||
8085 | 8057 | ||
8086 | static int tg3_nway_reset(struct net_device *dev) | 8058 | static int tg3_nway_reset(struct net_device *dev) |
8087 | { | 8059 | { |
@@ -9212,10 +9184,8 @@ static const struct ethtool_ops tg3_ethtool_ops = { | |||
9212 | .set_tx_csum = tg3_set_tx_csum, | 9184 | .set_tx_csum = tg3_set_tx_csum, |
9213 | .get_sg = ethtool_op_get_sg, | 9185 | .get_sg = ethtool_op_get_sg, |
9214 | .set_sg = ethtool_op_set_sg, | 9186 | .set_sg = ethtool_op_set_sg, |
9215 | #if TG3_TSO_SUPPORT != 0 | ||
9216 | .get_tso = ethtool_op_get_tso, | 9187 | .get_tso = ethtool_op_get_tso, |
9217 | .set_tso = tg3_set_tso, | 9188 | .set_tso = tg3_set_tso, |
9218 | #endif | ||
9219 | .self_test_count = tg3_get_test_count, | 9189 | .self_test_count = tg3_get_test_count, |
9220 | .self_test = tg3_self_test, | 9190 | .self_test = tg3_self_test, |
9221 | .get_strings = tg3_get_strings, | 9191 | .get_strings = tg3_get_strings, |
@@ -11856,7 +11826,6 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, | |||
11856 | 11826 | ||
11857 | tg3_init_bufmgr_config(tp); | 11827 | tg3_init_bufmgr_config(tp); |
11858 | 11828 | ||
11859 | #if TG3_TSO_SUPPORT != 0 | ||
11860 | if (tp->tg3_flags2 & TG3_FLG2_HW_TSO) { | 11829 | if (tp->tg3_flags2 & TG3_FLG2_HW_TSO) { |
11861 | tp->tg3_flags2 |= TG3_FLG2_TSO_CAPABLE; | 11830 | tp->tg3_flags2 |= TG3_FLG2_TSO_CAPABLE; |
11862 | } | 11831 | } |
@@ -11881,7 +11850,6 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, | |||
11881 | dev->features |= NETIF_F_TSO6; | 11850 | dev->features |= NETIF_F_TSO6; |
11882 | } | 11851 | } |
11883 | 11852 | ||
11884 | #endif | ||
11885 | 11853 | ||
11886 | if (tp->pci_chip_rev_id == CHIPREV_ID_5705_A1 && | 11854 | if (tp->pci_chip_rev_id == CHIPREV_ID_5705_A1 && |
11887 | !(tp->tg3_flags2 & TG3_FLG2_TSO_CAPABLE) && | 11855 | !(tp->tg3_flags2 & TG3_FLG2_TSO_CAPABLE) && |