aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/e1000
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-10-23 14:47:02 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-10-23 14:47:02 -0400
commit5f05647dd81c11a6a165ccc8f0c1370b16f3bcb0 (patch)
tree7851ef1c93aa1aba7ef327ca4b75fd35e6d10f29 /drivers/net/e1000
parent02f36038c568111ad4fc433f6fa760ff5e38fab4 (diff)
parentec37a48d1d16c30b655ac5280209edf52a6775d4 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6: (1699 commits) bnx2/bnx2x: Unsupported Ethtool operations should return -EINVAL. vlan: Calling vlan_hwaccel_do_receive() is always valid. tproxy: use the interface primary IP address as a default value for --on-ip tproxy: added IPv6 support to the socket match cxgb3: function namespace cleanup tproxy: added IPv6 support to the TPROXY target tproxy: added IPv6 socket lookup function to nf_tproxy_core be2net: Changes to use only priority codes allowed by f/w tproxy: allow non-local binds of IPv6 sockets if IP_TRANSPARENT is enabled tproxy: added tproxy sockopt interface in the IPV6 layer tproxy: added udp6_lib_lookup function tproxy: added const specifiers to udp lookup functions tproxy: split off ipv6 defragmentation to a separate module l2tp: small cleanup nf_nat: restrict ICMP translation for embedded header can: mcp251x: fix generation of error frames can: mcp251x: fix endless loop in interrupt handler if CANINTF_MERRF is set can-raw: add msg_flags to distinguish local traffic 9p: client code cleanup rds: make local functions/variables static ... Fix up conflicts in net/core/dev.c, drivers/net/pcmcia/smc91c92_cs.c and drivers/net/wireless/ath/ath9k/debug.c as per David
Diffstat (limited to 'drivers/net/e1000')
-rw-r--r--drivers/net/e1000/e1000.h3
-rw-r--r--drivers/net/e1000/e1000_main.c245
2 files changed, 157 insertions, 91 deletions
diff --git a/drivers/net/e1000/e1000.h b/drivers/net/e1000/e1000.h
index 99288b95aead..a881dd0093bd 100644
--- a/drivers/net/e1000/e1000.h
+++ b/drivers/net/e1000/e1000.h
@@ -310,6 +310,9 @@ struct e1000_adapter {
310 int need_ioport; 310 int need_ioport;
311 311
312 bool discarding; 312 bool discarding;
313
314 struct work_struct fifo_stall_task;
315 struct work_struct phy_info_task;
313}; 316};
314 317
315enum e1000_state_t { 318enum e1000_state_t {
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 5cc39ed289c6..a117f2a0252e 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -123,8 +123,10 @@ static void e1000_clean_rx_ring(struct e1000_adapter *adapter,
123 struct e1000_rx_ring *rx_ring); 123 struct e1000_rx_ring *rx_ring);
124static void e1000_set_rx_mode(struct net_device *netdev); 124static void e1000_set_rx_mode(struct net_device *netdev);
125static void e1000_update_phy_info(unsigned long data); 125static void e1000_update_phy_info(unsigned long data);
126static void e1000_update_phy_info_task(struct work_struct *work);
126static void e1000_watchdog(unsigned long data); 127static void e1000_watchdog(unsigned long data);
127static void e1000_82547_tx_fifo_stall(unsigned long data); 128static void e1000_82547_tx_fifo_stall(unsigned long data);
129static void e1000_82547_tx_fifo_stall_task(struct work_struct *work);
128static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb, 130static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb,
129 struct net_device *netdev); 131 struct net_device *netdev);
130static struct net_device_stats * e1000_get_stats(struct net_device *netdev); 132static struct net_device_stats * e1000_get_stats(struct net_device *netdev);
@@ -519,8 +521,21 @@ void e1000_down(struct e1000_adapter *adapter)
519 e1000_clean_all_rx_rings(adapter); 521 e1000_clean_all_rx_rings(adapter);
520} 522}
521 523
524void e1000_reinit_safe(struct e1000_adapter *adapter)
525{
526 while (test_and_set_bit(__E1000_RESETTING, &adapter->flags))
527 msleep(1);
528 rtnl_lock();
529 e1000_down(adapter);
530 e1000_up(adapter);
531 rtnl_unlock();
532 clear_bit(__E1000_RESETTING, &adapter->flags);
533}
534
522void e1000_reinit_locked(struct e1000_adapter *adapter) 535void e1000_reinit_locked(struct e1000_adapter *adapter)
523{ 536{
537 /* if rtnl_lock is not held the call path is bogus */
538 ASSERT_RTNL();
524 WARN_ON(in_interrupt()); 539 WARN_ON(in_interrupt());
525 while (test_and_set_bit(__E1000_RESETTING, &adapter->flags)) 540 while (test_and_set_bit(__E1000_RESETTING, &adapter->flags))
526 msleep(1); 541 msleep(1);
@@ -790,6 +805,70 @@ static const struct net_device_ops e1000_netdev_ops = {
790}; 805};
791 806
792/** 807/**
808 * e1000_init_hw_struct - initialize members of hw struct
809 * @adapter: board private struct
810 * @hw: structure used by e1000_hw.c
811 *
812 * Factors out initialization of the e1000_hw struct to its own function
813 * that can be called very early at init (just after struct allocation).
814 * Fields are initialized based on PCI device information and
815 * OS network device settings (MTU size).
816 * Returns negative error codes if MAC type setup fails.
817 */
818static int e1000_init_hw_struct(struct e1000_adapter *adapter,
819 struct e1000_hw *hw)
820{
821 struct pci_dev *pdev = adapter->pdev;
822
823 /* PCI config space info */
824 hw->vendor_id = pdev->vendor;
825 hw->device_id = pdev->device;
826 hw->subsystem_vendor_id = pdev->subsystem_vendor;
827 hw->subsystem_id = pdev->subsystem_device;
828 hw->revision_id = pdev->revision;
829
830 pci_read_config_word(pdev, PCI_COMMAND, &hw->pci_cmd_word);
831
832 hw->max_frame_size = adapter->netdev->mtu +
833 ENET_HEADER_SIZE + ETHERNET_FCS_SIZE;
834 hw->min_frame_size = MINIMUM_ETHERNET_FRAME_SIZE;
835
836 /* identify the MAC */
837 if (e1000_set_mac_type(hw)) {
838 e_err(probe, "Unknown MAC Type\n");
839 return -EIO;
840 }
841
842 switch (hw->mac_type) {
843 default:
844 break;
845 case e1000_82541:
846 case e1000_82547:
847 case e1000_82541_rev_2:
848 case e1000_82547_rev_2:
849 hw->phy_init_script = 1;
850 break;
851 }
852
853 e1000_set_media_type(hw);
854 e1000_get_bus_info(hw);
855
856 hw->wait_autoneg_complete = false;
857 hw->tbi_compatibility_en = true;
858 hw->adaptive_ifs = true;
859
860 /* Copper options */
861
862 if (hw->media_type == e1000_media_type_copper) {
863 hw->mdix = AUTO_ALL_MODES;
864 hw->disable_polarity_correction = false;
865 hw->master_slave = E1000_MASTER_SLAVE;
866 }
867
868 return 0;
869}
870
871/**
793 * e1000_probe - Device Initialization Routine 872 * e1000_probe - Device Initialization Routine
794 * @pdev: PCI device information struct 873 * @pdev: PCI device information struct
795 * @ent: entry in e1000_pci_tbl 874 * @ent: entry in e1000_pci_tbl
@@ -826,22 +905,6 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
826 if (err) 905 if (err)
827 return err; 906 return err;
828 907
829 if (!dma_set_mask(&pdev->dev, DMA_BIT_MASK(64)) &&
830 !dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(64))) {
831 pci_using_dac = 1;
832 } else {
833 err = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));
834 if (err) {
835 err = dma_set_coherent_mask(&pdev->dev,
836 DMA_BIT_MASK(32));
837 if (err) {
838 pr_err("No usable DMA config, aborting\n");
839 goto err_dma;
840 }
841 }
842 pci_using_dac = 0;
843 }
844
845 err = pci_request_selected_regions(pdev, bars, e1000_driver_name); 908 err = pci_request_selected_regions(pdev, bars, e1000_driver_name);
846 if (err) 909 if (err)
847 goto err_pci_reg; 910 goto err_pci_reg;
@@ -885,6 +948,32 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
885 } 948 }
886 } 949 }
887 950
951 /* make ready for any if (hw->...) below */
952 err = e1000_init_hw_struct(adapter, hw);
953 if (err)
954 goto err_sw_init;
955
956 /*
957 * there is a workaround being applied below that limits
958 * 64-bit DMA addresses to 64-bit hardware. There are some
959 * 32-bit adapters that Tx hang when given 64-bit DMA addresses
960 */
961 pci_using_dac = 0;
962 if ((hw->bus_type == e1000_bus_type_pcix) &&
963 !dma_set_mask(&pdev->dev, DMA_BIT_MASK(64))) {
964 /*
965 * according to DMA-API-HOWTO, coherent calls will always
966 * succeed if the set call did
967 */
968 dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(64));
969 pci_using_dac = 1;
970 } else if (!dma_set_mask(&pdev->dev, DMA_BIT_MASK(32))) {
971 dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
972 } else {
973 pr_err("No usable DMA config, aborting\n");
974 goto err_dma;
975 }
976
888 netdev->netdev_ops = &e1000_netdev_ops; 977 netdev->netdev_ops = &e1000_netdev_ops;
889 e1000_set_ethtool_ops(netdev); 978 e1000_set_ethtool_ops(netdev);
890 netdev->watchdog_timeo = 5 * HZ; 979 netdev->watchdog_timeo = 5 * HZ;
@@ -914,8 +1003,10 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
914 (hw->mac_type != e1000_82547)) 1003 (hw->mac_type != e1000_82547))
915 netdev->features |= NETIF_F_TSO; 1004 netdev->features |= NETIF_F_TSO;
916 1005
917 if (pci_using_dac) 1006 if (pci_using_dac) {
918 netdev->features |= NETIF_F_HIGHDMA; 1007 netdev->features |= NETIF_F_HIGHDMA;
1008 netdev->vlan_features |= NETIF_F_HIGHDMA;
1009 }
919 1010
920 netdev->vlan_features |= NETIF_F_TSO; 1011 netdev->vlan_features |= NETIF_F_TSO;
921 netdev->vlan_features |= NETIF_F_HW_CSUM; 1012 netdev->vlan_features |= NETIF_F_HW_CSUM;
@@ -959,21 +1050,21 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
959 if (!is_valid_ether_addr(netdev->perm_addr)) 1050 if (!is_valid_ether_addr(netdev->perm_addr))
960 e_err(probe, "Invalid MAC Address\n"); 1051 e_err(probe, "Invalid MAC Address\n");
961 1052
962 e1000_get_bus_info(hw);
963
964 init_timer(&adapter->tx_fifo_stall_timer); 1053 init_timer(&adapter->tx_fifo_stall_timer);
965 adapter->tx_fifo_stall_timer.function = &e1000_82547_tx_fifo_stall; 1054 adapter->tx_fifo_stall_timer.function = e1000_82547_tx_fifo_stall;
966 adapter->tx_fifo_stall_timer.data = (unsigned long)adapter; 1055 adapter->tx_fifo_stall_timer.data = (unsigned long)adapter;
967 1056
968 init_timer(&adapter->watchdog_timer); 1057 init_timer(&adapter->watchdog_timer);
969 adapter->watchdog_timer.function = &e1000_watchdog; 1058 adapter->watchdog_timer.function = e1000_watchdog;
970 adapter->watchdog_timer.data = (unsigned long) adapter; 1059 adapter->watchdog_timer.data = (unsigned long) adapter;
971 1060
972 init_timer(&adapter->phy_info_timer); 1061 init_timer(&adapter->phy_info_timer);
973 adapter->phy_info_timer.function = &e1000_update_phy_info; 1062 adapter->phy_info_timer.function = e1000_update_phy_info;
974 adapter->phy_info_timer.data = (unsigned long)adapter; 1063 adapter->phy_info_timer.data = (unsigned long)adapter;
975 1064
1065 INIT_WORK(&adapter->fifo_stall_task, e1000_82547_tx_fifo_stall_task);
976 INIT_WORK(&adapter->reset_task, e1000_reset_task); 1066 INIT_WORK(&adapter->reset_task, e1000_reset_task);
1067 INIT_WORK(&adapter->phy_info_task, e1000_update_phy_info_task);
977 1068
978 e1000_check_options(adapter); 1069 e1000_check_options(adapter);
979 1070
@@ -1072,6 +1163,7 @@ err_eeprom:
1072 iounmap(hw->flash_address); 1163 iounmap(hw->flash_address);
1073 kfree(adapter->tx_ring); 1164 kfree(adapter->tx_ring);
1074 kfree(adapter->rx_ring); 1165 kfree(adapter->rx_ring);
1166err_dma:
1075err_sw_init: 1167err_sw_init:
1076 iounmap(hw->hw_addr); 1168 iounmap(hw->hw_addr);
1077err_ioremap: 1169err_ioremap:
@@ -1079,7 +1171,6 @@ err_ioremap:
1079err_alloc_etherdev: 1171err_alloc_etherdev:
1080 pci_release_selected_regions(pdev, bars); 1172 pci_release_selected_regions(pdev, bars);
1081err_pci_reg: 1173err_pci_reg:
1082err_dma:
1083 pci_disable_device(pdev); 1174 pci_disable_device(pdev);
1084 return err; 1175 return err;
1085} 1176}
@@ -1131,62 +1222,12 @@ static void __devexit e1000_remove(struct pci_dev *pdev)
1131 * @adapter: board private structure to initialize 1222 * @adapter: board private structure to initialize
1132 * 1223 *
1133 * e1000_sw_init initializes the Adapter private data structure. 1224 * e1000_sw_init initializes the Adapter private data structure.
1134 * Fields are initialized based on PCI device information and 1225 * e1000_init_hw_struct MUST be called before this function
1135 * OS network device settings (MTU size).
1136 **/ 1226 **/
1137 1227
1138static int __devinit e1000_sw_init(struct e1000_adapter *adapter) 1228static int __devinit e1000_sw_init(struct e1000_adapter *adapter)
1139{ 1229{
1140 struct e1000_hw *hw = &adapter->hw;
1141 struct net_device *netdev = adapter->netdev;
1142 struct pci_dev *pdev = adapter->pdev;
1143
1144 /* PCI config space info */
1145
1146 hw->vendor_id = pdev->vendor;
1147 hw->device_id = pdev->device;
1148 hw->subsystem_vendor_id = pdev->subsystem_vendor;
1149 hw->subsystem_id = pdev->subsystem_device;
1150 hw->revision_id = pdev->revision;
1151
1152 pci_read_config_word(pdev, PCI_COMMAND, &hw->pci_cmd_word);
1153
1154 adapter->rx_buffer_len = MAXIMUM_ETHERNET_VLAN_SIZE; 1230 adapter->rx_buffer_len = MAXIMUM_ETHERNET_VLAN_SIZE;
1155 hw->max_frame_size = netdev->mtu +
1156 ENET_HEADER_SIZE + ETHERNET_FCS_SIZE;
1157 hw->min_frame_size = MINIMUM_ETHERNET_FRAME_SIZE;
1158
1159 /* identify the MAC */
1160
1161 if (e1000_set_mac_type(hw)) {
1162 e_err(probe, "Unknown MAC Type\n");
1163 return -EIO;
1164 }
1165
1166 switch (hw->mac_type) {
1167 default:
1168 break;
1169 case e1000_82541:
1170 case e1000_82547:
1171 case e1000_82541_rev_2:
1172 case e1000_82547_rev_2:
1173 hw->phy_init_script = 1;
1174 break;
1175 }
1176
1177 e1000_set_media_type(hw);
1178
1179 hw->wait_autoneg_complete = false;
1180 hw->tbi_compatibility_en = true;
1181 hw->adaptive_ifs = true;
1182
1183 /* Copper options */
1184
1185 if (hw->media_type == e1000_media_type_copper) {
1186 hw->mdix = AUTO_ALL_MODES;
1187 hw->disable_polarity_correction = false;
1188 hw->master_slave = E1000_MASTER_SLAVE;
1189 }
1190 1231
1191 adapter->num_tx_queues = 1; 1232 adapter->num_tx_queues = 1;
1192 adapter->num_rx_queues = 1; 1233 adapter->num_rx_queues = 1;
@@ -2210,22 +2251,45 @@ static void e1000_set_rx_mode(struct net_device *netdev)
2210static void e1000_update_phy_info(unsigned long data) 2251static void e1000_update_phy_info(unsigned long data)
2211{ 2252{
2212 struct e1000_adapter *adapter = (struct e1000_adapter *)data; 2253 struct e1000_adapter *adapter = (struct e1000_adapter *)data;
2254 schedule_work(&adapter->phy_info_task);
2255}
2256
2257static void e1000_update_phy_info_task(struct work_struct *work)
2258{
2259 struct e1000_adapter *adapter = container_of(work,
2260 struct e1000_adapter,
2261 phy_info_task);
2213 struct e1000_hw *hw = &adapter->hw; 2262 struct e1000_hw *hw = &adapter->hw;
2263
2264 rtnl_lock();
2214 e1000_phy_get_info(hw, &adapter->phy_info); 2265 e1000_phy_get_info(hw, &adapter->phy_info);
2266 rtnl_unlock();
2215} 2267}
2216 2268
2217/** 2269/**
2218 * e1000_82547_tx_fifo_stall - Timer Call-back 2270 * e1000_82547_tx_fifo_stall - Timer Call-back
2219 * @data: pointer to adapter cast into an unsigned long 2271 * @data: pointer to adapter cast into an unsigned long
2220 **/ 2272 **/
2221
2222static void e1000_82547_tx_fifo_stall(unsigned long data) 2273static void e1000_82547_tx_fifo_stall(unsigned long data)
2223{ 2274{
2224 struct e1000_adapter *adapter = (struct e1000_adapter *)data; 2275 struct e1000_adapter *adapter = (struct e1000_adapter *)data;
2276 schedule_work(&adapter->fifo_stall_task);
2277}
2278
2279/**
2280 * e1000_82547_tx_fifo_stall_task - task to complete work
2281 * @work: work struct contained inside adapter struct
2282 **/
2283static void e1000_82547_tx_fifo_stall_task(struct work_struct *work)
2284{
2285 struct e1000_adapter *adapter = container_of(work,
2286 struct e1000_adapter,
2287 fifo_stall_task);
2225 struct e1000_hw *hw = &adapter->hw; 2288 struct e1000_hw *hw = &adapter->hw;
2226 struct net_device *netdev = adapter->netdev; 2289 struct net_device *netdev = adapter->netdev;
2227 u32 tctl; 2290 u32 tctl;
2228 2291
2292 rtnl_lock();
2229 if (atomic_read(&adapter->tx_fifo_stall)) { 2293 if (atomic_read(&adapter->tx_fifo_stall)) {
2230 if ((er32(TDT) == er32(TDH)) && 2294 if ((er32(TDT) == er32(TDH)) &&
2231 (er32(TDFT) == er32(TDFH)) && 2295 (er32(TDFT) == er32(TDFH)) &&
@@ -2246,6 +2310,7 @@ static void e1000_82547_tx_fifo_stall(unsigned long data)
2246 mod_timer(&adapter->tx_fifo_stall_timer, jiffies + 1); 2310 mod_timer(&adapter->tx_fifo_stall_timer, jiffies + 1);
2247 } 2311 }
2248 } 2312 }
2313 rtnl_unlock();
2249} 2314}
2250 2315
2251bool e1000_has_link(struct e1000_adapter *adapter) 2316bool e1000_has_link(struct e1000_adapter *adapter)
@@ -3054,7 +3119,7 @@ static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb,
3054 } 3119 }
3055 } 3120 }
3056 3121
3057 if (unlikely(adapter->vlgrp && vlan_tx_tag_present(skb))) { 3122 if (unlikely(vlan_tx_tag_present(skb))) {
3058 tx_flags |= E1000_TX_FLAGS_VLAN; 3123 tx_flags |= E1000_TX_FLAGS_VLAN;
3059 tx_flags |= (vlan_tx_tag_get(skb) << E1000_TX_FLAGS_VLAN_SHIFT); 3124 tx_flags |= (vlan_tx_tag_get(skb) << E1000_TX_FLAGS_VLAN_SHIFT);
3060 } 3125 }
@@ -3113,7 +3178,7 @@ static void e1000_reset_task(struct work_struct *work)
3113 struct e1000_adapter *adapter = 3178 struct e1000_adapter *adapter =
3114 container_of(work, struct e1000_adapter, reset_task); 3179 container_of(work, struct e1000_adapter, reset_task);
3115 3180
3116 e1000_reinit_locked(adapter); 3181 e1000_reinit_safe(adapter);
3117} 3182}
3118 3183
3119/** 3184/**
@@ -3535,7 +3600,7 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter,
3535 adapter->total_tx_packets += total_tx_packets; 3600 adapter->total_tx_packets += total_tx_packets;
3536 netdev->stats.tx_bytes += total_tx_bytes; 3601 netdev->stats.tx_bytes += total_tx_bytes;
3537 netdev->stats.tx_packets += total_tx_packets; 3602 netdev->stats.tx_packets += total_tx_packets;
3538 return (count < tx_ring->count); 3603 return count < tx_ring->count;
3539} 3604}
3540 3605
3541/** 3606/**
@@ -3552,7 +3617,8 @@ static void e1000_rx_checksum(struct e1000_adapter *adapter, u32 status_err,
3552 struct e1000_hw *hw = &adapter->hw; 3617 struct e1000_hw *hw = &adapter->hw;
3553 u16 status = (u16)status_err; 3618 u16 status = (u16)status_err;
3554 u8 errors = (u8)(status_err >> 24); 3619 u8 errors = (u8)(status_err >> 24);
3555 skb->ip_summed = CHECKSUM_NONE; 3620
3621 skb_checksum_none_assert(skb);
3556 3622
3557 /* 82543 or newer only */ 3623 /* 82543 or newer only */
3558 if (unlikely(hw->mac_type < e1000_82543)) return; 3624 if (unlikely(hw->mac_type < e1000_82543)) return;
@@ -3598,13 +3664,14 @@ static void e1000_consume_page(struct e1000_buffer *bi, struct sk_buff *skb,
3598static void e1000_receive_skb(struct e1000_adapter *adapter, u8 status, 3664static void e1000_receive_skb(struct e1000_adapter *adapter, u8 status,
3599 __le16 vlan, struct sk_buff *skb) 3665 __le16 vlan, struct sk_buff *skb)
3600{ 3666{
3601 if (unlikely(adapter->vlgrp && (status & E1000_RXD_STAT_VP))) { 3667 skb->protocol = eth_type_trans(skb, adapter->netdev);
3602 vlan_hwaccel_receive_skb(skb, adapter->vlgrp, 3668
3603 le16_to_cpu(vlan) & 3669 if ((unlikely(adapter->vlgrp && (status & E1000_RXD_STAT_VP))))
3604 E1000_RXD_SPC_VLAN_MASK); 3670 vlan_gro_receive(&adapter->napi, adapter->vlgrp,
3605 } else { 3671 le16_to_cpu(vlan) & E1000_RXD_SPC_VLAN_MASK,
3606 netif_receive_skb(skb); 3672 skb);
3607 } 3673 else
3674 napi_gro_receive(&adapter->napi, skb);
3608} 3675}
3609 3676
3610/** 3677/**
@@ -3762,8 +3829,6 @@ static bool e1000_clean_jumbo_rx_irq(struct e1000_adapter *adapter,
3762 goto next_desc; 3829 goto next_desc;
3763 } 3830 }
3764 3831
3765 skb->protocol = eth_type_trans(skb, netdev);
3766
3767 e1000_receive_skb(adapter, status, rx_desc->special, skb); 3832 e1000_receive_skb(adapter, status, rx_desc->special, skb);
3768 3833
3769next_desc: 3834next_desc:
@@ -3926,8 +3991,6 @@ static bool e1000_clean_rx_irq(struct e1000_adapter *adapter,
3926 ((u32)(rx_desc->errors) << 24), 3991 ((u32)(rx_desc->errors) << 24),
3927 le16_to_cpu(rx_desc->csum), skb); 3992 le16_to_cpu(rx_desc->csum), skb);
3928 3993
3929 skb->protocol = eth_type_trans(skb, netdev);
3930
3931 e1000_receive_skb(adapter, status, rx_desc->special, skb); 3994 e1000_receive_skb(adapter, status, rx_desc->special, skb);
3932 3995
3933next_desc: 3996next_desc:
@@ -4478,7 +4541,7 @@ static void e1000_restore_vlan(struct e1000_adapter *adapter)
4478 4541
4479 if (adapter->vlgrp) { 4542 if (adapter->vlgrp) {
4480 u16 vid; 4543 u16 vid;
4481 for (vid = 0; vid < VLAN_GROUP_ARRAY_LEN; vid++) { 4544 for (vid = 0; vid < VLAN_N_VID; vid++) {
4482 if (!vlan_group_get_device(adapter->vlgrp, vid)) 4545 if (!vlan_group_get_device(adapter->vlgrp, vid))
4483 continue; 4546 continue;
4484 e1000_vlan_rx_add_vid(adapter->netdev, vid); 4547 e1000_vlan_rx_add_vid(adapter->netdev, vid);