diff options
Diffstat (limited to 'drivers/net/e1000e')
-rw-r--r-- | drivers/net/e1000e/82571.c | 49 | ||||
-rw-r--r-- | drivers/net/e1000e/defines.h | 9 | ||||
-rw-r--r-- | drivers/net/e1000e/e1000.h | 31 | ||||
-rw-r--r-- | drivers/net/e1000e/es2lan.c | 11 | ||||
-rw-r--r-- | drivers/net/e1000e/ethtool.c | 48 | ||||
-rw-r--r-- | drivers/net/e1000e/hw.h | 5 | ||||
-rw-r--r-- | drivers/net/e1000e/ich8lan.c | 391 | ||||
-rw-r--r-- | drivers/net/e1000e/lib.c | 60 | ||||
-rw-r--r-- | drivers/net/e1000e/netdev.c | 937 | ||||
-rw-r--r-- | drivers/net/e1000e/param.c | 25 | ||||
-rw-r--r-- | drivers/net/e1000e/phy.c | 21 |
11 files changed, 1086 insertions, 501 deletions
diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c index 712ccc66ba25..f654db9121de 100644 --- a/drivers/net/e1000e/82571.c +++ b/drivers/net/e1000e/82571.c | |||
@@ -234,9 +234,6 @@ static s32 e1000_init_mac_params_82571(struct e1000_adapter *adapter) | |||
234 | mac->mta_reg_count = 128; | 234 | mac->mta_reg_count = 128; |
235 | /* Set rar entry count */ | 235 | /* Set rar entry count */ |
236 | mac->rar_entry_count = E1000_RAR_ENTRIES; | 236 | mac->rar_entry_count = E1000_RAR_ENTRIES; |
237 | /* Set if manageability features are enabled. */ | ||
238 | mac->arc_subsystem_valid = (er32(FWSM) & E1000_FWSM_MODE_MASK) | ||
239 | ? true : false; | ||
240 | /* Adaptive IFS supported */ | 237 | /* Adaptive IFS supported */ |
241 | mac->adaptive_ifs = true; | 238 | mac->adaptive_ifs = true; |
242 | 239 | ||
@@ -271,6 +268,16 @@ static s32 e1000_init_mac_params_82571(struct e1000_adapter *adapter) | |||
271 | func->set_lan_id = e1000_set_lan_id_single_port; | 268 | func->set_lan_id = e1000_set_lan_id_single_port; |
272 | func->check_mng_mode = e1000e_check_mng_mode_generic; | 269 | func->check_mng_mode = e1000e_check_mng_mode_generic; |
273 | func->led_on = e1000e_led_on_generic; | 270 | func->led_on = e1000e_led_on_generic; |
271 | |||
272 | /* FWSM register */ | ||
273 | mac->has_fwsm = true; | ||
274 | /* | ||
275 | * ARC supported; valid only if manageability features are | ||
276 | * enabled. | ||
277 | */ | ||
278 | mac->arc_subsystem_valid = | ||
279 | (er32(FWSM) & E1000_FWSM_MODE_MASK) | ||
280 | ? true : false; | ||
274 | break; | 281 | break; |
275 | case e1000_82574: | 282 | case e1000_82574: |
276 | case e1000_82583: | 283 | case e1000_82583: |
@@ -281,6 +288,9 @@ static s32 e1000_init_mac_params_82571(struct e1000_adapter *adapter) | |||
281 | default: | 288 | default: |
282 | func->check_mng_mode = e1000e_check_mng_mode_generic; | 289 | func->check_mng_mode = e1000e_check_mng_mode_generic; |
283 | func->led_on = e1000e_led_on_generic; | 290 | func->led_on = e1000e_led_on_generic; |
291 | |||
292 | /* FWSM register */ | ||
293 | mac->has_fwsm = true; | ||
284 | break; | 294 | break; |
285 | } | 295 | } |
286 | 296 | ||
@@ -323,7 +333,7 @@ static s32 e1000_init_mac_params_82571(struct e1000_adapter *adapter) | |||
323 | } | 333 | } |
324 | 334 | ||
325 | /* | 335 | /* |
326 | * Initialze device specific counter of SMBI acquisition | 336 | * Initialize device specific counter of SMBI acquisition |
327 | * timeouts. | 337 | * timeouts. |
328 | */ | 338 | */ |
329 | hw->dev_spec.e82571.smb_counter = 0; | 339 | hw->dev_spec.e82571.smb_counter = 0; |
@@ -336,7 +346,6 @@ static s32 e1000_get_variants_82571(struct e1000_adapter *adapter) | |||
336 | struct e1000_hw *hw = &adapter->hw; | 346 | struct e1000_hw *hw = &adapter->hw; |
337 | static int global_quad_port_a; /* global port a indication */ | 347 | static int global_quad_port_a; /* global port a indication */ |
338 | struct pci_dev *pdev = adapter->pdev; | 348 | struct pci_dev *pdev = adapter->pdev; |
339 | u16 eeprom_data = 0; | ||
340 | int is_port_b = er32(STATUS) & E1000_STATUS_FUNC_1; | 349 | int is_port_b = er32(STATUS) & E1000_STATUS_FUNC_1; |
341 | s32 rc; | 350 | s32 rc; |
342 | 351 | ||
@@ -387,16 +396,15 @@ static s32 e1000_get_variants_82571(struct e1000_adapter *adapter) | |||
387 | if (pdev->device == E1000_DEV_ID_82571EB_SERDES_QUAD) | 396 | if (pdev->device == E1000_DEV_ID_82571EB_SERDES_QUAD) |
388 | adapter->flags &= ~FLAG_HAS_WOL; | 397 | adapter->flags &= ~FLAG_HAS_WOL; |
389 | break; | 398 | break; |
390 | |||
391 | case e1000_82573: | 399 | case e1000_82573: |
400 | case e1000_82574: | ||
401 | case e1000_82583: | ||
402 | /* Disable ASPM L0s due to hardware errata */ | ||
403 | e1000e_disable_aspm(adapter->pdev, PCIE_LINK_STATE_L0S); | ||
404 | |||
392 | if (pdev->device == E1000_DEV_ID_82573L) { | 405 | if (pdev->device == E1000_DEV_ID_82573L) { |
393 | if (e1000_read_nvm(&adapter->hw, NVM_INIT_3GIO_3, 1, | 406 | adapter->flags |= FLAG_HAS_JUMBO_FRAMES; |
394 | &eeprom_data) < 0) | 407 | adapter->max_hw_frame_size = DEFAULT_JUMBO; |
395 | break; | ||
396 | if (!(eeprom_data & NVM_WORD1A_ASPM_MASK)) { | ||
397 | adapter->flags |= FLAG_HAS_JUMBO_FRAMES; | ||
398 | adapter->max_hw_frame_size = DEFAULT_JUMBO; | ||
399 | } | ||
400 | } | 408 | } |
401 | break; | 409 | break; |
402 | default: | 410 | default: |
@@ -995,9 +1003,10 @@ static s32 e1000_init_hw_82571(struct e1000_hw *hw) | |||
995 | /* ...for both queues. */ | 1003 | /* ...for both queues. */ |
996 | switch (mac->type) { | 1004 | switch (mac->type) { |
997 | case e1000_82573: | 1005 | case e1000_82573: |
1006 | e1000e_enable_tx_pkt_filtering(hw); | ||
1007 | /* fall through */ | ||
998 | case e1000_82574: | 1008 | case e1000_82574: |
999 | case e1000_82583: | 1009 | case e1000_82583: |
1000 | e1000e_enable_tx_pkt_filtering(hw); | ||
1001 | reg_data = er32(GCR); | 1010 | reg_data = er32(GCR); |
1002 | reg_data |= E1000_GCR_L1_ACT_WITHOUT_L0S_RX; | 1011 | reg_data |= E1000_GCR_L1_ACT_WITHOUT_L0S_RX; |
1003 | ew32(GCR, reg_data); | 1012 | ew32(GCR, reg_data); |
@@ -1139,8 +1148,6 @@ static void e1000_initialize_hw_bits_82571(struct e1000_hw *hw) | |||
1139 | default: | 1148 | default: |
1140 | break; | 1149 | break; |
1141 | } | 1150 | } |
1142 | |||
1143 | return; | ||
1144 | } | 1151 | } |
1145 | 1152 | ||
1146 | /** | 1153 | /** |
@@ -1644,8 +1651,6 @@ static void e1000_power_down_phy_copper_82571(struct e1000_hw *hw) | |||
1644 | /* If the management interface is not enabled, then power down */ | 1651 | /* If the management interface is not enabled, then power down */ |
1645 | if (!(mac->ops.check_mng_mode(hw) || phy->ops.check_reset_block(hw))) | 1652 | if (!(mac->ops.check_mng_mode(hw) || phy->ops.check_reset_block(hw))) |
1646 | e1000_power_down_phy_copper(hw); | 1653 | e1000_power_down_phy_copper(hw); |
1647 | |||
1648 | return; | ||
1649 | } | 1654 | } |
1650 | 1655 | ||
1651 | /** | 1656 | /** |
@@ -1792,6 +1797,7 @@ struct e1000_info e1000_82571_info = { | |||
1792 | | FLAG_RESET_OVERWRITES_LAA /* errata */ | 1797 | | FLAG_RESET_OVERWRITES_LAA /* errata */ |
1793 | | FLAG_TARC_SPEED_MODE_BIT /* errata */ | 1798 | | FLAG_TARC_SPEED_MODE_BIT /* errata */ |
1794 | | FLAG_APME_CHECK_PORT_B, | 1799 | | FLAG_APME_CHECK_PORT_B, |
1800 | .flags2 = FLAG2_DISABLE_ASPM_L1, /* errata 13 */ | ||
1795 | .pba = 38, | 1801 | .pba = 38, |
1796 | .max_hw_frame_size = DEFAULT_JUMBO, | 1802 | .max_hw_frame_size = DEFAULT_JUMBO, |
1797 | .get_variants = e1000_get_variants_82571, | 1803 | .get_variants = e1000_get_variants_82571, |
@@ -1809,6 +1815,7 @@ struct e1000_info e1000_82572_info = { | |||
1809 | | FLAG_RX_CSUM_ENABLED | 1815 | | FLAG_RX_CSUM_ENABLED |
1810 | | FLAG_HAS_CTRLEXT_ON_LOAD | 1816 | | FLAG_HAS_CTRLEXT_ON_LOAD |
1811 | | FLAG_TARC_SPEED_MODE_BIT, /* errata */ | 1817 | | FLAG_TARC_SPEED_MODE_BIT, /* errata */ |
1818 | .flags2 = FLAG2_DISABLE_ASPM_L1, /* errata 13 */ | ||
1812 | .pba = 38, | 1819 | .pba = 38, |
1813 | .max_hw_frame_size = DEFAULT_JUMBO, | 1820 | .max_hw_frame_size = DEFAULT_JUMBO, |
1814 | .get_variants = e1000_get_variants_82571, | 1821 | .get_variants = e1000_get_variants_82571, |
@@ -1820,13 +1827,11 @@ struct e1000_info e1000_82572_info = { | |||
1820 | struct e1000_info e1000_82573_info = { | 1827 | struct e1000_info e1000_82573_info = { |
1821 | .mac = e1000_82573, | 1828 | .mac = e1000_82573, |
1822 | .flags = FLAG_HAS_HW_VLAN_FILTER | 1829 | .flags = FLAG_HAS_HW_VLAN_FILTER |
1823 | | FLAG_HAS_JUMBO_FRAMES | ||
1824 | | FLAG_HAS_WOL | 1830 | | FLAG_HAS_WOL |
1825 | | FLAG_APME_IN_CTRL3 | 1831 | | FLAG_APME_IN_CTRL3 |
1826 | | FLAG_RX_CSUM_ENABLED | 1832 | | FLAG_RX_CSUM_ENABLED |
1827 | | FLAG_HAS_SMART_POWER_DOWN | 1833 | | FLAG_HAS_SMART_POWER_DOWN |
1828 | | FLAG_HAS_AMT | 1834 | | FLAG_HAS_AMT |
1829 | | FLAG_HAS_ERT | ||
1830 | | FLAG_HAS_SWSM_ON_LOAD, | 1835 | | FLAG_HAS_SWSM_ON_LOAD, |
1831 | .pba = 20, | 1836 | .pba = 20, |
1832 | .max_hw_frame_size = ETH_FRAME_LEN + ETH_FCS_LEN, | 1837 | .max_hw_frame_size = ETH_FRAME_LEN + ETH_FCS_LEN, |
@@ -1847,7 +1852,7 @@ struct e1000_info e1000_82574_info = { | |||
1847 | | FLAG_HAS_SMART_POWER_DOWN | 1852 | | FLAG_HAS_SMART_POWER_DOWN |
1848 | | FLAG_HAS_AMT | 1853 | | FLAG_HAS_AMT |
1849 | | FLAG_HAS_CTRLEXT_ON_LOAD, | 1854 | | FLAG_HAS_CTRLEXT_ON_LOAD, |
1850 | .pba = 20, | 1855 | .pba = 36, |
1851 | .max_hw_frame_size = DEFAULT_JUMBO, | 1856 | .max_hw_frame_size = DEFAULT_JUMBO, |
1852 | .get_variants = e1000_get_variants_82571, | 1857 | .get_variants = e1000_get_variants_82571, |
1853 | .mac_ops = &e82571_mac_ops, | 1858 | .mac_ops = &e82571_mac_ops, |
@@ -1864,7 +1869,7 @@ struct e1000_info e1000_82583_info = { | |||
1864 | | FLAG_HAS_SMART_POWER_DOWN | 1869 | | FLAG_HAS_SMART_POWER_DOWN |
1865 | | FLAG_HAS_AMT | 1870 | | FLAG_HAS_AMT |
1866 | | FLAG_HAS_CTRLEXT_ON_LOAD, | 1871 | | FLAG_HAS_CTRLEXT_ON_LOAD, |
1867 | .pba = 20, | 1872 | .pba = 36, |
1868 | .max_hw_frame_size = ETH_FRAME_LEN + ETH_FCS_LEN, | 1873 | .max_hw_frame_size = ETH_FRAME_LEN + ETH_FCS_LEN, |
1869 | .get_variants = e1000_get_variants_82571, | 1874 | .get_variants = e1000_get_variants_82571, |
1870 | .mac_ops = &e82571_mac_ops, | 1875 | .mac_ops = &e82571_mac_ops, |
diff --git a/drivers/net/e1000e/defines.h b/drivers/net/e1000e/defines.h index e301e26d6897..4dc02c71ffd6 100644 --- a/drivers/net/e1000e/defines.h +++ b/drivers/net/e1000e/defines.h | |||
@@ -138,6 +138,11 @@ | |||
138 | /* Enable MNG packets to host memory */ | 138 | /* Enable MNG packets to host memory */ |
139 | #define E1000_MANC_EN_MNG2HOST 0x00200000 | 139 | #define E1000_MANC_EN_MNG2HOST 0x00200000 |
140 | 140 | ||
141 | #define E1000_MANC2H_PORT_623 0x00000020 /* Port 0x26f */ | ||
142 | #define E1000_MANC2H_PORT_664 0x00000040 /* Port 0x298 */ | ||
143 | #define E1000_MDEF_PORT_623 0x00000800 /* Port 0x26f */ | ||
144 | #define E1000_MDEF_PORT_664 0x00000400 /* Port 0x298 */ | ||
145 | |||
141 | /* Receive Control */ | 146 | /* Receive Control */ |
142 | #define E1000_RCTL_EN 0x00000002 /* enable */ | 147 | #define E1000_RCTL_EN 0x00000002 /* enable */ |
143 | #define E1000_RCTL_SBP 0x00000004 /* store bad packet */ | 148 | #define E1000_RCTL_SBP 0x00000004 /* store bad packet */ |
@@ -214,6 +219,8 @@ | |||
214 | #define E1000_CTRL_SPD_1000 0x00000200 /* Force 1Gb */ | 219 | #define E1000_CTRL_SPD_1000 0x00000200 /* Force 1Gb */ |
215 | #define E1000_CTRL_FRCSPD 0x00000800 /* Force Speed */ | 220 | #define E1000_CTRL_FRCSPD 0x00000800 /* Force Speed */ |
216 | #define E1000_CTRL_FRCDPX 0x00001000 /* Force Duplex */ | 221 | #define E1000_CTRL_FRCDPX 0x00001000 /* Force Duplex */ |
222 | #define E1000_CTRL_LANPHYPC_OVERRIDE 0x00010000 /* SW control of LANPHYPC */ | ||
223 | #define E1000_CTRL_LANPHYPC_VALUE 0x00020000 /* SW value of LANPHYPC */ | ||
217 | #define E1000_CTRL_SWDPIN0 0x00040000 /* SWDPIN 0 value */ | 224 | #define E1000_CTRL_SWDPIN0 0x00040000 /* SWDPIN 0 value */ |
218 | #define E1000_CTRL_SWDPIN1 0x00080000 /* SWDPIN 1 value */ | 225 | #define E1000_CTRL_SWDPIN1 0x00080000 /* SWDPIN 1 value */ |
219 | #define E1000_CTRL_SWDPIO0 0x00400000 /* SWDPIN 0 Input or output */ | 226 | #define E1000_CTRL_SWDPIO0 0x00400000 /* SWDPIN 0 Input or output */ |
@@ -622,6 +629,8 @@ | |||
622 | #define NVM_ALT_MAC_ADDR_PTR 0x0037 | 629 | #define NVM_ALT_MAC_ADDR_PTR 0x0037 |
623 | #define NVM_CHECKSUM_REG 0x003F | 630 | #define NVM_CHECKSUM_REG 0x003F |
624 | 631 | ||
632 | #define E1000_NVM_INIT_CTRL2_MNGM 0x6000 /* Manageability Operation Mode mask */ | ||
633 | |||
625 | #define E1000_NVM_CFG_DONE_PORT_0 0x40000 /* MNG config cycle done */ | 634 | #define E1000_NVM_CFG_DONE_PORT_0 0x40000 /* MNG config cycle done */ |
626 | #define E1000_NVM_CFG_DONE_PORT_1 0x80000 /* ...for second port */ | 635 | #define E1000_NVM_CFG_DONE_PORT_1 0x80000 /* ...for second port */ |
627 | 636 | ||
diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h index 118bdf483593..c0b3db40bd73 100644 --- a/drivers/net/e1000e/e1000.h +++ b/drivers/net/e1000e/e1000.h | |||
@@ -37,30 +37,22 @@ | |||
37 | #include <linux/io.h> | 37 | #include <linux/io.h> |
38 | #include <linux/netdevice.h> | 38 | #include <linux/netdevice.h> |
39 | #include <linux/pci.h> | 39 | #include <linux/pci.h> |
40 | #include <linux/pci-aspm.h> | ||
40 | 41 | ||
41 | #include "hw.h" | 42 | #include "hw.h" |
42 | 43 | ||
43 | struct e1000_info; | 44 | struct e1000_info; |
44 | 45 | ||
45 | #define e_printk(level, adapter, format, arg...) \ | ||
46 | printk(level "%s: %s: " format, pci_name(adapter->pdev), \ | ||
47 | adapter->netdev->name, ## arg) | ||
48 | |||
49 | #ifdef DEBUG | ||
50 | #define e_dbg(format, arg...) \ | 46 | #define e_dbg(format, arg...) \ |
51 | e_printk(KERN_DEBUG , hw->adapter, format, ## arg) | 47 | netdev_dbg(hw->adapter->netdev, format, ## arg) |
52 | #else | ||
53 | #define e_dbg(format, arg...) do { (void)(hw); } while (0) | ||
54 | #endif | ||
55 | |||
56 | #define e_err(format, arg...) \ | 48 | #define e_err(format, arg...) \ |
57 | e_printk(KERN_ERR, adapter, format, ## arg) | 49 | netdev_err(adapter->netdev, format, ## arg) |
58 | #define e_info(format, arg...) \ | 50 | #define e_info(format, arg...) \ |
59 | e_printk(KERN_INFO, adapter, format, ## arg) | 51 | netdev_info(adapter->netdev, format, ## arg) |
60 | #define e_warn(format, arg...) \ | 52 | #define e_warn(format, arg...) \ |
61 | e_printk(KERN_WARNING, adapter, format, ## arg) | 53 | netdev_warn(adapter->netdev, format, ## arg) |
62 | #define e_notice(format, arg...) \ | 54 | #define e_notice(format, arg...) \ |
63 | e_printk(KERN_NOTICE, adapter, format, ## arg) | 55 | netdev_notice(adapter->netdev, format, ## arg) |
64 | 56 | ||
65 | 57 | ||
66 | /* Interrupt modes, as used by the IntMode parameter */ | 58 | /* Interrupt modes, as used by the IntMode parameter */ |
@@ -158,6 +150,9 @@ struct e1000_info; | |||
158 | #define HV_M_STATUS_SPEED_1000 0x0200 | 150 | #define HV_M_STATUS_SPEED_1000 0x0200 |
159 | #define HV_M_STATUS_LINK_UP 0x0040 | 151 | #define HV_M_STATUS_LINK_UP 0x0040 |
160 | 152 | ||
153 | /* Time to wait before putting the device into D3 if there's no link (in ms). */ | ||
154 | #define LINK_TIMEOUT 100 | ||
155 | |||
161 | enum e1000_boards { | 156 | enum e1000_boards { |
162 | board_82571, | 157 | board_82571, |
163 | board_82572, | 158 | board_82572, |
@@ -194,6 +189,8 @@ struct e1000_buffer { | |||
194 | unsigned long time_stamp; | 189 | unsigned long time_stamp; |
195 | u16 length; | 190 | u16 length; |
196 | u16 next_to_watch; | 191 | u16 next_to_watch; |
192 | unsigned int segs; | ||
193 | unsigned int bytecount; | ||
197 | u16 mapped_as_page; | 194 | u16 mapped_as_page; |
198 | }; | 195 | }; |
199 | /* Rx */ | 196 | /* Rx */ |
@@ -369,12 +366,14 @@ struct e1000_adapter { | |||
369 | struct work_struct update_phy_task; | 366 | struct work_struct update_phy_task; |
370 | struct work_struct led_blink_task; | 367 | struct work_struct led_blink_task; |
371 | struct work_struct print_hang_task; | 368 | struct work_struct print_hang_task; |
369 | |||
370 | bool idle_check; | ||
372 | }; | 371 | }; |
373 | 372 | ||
374 | struct e1000_info { | 373 | struct e1000_info { |
375 | enum e1000_mac_type mac; | 374 | enum e1000_mac_type mac; |
376 | unsigned int flags; | 375 | unsigned int flags; |
377 | unsigned int flags2; | 376 | unsigned int flags2; |
378 | u32 pba; | 377 | u32 pba; |
379 | u32 max_hw_frame_size; | 378 | u32 max_hw_frame_size; |
380 | s32 (*get_variants)(struct e1000_adapter *); | 379 | s32 (*get_variants)(struct e1000_adapter *); |
@@ -421,6 +420,7 @@ struct e1000_info { | |||
421 | #define FLAG2_CRC_STRIPPING (1 << 0) | 420 | #define FLAG2_CRC_STRIPPING (1 << 0) |
422 | #define FLAG2_HAS_PHY_WAKEUP (1 << 1) | 421 | #define FLAG2_HAS_PHY_WAKEUP (1 << 1) |
423 | #define FLAG2_IS_DISCARDING (1 << 2) | 422 | #define FLAG2_IS_DISCARDING (1 << 2) |
423 | #define FLAG2_DISABLE_ASPM_L1 (1 << 3) | ||
424 | 424 | ||
425 | #define E1000_RX_DESC_PS(R, i) \ | 425 | #define E1000_RX_DESC_PS(R, i) \ |
426 | (&(((union e1000_rx_desc_packet_split *)((R).desc))[i])) | 426 | (&(((union e1000_rx_desc_packet_split *)((R).desc))[i])) |
@@ -461,6 +461,7 @@ extern void e1000e_update_stats(struct e1000_adapter *adapter); | |||
461 | extern bool e1000e_has_link(struct e1000_adapter *adapter); | 461 | extern bool e1000e_has_link(struct e1000_adapter *adapter); |
462 | extern void e1000e_set_interrupt_capability(struct e1000_adapter *adapter); | 462 | extern void e1000e_set_interrupt_capability(struct e1000_adapter *adapter); |
463 | extern void e1000e_reset_interrupt_capability(struct e1000_adapter *adapter); | 463 | extern void e1000e_reset_interrupt_capability(struct e1000_adapter *adapter); |
464 | extern void e1000e_disable_aspm(struct pci_dev *pdev, u16 state); | ||
464 | 465 | ||
465 | extern unsigned int copybreak; | 466 | extern unsigned int copybreak; |
466 | 467 | ||
diff --git a/drivers/net/e1000e/es2lan.c b/drivers/net/e1000e/es2lan.c index 27d21589a69a..38d79a669059 100644 --- a/drivers/net/e1000e/es2lan.c +++ b/drivers/net/e1000e/es2lan.c | |||
@@ -221,9 +221,12 @@ static s32 e1000_init_mac_params_80003es2lan(struct e1000_adapter *adapter) | |||
221 | mac->mta_reg_count = 128; | 221 | mac->mta_reg_count = 128; |
222 | /* Set rar entry count */ | 222 | /* Set rar entry count */ |
223 | mac->rar_entry_count = E1000_RAR_ENTRIES; | 223 | mac->rar_entry_count = E1000_RAR_ENTRIES; |
224 | /* Set if manageability features are enabled. */ | 224 | /* FWSM register */ |
225 | mac->arc_subsystem_valid = (er32(FWSM) & E1000_FWSM_MODE_MASK) | 225 | mac->has_fwsm = true; |
226 | ? true : false; | 226 | /* ARC supported; valid only if manageability features are enabled. */ |
227 | mac->arc_subsystem_valid = | ||
228 | (er32(FWSM) & E1000_FWSM_MODE_MASK) | ||
229 | ? true : false; | ||
227 | /* Adaptive IFS not supported */ | 230 | /* Adaptive IFS not supported */ |
228 | mac->adaptive_ifs = false; | 231 | mac->adaptive_ifs = false; |
229 | 232 | ||
@@ -1380,8 +1383,6 @@ static void e1000_power_down_phy_copper_80003es2lan(struct e1000_hw *hw) | |||
1380 | if (!(hw->mac.ops.check_mng_mode(hw) || | 1383 | if (!(hw->mac.ops.check_mng_mode(hw) || |
1381 | hw->phy.ops.check_reset_block(hw))) | 1384 | hw->phy.ops.check_reset_block(hw))) |
1382 | e1000_power_down_phy_copper(hw); | 1385 | e1000_power_down_phy_copper(hw); |
1383 | |||
1384 | return; | ||
1385 | } | 1386 | } |
1386 | 1387 | ||
1387 | /** | 1388 | /** |
diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c index 983493f2330c..2c521218102b 100644 --- a/drivers/net/e1000e/ethtool.c +++ b/drivers/net/e1000e/ethtool.c | |||
@@ -412,7 +412,6 @@ static int e1000_set_tso(struct net_device *netdev, u32 data) | |||
412 | netdev->features &= ~NETIF_F_TSO6; | 412 | netdev->features &= ~NETIF_F_TSO6; |
413 | } | 413 | } |
414 | 414 | ||
415 | e_info("TSO is %s\n", data ? "Enabled" : "Disabled"); | ||
416 | adapter->flags |= FLAG_TSO_FORCE; | 415 | adapter->flags |= FLAG_TSO_FORCE; |
417 | return 0; | 416 | return 0; |
418 | } | 417 | } |
@@ -1069,10 +1068,10 @@ static void e1000_free_desc_rings(struct e1000_adapter *adapter) | |||
1069 | if (tx_ring->desc && tx_ring->buffer_info) { | 1068 | if (tx_ring->desc && tx_ring->buffer_info) { |
1070 | for (i = 0; i < tx_ring->count; i++) { | 1069 | for (i = 0; i < tx_ring->count; i++) { |
1071 | if (tx_ring->buffer_info[i].dma) | 1070 | if (tx_ring->buffer_info[i].dma) |
1072 | pci_unmap_single(pdev, | 1071 | dma_unmap_single(&pdev->dev, |
1073 | tx_ring->buffer_info[i].dma, | 1072 | tx_ring->buffer_info[i].dma, |
1074 | tx_ring->buffer_info[i].length, | 1073 | tx_ring->buffer_info[i].length, |
1075 | PCI_DMA_TODEVICE); | 1074 | DMA_TO_DEVICE); |
1076 | if (tx_ring->buffer_info[i].skb) | 1075 | if (tx_ring->buffer_info[i].skb) |
1077 | dev_kfree_skb(tx_ring->buffer_info[i].skb); | 1076 | dev_kfree_skb(tx_ring->buffer_info[i].skb); |
1078 | } | 1077 | } |
@@ -1081,9 +1080,9 @@ static void e1000_free_desc_rings(struct e1000_adapter *adapter) | |||
1081 | if (rx_ring->desc && rx_ring->buffer_info) { | 1080 | if (rx_ring->desc && rx_ring->buffer_info) { |
1082 | for (i = 0; i < rx_ring->count; i++) { | 1081 | for (i = 0; i < rx_ring->count; i++) { |
1083 | if (rx_ring->buffer_info[i].dma) | 1082 | if (rx_ring->buffer_info[i].dma) |
1084 | pci_unmap_single(pdev, | 1083 | dma_unmap_single(&pdev->dev, |
1085 | rx_ring->buffer_info[i].dma, | 1084 | rx_ring->buffer_info[i].dma, |
1086 | 2048, PCI_DMA_FROMDEVICE); | 1085 | 2048, DMA_FROM_DEVICE); |
1087 | if (rx_ring->buffer_info[i].skb) | 1086 | if (rx_ring->buffer_info[i].skb) |
1088 | dev_kfree_skb(rx_ring->buffer_info[i].skb); | 1087 | dev_kfree_skb(rx_ring->buffer_info[i].skb); |
1089 | } | 1088 | } |
@@ -1163,9 +1162,10 @@ static int e1000_setup_desc_rings(struct e1000_adapter *adapter) | |||
1163 | tx_ring->buffer_info[i].skb = skb; | 1162 | tx_ring->buffer_info[i].skb = skb; |
1164 | tx_ring->buffer_info[i].length = skb->len; | 1163 | tx_ring->buffer_info[i].length = skb->len; |
1165 | tx_ring->buffer_info[i].dma = | 1164 | tx_ring->buffer_info[i].dma = |
1166 | pci_map_single(pdev, skb->data, skb->len, | 1165 | dma_map_single(&pdev->dev, skb->data, skb->len, |
1167 | PCI_DMA_TODEVICE); | 1166 | DMA_TO_DEVICE); |
1168 | if (pci_dma_mapping_error(pdev, tx_ring->buffer_info[i].dma)) { | 1167 | if (dma_mapping_error(&pdev->dev, |
1168 | tx_ring->buffer_info[i].dma)) { | ||
1169 | ret_val = 4; | 1169 | ret_val = 4; |
1170 | goto err_nomem; | 1170 | goto err_nomem; |
1171 | } | 1171 | } |
@@ -1226,9 +1226,10 @@ static int e1000_setup_desc_rings(struct e1000_adapter *adapter) | |||
1226 | skb_reserve(skb, NET_IP_ALIGN); | 1226 | skb_reserve(skb, NET_IP_ALIGN); |
1227 | rx_ring->buffer_info[i].skb = skb; | 1227 | rx_ring->buffer_info[i].skb = skb; |
1228 | rx_ring->buffer_info[i].dma = | 1228 | rx_ring->buffer_info[i].dma = |
1229 | pci_map_single(pdev, skb->data, 2048, | 1229 | dma_map_single(&pdev->dev, skb->data, 2048, |
1230 | PCI_DMA_FROMDEVICE); | 1230 | DMA_FROM_DEVICE); |
1231 | if (pci_dma_mapping_error(pdev, rx_ring->buffer_info[i].dma)) { | 1231 | if (dma_mapping_error(&pdev->dev, |
1232 | rx_ring->buffer_info[i].dma)) { | ||
1232 | ret_val = 8; | 1233 | ret_val = 8; |
1233 | goto err_nomem; | 1234 | goto err_nomem; |
1234 | } | 1235 | } |
@@ -1556,10 +1557,10 @@ static int e1000_run_loopback_test(struct e1000_adapter *adapter) | |||
1556 | for (i = 0; i < 64; i++) { /* send the packets */ | 1557 | for (i = 0; i < 64; i++) { /* send the packets */ |
1557 | e1000_create_lbtest_frame(tx_ring->buffer_info[k].skb, | 1558 | e1000_create_lbtest_frame(tx_ring->buffer_info[k].skb, |
1558 | 1024); | 1559 | 1024); |
1559 | pci_dma_sync_single_for_device(pdev, | 1560 | dma_sync_single_for_device(&pdev->dev, |
1560 | tx_ring->buffer_info[k].dma, | 1561 | tx_ring->buffer_info[k].dma, |
1561 | tx_ring->buffer_info[k].length, | 1562 | tx_ring->buffer_info[k].length, |
1562 | PCI_DMA_TODEVICE); | 1563 | DMA_TO_DEVICE); |
1563 | k++; | 1564 | k++; |
1564 | if (k == tx_ring->count) | 1565 | if (k == tx_ring->count) |
1565 | k = 0; | 1566 | k = 0; |
@@ -1569,9 +1570,9 @@ static int e1000_run_loopback_test(struct e1000_adapter *adapter) | |||
1569 | time = jiffies; /* set the start time for the receive */ | 1570 | time = jiffies; /* set the start time for the receive */ |
1570 | good_cnt = 0; | 1571 | good_cnt = 0; |
1571 | do { /* receive the sent packets */ | 1572 | do { /* receive the sent packets */ |
1572 | pci_dma_sync_single_for_cpu(pdev, | 1573 | dma_sync_single_for_cpu(&pdev->dev, |
1573 | rx_ring->buffer_info[l].dma, 2048, | 1574 | rx_ring->buffer_info[l].dma, 2048, |
1574 | PCI_DMA_FROMDEVICE); | 1575 | DMA_FROM_DEVICE); |
1575 | 1576 | ||
1576 | ret_val = e1000_check_lbtest_frame( | 1577 | ret_val = e1000_check_lbtest_frame( |
1577 | rx_ring->buffer_info[l].skb, 1024); | 1578 | rx_ring->buffer_info[l].skb, 1024); |
@@ -1736,6 +1737,12 @@ static void e1000_diag_test(struct net_device *netdev, | |||
1736 | if (if_running) | 1737 | if (if_running) |
1737 | dev_open(netdev); | 1738 | dev_open(netdev); |
1738 | } else { | 1739 | } else { |
1740 | if (!if_running && (adapter->flags & FLAG_HAS_AMT)) { | ||
1741 | clear_bit(__E1000_TESTING, &adapter->state); | ||
1742 | dev_open(netdev); | ||
1743 | set_bit(__E1000_TESTING, &adapter->state); | ||
1744 | } | ||
1745 | |||
1739 | e_info("online testing starting\n"); | 1746 | e_info("online testing starting\n"); |
1740 | /* Online tests */ | 1747 | /* Online tests */ |
1741 | if (e1000_link_test(adapter, &data[4])) | 1748 | if (e1000_link_test(adapter, &data[4])) |
@@ -1747,6 +1754,9 @@ static void e1000_diag_test(struct net_device *netdev, | |||
1747 | data[2] = 0; | 1754 | data[2] = 0; |
1748 | data[3] = 0; | 1755 | data[3] = 0; |
1749 | 1756 | ||
1757 | if (!if_running && (adapter->flags & FLAG_HAS_AMT)) | ||
1758 | dev_close(netdev); | ||
1759 | |||
1750 | clear_bit(__E1000_TESTING, &adapter->state); | 1760 | clear_bit(__E1000_TESTING, &adapter->state); |
1751 | } | 1761 | } |
1752 | msleep_interruptible(4 * 1000); | 1762 | msleep_interruptible(4 * 1000); |
@@ -1889,7 +1899,7 @@ static int e1000_get_coalesce(struct net_device *netdev, | |||
1889 | { | 1899 | { |
1890 | struct e1000_adapter *adapter = netdev_priv(netdev); | 1900 | struct e1000_adapter *adapter = netdev_priv(netdev); |
1891 | 1901 | ||
1892 | if (adapter->itr_setting <= 3) | 1902 | if (adapter->itr_setting <= 4) |
1893 | ec->rx_coalesce_usecs = adapter->itr_setting; | 1903 | ec->rx_coalesce_usecs = adapter->itr_setting; |
1894 | else | 1904 | else |
1895 | ec->rx_coalesce_usecs = 1000000 / adapter->itr_setting; | 1905 | ec->rx_coalesce_usecs = 1000000 / adapter->itr_setting; |
@@ -1904,12 +1914,14 @@ static int e1000_set_coalesce(struct net_device *netdev, | |||
1904 | struct e1000_hw *hw = &adapter->hw; | 1914 | struct e1000_hw *hw = &adapter->hw; |
1905 | 1915 | ||
1906 | if ((ec->rx_coalesce_usecs > E1000_MAX_ITR_USECS) || | 1916 | if ((ec->rx_coalesce_usecs > E1000_MAX_ITR_USECS) || |
1907 | ((ec->rx_coalesce_usecs > 3) && | 1917 | ((ec->rx_coalesce_usecs > 4) && |
1908 | (ec->rx_coalesce_usecs < E1000_MIN_ITR_USECS)) || | 1918 | (ec->rx_coalesce_usecs < E1000_MIN_ITR_USECS)) || |
1909 | (ec->rx_coalesce_usecs == 2)) | 1919 | (ec->rx_coalesce_usecs == 2)) |
1910 | return -EINVAL; | 1920 | return -EINVAL; |
1911 | 1921 | ||
1912 | if (ec->rx_coalesce_usecs <= 3) { | 1922 | if (ec->rx_coalesce_usecs == 4) { |
1923 | adapter->itr = adapter->itr_setting = 4; | ||
1924 | } else if (ec->rx_coalesce_usecs <= 3) { | ||
1913 | adapter->itr = 20000; | 1925 | adapter->itr = 20000; |
1914 | adapter->itr_setting = ec->rx_coalesce_usecs; | 1926 | adapter->itr_setting = ec->rx_coalesce_usecs; |
1915 | } else { | 1927 | } else { |
diff --git a/drivers/net/e1000e/hw.h b/drivers/net/e1000e/hw.h index 8bdcd5f24eff..5d1220d188d4 100644 --- a/drivers/net/e1000e/hw.h +++ b/drivers/net/e1000e/hw.h | |||
@@ -208,6 +208,8 @@ enum e1e_registers { | |||
208 | 208 | ||
209 | E1000_KMRNCTRLSTA = 0x00034, /* MAC-PHY interface - RW */ | 209 | E1000_KMRNCTRLSTA = 0x00034, /* MAC-PHY interface - RW */ |
210 | E1000_MANC2H = 0x05860, /* Management Control To Host - RW */ | 210 | E1000_MANC2H = 0x05860, /* Management Control To Host - RW */ |
211 | E1000_MDEF_BASE = 0x05890, /* Management Decision Filters */ | ||
212 | #define E1000_MDEF(_n) (E1000_MDEF_BASE + ((_n) * 4)) | ||
211 | E1000_SW_FW_SYNC = 0x05B5C, /* Software-Firmware Synchronization - RW */ | 213 | E1000_SW_FW_SYNC = 0x05B5C, /* Software-Firmware Synchronization - RW */ |
212 | E1000_GCR = 0x05B00, /* PCI-Ex Control */ | 214 | E1000_GCR = 0x05B00, /* PCI-Ex Control */ |
213 | E1000_GCR2 = 0x05B64, /* PCI-Ex Control #2 */ | 215 | E1000_GCR2 = 0x05B64, /* PCI-Ex Control #2 */ |
@@ -380,6 +382,7 @@ enum e1e_registers { | |||
380 | #define E1000_DEV_ID_ICH10_R_BM_V 0x10CE | 382 | #define E1000_DEV_ID_ICH10_R_BM_V 0x10CE |
381 | #define E1000_DEV_ID_ICH10_D_BM_LM 0x10DE | 383 | #define E1000_DEV_ID_ICH10_D_BM_LM 0x10DE |
382 | #define E1000_DEV_ID_ICH10_D_BM_LF 0x10DF | 384 | #define E1000_DEV_ID_ICH10_D_BM_LF 0x10DF |
385 | #define E1000_DEV_ID_ICH10_D_BM_V 0x1525 | ||
383 | #define E1000_DEV_ID_PCH_M_HV_LM 0x10EA | 386 | #define E1000_DEV_ID_PCH_M_HV_LM 0x10EA |
384 | #define E1000_DEV_ID_PCH_M_HV_LC 0x10EB | 387 | #define E1000_DEV_ID_PCH_M_HV_LC 0x10EB |
385 | #define E1000_DEV_ID_PCH_D_HV_DM 0x10EF | 388 | #define E1000_DEV_ID_PCH_D_HV_DM 0x10EF |
@@ -828,6 +831,7 @@ struct e1000_mac_info { | |||
828 | u8 forced_speed_duplex; | 831 | u8 forced_speed_duplex; |
829 | 832 | ||
830 | bool adaptive_ifs; | 833 | bool adaptive_ifs; |
834 | bool has_fwsm; | ||
831 | bool arc_subsystem_valid; | 835 | bool arc_subsystem_valid; |
832 | bool autoneg; | 836 | bool autoneg; |
833 | bool autoneg_failed; | 837 | bool autoneg_failed; |
@@ -898,6 +902,7 @@ struct e1000_fc_info { | |||
898 | u32 high_water; /* Flow control high-water mark */ | 902 | u32 high_water; /* Flow control high-water mark */ |
899 | u32 low_water; /* Flow control low-water mark */ | 903 | u32 low_water; /* Flow control low-water mark */ |
900 | u16 pause_time; /* Flow control pause timer */ | 904 | u16 pause_time; /* Flow control pause timer */ |
905 | u16 refresh_time; /* Flow control refresh timer */ | ||
901 | bool send_xon; /* Flow control send XON */ | 906 | bool send_xon; /* Flow control send XON */ |
902 | bool strict_ieee; /* Strict IEEE mode */ | 907 | bool strict_ieee; /* Strict IEEE mode */ |
903 | enum e1000_fc_mode current_mode; /* FC mode in effect */ | 908 | enum e1000_fc_mode current_mode; /* FC mode in effect */ |
diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c index 8b5e157e9c87..b2507d93de99 100644 --- a/drivers/net/e1000e/ich8lan.c +++ b/drivers/net/e1000e/ich8lan.c | |||
@@ -83,6 +83,8 @@ | |||
83 | 83 | ||
84 | 84 | ||
85 | #define E1000_ICH_FWSM_RSPCIPHY 0x00000040 /* Reset PHY on PCI Reset */ | 85 | #define E1000_ICH_FWSM_RSPCIPHY 0x00000040 /* Reset PHY on PCI Reset */ |
86 | /* FW established a valid mode */ | ||
87 | #define E1000_ICH_FWSM_FW_VALID 0x00008000 | ||
86 | 88 | ||
87 | #define E1000_ICH_MNG_IAMT_MODE 0x2 | 89 | #define E1000_ICH_MNG_IAMT_MODE 0x2 |
88 | 90 | ||
@@ -259,6 +261,7 @@ static inline void __ew32flash(struct e1000_hw *hw, unsigned long reg, u32 val) | |||
259 | static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw) | 261 | static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw) |
260 | { | 262 | { |
261 | struct e1000_phy_info *phy = &hw->phy; | 263 | struct e1000_phy_info *phy = &hw->phy; |
264 | u32 ctrl; | ||
262 | s32 ret_val = 0; | 265 | s32 ret_val = 0; |
263 | 266 | ||
264 | phy->addr = 1; | 267 | phy->addr = 1; |
@@ -274,6 +277,33 @@ static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw) | |||
274 | phy->ops.power_down = e1000_power_down_phy_copper_ich8lan; | 277 | phy->ops.power_down = e1000_power_down_phy_copper_ich8lan; |
275 | phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT; | 278 | phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT; |
276 | 279 | ||
280 | if (!(er32(FWSM) & E1000_ICH_FWSM_FW_VALID)) { | ||
281 | /* | ||
282 | * The MAC-PHY interconnect may still be in SMBus mode | ||
283 | * after Sx->S0. Toggle the LANPHYPC Value bit to force | ||
284 | * the interconnect to PCIe mode, but only if there is no | ||
285 | * firmware present otherwise firmware will have done it. | ||
286 | */ | ||
287 | ctrl = er32(CTRL); | ||
288 | ctrl |= E1000_CTRL_LANPHYPC_OVERRIDE; | ||
289 | ctrl &= ~E1000_CTRL_LANPHYPC_VALUE; | ||
290 | ew32(CTRL, ctrl); | ||
291 | udelay(10); | ||
292 | ctrl &= ~E1000_CTRL_LANPHYPC_OVERRIDE; | ||
293 | ew32(CTRL, ctrl); | ||
294 | msleep(50); | ||
295 | } | ||
296 | |||
297 | /* | ||
298 | * Reset the PHY before any acccess to it. Doing so, ensures that | ||
299 | * the PHY is in a known good state before we read/write PHY registers. | ||
300 | * The generic reset is sufficient here, because we haven't determined | ||
301 | * the PHY type yet. | ||
302 | */ | ||
303 | ret_val = e1000e_phy_hw_reset_generic(hw); | ||
304 | if (ret_val) | ||
305 | goto out; | ||
306 | |||
277 | phy->id = e1000_phy_unknown; | 307 | phy->id = e1000_phy_unknown; |
278 | ret_val = e1000e_get_phy_id(hw); | 308 | ret_val = e1000e_get_phy_id(hw); |
279 | if (ret_val) | 309 | if (ret_val) |
@@ -300,6 +330,7 @@ static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw) | |||
300 | phy->ops.get_cable_length = e1000_get_cable_length_82577; | 330 | phy->ops.get_cable_length = e1000_get_cable_length_82577; |
301 | phy->ops.get_info = e1000_get_phy_info_82577; | 331 | phy->ops.get_info = e1000_get_phy_info_82577; |
302 | phy->ops.commit = e1000e_phy_sw_reset; | 332 | phy->ops.commit = e1000e_phy_sw_reset; |
333 | break; | ||
303 | case e1000_phy_82578: | 334 | case e1000_phy_82578: |
304 | phy->ops.check_polarity = e1000_check_polarity_m88; | 335 | phy->ops.check_polarity = e1000_check_polarity_m88; |
305 | phy->ops.force_speed_duplex = e1000e_phy_force_speed_duplex_m88; | 336 | phy->ops.force_speed_duplex = e1000e_phy_force_speed_duplex_m88; |
@@ -472,8 +503,10 @@ static s32 e1000_init_mac_params_ich8lan(struct e1000_adapter *adapter) | |||
472 | mac->rar_entry_count = E1000_ICH_RAR_ENTRIES; | 503 | mac->rar_entry_count = E1000_ICH_RAR_ENTRIES; |
473 | if (mac->type == e1000_ich8lan) | 504 | if (mac->type == e1000_ich8lan) |
474 | mac->rar_entry_count--; | 505 | mac->rar_entry_count--; |
475 | /* Set if manageability features are enabled. */ | 506 | /* FWSM register */ |
476 | mac->arc_subsystem_valid = true; | 507 | mac->has_fwsm = true; |
508 | /* ARC subsystem not supported */ | ||
509 | mac->arc_subsystem_valid = false; | ||
477 | /* Adaptive IFS supported */ | 510 | /* Adaptive IFS supported */ |
478 | mac->adaptive_ifs = true; | 511 | mac->adaptive_ifs = true; |
479 | 512 | ||
@@ -657,8 +690,6 @@ static s32 e1000_acquire_nvm_ich8lan(struct e1000_hw *hw) | |||
657 | static void e1000_release_nvm_ich8lan(struct e1000_hw *hw) | 690 | static void e1000_release_nvm_ich8lan(struct e1000_hw *hw) |
658 | { | 691 | { |
659 | mutex_unlock(&nvm_mutex); | 692 | mutex_unlock(&nvm_mutex); |
660 | |||
661 | return; | ||
662 | } | 693 | } |
663 | 694 | ||
664 | static DEFINE_MUTEX(swflag_mutex); | 695 | static DEFINE_MUTEX(swflag_mutex); |
@@ -737,8 +768,6 @@ static void e1000_release_swflag_ich8lan(struct e1000_hw *hw) | |||
737 | ew32(EXTCNF_CTRL, extcnf_ctrl); | 768 | ew32(EXTCNF_CTRL, extcnf_ctrl); |
738 | 769 | ||
739 | mutex_unlock(&swflag_mutex); | 770 | mutex_unlock(&swflag_mutex); |
740 | |||
741 | return; | ||
742 | } | 771 | } |
743 | 772 | ||
744 | /** | 773 | /** |
@@ -785,11 +814,16 @@ static s32 e1000_check_reset_block_ich8lan(struct e1000_hw *hw) | |||
785 | **/ | 814 | **/ |
786 | static s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw) | 815 | static s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw) |
787 | { | 816 | { |
817 | struct e1000_adapter *adapter = hw->adapter; | ||
788 | struct e1000_phy_info *phy = &hw->phy; | 818 | struct e1000_phy_info *phy = &hw->phy; |
789 | u32 i, data, cnf_size, cnf_base_addr, sw_cfg_mask; | 819 | u32 i, data, cnf_size, cnf_base_addr, sw_cfg_mask; |
790 | s32 ret_val; | 820 | s32 ret_val = 0; |
791 | u16 word_addr, reg_data, reg_addr, phy_page = 0; | 821 | u16 word_addr, reg_data, reg_addr, phy_page = 0; |
792 | 822 | ||
823 | if (!(hw->mac.type == e1000_ich8lan && phy->type == e1000_phy_igp_3) && | ||
824 | !(hw->mac.type == e1000_pchlan)) | ||
825 | return ret_val; | ||
826 | |||
793 | ret_val = hw->phy.ops.acquire(hw); | 827 | ret_val = hw->phy.ops.acquire(hw); |
794 | if (ret_val) | 828 | if (ret_val) |
795 | return ret_val; | 829 | return ret_val; |
@@ -801,97 +835,87 @@ static s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw) | |||
801 | * Therefore, after each PHY reset, we will load the | 835 | * Therefore, after each PHY reset, we will load the |
802 | * configuration data out of the NVM manually. | 836 | * configuration data out of the NVM manually. |
803 | */ | 837 | */ |
804 | if ((hw->mac.type == e1000_ich8lan && phy->type == e1000_phy_igp_3) || | 838 | if ((adapter->pdev->device == E1000_DEV_ID_ICH8_IGP_M_AMT) || |
805 | (hw->mac.type == e1000_pchlan)) { | 839 | (adapter->pdev->device == E1000_DEV_ID_ICH8_IGP_M) || |
806 | struct e1000_adapter *adapter = hw->adapter; | 840 | (hw->mac.type == e1000_pchlan)) |
807 | 841 | sw_cfg_mask = E1000_FEXTNVM_SW_CONFIG_ICH8M; | |
808 | /* Check if SW needs to configure the PHY */ | 842 | else |
809 | if ((adapter->pdev->device == E1000_DEV_ID_ICH8_IGP_M_AMT) || | 843 | sw_cfg_mask = E1000_FEXTNVM_SW_CONFIG; |
810 | (adapter->pdev->device == E1000_DEV_ID_ICH8_IGP_M) || | ||
811 | (hw->mac.type == e1000_pchlan)) | ||
812 | sw_cfg_mask = E1000_FEXTNVM_SW_CONFIG_ICH8M; | ||
813 | else | ||
814 | sw_cfg_mask = E1000_FEXTNVM_SW_CONFIG; | ||
815 | 844 | ||
816 | data = er32(FEXTNVM); | 845 | data = er32(FEXTNVM); |
817 | if (!(data & sw_cfg_mask)) | 846 | if (!(data & sw_cfg_mask)) |
818 | goto out; | 847 | goto out; |
819 | 848 | ||
820 | /* Wait for basic configuration completes before proceeding */ | 849 | /* |
821 | e1000_lan_init_done_ich8lan(hw); | 850 | * Make sure HW does not configure LCD from PHY |
851 | * extended configuration before SW configuration | ||
852 | */ | ||
853 | data = er32(EXTCNF_CTRL); | ||
854 | if (data & E1000_EXTCNF_CTRL_LCD_WRITE_ENABLE) | ||
855 | goto out; | ||
856 | |||
857 | cnf_size = er32(EXTCNF_SIZE); | ||
858 | cnf_size &= E1000_EXTCNF_SIZE_EXT_PCIE_LENGTH_MASK; | ||
859 | cnf_size >>= E1000_EXTCNF_SIZE_EXT_PCIE_LENGTH_SHIFT; | ||
860 | if (!cnf_size) | ||
861 | goto out; | ||
862 | |||
863 | cnf_base_addr = data & E1000_EXTCNF_CTRL_EXT_CNF_POINTER_MASK; | ||
864 | cnf_base_addr >>= E1000_EXTCNF_CTRL_EXT_CNF_POINTER_SHIFT; | ||
822 | 865 | ||
866 | if (!(data & E1000_EXTCNF_CTRL_OEM_WRITE_ENABLE) && | ||
867 | (hw->mac.type == e1000_pchlan)) { | ||
823 | /* | 868 | /* |
824 | * Make sure HW does not configure LCD from PHY | 869 | * HW configures the SMBus address and LEDs when the |
825 | * extended configuration before SW configuration | 870 | * OEM and LCD Write Enable bits are set in the NVM. |
871 | * When both NVM bits are cleared, SW will configure | ||
872 | * them instead. | ||
826 | */ | 873 | */ |
827 | data = er32(EXTCNF_CTRL); | 874 | data = er32(STRAP); |
828 | if (data & E1000_EXTCNF_CTRL_LCD_WRITE_ENABLE) | 875 | data &= E1000_STRAP_SMBUS_ADDRESS_MASK; |
876 | reg_data = data >> E1000_STRAP_SMBUS_ADDRESS_SHIFT; | ||
877 | reg_data |= HV_SMB_ADDR_PEC_EN | HV_SMB_ADDR_VALID; | ||
878 | ret_val = e1000_write_phy_reg_hv_locked(hw, HV_SMB_ADDR, | ||
879 | reg_data); | ||
880 | if (ret_val) | ||
829 | goto out; | 881 | goto out; |
830 | 882 | ||
831 | cnf_size = er32(EXTCNF_SIZE); | 883 | data = er32(LEDCTL); |
832 | cnf_size &= E1000_EXTCNF_SIZE_EXT_PCIE_LENGTH_MASK; | 884 | ret_val = e1000_write_phy_reg_hv_locked(hw, HV_LED_CONFIG, |
833 | cnf_size >>= E1000_EXTCNF_SIZE_EXT_PCIE_LENGTH_SHIFT; | 885 | (u16)data); |
834 | if (!cnf_size) | 886 | if (ret_val) |
835 | goto out; | 887 | goto out; |
888 | } | ||
836 | 889 | ||
837 | cnf_base_addr = data & E1000_EXTCNF_CTRL_EXT_CNF_POINTER_MASK; | 890 | /* Configure LCD from extended configuration region. */ |
838 | cnf_base_addr >>= E1000_EXTCNF_CTRL_EXT_CNF_POINTER_SHIFT; | ||
839 | |||
840 | if (!(data & E1000_EXTCNF_CTRL_OEM_WRITE_ENABLE) && | ||
841 | (hw->mac.type == e1000_pchlan)) { | ||
842 | /* | ||
843 | * HW configures the SMBus address and LEDs when the | ||
844 | * OEM and LCD Write Enable bits are set in the NVM. | ||
845 | * When both NVM bits are cleared, SW will configure | ||
846 | * them instead. | ||
847 | */ | ||
848 | data = er32(STRAP); | ||
849 | data &= E1000_STRAP_SMBUS_ADDRESS_MASK; | ||
850 | reg_data = data >> E1000_STRAP_SMBUS_ADDRESS_SHIFT; | ||
851 | reg_data |= HV_SMB_ADDR_PEC_EN | HV_SMB_ADDR_VALID; | ||
852 | ret_val = e1000_write_phy_reg_hv_locked(hw, HV_SMB_ADDR, | ||
853 | reg_data); | ||
854 | if (ret_val) | ||
855 | goto out; | ||
856 | |||
857 | data = er32(LEDCTL); | ||
858 | ret_val = e1000_write_phy_reg_hv_locked(hw, | ||
859 | HV_LED_CONFIG, | ||
860 | (u16)data); | ||
861 | if (ret_val) | ||
862 | goto out; | ||
863 | } | ||
864 | /* Configure LCD from extended configuration region. */ | ||
865 | 891 | ||
866 | /* cnf_base_addr is in DWORD */ | 892 | /* cnf_base_addr is in DWORD */ |
867 | word_addr = (u16)(cnf_base_addr << 1); | 893 | word_addr = (u16)(cnf_base_addr << 1); |
868 | 894 | ||
869 | for (i = 0; i < cnf_size; i++) { | 895 | for (i = 0; i < cnf_size; i++) { |
870 | ret_val = e1000_read_nvm(hw, (word_addr + i * 2), 1, | 896 | ret_val = e1000_read_nvm(hw, (word_addr + i * 2), 1, |
871 | ®_data); | 897 | ®_data); |
872 | if (ret_val) | 898 | if (ret_val) |
873 | goto out; | 899 | goto out; |
874 | 900 | ||
875 | ret_val = e1000_read_nvm(hw, (word_addr + i * 2 + 1), | 901 | ret_val = e1000_read_nvm(hw, (word_addr + i * 2 + 1), |
876 | 1, ®_addr); | 902 | 1, ®_addr); |
877 | if (ret_val) | 903 | if (ret_val) |
878 | goto out; | 904 | goto out; |
879 | 905 | ||
880 | /* Save off the PHY page for future writes. */ | 906 | /* Save off the PHY page for future writes. */ |
881 | if (reg_addr == IGP01E1000_PHY_PAGE_SELECT) { | 907 | if (reg_addr == IGP01E1000_PHY_PAGE_SELECT) { |
882 | phy_page = reg_data; | 908 | phy_page = reg_data; |
883 | continue; | 909 | continue; |
884 | } | 910 | } |
885 | 911 | ||
886 | reg_addr &= PHY_REG_MASK; | 912 | reg_addr &= PHY_REG_MASK; |
887 | reg_addr |= phy_page; | 913 | reg_addr |= phy_page; |
888 | 914 | ||
889 | ret_val = phy->ops.write_reg_locked(hw, | 915 | ret_val = phy->ops.write_reg_locked(hw, (u32)reg_addr, |
890 | (u32)reg_addr, | 916 | reg_data); |
891 | reg_data); | 917 | if (ret_val) |
892 | if (ret_val) | 918 | goto out; |
893 | goto out; | ||
894 | } | ||
895 | } | 919 | } |
896 | 920 | ||
897 | out: | 921 | out: |
@@ -1229,30 +1253,26 @@ static void e1000_lan_init_done_ich8lan(struct e1000_hw *hw) | |||
1229 | } | 1253 | } |
1230 | 1254 | ||
1231 | /** | 1255 | /** |
1232 | * e1000_phy_hw_reset_ich8lan - Performs a PHY reset | 1256 | * e1000_post_phy_reset_ich8lan - Perform steps required after a PHY reset |
1233 | * @hw: pointer to the HW structure | 1257 | * @hw: pointer to the HW structure |
1234 | * | ||
1235 | * Resets the PHY | ||
1236 | * This is a function pointer entry point called by drivers | ||
1237 | * or other shared routines. | ||
1238 | **/ | 1258 | **/ |
1239 | static s32 e1000_phy_hw_reset_ich8lan(struct e1000_hw *hw) | 1259 | static s32 e1000_post_phy_reset_ich8lan(struct e1000_hw *hw) |
1240 | { | 1260 | { |
1241 | s32 ret_val = 0; | 1261 | s32 ret_val = 0; |
1242 | u16 reg; | 1262 | u16 reg; |
1243 | 1263 | ||
1244 | ret_val = e1000e_phy_hw_reset_generic(hw); | 1264 | if (e1000_check_reset_block(hw)) |
1245 | if (ret_val) | 1265 | goto out; |
1246 | return ret_val; | ||
1247 | |||
1248 | /* Allow time for h/w to get to a quiescent state after reset */ | ||
1249 | mdelay(10); | ||
1250 | 1266 | ||
1251 | /* Perform any necessary post-reset workarounds */ | 1267 | /* Perform any necessary post-reset workarounds */ |
1252 | if (hw->mac.type == e1000_pchlan) { | 1268 | switch (hw->mac.type) { |
1269 | case e1000_pchlan: | ||
1253 | ret_val = e1000_hv_phy_workarounds_ich8lan(hw); | 1270 | ret_val = e1000_hv_phy_workarounds_ich8lan(hw); |
1254 | if (ret_val) | 1271 | if (ret_val) |
1255 | return ret_val; | 1272 | goto out; |
1273 | break; | ||
1274 | default: | ||
1275 | break; | ||
1256 | } | 1276 | } |
1257 | 1277 | ||
1258 | /* Dummy read to clear the phy wakeup bit after lcd reset */ | 1278 | /* Dummy read to clear the phy wakeup bit after lcd reset */ |
@@ -1265,11 +1285,32 @@ static s32 e1000_phy_hw_reset_ich8lan(struct e1000_hw *hw) | |||
1265 | goto out; | 1285 | goto out; |
1266 | 1286 | ||
1267 | /* Configure the LCD with the OEM bits in NVM */ | 1287 | /* Configure the LCD with the OEM bits in NVM */ |
1268 | if (hw->mac.type == e1000_pchlan) | 1288 | ret_val = e1000_oem_bits_config_ich8lan(hw, true); |
1269 | ret_val = e1000_oem_bits_config_ich8lan(hw, true); | ||
1270 | 1289 | ||
1271 | out: | 1290 | out: |
1272 | return 0; | 1291 | return ret_val; |
1292 | } | ||
1293 | |||
1294 | /** | ||
1295 | * e1000_phy_hw_reset_ich8lan - Performs a PHY reset | ||
1296 | * @hw: pointer to the HW structure | ||
1297 | * | ||
1298 | * Resets the PHY | ||
1299 | * This is a function pointer entry point called by drivers | ||
1300 | * or other shared routines. | ||
1301 | **/ | ||
1302 | static s32 e1000_phy_hw_reset_ich8lan(struct e1000_hw *hw) | ||
1303 | { | ||
1304 | s32 ret_val = 0; | ||
1305 | |||
1306 | ret_val = e1000e_phy_hw_reset_generic(hw); | ||
1307 | if (ret_val) | ||
1308 | goto out; | ||
1309 | |||
1310 | ret_val = e1000_post_phy_reset_ich8lan(hw); | ||
1311 | |||
1312 | out: | ||
1313 | return ret_val; | ||
1273 | } | 1314 | } |
1274 | 1315 | ||
1275 | /** | 1316 | /** |
@@ -1622,7 +1663,7 @@ static s32 e1000_flash_cycle_init_ich8lan(struct e1000_hw *hw) | |||
1622 | /* Check if the flash descriptor is valid */ | 1663 | /* Check if the flash descriptor is valid */ |
1623 | if (hsfsts.hsf_status.fldesvalid == 0) { | 1664 | if (hsfsts.hsf_status.fldesvalid == 0) { |
1624 | e_dbg("Flash descriptor invalid. " | 1665 | e_dbg("Flash descriptor invalid. " |
1625 | "SW Sequencing must be used."); | 1666 | "SW Sequencing must be used.\n"); |
1626 | return -E1000_ERR_NVM; | 1667 | return -E1000_ERR_NVM; |
1627 | } | 1668 | } |
1628 | 1669 | ||
@@ -1671,7 +1712,7 @@ static s32 e1000_flash_cycle_init_ich8lan(struct e1000_hw *hw) | |||
1671 | hsfsts.hsf_status.flcdone = 1; | 1712 | hsfsts.hsf_status.flcdone = 1; |
1672 | ew16flash(ICH_FLASH_HSFSTS, hsfsts.regval); | 1713 | ew16flash(ICH_FLASH_HSFSTS, hsfsts.regval); |
1673 | } else { | 1714 | } else { |
1674 | e_dbg("Flash controller busy, cannot get access"); | 1715 | e_dbg("Flash controller busy, cannot get access\n"); |
1675 | } | 1716 | } |
1676 | } | 1717 | } |
1677 | 1718 | ||
@@ -1822,7 +1863,7 @@ static s32 e1000_read_flash_data_ich8lan(struct e1000_hw *hw, u32 offset, | |||
1822 | continue; | 1863 | continue; |
1823 | } else if (hsfsts.hsf_status.flcdone == 0) { | 1864 | } else if (hsfsts.hsf_status.flcdone == 0) { |
1824 | e_dbg("Timeout error - flash cycle " | 1865 | e_dbg("Timeout error - flash cycle " |
1825 | "did not complete."); | 1866 | "did not complete.\n"); |
1826 | break; | 1867 | break; |
1827 | } | 1868 | } |
1828 | } | 1869 | } |
@@ -1908,18 +1949,14 @@ static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw) | |||
1908 | new_bank_offset = nvm->flash_bank_size; | 1949 | new_bank_offset = nvm->flash_bank_size; |
1909 | old_bank_offset = 0; | 1950 | old_bank_offset = 0; |
1910 | ret_val = e1000_erase_flash_bank_ich8lan(hw, 1); | 1951 | ret_val = e1000_erase_flash_bank_ich8lan(hw, 1); |
1911 | if (ret_val) { | 1952 | if (ret_val) |
1912 | nvm->ops.release(hw); | 1953 | goto release; |
1913 | goto out; | ||
1914 | } | ||
1915 | } else { | 1954 | } else { |
1916 | old_bank_offset = nvm->flash_bank_size; | 1955 | old_bank_offset = nvm->flash_bank_size; |
1917 | new_bank_offset = 0; | 1956 | new_bank_offset = 0; |
1918 | ret_val = e1000_erase_flash_bank_ich8lan(hw, 0); | 1957 | ret_val = e1000_erase_flash_bank_ich8lan(hw, 0); |
1919 | if (ret_val) { | 1958 | if (ret_val) |
1920 | nvm->ops.release(hw); | 1959 | goto release; |
1921 | goto out; | ||
1922 | } | ||
1923 | } | 1960 | } |
1924 | 1961 | ||
1925 | for (i = 0; i < E1000_ICH8_SHADOW_RAM_WORDS; i++) { | 1962 | for (i = 0; i < E1000_ICH8_SHADOW_RAM_WORDS; i++) { |
@@ -1975,8 +2012,7 @@ static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw) | |||
1975 | if (ret_val) { | 2012 | if (ret_val) { |
1976 | /* Possibly read-only, see e1000e_write_protect_nvm_ich8lan() */ | 2013 | /* Possibly read-only, see e1000e_write_protect_nvm_ich8lan() */ |
1977 | e_dbg("Flash commit failed.\n"); | 2014 | e_dbg("Flash commit failed.\n"); |
1978 | nvm->ops.release(hw); | 2015 | goto release; |
1979 | goto out; | ||
1980 | } | 2016 | } |
1981 | 2017 | ||
1982 | /* | 2018 | /* |
@@ -1987,18 +2023,15 @@ static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw) | |||
1987 | */ | 2023 | */ |
1988 | act_offset = new_bank_offset + E1000_ICH_NVM_SIG_WORD; | 2024 | act_offset = new_bank_offset + E1000_ICH_NVM_SIG_WORD; |
1989 | ret_val = e1000_read_flash_word_ich8lan(hw, act_offset, &data); | 2025 | ret_val = e1000_read_flash_word_ich8lan(hw, act_offset, &data); |
1990 | if (ret_val) { | 2026 | if (ret_val) |
1991 | nvm->ops.release(hw); | 2027 | goto release; |
1992 | goto out; | 2028 | |
1993 | } | ||
1994 | data &= 0xBFFF; | 2029 | data &= 0xBFFF; |
1995 | ret_val = e1000_retry_write_flash_byte_ich8lan(hw, | 2030 | ret_val = e1000_retry_write_flash_byte_ich8lan(hw, |
1996 | act_offset * 2 + 1, | 2031 | act_offset * 2 + 1, |
1997 | (u8)(data >> 8)); | 2032 | (u8)(data >> 8)); |
1998 | if (ret_val) { | 2033 | if (ret_val) |
1999 | nvm->ops.release(hw); | 2034 | goto release; |
2000 | goto out; | ||
2001 | } | ||
2002 | 2035 | ||
2003 | /* | 2036 | /* |
2004 | * And invalidate the previously valid segment by setting | 2037 | * And invalidate the previously valid segment by setting |
@@ -2008,10 +2041,8 @@ static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw) | |||
2008 | */ | 2041 | */ |
2009 | act_offset = (old_bank_offset + E1000_ICH_NVM_SIG_WORD) * 2 + 1; | 2042 | act_offset = (old_bank_offset + E1000_ICH_NVM_SIG_WORD) * 2 + 1; |
2010 | ret_val = e1000_retry_write_flash_byte_ich8lan(hw, act_offset, 0); | 2043 | ret_val = e1000_retry_write_flash_byte_ich8lan(hw, act_offset, 0); |
2011 | if (ret_val) { | 2044 | if (ret_val) |
2012 | nvm->ops.release(hw); | 2045 | goto release; |
2013 | goto out; | ||
2014 | } | ||
2015 | 2046 | ||
2016 | /* Great! Everything worked, we can now clear the cached entries. */ | 2047 | /* Great! Everything worked, we can now clear the cached entries. */ |
2017 | for (i = 0; i < E1000_ICH8_SHADOW_RAM_WORDS; i++) { | 2048 | for (i = 0; i < E1000_ICH8_SHADOW_RAM_WORDS; i++) { |
@@ -2019,14 +2050,17 @@ static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw) | |||
2019 | dev_spec->shadow_ram[i].value = 0xFFFF; | 2050 | dev_spec->shadow_ram[i].value = 0xFFFF; |
2020 | } | 2051 | } |
2021 | 2052 | ||
2053 | release: | ||
2022 | nvm->ops.release(hw); | 2054 | nvm->ops.release(hw); |
2023 | 2055 | ||
2024 | /* | 2056 | /* |
2025 | * Reload the EEPROM, or else modifications will not appear | 2057 | * Reload the EEPROM, or else modifications will not appear |
2026 | * until after the next adapter reset. | 2058 | * until after the next adapter reset. |
2027 | */ | 2059 | */ |
2028 | e1000e_reload_nvm(hw); | 2060 | if (!ret_val) { |
2029 | msleep(10); | 2061 | e1000e_reload_nvm(hw); |
2062 | msleep(10); | ||
2063 | } | ||
2030 | 2064 | ||
2031 | out: | 2065 | out: |
2032 | if (ret_val) | 2066 | if (ret_val) |
@@ -2487,9 +2521,8 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw) | |||
2487 | * on the last TLP read/write transaction when MAC is reset. | 2521 | * on the last TLP read/write transaction when MAC is reset. |
2488 | */ | 2522 | */ |
2489 | ret_val = e1000e_disable_pcie_master(hw); | 2523 | ret_val = e1000e_disable_pcie_master(hw); |
2490 | if (ret_val) { | 2524 | if (ret_val) |
2491 | e_dbg("PCI-E Master disable polling has failed.\n"); | 2525 | e_dbg("PCI-E Master disable polling has failed.\n"); |
2492 | } | ||
2493 | 2526 | ||
2494 | e_dbg("Masking off all interrupts\n"); | 2527 | e_dbg("Masking off all interrupts\n"); |
2495 | ew32(IMC, 0xffffffff); | 2528 | ew32(IMC, 0xffffffff); |
@@ -2528,14 +2561,8 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw) | |||
2528 | ctrl = er32(CTRL); | 2561 | ctrl = er32(CTRL); |
2529 | 2562 | ||
2530 | if (!e1000_check_reset_block(hw)) { | 2563 | if (!e1000_check_reset_block(hw)) { |
2531 | /* Clear PHY Reset Asserted bit */ | ||
2532 | if (hw->mac.type >= e1000_pchlan) { | ||
2533 | u32 status = er32(STATUS); | ||
2534 | ew32(STATUS, status & ~E1000_STATUS_PHYRA); | ||
2535 | } | ||
2536 | |||
2537 | /* | 2564 | /* |
2538 | * PHY HW reset requires MAC CORE reset at the same | 2565 | * Full-chip reset requires MAC and PHY reset at the same |
2539 | * time to make sure the interface between MAC and the | 2566 | * time to make sure the interface between MAC and the |
2540 | * external PHY is reset. | 2567 | * external PHY is reset. |
2541 | */ | 2568 | */ |
@@ -2549,39 +2576,16 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw) | |||
2549 | if (!ret_val) | 2576 | if (!ret_val) |
2550 | e1000_release_swflag_ich8lan(hw); | 2577 | e1000_release_swflag_ich8lan(hw); |
2551 | 2578 | ||
2552 | /* Perform any necessary post-reset workarounds */ | 2579 | if (ctrl & E1000_CTRL_PHY_RST) { |
2553 | if (hw->mac.type == e1000_pchlan) | ||
2554 | ret_val = e1000_hv_phy_workarounds_ich8lan(hw); | ||
2555 | |||
2556 | if (ctrl & E1000_CTRL_PHY_RST) | ||
2557 | ret_val = hw->phy.ops.get_cfg_done(hw); | 2580 | ret_val = hw->phy.ops.get_cfg_done(hw); |
2581 | if (ret_val) | ||
2582 | goto out; | ||
2558 | 2583 | ||
2559 | if (hw->mac.type >= e1000_ich10lan) { | 2584 | ret_val = e1000_post_phy_reset_ich8lan(hw); |
2560 | e1000_lan_init_done_ich8lan(hw); | ||
2561 | } else { | ||
2562 | ret_val = e1000e_get_auto_rd_done(hw); | ||
2563 | if (ret_val) { | ||
2564 | /* | ||
2565 | * When auto config read does not complete, do not | ||
2566 | * return with an error. This can happen in situations | ||
2567 | * where there is no eeprom and prevents getting link. | ||
2568 | */ | ||
2569 | e_dbg("Auto Read Done did not complete\n"); | ||
2570 | } | ||
2571 | } | ||
2572 | /* Dummy read to clear the phy wakeup bit after lcd reset */ | ||
2573 | if (hw->mac.type == e1000_pchlan) | ||
2574 | e1e_rphy(hw, BM_WUC, ®); | ||
2575 | |||
2576 | ret_val = e1000_sw_lcd_config_ich8lan(hw); | ||
2577 | if (ret_val) | ||
2578 | goto out; | ||
2579 | |||
2580 | if (hw->mac.type == e1000_pchlan) { | ||
2581 | ret_val = e1000_oem_bits_config_ich8lan(hw, true); | ||
2582 | if (ret_val) | 2585 | if (ret_val) |
2583 | goto out; | 2586 | goto out; |
2584 | } | 2587 | } |
2588 | |||
2585 | /* | 2589 | /* |
2586 | * For PCH, this write will make sure that any noise | 2590 | * For PCH, this write will make sure that any noise |
2587 | * will be detected as a CRC error and be dropped rather than show up | 2591 | * will be detected as a CRC error and be dropped rather than show up |
@@ -2748,8 +2752,6 @@ static void e1000_initialize_hw_bits_ich8lan(struct e1000_hw *hw) | |||
2748 | reg = er32(RFCTL); | 2752 | reg = er32(RFCTL); |
2749 | reg |= (E1000_RFCTL_NFSW_DIS | E1000_RFCTL_NFSR_DIS); | 2753 | reg |= (E1000_RFCTL_NFSW_DIS | E1000_RFCTL_NFSR_DIS); |
2750 | ew32(RFCTL, reg); | 2754 | ew32(RFCTL, reg); |
2751 | |||
2752 | return; | ||
2753 | } | 2755 | } |
2754 | 2756 | ||
2755 | /** | 2757 | /** |
@@ -2799,6 +2801,8 @@ static s32 e1000_setup_link_ich8lan(struct e1000_hw *hw) | |||
2799 | ew32(FCTTV, hw->fc.pause_time); | 2801 | ew32(FCTTV, hw->fc.pause_time); |
2800 | if ((hw->phy.type == e1000_phy_82578) || | 2802 | if ((hw->phy.type == e1000_phy_82578) || |
2801 | (hw->phy.type == e1000_phy_82577)) { | 2803 | (hw->phy.type == e1000_phy_82577)) { |
2804 | ew32(FCRTV_PCH, hw->fc.refresh_time); | ||
2805 | |||
2802 | ret_val = hw->phy.ops.write_reg(hw, | 2806 | ret_val = hw->phy.ops.write_reg(hw, |
2803 | PHY_REG(BM_PORT_CTRL_PAGE, 27), | 2807 | PHY_REG(BM_PORT_CTRL_PAGE, 27), |
2804 | hw->fc.pause_time); | 2808 | hw->fc.pause_time); |
@@ -3127,8 +3131,6 @@ void e1000e_disable_gig_wol_ich8lan(struct e1000_hw *hw) | |||
3127 | default: | 3131 | default: |
3128 | break; | 3132 | break; |
3129 | } | 3133 | } |
3130 | |||
3131 | return; | ||
3132 | } | 3134 | } |
3133 | 3135 | ||
3134 | /** | 3136 | /** |
@@ -3265,33 +3267,50 @@ static s32 e1000_led_off_pchlan(struct e1000_hw *hw) | |||
3265 | } | 3267 | } |
3266 | 3268 | ||
3267 | /** | 3269 | /** |
3268 | * e1000_get_cfg_done_ich8lan - Read config done bit | 3270 | * e1000_get_cfg_done_ich8lan - Read config done bit after Full or PHY reset |
3269 | * @hw: pointer to the HW structure | 3271 | * @hw: pointer to the HW structure |
3270 | * | 3272 | * |
3271 | * Read the management control register for the config done bit for | 3273 | * Read appropriate register for the config done bit for completion status |
3272 | * completion status. NOTE: silicon which is EEPROM-less will fail trying | 3274 | * and configure the PHY through s/w for EEPROM-less parts. |
3273 | * to read the config done bit, so an error is *ONLY* logged and returns | 3275 | * |
3274 | * 0. If we were to return with error, EEPROM-less silicon | 3276 | * NOTE: some silicon which is EEPROM-less will fail trying to read the |
3275 | * would not be able to be reset or change link. | 3277 | * config done bit, so only an error is logged and continues. If we were |
3278 | * to return with error, EEPROM-less silicon would not be able to be reset | ||
3279 | * or change link. | ||
3276 | **/ | 3280 | **/ |
3277 | static s32 e1000_get_cfg_done_ich8lan(struct e1000_hw *hw) | 3281 | static s32 e1000_get_cfg_done_ich8lan(struct e1000_hw *hw) |
3278 | { | 3282 | { |
3283 | s32 ret_val = 0; | ||
3279 | u32 bank = 0; | 3284 | u32 bank = 0; |
3285 | u32 status; | ||
3280 | 3286 | ||
3281 | if (hw->mac.type >= e1000_pchlan) { | 3287 | e1000e_get_cfg_done(hw); |
3282 | u32 status = er32(STATUS); | ||
3283 | 3288 | ||
3284 | if (status & E1000_STATUS_PHYRA) | 3289 | /* Wait for indication from h/w that it has completed basic config */ |
3285 | ew32(STATUS, status & ~E1000_STATUS_PHYRA); | 3290 | if (hw->mac.type >= e1000_ich10lan) { |
3286 | else | 3291 | e1000_lan_init_done_ich8lan(hw); |
3287 | e_dbg("PHY Reset Asserted not set - needs delay\n"); | 3292 | } else { |
3293 | ret_val = e1000e_get_auto_rd_done(hw); | ||
3294 | if (ret_val) { | ||
3295 | /* | ||
3296 | * When auto config read does not complete, do not | ||
3297 | * return with an error. This can happen in situations | ||
3298 | * where there is no eeprom and prevents getting link. | ||
3299 | */ | ||
3300 | e_dbg("Auto Read Done did not complete\n"); | ||
3301 | ret_val = 0; | ||
3302 | } | ||
3288 | } | 3303 | } |
3289 | 3304 | ||
3290 | e1000e_get_cfg_done(hw); | 3305 | /* Clear PHY Reset Asserted bit */ |
3306 | status = er32(STATUS); | ||
3307 | if (status & E1000_STATUS_PHYRA) | ||
3308 | ew32(STATUS, status & ~E1000_STATUS_PHYRA); | ||
3309 | else | ||
3310 | e_dbg("PHY Reset Asserted not set - needs delay\n"); | ||
3291 | 3311 | ||
3292 | /* If EEPROM is not marked present, init the IGP 3 PHY manually */ | 3312 | /* If EEPROM is not marked present, init the IGP 3 PHY manually */ |
3293 | if ((hw->mac.type != e1000_ich10lan) && | 3313 | if (hw->mac.type <= e1000_ich9lan) { |
3294 | (hw->mac.type != e1000_pchlan)) { | ||
3295 | if (((er32(EECD) & E1000_EECD_PRES) == 0) && | 3314 | if (((er32(EECD) & E1000_EECD_PRES) == 0) && |
3296 | (hw->phy.type == e1000_phy_igp_3)) { | 3315 | (hw->phy.type == e1000_phy_igp_3)) { |
3297 | e1000e_phy_init_script_igp3(hw); | 3316 | e1000e_phy_init_script_igp3(hw); |
@@ -3300,11 +3319,11 @@ static s32 e1000_get_cfg_done_ich8lan(struct e1000_hw *hw) | |||
3300 | if (e1000_valid_nvm_bank_detect_ich8lan(hw, &bank)) { | 3319 | if (e1000_valid_nvm_bank_detect_ich8lan(hw, &bank)) { |
3301 | /* Maybe we should do a basic PHY config */ | 3320 | /* Maybe we should do a basic PHY config */ |
3302 | e_dbg("EEPROM not present\n"); | 3321 | e_dbg("EEPROM not present\n"); |
3303 | return -E1000_ERR_CONFIG; | 3322 | ret_val = -E1000_ERR_CONFIG; |
3304 | } | 3323 | } |
3305 | } | 3324 | } |
3306 | 3325 | ||
3307 | return 0; | 3326 | return ret_val; |
3308 | } | 3327 | } |
3309 | 3328 | ||
3310 | /** | 3329 | /** |
@@ -3320,8 +3339,6 @@ static void e1000_power_down_phy_copper_ich8lan(struct e1000_hw *hw) | |||
3320 | if (!(hw->mac.ops.check_mng_mode(hw) || | 3339 | if (!(hw->mac.ops.check_mng_mode(hw) || |
3321 | hw->phy.ops.check_reset_block(hw))) | 3340 | hw->phy.ops.check_reset_block(hw))) |
3322 | e1000_power_down_phy_copper(hw); | 3341 | e1000_power_down_phy_copper(hw); |
3323 | |||
3324 | return; | ||
3325 | } | 3342 | } |
3326 | 3343 | ||
3327 | /** | 3344 | /** |
diff --git a/drivers/net/e1000e/lib.c b/drivers/net/e1000e/lib.c index a8b2c0de27c4..a968e3a416ac 100644 --- a/drivers/net/e1000e/lib.c +++ b/drivers/net/e1000e/lib.c | |||
@@ -1262,24 +1262,21 @@ s32 e1000e_get_speed_and_duplex_copper(struct e1000_hw *hw, u16 *speed, u16 *dup | |||
1262 | u32 status; | 1262 | u32 status; |
1263 | 1263 | ||
1264 | status = er32(STATUS); | 1264 | status = er32(STATUS); |
1265 | if (status & E1000_STATUS_SPEED_1000) { | 1265 | if (status & E1000_STATUS_SPEED_1000) |
1266 | *speed = SPEED_1000; | 1266 | *speed = SPEED_1000; |
1267 | e_dbg("1000 Mbs, "); | 1267 | else if (status & E1000_STATUS_SPEED_100) |
1268 | } else if (status & E1000_STATUS_SPEED_100) { | ||
1269 | *speed = SPEED_100; | 1268 | *speed = SPEED_100; |
1270 | e_dbg("100 Mbs, "); | 1269 | else |
1271 | } else { | ||
1272 | *speed = SPEED_10; | 1270 | *speed = SPEED_10; |
1273 | e_dbg("10 Mbs, "); | ||
1274 | } | ||
1275 | 1271 | ||
1276 | if (status & E1000_STATUS_FD) { | 1272 | if (status & E1000_STATUS_FD) |
1277 | *duplex = FULL_DUPLEX; | 1273 | *duplex = FULL_DUPLEX; |
1278 | e_dbg("Full Duplex\n"); | 1274 | else |
1279 | } else { | ||
1280 | *duplex = HALF_DUPLEX; | 1275 | *duplex = HALF_DUPLEX; |
1281 | e_dbg("Half Duplex\n"); | 1276 | |
1282 | } | 1277 | e_dbg("%u Mbps, %s Duplex\n", |
1278 | *speed == SPEED_1000 ? 1000 : *speed == SPEED_100 ? 100 : 10, | ||
1279 | *duplex == FULL_DUPLEX ? "Full" : "Half"); | ||
1283 | 1280 | ||
1284 | return 0; | 1281 | return 0; |
1285 | } | 1282 | } |
@@ -2275,6 +2272,11 @@ static s32 e1000_mng_enable_host_if(struct e1000_hw *hw) | |||
2275 | u32 hicr; | 2272 | u32 hicr; |
2276 | u8 i; | 2273 | u8 i; |
2277 | 2274 | ||
2275 | if (!(hw->mac.arc_subsystem_valid)) { | ||
2276 | e_dbg("ARC subsystem not valid.\n"); | ||
2277 | return -E1000_ERR_HOST_INTERFACE_COMMAND; | ||
2278 | } | ||
2279 | |||
2278 | /* Check that the host interface is enabled. */ | 2280 | /* Check that the host interface is enabled. */ |
2279 | hicr = er32(HICR); | 2281 | hicr = er32(HICR); |
2280 | if ((hicr & E1000_HICR_EN) == 0) { | 2282 | if ((hicr & E1000_HICR_EN) == 0) { |
@@ -2518,10 +2520,11 @@ s32 e1000e_mng_write_dhcp_info(struct e1000_hw *hw, u8 *buffer, u16 length) | |||
2518 | } | 2520 | } |
2519 | 2521 | ||
2520 | /** | 2522 | /** |
2521 | * e1000e_enable_mng_pass_thru - Enable processing of ARP's | 2523 | * e1000e_enable_mng_pass_thru - Check if management passthrough is needed |
2522 | * @hw: pointer to the HW structure | 2524 | * @hw: pointer to the HW structure |
2523 | * | 2525 | * |
2524 | * Verifies the hardware needs to allow ARPs to be processed by the host. | 2526 | * Verifies the hardware needs to leave interface enabled so that frames can |
2527 | * be directed to and from the management interface. | ||
2525 | **/ | 2528 | **/ |
2526 | bool e1000e_enable_mng_pass_thru(struct e1000_hw *hw) | 2529 | bool e1000e_enable_mng_pass_thru(struct e1000_hw *hw) |
2527 | { | 2530 | { |
@@ -2531,11 +2534,10 @@ bool e1000e_enable_mng_pass_thru(struct e1000_hw *hw) | |||
2531 | 2534 | ||
2532 | manc = er32(MANC); | 2535 | manc = er32(MANC); |
2533 | 2536 | ||
2534 | if (!(manc & E1000_MANC_RCV_TCO_EN) || | 2537 | if (!(manc & E1000_MANC_RCV_TCO_EN)) |
2535 | !(manc & E1000_MANC_EN_MAC_ADDR_FILTER)) | 2538 | goto out; |
2536 | return ret_val; | ||
2537 | 2539 | ||
2538 | if (hw->mac.arc_subsystem_valid) { | 2540 | if (hw->mac.has_fwsm) { |
2539 | fwsm = er32(FWSM); | 2541 | fwsm = er32(FWSM); |
2540 | factps = er32(FACTPS); | 2542 | factps = er32(FACTPS); |
2541 | 2543 | ||
@@ -2543,16 +2545,28 @@ bool e1000e_enable_mng_pass_thru(struct e1000_hw *hw) | |||
2543 | ((fwsm & E1000_FWSM_MODE_MASK) == | 2545 | ((fwsm & E1000_FWSM_MODE_MASK) == |
2544 | (e1000_mng_mode_pt << E1000_FWSM_MODE_SHIFT))) { | 2546 | (e1000_mng_mode_pt << E1000_FWSM_MODE_SHIFT))) { |
2545 | ret_val = true; | 2547 | ret_val = true; |
2546 | return ret_val; | 2548 | goto out; |
2547 | } | 2549 | } |
2548 | } else { | 2550 | } else if ((hw->mac.type == e1000_82574) || |
2549 | if ((manc & E1000_MANC_SMBUS_EN) && | 2551 | (hw->mac.type == e1000_82583)) { |
2550 | !(manc & E1000_MANC_ASF_EN)) { | 2552 | u16 data; |
2553 | |||
2554 | factps = er32(FACTPS); | ||
2555 | e1000_read_nvm(hw, NVM_INIT_CONTROL2_REG, 1, &data); | ||
2556 | |||
2557 | if (!(factps & E1000_FACTPS_MNGCG) && | ||
2558 | ((data & E1000_NVM_INIT_CTRL2_MNGM) == | ||
2559 | (e1000_mng_mode_pt << 13))) { | ||
2551 | ret_val = true; | 2560 | ret_val = true; |
2552 | return ret_val; | 2561 | goto out; |
2553 | } | 2562 | } |
2563 | } else if ((manc & E1000_MANC_SMBUS_EN) && | ||
2564 | !(manc & E1000_MANC_ASF_EN)) { | ||
2565 | ret_val = true; | ||
2566 | goto out; | ||
2554 | } | 2567 | } |
2555 | 2568 | ||
2569 | out: | ||
2556 | return ret_val; | 2570 | return ret_val; |
2557 | } | 2571 | } |
2558 | 2572 | ||
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c index 73d43c53015a..24507f3b8b17 100644 --- a/drivers/net/e1000e/netdev.c +++ b/drivers/net/e1000e/netdev.c | |||
@@ -26,6 +26,8 @@ | |||
26 | 26 | ||
27 | *******************************************************************************/ | 27 | *******************************************************************************/ |
28 | 28 | ||
29 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
30 | |||
29 | #include <linux/module.h> | 31 | #include <linux/module.h> |
30 | #include <linux/types.h> | 32 | #include <linux/types.h> |
31 | #include <linux/init.h> | 33 | #include <linux/init.h> |
@@ -45,11 +47,12 @@ | |||
45 | #include <linux/cpu.h> | 47 | #include <linux/cpu.h> |
46 | #include <linux/smp.h> | 48 | #include <linux/smp.h> |
47 | #include <linux/pm_qos_params.h> | 49 | #include <linux/pm_qos_params.h> |
50 | #include <linux/pm_runtime.h> | ||
48 | #include <linux/aer.h> | 51 | #include <linux/aer.h> |
49 | 52 | ||
50 | #include "e1000.h" | 53 | #include "e1000.h" |
51 | 54 | ||
52 | #define DRV_VERSION "1.0.2-k2" | 55 | #define DRV_VERSION "1.0.2-k4" |
53 | char e1000e_driver_name[] = "e1000e"; | 56 | char e1000e_driver_name[] = "e1000e"; |
54 | const char e1000e_driver_version[] = DRV_VERSION; | 57 | const char e1000e_driver_version[] = DRV_VERSION; |
55 | 58 | ||
@@ -66,6 +69,361 @@ static const struct e1000_info *e1000_info_tbl[] = { | |||
66 | [board_pchlan] = &e1000_pch_info, | 69 | [board_pchlan] = &e1000_pch_info, |
67 | }; | 70 | }; |
68 | 71 | ||
72 | struct e1000_reg_info { | ||
73 | u32 ofs; | ||
74 | char *name; | ||
75 | }; | ||
76 | |||
77 | #define E1000_RDFH 0x02410 /* Rx Data FIFO Head - RW */ | ||
78 | #define E1000_RDFT 0x02418 /* Rx Data FIFO Tail - RW */ | ||
79 | #define E1000_RDFHS 0x02420 /* Rx Data FIFO Head Saved - RW */ | ||
80 | #define E1000_RDFTS 0x02428 /* Rx Data FIFO Tail Saved - RW */ | ||
81 | #define E1000_RDFPC 0x02430 /* Rx Data FIFO Packet Count - RW */ | ||
82 | |||
83 | #define E1000_TDFH 0x03410 /* Tx Data FIFO Head - RW */ | ||
84 | #define E1000_TDFT 0x03418 /* Tx Data FIFO Tail - RW */ | ||
85 | #define E1000_TDFHS 0x03420 /* Tx Data FIFO Head Saved - RW */ | ||
86 | #define E1000_TDFTS 0x03428 /* Tx Data FIFO Tail Saved - RW */ | ||
87 | #define E1000_TDFPC 0x03430 /* Tx Data FIFO Packet Count - RW */ | ||
88 | |||
89 | static const struct e1000_reg_info e1000_reg_info_tbl[] = { | ||
90 | |||
91 | /* General Registers */ | ||
92 | {E1000_CTRL, "CTRL"}, | ||
93 | {E1000_STATUS, "STATUS"}, | ||
94 | {E1000_CTRL_EXT, "CTRL_EXT"}, | ||
95 | |||
96 | /* Interrupt Registers */ | ||
97 | {E1000_ICR, "ICR"}, | ||
98 | |||
99 | /* RX Registers */ | ||
100 | {E1000_RCTL, "RCTL"}, | ||
101 | {E1000_RDLEN, "RDLEN"}, | ||
102 | {E1000_RDH, "RDH"}, | ||
103 | {E1000_RDT, "RDT"}, | ||
104 | {E1000_RDTR, "RDTR"}, | ||
105 | {E1000_RXDCTL(0), "RXDCTL"}, | ||
106 | {E1000_ERT, "ERT"}, | ||
107 | {E1000_RDBAL, "RDBAL"}, | ||
108 | {E1000_RDBAH, "RDBAH"}, | ||
109 | {E1000_RDFH, "RDFH"}, | ||
110 | {E1000_RDFT, "RDFT"}, | ||
111 | {E1000_RDFHS, "RDFHS"}, | ||
112 | {E1000_RDFTS, "RDFTS"}, | ||
113 | {E1000_RDFPC, "RDFPC"}, | ||
114 | |||
115 | /* TX Registers */ | ||
116 | {E1000_TCTL, "TCTL"}, | ||
117 | {E1000_TDBAL, "TDBAL"}, | ||
118 | {E1000_TDBAH, "TDBAH"}, | ||
119 | {E1000_TDLEN, "TDLEN"}, | ||
120 | {E1000_TDH, "TDH"}, | ||
121 | {E1000_TDT, "TDT"}, | ||
122 | {E1000_TIDV, "TIDV"}, | ||
123 | {E1000_TXDCTL(0), "TXDCTL"}, | ||
124 | {E1000_TADV, "TADV"}, | ||
125 | {E1000_TARC(0), "TARC"}, | ||
126 | {E1000_TDFH, "TDFH"}, | ||
127 | {E1000_TDFT, "TDFT"}, | ||
128 | {E1000_TDFHS, "TDFHS"}, | ||
129 | {E1000_TDFTS, "TDFTS"}, | ||
130 | {E1000_TDFPC, "TDFPC"}, | ||
131 | |||
132 | /* List Terminator */ | ||
133 | {} | ||
134 | }; | ||
135 | |||
136 | /* | ||
137 | * e1000_regdump - register printout routine | ||
138 | */ | ||
139 | static void e1000_regdump(struct e1000_hw *hw, struct e1000_reg_info *reginfo) | ||
140 | { | ||
141 | int n = 0; | ||
142 | char rname[16]; | ||
143 | u32 regs[8]; | ||
144 | |||
145 | switch (reginfo->ofs) { | ||
146 | case E1000_RXDCTL(0): | ||
147 | for (n = 0; n < 2; n++) | ||
148 | regs[n] = __er32(hw, E1000_RXDCTL(n)); | ||
149 | break; | ||
150 | case E1000_TXDCTL(0): | ||
151 | for (n = 0; n < 2; n++) | ||
152 | regs[n] = __er32(hw, E1000_TXDCTL(n)); | ||
153 | break; | ||
154 | case E1000_TARC(0): | ||
155 | for (n = 0; n < 2; n++) | ||
156 | regs[n] = __er32(hw, E1000_TARC(n)); | ||
157 | break; | ||
158 | default: | ||
159 | printk(KERN_INFO "%-15s %08x\n", | ||
160 | reginfo->name, __er32(hw, reginfo->ofs)); | ||
161 | return; | ||
162 | } | ||
163 | |||
164 | snprintf(rname, 16, "%s%s", reginfo->name, "[0-1]"); | ||
165 | printk(KERN_INFO "%-15s ", rname); | ||
166 | for (n = 0; n < 2; n++) | ||
167 | printk(KERN_CONT "%08x ", regs[n]); | ||
168 | printk(KERN_CONT "\n"); | ||
169 | } | ||
170 | |||
171 | |||
172 | /* | ||
173 | * e1000e_dump - Print registers, tx-ring and rx-ring | ||
174 | */ | ||
175 | static void e1000e_dump(struct e1000_adapter *adapter) | ||
176 | { | ||
177 | struct net_device *netdev = adapter->netdev; | ||
178 | struct e1000_hw *hw = &adapter->hw; | ||
179 | struct e1000_reg_info *reginfo; | ||
180 | struct e1000_ring *tx_ring = adapter->tx_ring; | ||
181 | struct e1000_tx_desc *tx_desc; | ||
182 | struct my_u0 { u64 a; u64 b; } *u0; | ||
183 | struct e1000_buffer *buffer_info; | ||
184 | struct e1000_ring *rx_ring = adapter->rx_ring; | ||
185 | union e1000_rx_desc_packet_split *rx_desc_ps; | ||
186 | struct e1000_rx_desc *rx_desc; | ||
187 | struct my_u1 { u64 a; u64 b; u64 c; u64 d; } *u1; | ||
188 | u32 staterr; | ||
189 | int i = 0; | ||
190 | |||
191 | if (!netif_msg_hw(adapter)) | ||
192 | return; | ||
193 | |||
194 | /* Print netdevice Info */ | ||
195 | if (netdev) { | ||
196 | dev_info(&adapter->pdev->dev, "Net device Info\n"); | ||
197 | printk(KERN_INFO "Device Name state " | ||
198 | "trans_start last_rx\n"); | ||
199 | printk(KERN_INFO "%-15s %016lX %016lX %016lX\n", | ||
200 | netdev->name, | ||
201 | netdev->state, | ||
202 | netdev->trans_start, | ||
203 | netdev->last_rx); | ||
204 | } | ||
205 | |||
206 | /* Print Registers */ | ||
207 | dev_info(&adapter->pdev->dev, "Register Dump\n"); | ||
208 | printk(KERN_INFO " Register Name Value\n"); | ||
209 | for (reginfo = (struct e1000_reg_info *)e1000_reg_info_tbl; | ||
210 | reginfo->name; reginfo++) { | ||
211 | e1000_regdump(hw, reginfo); | ||
212 | } | ||
213 | |||
214 | /* Print TX Ring Summary */ | ||
215 | if (!netdev || !netif_running(netdev)) | ||
216 | goto exit; | ||
217 | |||
218 | dev_info(&adapter->pdev->dev, "TX Rings Summary\n"); | ||
219 | printk(KERN_INFO "Queue [NTU] [NTC] [bi(ntc)->dma ]" | ||
220 | " leng ntw timestamp\n"); | ||
221 | buffer_info = &tx_ring->buffer_info[tx_ring->next_to_clean]; | ||
222 | printk(KERN_INFO " %5d %5X %5X %016llX %04X %3X %016llX\n", | ||
223 | 0, tx_ring->next_to_use, tx_ring->next_to_clean, | ||
224 | (u64)buffer_info->dma, | ||
225 | buffer_info->length, | ||
226 | buffer_info->next_to_watch, | ||
227 | (u64)buffer_info->time_stamp); | ||
228 | |||
229 | /* Print TX Rings */ | ||
230 | if (!netif_msg_tx_done(adapter)) | ||
231 | goto rx_ring_summary; | ||
232 | |||
233 | dev_info(&adapter->pdev->dev, "TX Rings Dump\n"); | ||
234 | |||
235 | /* Transmit Descriptor Formats - DEXT[29] is 0 (Legacy) or 1 (Extended) | ||
236 | * | ||
237 | * Legacy Transmit Descriptor | ||
238 | * +--------------------------------------------------------------+ | ||
239 | * 0 | Buffer Address [63:0] (Reserved on Write Back) | | ||
240 | * +--------------------------------------------------------------+ | ||
241 | * 8 | Special | CSS | Status | CMD | CSO | Length | | ||
242 | * +--------------------------------------------------------------+ | ||
243 | * 63 48 47 36 35 32 31 24 23 16 15 0 | ||
244 | * | ||
245 | * Extended Context Descriptor (DTYP=0x0) for TSO or checksum offload | ||
246 | * 63 48 47 40 39 32 31 16 15 8 7 0 | ||
247 | * +----------------------------------------------------------------+ | ||
248 | * 0 | TUCSE | TUCS0 | TUCSS | IPCSE | IPCS0 | IPCSS | | ||
249 | * +----------------------------------------------------------------+ | ||
250 | * 8 | MSS | HDRLEN | RSV | STA | TUCMD | DTYP | PAYLEN | | ||
251 | * +----------------------------------------------------------------+ | ||
252 | * 63 48 47 40 39 36 35 32 31 24 23 20 19 0 | ||
253 | * | ||
254 | * Extended Data Descriptor (DTYP=0x1) | ||
255 | * +----------------------------------------------------------------+ | ||
256 | * 0 | Buffer Address [63:0] | | ||
257 | * +----------------------------------------------------------------+ | ||
258 | * 8 | VLAN tag | POPTS | Rsvd | Status | Command | DTYP | DTALEN | | ||
259 | * +----------------------------------------------------------------+ | ||
260 | * 63 48 47 40 39 36 35 32 31 24 23 20 19 0 | ||
261 | */ | ||
262 | printk(KERN_INFO "Tl[desc] [address 63:0 ] [SpeCssSCmCsLen]" | ||
263 | " [bi->dma ] leng ntw timestamp bi->skb " | ||
264 | "<-- Legacy format\n"); | ||
265 | printk(KERN_INFO "Tc[desc] [Ce CoCsIpceCoS] [MssHlRSCm0Plen]" | ||
266 | " [bi->dma ] leng ntw timestamp bi->skb " | ||
267 | "<-- Ext Context format\n"); | ||
268 | printk(KERN_INFO "Td[desc] [address 63:0 ] [VlaPoRSCm1Dlen]" | ||
269 | " [bi->dma ] leng ntw timestamp bi->skb " | ||
270 | "<-- Ext Data format\n"); | ||
271 | for (i = 0; tx_ring->desc && (i < tx_ring->count); i++) { | ||
272 | tx_desc = E1000_TX_DESC(*tx_ring, i); | ||
273 | buffer_info = &tx_ring->buffer_info[i]; | ||
274 | u0 = (struct my_u0 *)tx_desc; | ||
275 | printk(KERN_INFO "T%c[0x%03X] %016llX %016llX %016llX " | ||
276 | "%04X %3X %016llX %p", | ||
277 | (!(le64_to_cpu(u0->b) & (1<<29)) ? 'l' : | ||
278 | ((le64_to_cpu(u0->b) & (1<<20)) ? 'd' : 'c')), i, | ||
279 | le64_to_cpu(u0->a), le64_to_cpu(u0->b), | ||
280 | (u64)buffer_info->dma, buffer_info->length, | ||
281 | buffer_info->next_to_watch, (u64)buffer_info->time_stamp, | ||
282 | buffer_info->skb); | ||
283 | if (i == tx_ring->next_to_use && i == tx_ring->next_to_clean) | ||
284 | printk(KERN_CONT " NTC/U\n"); | ||
285 | else if (i == tx_ring->next_to_use) | ||
286 | printk(KERN_CONT " NTU\n"); | ||
287 | else if (i == tx_ring->next_to_clean) | ||
288 | printk(KERN_CONT " NTC\n"); | ||
289 | else | ||
290 | printk(KERN_CONT "\n"); | ||
291 | |||
292 | if (netif_msg_pktdata(adapter) && buffer_info->dma != 0) | ||
293 | print_hex_dump(KERN_INFO, "", DUMP_PREFIX_ADDRESS, | ||
294 | 16, 1, phys_to_virt(buffer_info->dma), | ||
295 | buffer_info->length, true); | ||
296 | } | ||
297 | |||
298 | /* Print RX Rings Summary */ | ||
299 | rx_ring_summary: | ||
300 | dev_info(&adapter->pdev->dev, "RX Rings Summary\n"); | ||
301 | printk(KERN_INFO "Queue [NTU] [NTC]\n"); | ||
302 | printk(KERN_INFO " %5d %5X %5X\n", 0, | ||
303 | rx_ring->next_to_use, rx_ring->next_to_clean); | ||
304 | |||
305 | /* Print RX Rings */ | ||
306 | if (!netif_msg_rx_status(adapter)) | ||
307 | goto exit; | ||
308 | |||
309 | dev_info(&adapter->pdev->dev, "RX Rings Dump\n"); | ||
310 | switch (adapter->rx_ps_pages) { | ||
311 | case 1: | ||
312 | case 2: | ||
313 | case 3: | ||
314 | /* [Extended] Packet Split Receive Descriptor Format | ||
315 | * | ||
316 | * +-----------------------------------------------------+ | ||
317 | * 0 | Buffer Address 0 [63:0] | | ||
318 | * +-----------------------------------------------------+ | ||
319 | * 8 | Buffer Address 1 [63:0] | | ||
320 | * +-----------------------------------------------------+ | ||
321 | * 16 | Buffer Address 2 [63:0] | | ||
322 | * +-----------------------------------------------------+ | ||
323 | * 24 | Buffer Address 3 [63:0] | | ||
324 | * +-----------------------------------------------------+ | ||
325 | */ | ||
326 | printk(KERN_INFO "R [desc] [buffer 0 63:0 ] " | ||
327 | "[buffer 1 63:0 ] " | ||
328 | "[buffer 2 63:0 ] [buffer 3 63:0 ] [bi->dma ] " | ||
329 | "[bi->skb] <-- Ext Pkt Split format\n"); | ||
330 | /* [Extended] Receive Descriptor (Write-Back) Format | ||
331 | * | ||
332 | * 63 48 47 32 31 13 12 8 7 4 3 0 | ||
333 | * +------------------------------------------------------+ | ||
334 | * 0 | Packet | IP | Rsvd | MRQ | Rsvd | MRQ RSS | | ||
335 | * | Checksum | Ident | | Queue | | Type | | ||
336 | * +------------------------------------------------------+ | ||
337 | * 8 | VLAN Tag | Length | Extended Error | Extended Status | | ||
338 | * +------------------------------------------------------+ | ||
339 | * 63 48 47 32 31 20 19 0 | ||
340 | */ | ||
341 | printk(KERN_INFO "RWB[desc] [ck ipid mrqhsh] " | ||
342 | "[vl l0 ee es] " | ||
343 | "[ l3 l2 l1 hs] [reserved ] ---------------- " | ||
344 | "[bi->skb] <-- Ext Rx Write-Back format\n"); | ||
345 | for (i = 0; i < rx_ring->count; i++) { | ||
346 | buffer_info = &rx_ring->buffer_info[i]; | ||
347 | rx_desc_ps = E1000_RX_DESC_PS(*rx_ring, i); | ||
348 | u1 = (struct my_u1 *)rx_desc_ps; | ||
349 | staterr = | ||
350 | le32_to_cpu(rx_desc_ps->wb.middle.status_error); | ||
351 | if (staterr & E1000_RXD_STAT_DD) { | ||
352 | /* Descriptor Done */ | ||
353 | printk(KERN_INFO "RWB[0x%03X] %016llX " | ||
354 | "%016llX %016llX %016llX " | ||
355 | "---------------- %p", i, | ||
356 | le64_to_cpu(u1->a), | ||
357 | le64_to_cpu(u1->b), | ||
358 | le64_to_cpu(u1->c), | ||
359 | le64_to_cpu(u1->d), | ||
360 | buffer_info->skb); | ||
361 | } else { | ||
362 | printk(KERN_INFO "R [0x%03X] %016llX " | ||
363 | "%016llX %016llX %016llX %016llX %p", i, | ||
364 | le64_to_cpu(u1->a), | ||
365 | le64_to_cpu(u1->b), | ||
366 | le64_to_cpu(u1->c), | ||
367 | le64_to_cpu(u1->d), | ||
368 | (u64)buffer_info->dma, | ||
369 | buffer_info->skb); | ||
370 | |||
371 | if (netif_msg_pktdata(adapter)) | ||
372 | print_hex_dump(KERN_INFO, "", | ||
373 | DUMP_PREFIX_ADDRESS, 16, 1, | ||
374 | phys_to_virt(buffer_info->dma), | ||
375 | adapter->rx_ps_bsize0, true); | ||
376 | } | ||
377 | |||
378 | if (i == rx_ring->next_to_use) | ||
379 | printk(KERN_CONT " NTU\n"); | ||
380 | else if (i == rx_ring->next_to_clean) | ||
381 | printk(KERN_CONT " NTC\n"); | ||
382 | else | ||
383 | printk(KERN_CONT "\n"); | ||
384 | } | ||
385 | break; | ||
386 | default: | ||
387 | case 0: | ||
388 | /* Legacy Receive Descriptor Format | ||
389 | * | ||
390 | * +-----------------------------------------------------+ | ||
391 | * | Buffer Address [63:0] | | ||
392 | * +-----------------------------------------------------+ | ||
393 | * | VLAN Tag | Errors | Status 0 | Packet csum | Length | | ||
394 | * +-----------------------------------------------------+ | ||
395 | * 63 48 47 40 39 32 31 16 15 0 | ||
396 | */ | ||
397 | printk(KERN_INFO "Rl[desc] [address 63:0 ] " | ||
398 | "[vl er S cks ln] [bi->dma ] [bi->skb] " | ||
399 | "<-- Legacy format\n"); | ||
400 | for (i = 0; rx_ring->desc && (i < rx_ring->count); i++) { | ||
401 | rx_desc = E1000_RX_DESC(*rx_ring, i); | ||
402 | buffer_info = &rx_ring->buffer_info[i]; | ||
403 | u0 = (struct my_u0 *)rx_desc; | ||
404 | printk(KERN_INFO "Rl[0x%03X] %016llX %016llX " | ||
405 | "%016llX %p", | ||
406 | i, le64_to_cpu(u0->a), le64_to_cpu(u0->b), | ||
407 | (u64)buffer_info->dma, buffer_info->skb); | ||
408 | if (i == rx_ring->next_to_use) | ||
409 | printk(KERN_CONT " NTU\n"); | ||
410 | else if (i == rx_ring->next_to_clean) | ||
411 | printk(KERN_CONT " NTC\n"); | ||
412 | else | ||
413 | printk(KERN_CONT "\n"); | ||
414 | |||
415 | if (netif_msg_pktdata(adapter)) | ||
416 | print_hex_dump(KERN_INFO, "", | ||
417 | DUMP_PREFIX_ADDRESS, | ||
418 | 16, 1, phys_to_virt(buffer_info->dma), | ||
419 | adapter->rx_buffer_len, true); | ||
420 | } | ||
421 | } | ||
422 | |||
423 | exit: | ||
424 | return; | ||
425 | } | ||
426 | |||
69 | /** | 427 | /** |
70 | * e1000_desc_unused - calculate if we have unused descriptors | 428 | * e1000_desc_unused - calculate if we have unused descriptors |
71 | **/ | 429 | **/ |
@@ -178,10 +536,10 @@ static void e1000_alloc_rx_buffers(struct e1000_adapter *adapter, | |||
178 | 536 | ||
179 | buffer_info->skb = skb; | 537 | buffer_info->skb = skb; |
180 | map_skb: | 538 | map_skb: |
181 | buffer_info->dma = pci_map_single(pdev, skb->data, | 539 | buffer_info->dma = dma_map_single(&pdev->dev, skb->data, |
182 | adapter->rx_buffer_len, | 540 | adapter->rx_buffer_len, |
183 | PCI_DMA_FROMDEVICE); | 541 | DMA_FROM_DEVICE); |
184 | if (pci_dma_mapping_error(pdev, buffer_info->dma)) { | 542 | if (dma_mapping_error(&pdev->dev, buffer_info->dma)) { |
185 | dev_err(&pdev->dev, "RX DMA map failed\n"); | 543 | dev_err(&pdev->dev, "RX DMA map failed\n"); |
186 | adapter->rx_dma_failed++; | 544 | adapter->rx_dma_failed++; |
187 | break; | 545 | break; |
@@ -190,26 +548,23 @@ map_skb: | |||
190 | rx_desc = E1000_RX_DESC(*rx_ring, i); | 548 | rx_desc = E1000_RX_DESC(*rx_ring, i); |
191 | rx_desc->buffer_addr = cpu_to_le64(buffer_info->dma); | 549 | rx_desc->buffer_addr = cpu_to_le64(buffer_info->dma); |
192 | 550 | ||
551 | if (unlikely(!(i & (E1000_RX_BUFFER_WRITE - 1)))) { | ||
552 | /* | ||
553 | * Force memory writes to complete before letting h/w | ||
554 | * know there are new descriptors to fetch. (Only | ||
555 | * applicable for weak-ordered memory model archs, | ||
556 | * such as IA-64). | ||
557 | */ | ||
558 | wmb(); | ||
559 | writel(i, adapter->hw.hw_addr + rx_ring->tail); | ||
560 | } | ||
193 | i++; | 561 | i++; |
194 | if (i == rx_ring->count) | 562 | if (i == rx_ring->count) |
195 | i = 0; | 563 | i = 0; |
196 | buffer_info = &rx_ring->buffer_info[i]; | 564 | buffer_info = &rx_ring->buffer_info[i]; |
197 | } | 565 | } |
198 | 566 | ||
199 | if (rx_ring->next_to_use != i) { | 567 | rx_ring->next_to_use = i; |
200 | rx_ring->next_to_use = i; | ||
201 | if (i-- == 0) | ||
202 | i = (rx_ring->count - 1); | ||
203 | |||
204 | /* | ||
205 | * Force memory writes to complete before letting h/w | ||
206 | * know there are new descriptors to fetch. (Only | ||
207 | * applicable for weak-ordered memory model archs, | ||
208 | * such as IA-64). | ||
209 | */ | ||
210 | wmb(); | ||
211 | writel(i, adapter->hw.hw_addr + rx_ring->tail); | ||
212 | } | ||
213 | } | 568 | } |
214 | 569 | ||
215 | /** | 570 | /** |
@@ -247,11 +602,12 @@ static void e1000_alloc_rx_buffers_ps(struct e1000_adapter *adapter, | |||
247 | adapter->alloc_rx_buff_failed++; | 602 | adapter->alloc_rx_buff_failed++; |
248 | goto no_buffers; | 603 | goto no_buffers; |
249 | } | 604 | } |
250 | ps_page->dma = pci_map_page(pdev, | 605 | ps_page->dma = dma_map_page(&pdev->dev, |
251 | ps_page->page, | 606 | ps_page->page, |
252 | 0, PAGE_SIZE, | 607 | 0, PAGE_SIZE, |
253 | PCI_DMA_FROMDEVICE); | 608 | DMA_FROM_DEVICE); |
254 | if (pci_dma_mapping_error(pdev, ps_page->dma)) { | 609 | if (dma_mapping_error(&pdev->dev, |
610 | ps_page->dma)) { | ||
255 | dev_err(&adapter->pdev->dev, | 611 | dev_err(&adapter->pdev->dev, |
256 | "RX DMA page map failed\n"); | 612 | "RX DMA page map failed\n"); |
257 | adapter->rx_dma_failed++; | 613 | adapter->rx_dma_failed++; |
@@ -276,10 +632,10 @@ static void e1000_alloc_rx_buffers_ps(struct e1000_adapter *adapter, | |||
276 | } | 632 | } |
277 | 633 | ||
278 | buffer_info->skb = skb; | 634 | buffer_info->skb = skb; |
279 | buffer_info->dma = pci_map_single(pdev, skb->data, | 635 | buffer_info->dma = dma_map_single(&pdev->dev, skb->data, |
280 | adapter->rx_ps_bsize0, | 636 | adapter->rx_ps_bsize0, |
281 | PCI_DMA_FROMDEVICE); | 637 | DMA_FROM_DEVICE); |
282 | if (pci_dma_mapping_error(pdev, buffer_info->dma)) { | 638 | if (dma_mapping_error(&pdev->dev, buffer_info->dma)) { |
283 | dev_err(&pdev->dev, "RX DMA map failed\n"); | 639 | dev_err(&pdev->dev, "RX DMA map failed\n"); |
284 | adapter->rx_dma_failed++; | 640 | adapter->rx_dma_failed++; |
285 | /* cleanup skb */ | 641 | /* cleanup skb */ |
@@ -290,6 +646,17 @@ static void e1000_alloc_rx_buffers_ps(struct e1000_adapter *adapter, | |||
290 | 646 | ||
291 | rx_desc->read.buffer_addr[0] = cpu_to_le64(buffer_info->dma); | 647 | rx_desc->read.buffer_addr[0] = cpu_to_le64(buffer_info->dma); |
292 | 648 | ||
649 | if (unlikely(!(i & (E1000_RX_BUFFER_WRITE - 1)))) { | ||
650 | /* | ||
651 | * Force memory writes to complete before letting h/w | ||
652 | * know there are new descriptors to fetch. (Only | ||
653 | * applicable for weak-ordered memory model archs, | ||
654 | * such as IA-64). | ||
655 | */ | ||
656 | wmb(); | ||
657 | writel(i<<1, adapter->hw.hw_addr + rx_ring->tail); | ||
658 | } | ||
659 | |||
293 | i++; | 660 | i++; |
294 | if (i == rx_ring->count) | 661 | if (i == rx_ring->count) |
295 | i = 0; | 662 | i = 0; |
@@ -297,26 +664,7 @@ static void e1000_alloc_rx_buffers_ps(struct e1000_adapter *adapter, | |||
297 | } | 664 | } |
298 | 665 | ||
299 | no_buffers: | 666 | no_buffers: |
300 | if (rx_ring->next_to_use != i) { | 667 | rx_ring->next_to_use = i; |
301 | rx_ring->next_to_use = i; | ||
302 | |||
303 | if (!(i--)) | ||
304 | i = (rx_ring->count - 1); | ||
305 | |||
306 | /* | ||
307 | * Force memory writes to complete before letting h/w | ||
308 | * know there are new descriptors to fetch. (Only | ||
309 | * applicable for weak-ordered memory model archs, | ||
310 | * such as IA-64). | ||
311 | */ | ||
312 | wmb(); | ||
313 | /* | ||
314 | * Hardware increments by 16 bytes, but packet split | ||
315 | * descriptors are 32 bytes...so we increment tail | ||
316 | * twice as much. | ||
317 | */ | ||
318 | writel(i<<1, adapter->hw.hw_addr + rx_ring->tail); | ||
319 | } | ||
320 | } | 668 | } |
321 | 669 | ||
322 | /** | 670 | /** |
@@ -366,10 +714,10 @@ check_page: | |||
366 | } | 714 | } |
367 | 715 | ||
368 | if (!buffer_info->dma) | 716 | if (!buffer_info->dma) |
369 | buffer_info->dma = pci_map_page(pdev, | 717 | buffer_info->dma = dma_map_page(&pdev->dev, |
370 | buffer_info->page, 0, | 718 | buffer_info->page, 0, |
371 | PAGE_SIZE, | 719 | PAGE_SIZE, |
372 | PCI_DMA_FROMDEVICE); | 720 | DMA_FROM_DEVICE); |
373 | 721 | ||
374 | rx_desc = E1000_RX_DESC(*rx_ring, i); | 722 | rx_desc = E1000_RX_DESC(*rx_ring, i); |
375 | rx_desc->buffer_addr = cpu_to_le64(buffer_info->dma); | 723 | rx_desc->buffer_addr = cpu_to_le64(buffer_info->dma); |
@@ -443,10 +791,10 @@ static bool e1000_clean_rx_irq(struct e1000_adapter *adapter, | |||
443 | 791 | ||
444 | cleaned = 1; | 792 | cleaned = 1; |
445 | cleaned_count++; | 793 | cleaned_count++; |
446 | pci_unmap_single(pdev, | 794 | dma_unmap_single(&pdev->dev, |
447 | buffer_info->dma, | 795 | buffer_info->dma, |
448 | adapter->rx_buffer_len, | 796 | adapter->rx_buffer_len, |
449 | PCI_DMA_FROMDEVICE); | 797 | DMA_FROM_DEVICE); |
450 | buffer_info->dma = 0; | 798 | buffer_info->dma = 0; |
451 | 799 | ||
452 | length = le16_to_cpu(rx_desc->length); | 800 | length = le16_to_cpu(rx_desc->length); |
@@ -547,12 +895,11 @@ static void e1000_put_txbuf(struct e1000_adapter *adapter, | |||
547 | { | 895 | { |
548 | if (buffer_info->dma) { | 896 | if (buffer_info->dma) { |
549 | if (buffer_info->mapped_as_page) | 897 | if (buffer_info->mapped_as_page) |
550 | pci_unmap_page(adapter->pdev, buffer_info->dma, | 898 | dma_unmap_page(&adapter->pdev->dev, buffer_info->dma, |
551 | buffer_info->length, PCI_DMA_TODEVICE); | 899 | buffer_info->length, DMA_TO_DEVICE); |
552 | else | 900 | else |
553 | pci_unmap_single(adapter->pdev, buffer_info->dma, | 901 | dma_unmap_single(&adapter->pdev->dev, buffer_info->dma, |
554 | buffer_info->length, | 902 | buffer_info->length, DMA_TO_DEVICE); |
555 | PCI_DMA_TODEVICE); | ||
556 | buffer_info->dma = 0; | 903 | buffer_info->dma = 0; |
557 | } | 904 | } |
558 | if (buffer_info->skb) { | 905 | if (buffer_info->skb) { |
@@ -643,14 +990,8 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter) | |||
643 | cleaned = (i == eop); | 990 | cleaned = (i == eop); |
644 | 991 | ||
645 | if (cleaned) { | 992 | if (cleaned) { |
646 | struct sk_buff *skb = buffer_info->skb; | 993 | total_tx_packets += buffer_info->segs; |
647 | unsigned int segs, bytecount; | 994 | total_tx_bytes += buffer_info->bytecount; |
648 | segs = skb_shinfo(skb)->gso_segs ?: 1; | ||
649 | /* multiply data chunks by size of headers */ | ||
650 | bytecount = ((segs - 1) * skb_headlen(skb)) + | ||
651 | skb->len; | ||
652 | total_tx_packets += segs; | ||
653 | total_tx_bytes += bytecount; | ||
654 | } | 995 | } |
655 | 996 | ||
656 | e1000_put_txbuf(adapter, buffer_info); | 997 | e1000_put_txbuf(adapter, buffer_info); |
@@ -753,9 +1094,9 @@ static bool e1000_clean_rx_irq_ps(struct e1000_adapter *adapter, | |||
753 | 1094 | ||
754 | cleaned = 1; | 1095 | cleaned = 1; |
755 | cleaned_count++; | 1096 | cleaned_count++; |
756 | pci_unmap_single(pdev, buffer_info->dma, | 1097 | dma_unmap_single(&pdev->dev, buffer_info->dma, |
757 | adapter->rx_ps_bsize0, | 1098 | adapter->rx_ps_bsize0, |
758 | PCI_DMA_FROMDEVICE); | 1099 | DMA_FROM_DEVICE); |
759 | buffer_info->dma = 0; | 1100 | buffer_info->dma = 0; |
760 | 1101 | ||
761 | /* see !EOP comment in other rx routine */ | 1102 | /* see !EOP comment in other rx routine */ |
@@ -811,13 +1152,13 @@ static bool e1000_clean_rx_irq_ps(struct e1000_adapter *adapter, | |||
811 | * kmap_atomic, so we can't hold the mapping | 1152 | * kmap_atomic, so we can't hold the mapping |
812 | * very long | 1153 | * very long |
813 | */ | 1154 | */ |
814 | pci_dma_sync_single_for_cpu(pdev, ps_page->dma, | 1155 | dma_sync_single_for_cpu(&pdev->dev, ps_page->dma, |
815 | PAGE_SIZE, PCI_DMA_FROMDEVICE); | 1156 | PAGE_SIZE, DMA_FROM_DEVICE); |
816 | vaddr = kmap_atomic(ps_page->page, KM_SKB_DATA_SOFTIRQ); | 1157 | vaddr = kmap_atomic(ps_page->page, KM_SKB_DATA_SOFTIRQ); |
817 | memcpy(skb_tail_pointer(skb), vaddr, l1); | 1158 | memcpy(skb_tail_pointer(skb), vaddr, l1); |
818 | kunmap_atomic(vaddr, KM_SKB_DATA_SOFTIRQ); | 1159 | kunmap_atomic(vaddr, KM_SKB_DATA_SOFTIRQ); |
819 | pci_dma_sync_single_for_device(pdev, ps_page->dma, | 1160 | dma_sync_single_for_device(&pdev->dev, ps_page->dma, |
820 | PAGE_SIZE, PCI_DMA_FROMDEVICE); | 1161 | PAGE_SIZE, DMA_FROM_DEVICE); |
821 | 1162 | ||
822 | /* remove the CRC */ | 1163 | /* remove the CRC */ |
823 | if (!(adapter->flags2 & FLAG2_CRC_STRIPPING)) | 1164 | if (!(adapter->flags2 & FLAG2_CRC_STRIPPING)) |
@@ -834,8 +1175,8 @@ static bool e1000_clean_rx_irq_ps(struct e1000_adapter *adapter, | |||
834 | break; | 1175 | break; |
835 | 1176 | ||
836 | ps_page = &buffer_info->ps_pages[j]; | 1177 | ps_page = &buffer_info->ps_pages[j]; |
837 | pci_unmap_page(pdev, ps_page->dma, PAGE_SIZE, | 1178 | dma_unmap_page(&pdev->dev, ps_page->dma, PAGE_SIZE, |
838 | PCI_DMA_FROMDEVICE); | 1179 | DMA_FROM_DEVICE); |
839 | ps_page->dma = 0; | 1180 | ps_page->dma = 0; |
840 | skb_fill_page_desc(skb, j, ps_page->page, 0, length); | 1181 | skb_fill_page_desc(skb, j, ps_page->page, 0, length); |
841 | ps_page->page = NULL; | 1182 | ps_page->page = NULL; |
@@ -953,8 +1294,8 @@ static bool e1000_clean_jumbo_rx_irq(struct e1000_adapter *adapter, | |||
953 | 1294 | ||
954 | cleaned = true; | 1295 | cleaned = true; |
955 | cleaned_count++; | 1296 | cleaned_count++; |
956 | pci_unmap_page(pdev, buffer_info->dma, PAGE_SIZE, | 1297 | dma_unmap_page(&pdev->dev, buffer_info->dma, PAGE_SIZE, |
957 | PCI_DMA_FROMDEVICE); | 1298 | DMA_FROM_DEVICE); |
958 | buffer_info->dma = 0; | 1299 | buffer_info->dma = 0; |
959 | 1300 | ||
960 | length = le16_to_cpu(rx_desc->length); | 1301 | length = le16_to_cpu(rx_desc->length); |
@@ -1090,17 +1431,17 @@ static void e1000_clean_rx_ring(struct e1000_adapter *adapter) | |||
1090 | buffer_info = &rx_ring->buffer_info[i]; | 1431 | buffer_info = &rx_ring->buffer_info[i]; |
1091 | if (buffer_info->dma) { | 1432 | if (buffer_info->dma) { |
1092 | if (adapter->clean_rx == e1000_clean_rx_irq) | 1433 | if (adapter->clean_rx == e1000_clean_rx_irq) |
1093 | pci_unmap_single(pdev, buffer_info->dma, | 1434 | dma_unmap_single(&pdev->dev, buffer_info->dma, |
1094 | adapter->rx_buffer_len, | 1435 | adapter->rx_buffer_len, |
1095 | PCI_DMA_FROMDEVICE); | 1436 | DMA_FROM_DEVICE); |
1096 | else if (adapter->clean_rx == e1000_clean_jumbo_rx_irq) | 1437 | else if (adapter->clean_rx == e1000_clean_jumbo_rx_irq) |
1097 | pci_unmap_page(pdev, buffer_info->dma, | 1438 | dma_unmap_page(&pdev->dev, buffer_info->dma, |
1098 | PAGE_SIZE, | 1439 | PAGE_SIZE, |
1099 | PCI_DMA_FROMDEVICE); | 1440 | DMA_FROM_DEVICE); |
1100 | else if (adapter->clean_rx == e1000_clean_rx_irq_ps) | 1441 | else if (adapter->clean_rx == e1000_clean_rx_irq_ps) |
1101 | pci_unmap_single(pdev, buffer_info->dma, | 1442 | dma_unmap_single(&pdev->dev, buffer_info->dma, |
1102 | adapter->rx_ps_bsize0, | 1443 | adapter->rx_ps_bsize0, |
1103 | PCI_DMA_FROMDEVICE); | 1444 | DMA_FROM_DEVICE); |
1104 | buffer_info->dma = 0; | 1445 | buffer_info->dma = 0; |
1105 | } | 1446 | } |
1106 | 1447 | ||
@@ -1118,8 +1459,8 @@ static void e1000_clean_rx_ring(struct e1000_adapter *adapter) | |||
1118 | ps_page = &buffer_info->ps_pages[j]; | 1459 | ps_page = &buffer_info->ps_pages[j]; |
1119 | if (!ps_page->page) | 1460 | if (!ps_page->page) |
1120 | break; | 1461 | break; |
1121 | pci_unmap_page(pdev, ps_page->dma, PAGE_SIZE, | 1462 | dma_unmap_page(&pdev->dev, ps_page->dma, PAGE_SIZE, |
1122 | PCI_DMA_FROMDEVICE); | 1463 | DMA_FROM_DEVICE); |
1123 | ps_page->dma = 0; | 1464 | ps_page->dma = 0; |
1124 | put_page(ps_page->page); | 1465 | put_page(ps_page->page); |
1125 | ps_page->page = NULL; | 1466 | ps_page->page = NULL; |
@@ -1426,8 +1767,6 @@ void e1000e_reset_interrupt_capability(struct e1000_adapter *adapter) | |||
1426 | pci_disable_msi(adapter->pdev); | 1767 | pci_disable_msi(adapter->pdev); |
1427 | adapter->flags &= ~FLAG_MSI_ENABLED; | 1768 | adapter->flags &= ~FLAG_MSI_ENABLED; |
1428 | } | 1769 | } |
1429 | |||
1430 | return; | ||
1431 | } | 1770 | } |
1432 | 1771 | ||
1433 | /** | 1772 | /** |
@@ -1479,8 +1818,6 @@ void e1000e_set_interrupt_capability(struct e1000_adapter *adapter) | |||
1479 | /* Don't do anything; this is the system default */ | 1818 | /* Don't do anything; this is the system default */ |
1480 | break; | 1819 | break; |
1481 | } | 1820 | } |
1482 | |||
1483 | return; | ||
1484 | } | 1821 | } |
1485 | 1822 | ||
1486 | /** | 1823 | /** |
@@ -2185,10 +2522,10 @@ static void e1000_restore_vlan(struct e1000_adapter *adapter) | |||
2185 | } | 2522 | } |
2186 | } | 2523 | } |
2187 | 2524 | ||
2188 | static void e1000_init_manageability(struct e1000_adapter *adapter) | 2525 | static void e1000_init_manageability_pt(struct e1000_adapter *adapter) |
2189 | { | 2526 | { |
2190 | struct e1000_hw *hw = &adapter->hw; | 2527 | struct e1000_hw *hw = &adapter->hw; |
2191 | u32 manc, manc2h; | 2528 | u32 manc, manc2h, mdef, i, j; |
2192 | 2529 | ||
2193 | if (!(adapter->flags & FLAG_MNG_PT_ENABLED)) | 2530 | if (!(adapter->flags & FLAG_MNG_PT_ENABLED)) |
2194 | return; | 2531 | return; |
@@ -2202,10 +2539,49 @@ static void e1000_init_manageability(struct e1000_adapter *adapter) | |||
2202 | */ | 2539 | */ |
2203 | manc |= E1000_MANC_EN_MNG2HOST; | 2540 | manc |= E1000_MANC_EN_MNG2HOST; |
2204 | manc2h = er32(MANC2H); | 2541 | manc2h = er32(MANC2H); |
2205 | #define E1000_MNG2HOST_PORT_623 (1 << 5) | 2542 | |
2206 | #define E1000_MNG2HOST_PORT_664 (1 << 6) | 2543 | switch (hw->mac.type) { |
2207 | manc2h |= E1000_MNG2HOST_PORT_623; | 2544 | default: |
2208 | manc2h |= E1000_MNG2HOST_PORT_664; | 2545 | manc2h |= (E1000_MANC2H_PORT_623 | E1000_MANC2H_PORT_664); |
2546 | break; | ||
2547 | case e1000_82574: | ||
2548 | case e1000_82583: | ||
2549 | /* | ||
2550 | * Check if IPMI pass-through decision filter already exists; | ||
2551 | * if so, enable it. | ||
2552 | */ | ||
2553 | for (i = 0, j = 0; i < 8; i++) { | ||
2554 | mdef = er32(MDEF(i)); | ||
2555 | |||
2556 | /* Ignore filters with anything other than IPMI ports */ | ||
2557 | if (mdef & !(E1000_MDEF_PORT_623 | E1000_MDEF_PORT_664)) | ||
2558 | continue; | ||
2559 | |||
2560 | /* Enable this decision filter in MANC2H */ | ||
2561 | if (mdef) | ||
2562 | manc2h |= (1 << i); | ||
2563 | |||
2564 | j |= mdef; | ||
2565 | } | ||
2566 | |||
2567 | if (j == (E1000_MDEF_PORT_623 | E1000_MDEF_PORT_664)) | ||
2568 | break; | ||
2569 | |||
2570 | /* Create new decision filter in an empty filter */ | ||
2571 | for (i = 0, j = 0; i < 8; i++) | ||
2572 | if (er32(MDEF(i)) == 0) { | ||
2573 | ew32(MDEF(i), (E1000_MDEF_PORT_623 | | ||
2574 | E1000_MDEF_PORT_664)); | ||
2575 | manc2h |= (1 << 1); | ||
2576 | j++; | ||
2577 | break; | ||
2578 | } | ||
2579 | |||
2580 | if (!j) | ||
2581 | e_warn("Unable to create IPMI pass-through filter\n"); | ||
2582 | break; | ||
2583 | } | ||
2584 | |||
2209 | ew32(MANC2H, manc2h); | 2585 | ew32(MANC2H, manc2h); |
2210 | ew32(MANC, manc); | 2586 | ew32(MANC, manc); |
2211 | } | 2587 | } |
@@ -2524,12 +2900,12 @@ static void e1000_configure_rx(struct e1000_adapter *adapter) | |||
2524 | * excessive C-state transition latencies result in | 2900 | * excessive C-state transition latencies result in |
2525 | * dropped transactions. | 2901 | * dropped transactions. |
2526 | */ | 2902 | */ |
2527 | pm_qos_update_requirement(PM_QOS_CPU_DMA_LATENCY, | 2903 | pm_qos_update_request( |
2528 | adapter->netdev->name, 55); | 2904 | adapter->netdev->pm_qos_req, 55); |
2529 | } else { | 2905 | } else { |
2530 | pm_qos_update_requirement(PM_QOS_CPU_DMA_LATENCY, | 2906 | pm_qos_update_request( |
2531 | adapter->netdev->name, | 2907 | adapter->netdev->pm_qos_req, |
2532 | PM_QOS_DEFAULT_VALUE); | 2908 | PM_QOS_DEFAULT_VALUE); |
2533 | } | 2909 | } |
2534 | } | 2910 | } |
2535 | 2911 | ||
@@ -2565,7 +2941,7 @@ static void e1000_set_multi(struct net_device *netdev) | |||
2565 | { | 2941 | { |
2566 | struct e1000_adapter *adapter = netdev_priv(netdev); | 2942 | struct e1000_adapter *adapter = netdev_priv(netdev); |
2567 | struct e1000_hw *hw = &adapter->hw; | 2943 | struct e1000_hw *hw = &adapter->hw; |
2568 | struct dev_mc_list *mc_ptr; | 2944 | struct netdev_hw_addr *ha; |
2569 | u8 *mta_list; | 2945 | u8 *mta_list; |
2570 | u32 rctl; | 2946 | u32 rctl; |
2571 | int i; | 2947 | int i; |
@@ -2597,9 +2973,8 @@ static void e1000_set_multi(struct net_device *netdev) | |||
2597 | 2973 | ||
2598 | /* prepare a packed array of only addresses. */ | 2974 | /* prepare a packed array of only addresses. */ |
2599 | i = 0; | 2975 | i = 0; |
2600 | netdev_for_each_mc_addr(mc_ptr, netdev) | 2976 | netdev_for_each_mc_addr(ha, netdev) |
2601 | memcpy(mta_list + (i++ * ETH_ALEN), | 2977 | memcpy(mta_list + (i++ * ETH_ALEN), ha->addr, ETH_ALEN); |
2602 | mc_ptr->dmi_addr, ETH_ALEN); | ||
2603 | 2978 | ||
2604 | e1000_update_mc_addr_list(hw, mta_list, i); | 2979 | e1000_update_mc_addr_list(hw, mta_list, i); |
2605 | kfree(mta_list); | 2980 | kfree(mta_list); |
@@ -2621,7 +2996,7 @@ static void e1000_configure(struct e1000_adapter *adapter) | |||
2621 | e1000_set_multi(adapter->netdev); | 2996 | e1000_set_multi(adapter->netdev); |
2622 | 2997 | ||
2623 | e1000_restore_vlan(adapter); | 2998 | e1000_restore_vlan(adapter); |
2624 | e1000_init_manageability(adapter); | 2999 | e1000_init_manageability_pt(adapter); |
2625 | 3000 | ||
2626 | e1000_configure_tx(adapter); | 3001 | e1000_configure_tx(adapter); |
2627 | e1000_setup_rctl(adapter); | 3002 | e1000_setup_rctl(adapter); |
@@ -2755,6 +3130,7 @@ void e1000e_reset(struct e1000_adapter *adapter) | |||
2755 | fc->high_water = 0x5000; | 3130 | fc->high_water = 0x5000; |
2756 | fc->low_water = 0x3000; | 3131 | fc->low_water = 0x3000; |
2757 | } | 3132 | } |
3133 | fc->refresh_time = 0x1000; | ||
2758 | } else { | 3134 | } else { |
2759 | if ((adapter->flags & FLAG_HAS_ERT) && | 3135 | if ((adapter->flags & FLAG_HAS_ERT) && |
2760 | (adapter->netdev->mtu > ETH_DATA_LEN)) | 3136 | (adapter->netdev->mtu > ETH_DATA_LEN)) |
@@ -2792,10 +3168,6 @@ void e1000e_reset(struct e1000_adapter *adapter) | |||
2792 | if (mac->ops.init_hw(hw)) | 3168 | if (mac->ops.init_hw(hw)) |
2793 | e_err("Hardware Error\n"); | 3169 | e_err("Hardware Error\n"); |
2794 | 3170 | ||
2795 | /* additional part of the flow-control workaround above */ | ||
2796 | if (hw->mac.type == e1000_pchlan) | ||
2797 | ew32(FCRTV_PCH, 0x1000); | ||
2798 | |||
2799 | e1000_update_mng_vlan(adapter); | 3171 | e1000_update_mng_vlan(adapter); |
2800 | 3172 | ||
2801 | /* Enable h/w to recognize an 802.1Q VLAN Ethernet packet */ | 3173 | /* Enable h/w to recognize an 802.1Q VLAN Ethernet packet */ |
@@ -2824,8 +3196,8 @@ int e1000e_up(struct e1000_adapter *adapter) | |||
2824 | 3196 | ||
2825 | /* DMA latency requirement to workaround early-receive/jumbo issue */ | 3197 | /* DMA latency requirement to workaround early-receive/jumbo issue */ |
2826 | if (adapter->flags & FLAG_HAS_ERT) | 3198 | if (adapter->flags & FLAG_HAS_ERT) |
2827 | pm_qos_add_requirement(PM_QOS_CPU_DMA_LATENCY, | 3199 | adapter->netdev->pm_qos_req = |
2828 | adapter->netdev->name, | 3200 | pm_qos_add_request(PM_QOS_CPU_DMA_LATENCY, |
2829 | PM_QOS_DEFAULT_VALUE); | 3201 | PM_QOS_DEFAULT_VALUE); |
2830 | 3202 | ||
2831 | /* hardware has been reset, we need to reload some things */ | 3203 | /* hardware has been reset, we need to reload some things */ |
@@ -2841,7 +3213,11 @@ int e1000e_up(struct e1000_adapter *adapter) | |||
2841 | netif_wake_queue(adapter->netdev); | 3213 | netif_wake_queue(adapter->netdev); |
2842 | 3214 | ||
2843 | /* fire a link change interrupt to start the watchdog */ | 3215 | /* fire a link change interrupt to start the watchdog */ |
2844 | ew32(ICS, E1000_ICS_LSC); | 3216 | if (adapter->msix_entries) |
3217 | ew32(ICS, E1000_ICS_LSC | E1000_ICR_OTHER); | ||
3218 | else | ||
3219 | ew32(ICS, E1000_ICS_LSC); | ||
3220 | |||
2845 | return 0; | 3221 | return 0; |
2846 | } | 3222 | } |
2847 | 3223 | ||
@@ -2887,9 +3263,11 @@ void e1000e_down(struct e1000_adapter *adapter) | |||
2887 | e1000_clean_tx_ring(adapter); | 3263 | e1000_clean_tx_ring(adapter); |
2888 | e1000_clean_rx_ring(adapter); | 3264 | e1000_clean_rx_ring(adapter); |
2889 | 3265 | ||
2890 | if (adapter->flags & FLAG_HAS_ERT) | 3266 | if (adapter->flags & FLAG_HAS_ERT) { |
2891 | pm_qos_remove_requirement(PM_QOS_CPU_DMA_LATENCY, | 3267 | pm_qos_remove_request( |
2892 | adapter->netdev->name); | 3268 | adapter->netdev->pm_qos_req); |
3269 | adapter->netdev->pm_qos_req = NULL; | ||
3270 | } | ||
2893 | 3271 | ||
2894 | /* | 3272 | /* |
2895 | * TODO: for power management, we could drop the link and | 3273 | * TODO: for power management, we could drop the link and |
@@ -3083,12 +3461,15 @@ static int e1000_open(struct net_device *netdev) | |||
3083 | { | 3461 | { |
3084 | struct e1000_adapter *adapter = netdev_priv(netdev); | 3462 | struct e1000_adapter *adapter = netdev_priv(netdev); |
3085 | struct e1000_hw *hw = &adapter->hw; | 3463 | struct e1000_hw *hw = &adapter->hw; |
3464 | struct pci_dev *pdev = adapter->pdev; | ||
3086 | int err; | 3465 | int err; |
3087 | 3466 | ||
3088 | /* disallow open during test */ | 3467 | /* disallow open during test */ |
3089 | if (test_bit(__E1000_TESTING, &adapter->state)) | 3468 | if (test_bit(__E1000_TESTING, &adapter->state)) |
3090 | return -EBUSY; | 3469 | return -EBUSY; |
3091 | 3470 | ||
3471 | pm_runtime_get_sync(&pdev->dev); | ||
3472 | |||
3092 | netif_carrier_off(netdev); | 3473 | netif_carrier_off(netdev); |
3093 | 3474 | ||
3094 | /* allocate transmit descriptors */ | 3475 | /* allocate transmit descriptors */ |
@@ -3101,6 +3482,15 @@ static int e1000_open(struct net_device *netdev) | |||
3101 | if (err) | 3482 | if (err) |
3102 | goto err_setup_rx; | 3483 | goto err_setup_rx; |
3103 | 3484 | ||
3485 | /* | ||
3486 | * If AMT is enabled, let the firmware know that the network | ||
3487 | * interface is now open and reset the part to a known state. | ||
3488 | */ | ||
3489 | if (adapter->flags & FLAG_HAS_AMT) { | ||
3490 | e1000_get_hw_control(adapter); | ||
3491 | e1000e_reset(adapter); | ||
3492 | } | ||
3493 | |||
3104 | e1000e_power_up_phy(adapter); | 3494 | e1000e_power_up_phy(adapter); |
3105 | 3495 | ||
3106 | adapter->mng_vlan_id = E1000_MNG_VLAN_NONE; | 3496 | adapter->mng_vlan_id = E1000_MNG_VLAN_NONE; |
@@ -3109,13 +3499,6 @@ static int e1000_open(struct net_device *netdev) | |||
3109 | e1000_update_mng_vlan(adapter); | 3499 | e1000_update_mng_vlan(adapter); |
3110 | 3500 | ||
3111 | /* | 3501 | /* |
3112 | * If AMT is enabled, let the firmware know that the network | ||
3113 | * interface is now open | ||
3114 | */ | ||
3115 | if (adapter->flags & FLAG_HAS_AMT) | ||
3116 | e1000_get_hw_control(adapter); | ||
3117 | |||
3118 | /* | ||
3119 | * before we allocate an interrupt, we must be ready to handle it. | 3502 | * before we allocate an interrupt, we must be ready to handle it. |
3120 | * Setting DEBUG_SHIRQ in the kernel makes it fire an interrupt | 3503 | * Setting DEBUG_SHIRQ in the kernel makes it fire an interrupt |
3121 | * as soon as we call pci_request_irq, so we have to setup our | 3504 | * as soon as we call pci_request_irq, so we have to setup our |
@@ -3149,8 +3532,14 @@ static int e1000_open(struct net_device *netdev) | |||
3149 | 3532 | ||
3150 | netif_start_queue(netdev); | 3533 | netif_start_queue(netdev); |
3151 | 3534 | ||
3535 | adapter->idle_check = true; | ||
3536 | pm_runtime_put(&pdev->dev); | ||
3537 | |||
3152 | /* fire a link status change interrupt to start the watchdog */ | 3538 | /* fire a link status change interrupt to start the watchdog */ |
3153 | ew32(ICS, E1000_ICS_LSC); | 3539 | if (adapter->msix_entries) |
3540 | ew32(ICS, E1000_ICS_LSC | E1000_ICR_OTHER); | ||
3541 | else | ||
3542 | ew32(ICS, E1000_ICS_LSC); | ||
3154 | 3543 | ||
3155 | return 0; | 3544 | return 0; |
3156 | 3545 | ||
@@ -3162,6 +3551,7 @@ err_setup_rx: | |||
3162 | e1000e_free_tx_resources(adapter); | 3551 | e1000e_free_tx_resources(adapter); |
3163 | err_setup_tx: | 3552 | err_setup_tx: |
3164 | e1000e_reset(adapter); | 3553 | e1000e_reset(adapter); |
3554 | pm_runtime_put_sync(&pdev->dev); | ||
3165 | 3555 | ||
3166 | return err; | 3556 | return err; |
3167 | } | 3557 | } |
@@ -3180,11 +3570,17 @@ err_setup_tx: | |||
3180 | static int e1000_close(struct net_device *netdev) | 3570 | static int e1000_close(struct net_device *netdev) |
3181 | { | 3571 | { |
3182 | struct e1000_adapter *adapter = netdev_priv(netdev); | 3572 | struct e1000_adapter *adapter = netdev_priv(netdev); |
3573 | struct pci_dev *pdev = adapter->pdev; | ||
3183 | 3574 | ||
3184 | WARN_ON(test_bit(__E1000_RESETTING, &adapter->state)); | 3575 | WARN_ON(test_bit(__E1000_RESETTING, &adapter->state)); |
3185 | e1000e_down(adapter); | 3576 | |
3577 | pm_runtime_get_sync(&pdev->dev); | ||
3578 | |||
3579 | if (!test_bit(__E1000_DOWN, &adapter->state)) { | ||
3580 | e1000e_down(adapter); | ||
3581 | e1000_free_irq(adapter); | ||
3582 | } | ||
3186 | e1000_power_down_phy(adapter); | 3583 | e1000_power_down_phy(adapter); |
3187 | e1000_free_irq(adapter); | ||
3188 | 3584 | ||
3189 | e1000e_free_tx_resources(adapter); | 3585 | e1000e_free_tx_resources(adapter); |
3190 | e1000e_free_rx_resources(adapter); | 3586 | e1000e_free_rx_resources(adapter); |
@@ -3206,6 +3602,8 @@ static int e1000_close(struct net_device *netdev) | |||
3206 | if (adapter->flags & FLAG_HAS_AMT) | 3602 | if (adapter->flags & FLAG_HAS_AMT) |
3207 | e1000_release_hw_control(adapter); | 3603 | e1000_release_hw_control(adapter); |
3208 | 3604 | ||
3605 | pm_runtime_put_sync(&pdev->dev); | ||
3606 | |||
3209 | return 0; | 3607 | return 0; |
3210 | } | 3608 | } |
3211 | /** | 3609 | /** |
@@ -3550,6 +3948,9 @@ static void e1000_watchdog_task(struct work_struct *work) | |||
3550 | 3948 | ||
3551 | link = e1000e_has_link(adapter); | 3949 | link = e1000e_has_link(adapter); |
3552 | if ((netif_carrier_ok(netdev)) && link) { | 3950 | if ((netif_carrier_ok(netdev)) && link) { |
3951 | /* Cancel scheduled suspend requests. */ | ||
3952 | pm_runtime_resume(netdev->dev.parent); | ||
3953 | |||
3553 | e1000e_enable_receives(adapter); | 3954 | e1000e_enable_receives(adapter); |
3554 | goto link_up; | 3955 | goto link_up; |
3555 | } | 3956 | } |
@@ -3561,6 +3962,10 @@ static void e1000_watchdog_task(struct work_struct *work) | |||
3561 | if (link) { | 3962 | if (link) { |
3562 | if (!netif_carrier_ok(netdev)) { | 3963 | if (!netif_carrier_ok(netdev)) { |
3563 | bool txb2b = 1; | 3964 | bool txb2b = 1; |
3965 | |||
3966 | /* Cancel scheduled suspend requests. */ | ||
3967 | pm_runtime_resume(netdev->dev.parent); | ||
3968 | |||
3564 | /* update snapshot of PHY registers on LSC */ | 3969 | /* update snapshot of PHY registers on LSC */ |
3565 | e1000_phy_read_status(adapter); | 3970 | e1000_phy_read_status(adapter); |
3566 | mac->ops.get_link_up_info(&adapter->hw, | 3971 | mac->ops.get_link_up_info(&adapter->hw, |
@@ -3670,6 +4075,9 @@ static void e1000_watchdog_task(struct work_struct *work) | |||
3670 | 4075 | ||
3671 | if (adapter->flags & FLAG_RX_NEEDS_RESTART) | 4076 | if (adapter->flags & FLAG_RX_NEEDS_RESTART) |
3672 | schedule_work(&adapter->reset_task); | 4077 | schedule_work(&adapter->reset_task); |
4078 | else | ||
4079 | pm_schedule_suspend(netdev->dev.parent, | ||
4080 | LINK_TIMEOUT); | ||
3673 | } | 4081 | } |
3674 | } | 4082 | } |
3675 | 4083 | ||
@@ -3705,6 +4113,22 @@ link_up: | |||
3705 | } | 4113 | } |
3706 | } | 4114 | } |
3707 | 4115 | ||
4116 | /* Simple mode for Interrupt Throttle Rate (ITR) */ | ||
4117 | if (adapter->itr_setting == 4) { | ||
4118 | /* | ||
4119 | * Symmetric Tx/Rx gets a reduced ITR=2000; | ||
4120 | * Total asymmetrical Tx or Rx gets ITR=8000; | ||
4121 | * everyone else is between 2000-8000. | ||
4122 | */ | ||
4123 | u32 goc = (adapter->gotc + adapter->gorc) / 10000; | ||
4124 | u32 dif = (adapter->gotc > adapter->gorc ? | ||
4125 | adapter->gotc - adapter->gorc : | ||
4126 | adapter->gorc - adapter->gotc) / 10000; | ||
4127 | u32 itr = goc > 0 ? (dif * 6000 / goc + 2000) : 8000; | ||
4128 | |||
4129 | ew32(ITR, 1000000000 / (itr * 256)); | ||
4130 | } | ||
4131 | |||
3708 | /* Cause software interrupt to ensure Rx ring is cleaned */ | 4132 | /* Cause software interrupt to ensure Rx ring is cleaned */ |
3709 | if (adapter->msix_entries) | 4133 | if (adapter->msix_entries) |
3710 | ew32(ICS, adapter->rx_ring->ims_val); | 4134 | ew32(ICS, adapter->rx_ring->ims_val); |
@@ -3879,7 +4303,7 @@ static int e1000_tx_map(struct e1000_adapter *adapter, | |||
3879 | struct e1000_buffer *buffer_info; | 4303 | struct e1000_buffer *buffer_info; |
3880 | unsigned int len = skb_headlen(skb); | 4304 | unsigned int len = skb_headlen(skb); |
3881 | unsigned int offset = 0, size, count = 0, i; | 4305 | unsigned int offset = 0, size, count = 0, i; |
3882 | unsigned int f; | 4306 | unsigned int f, bytecount, segs; |
3883 | 4307 | ||
3884 | i = tx_ring->next_to_use; | 4308 | i = tx_ring->next_to_use; |
3885 | 4309 | ||
@@ -3890,10 +4314,11 @@ static int e1000_tx_map(struct e1000_adapter *adapter, | |||
3890 | buffer_info->length = size; | 4314 | buffer_info->length = size; |
3891 | buffer_info->time_stamp = jiffies; | 4315 | buffer_info->time_stamp = jiffies; |
3892 | buffer_info->next_to_watch = i; | 4316 | buffer_info->next_to_watch = i; |
3893 | buffer_info->dma = pci_map_single(pdev, skb->data + offset, | 4317 | buffer_info->dma = dma_map_single(&pdev->dev, |
3894 | size, PCI_DMA_TODEVICE); | 4318 | skb->data + offset, |
4319 | size, DMA_TO_DEVICE); | ||
3895 | buffer_info->mapped_as_page = false; | 4320 | buffer_info->mapped_as_page = false; |
3896 | if (pci_dma_mapping_error(pdev, buffer_info->dma)) | 4321 | if (dma_mapping_error(&pdev->dev, buffer_info->dma)) |
3897 | goto dma_error; | 4322 | goto dma_error; |
3898 | 4323 | ||
3899 | len -= size; | 4324 | len -= size; |
@@ -3925,11 +4350,11 @@ static int e1000_tx_map(struct e1000_adapter *adapter, | |||
3925 | buffer_info->length = size; | 4350 | buffer_info->length = size; |
3926 | buffer_info->time_stamp = jiffies; | 4351 | buffer_info->time_stamp = jiffies; |
3927 | buffer_info->next_to_watch = i; | 4352 | buffer_info->next_to_watch = i; |
3928 | buffer_info->dma = pci_map_page(pdev, frag->page, | 4353 | buffer_info->dma = dma_map_page(&pdev->dev, frag->page, |
3929 | offset, size, | 4354 | offset, size, |
3930 | PCI_DMA_TODEVICE); | 4355 | DMA_TO_DEVICE); |
3931 | buffer_info->mapped_as_page = true; | 4356 | buffer_info->mapped_as_page = true; |
3932 | if (pci_dma_mapping_error(pdev, buffer_info->dma)) | 4357 | if (dma_mapping_error(&pdev->dev, buffer_info->dma)) |
3933 | goto dma_error; | 4358 | goto dma_error; |
3934 | 4359 | ||
3935 | len -= size; | 4360 | len -= size; |
@@ -3938,7 +4363,13 @@ static int e1000_tx_map(struct e1000_adapter *adapter, | |||
3938 | } | 4363 | } |
3939 | } | 4364 | } |
3940 | 4365 | ||
4366 | segs = skb_shinfo(skb)->gso_segs ?: 1; | ||
4367 | /* multiply data chunks by size of headers */ | ||
4368 | bytecount = ((segs - 1) * skb_headlen(skb)) + skb->len; | ||
4369 | |||
3941 | tx_ring->buffer_info[i].skb = skb; | 4370 | tx_ring->buffer_info[i].skb = skb; |
4371 | tx_ring->buffer_info[i].segs = segs; | ||
4372 | tx_ring->buffer_info[i].bytecount = bytecount; | ||
3942 | tx_ring->buffer_info[first].next_to_watch = i; | 4373 | tx_ring->buffer_info[first].next_to_watch = i; |
3943 | 4374 | ||
3944 | return count; | 4375 | return count; |
@@ -4105,7 +4536,7 @@ static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb, | |||
4105 | unsigned int max_per_txd = E1000_MAX_PER_TXD; | 4536 | unsigned int max_per_txd = E1000_MAX_PER_TXD; |
4106 | unsigned int max_txd_pwr = E1000_MAX_TXD_PWR; | 4537 | unsigned int max_txd_pwr = E1000_MAX_TXD_PWR; |
4107 | unsigned int tx_flags = 0; | 4538 | unsigned int tx_flags = 0; |
4108 | unsigned int len = skb->len - skb->data_len; | 4539 | unsigned int len = skb_headlen(skb); |
4109 | unsigned int nr_frags; | 4540 | unsigned int nr_frags; |
4110 | unsigned int mss; | 4541 | unsigned int mss; |
4111 | int count = 0; | 4542 | int count = 0; |
@@ -4155,7 +4586,7 @@ static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb, | |||
4155 | dev_kfree_skb_any(skb); | 4586 | dev_kfree_skb_any(skb); |
4156 | return NETDEV_TX_OK; | 4587 | return NETDEV_TX_OK; |
4157 | } | 4588 | } |
4158 | len = skb->len - skb->data_len; | 4589 | len = skb_headlen(skb); |
4159 | } | 4590 | } |
4160 | } | 4591 | } |
4161 | 4592 | ||
@@ -4241,6 +4672,8 @@ static void e1000_reset_task(struct work_struct *work) | |||
4241 | struct e1000_adapter *adapter; | 4672 | struct e1000_adapter *adapter; |
4242 | adapter = container_of(work, struct e1000_adapter, reset_task); | 4673 | adapter = container_of(work, struct e1000_adapter, reset_task); |
4243 | 4674 | ||
4675 | e1000e_dump(adapter); | ||
4676 | e_err("Reset adapter\n"); | ||
4244 | e1000e_reinit_locked(adapter); | 4677 | e1000e_reinit_locked(adapter); |
4245 | } | 4678 | } |
4246 | 4679 | ||
@@ -4283,6 +4716,14 @@ static int e1000_change_mtu(struct net_device *netdev, int new_mtu) | |||
4283 | return -EINVAL; | 4716 | return -EINVAL; |
4284 | } | 4717 | } |
4285 | 4718 | ||
4719 | /* 82573 Errata 17 */ | ||
4720 | if (((adapter->hw.mac.type == e1000_82573) || | ||
4721 | (adapter->hw.mac.type == e1000_82574)) && | ||
4722 | (max_frame > ETH_FRAME_LEN + ETH_FCS_LEN)) { | ||
4723 | adapter->flags2 |= FLAG2_DISABLE_ASPM_L1; | ||
4724 | e1000e_disable_aspm(adapter->pdev, PCIE_LINK_STATE_L1); | ||
4725 | } | ||
4726 | |||
4286 | while (test_and_set_bit(__E1000_RESETTING, &adapter->state)) | 4727 | while (test_and_set_bit(__E1000_RESETTING, &adapter->state)) |
4287 | msleep(1); | 4728 | msleep(1); |
4288 | /* e1000e_down -> e1000e_reset dependent on max_frame_size & mtu */ | 4729 | /* e1000e_down -> e1000e_reset dependent on max_frame_size & mtu */ |
@@ -4467,13 +4908,15 @@ out: | |||
4467 | return retval; | 4908 | return retval; |
4468 | } | 4909 | } |
4469 | 4910 | ||
4470 | static int __e1000_shutdown(struct pci_dev *pdev, bool *enable_wake) | 4911 | static int __e1000_shutdown(struct pci_dev *pdev, bool *enable_wake, |
4912 | bool runtime) | ||
4471 | { | 4913 | { |
4472 | struct net_device *netdev = pci_get_drvdata(pdev); | 4914 | struct net_device *netdev = pci_get_drvdata(pdev); |
4473 | struct e1000_adapter *adapter = netdev_priv(netdev); | 4915 | struct e1000_adapter *adapter = netdev_priv(netdev); |
4474 | struct e1000_hw *hw = &adapter->hw; | 4916 | struct e1000_hw *hw = &adapter->hw; |
4475 | u32 ctrl, ctrl_ext, rctl, status; | 4917 | u32 ctrl, ctrl_ext, rctl, status; |
4476 | u32 wufc = adapter->wol; | 4918 | /* Runtime suspend should only enable wakeup for link changes */ |
4919 | u32 wufc = runtime ? E1000_WUFC_LNKC : adapter->wol; | ||
4477 | int retval = 0; | 4920 | int retval = 0; |
4478 | 4921 | ||
4479 | netif_device_detach(netdev); | 4922 | netif_device_detach(netdev); |
@@ -4605,45 +5048,51 @@ static void e1000_complete_shutdown(struct pci_dev *pdev, bool sleep, | |||
4605 | } | 5048 | } |
4606 | } | 5049 | } |
4607 | 5050 | ||
4608 | static void e1000e_disable_l1aspm(struct pci_dev *pdev) | 5051 | #ifdef CONFIG_PCIEASPM |
5052 | static void __e1000e_disable_aspm(struct pci_dev *pdev, u16 state) | ||
5053 | { | ||
5054 | pci_disable_link_state(pdev, state); | ||
5055 | } | ||
5056 | #else | ||
5057 | static void __e1000e_disable_aspm(struct pci_dev *pdev, u16 state) | ||
4609 | { | 5058 | { |
4610 | int pos; | 5059 | int pos; |
4611 | u16 val; | 5060 | u16 reg16; |
4612 | 5061 | ||
4613 | /* | 5062 | /* |
4614 | * 82573 workaround - disable L1 ASPM on mobile chipsets | 5063 | * Both device and parent should have the same ASPM setting. |
4615 | * | 5064 | * Disable ASPM in downstream component first and then upstream. |
4616 | * L1 ASPM on various mobile (ich7) chipsets do not behave properly | ||
4617 | * resulting in lost data or garbage information on the pci-e link | ||
4618 | * level. This could result in (false) bad EEPROM checksum errors, | ||
4619 | * long ping times (up to 2s) or even a system freeze/hang. | ||
4620 | * | ||
4621 | * Unfortunately this feature saves about 1W power consumption when | ||
4622 | * active. | ||
4623 | */ | 5065 | */ |
4624 | pos = pci_find_capability(pdev, PCI_CAP_ID_EXP); | 5066 | pos = pci_pcie_cap(pdev); |
4625 | pci_read_config_word(pdev, pos + PCI_EXP_LNKCTL, &val); | 5067 | pci_read_config_word(pdev, pos + PCI_EXP_LNKCTL, ®16); |
4626 | if (val & 0x2) { | 5068 | reg16 &= ~state; |
4627 | dev_warn(&pdev->dev, "Disabling L1 ASPM\n"); | 5069 | pci_write_config_word(pdev, pos + PCI_EXP_LNKCTL, reg16); |
4628 | val &= ~0x2; | 5070 | |
4629 | pci_write_config_word(pdev, pos + PCI_EXP_LNKCTL, val); | 5071 | if (!pdev->bus->self) |
4630 | } | 5072 | return; |
4631 | } | ||
4632 | 5073 | ||
4633 | #ifdef CONFIG_PM | 5074 | pos = pci_pcie_cap(pdev->bus->self); |
4634 | static int e1000_suspend(struct pci_dev *pdev, pm_message_t state) | 5075 | pci_read_config_word(pdev->bus->self, pos + PCI_EXP_LNKCTL, ®16); |
5076 | reg16 &= ~state; | ||
5077 | pci_write_config_word(pdev->bus->self, pos + PCI_EXP_LNKCTL, reg16); | ||
5078 | } | ||
5079 | #endif | ||
5080 | void e1000e_disable_aspm(struct pci_dev *pdev, u16 state) | ||
4635 | { | 5081 | { |
4636 | int retval; | 5082 | dev_info(&pdev->dev, "Disabling ASPM %s %s\n", |
4637 | bool wake; | 5083 | (state & PCIE_LINK_STATE_L0S) ? "L0s" : "", |
5084 | (state & PCIE_LINK_STATE_L1) ? "L1" : ""); | ||
4638 | 5085 | ||
4639 | retval = __e1000_shutdown(pdev, &wake); | 5086 | __e1000e_disable_aspm(pdev, state); |
4640 | if (!retval) | 5087 | } |
4641 | e1000_complete_shutdown(pdev, true, wake); | ||
4642 | 5088 | ||
4643 | return retval; | 5089 | #ifdef CONFIG_PM_OPS |
5090 | static bool e1000e_pm_ready(struct e1000_adapter *adapter) | ||
5091 | { | ||
5092 | return !!adapter->tx_ring->buffer_info; | ||
4644 | } | 5093 | } |
4645 | 5094 | ||
4646 | static int e1000_resume(struct pci_dev *pdev) | 5095 | static int __e1000_resume(struct pci_dev *pdev) |
4647 | { | 5096 | { |
4648 | struct net_device *netdev = pci_get_drvdata(pdev); | 5097 | struct net_device *netdev = pci_get_drvdata(pdev); |
4649 | struct e1000_adapter *adapter = netdev_priv(netdev); | 5098 | struct e1000_adapter *adapter = netdev_priv(netdev); |
@@ -4653,19 +5102,8 @@ static int e1000_resume(struct pci_dev *pdev) | |||
4653 | pci_set_power_state(pdev, PCI_D0); | 5102 | pci_set_power_state(pdev, PCI_D0); |
4654 | pci_restore_state(pdev); | 5103 | pci_restore_state(pdev); |
4655 | pci_save_state(pdev); | 5104 | pci_save_state(pdev); |
4656 | e1000e_disable_l1aspm(pdev); | 5105 | if (adapter->flags2 & FLAG2_DISABLE_ASPM_L1) |
4657 | 5106 | e1000e_disable_aspm(pdev, PCIE_LINK_STATE_L1); | |
4658 | err = pci_enable_device_mem(pdev); | ||
4659 | if (err) { | ||
4660 | dev_err(&pdev->dev, | ||
4661 | "Cannot enable PCI device from suspend\n"); | ||
4662 | return err; | ||
4663 | } | ||
4664 | |||
4665 | pci_set_master(pdev); | ||
4666 | |||
4667 | pci_enable_wake(pdev, PCI_D3hot, 0); | ||
4668 | pci_enable_wake(pdev, PCI_D3cold, 0); | ||
4669 | 5107 | ||
4670 | e1000e_set_interrupt_capability(adapter); | 5108 | e1000e_set_interrupt_capability(adapter); |
4671 | if (netif_running(netdev)) { | 5109 | if (netif_running(netdev)) { |
@@ -4707,7 +5145,7 @@ static int e1000_resume(struct pci_dev *pdev) | |||
4707 | 5145 | ||
4708 | e1000e_reset(adapter); | 5146 | e1000e_reset(adapter); |
4709 | 5147 | ||
4710 | e1000_init_manageability(adapter); | 5148 | e1000_init_manageability_pt(adapter); |
4711 | 5149 | ||
4712 | if (netif_running(netdev)) | 5150 | if (netif_running(netdev)) |
4713 | e1000e_up(adapter); | 5151 | e1000e_up(adapter); |
@@ -4724,13 +5162,88 @@ static int e1000_resume(struct pci_dev *pdev) | |||
4724 | 5162 | ||
4725 | return 0; | 5163 | return 0; |
4726 | } | 5164 | } |
4727 | #endif | 5165 | |
5166 | #ifdef CONFIG_PM_SLEEP | ||
5167 | static int e1000_suspend(struct device *dev) | ||
5168 | { | ||
5169 | struct pci_dev *pdev = to_pci_dev(dev); | ||
5170 | int retval; | ||
5171 | bool wake; | ||
5172 | |||
5173 | retval = __e1000_shutdown(pdev, &wake, false); | ||
5174 | if (!retval) | ||
5175 | e1000_complete_shutdown(pdev, true, wake); | ||
5176 | |||
5177 | return retval; | ||
5178 | } | ||
5179 | |||
5180 | static int e1000_resume(struct device *dev) | ||
5181 | { | ||
5182 | struct pci_dev *pdev = to_pci_dev(dev); | ||
5183 | struct net_device *netdev = pci_get_drvdata(pdev); | ||
5184 | struct e1000_adapter *adapter = netdev_priv(netdev); | ||
5185 | |||
5186 | if (e1000e_pm_ready(adapter)) | ||
5187 | adapter->idle_check = true; | ||
5188 | |||
5189 | return __e1000_resume(pdev); | ||
5190 | } | ||
5191 | #endif /* CONFIG_PM_SLEEP */ | ||
5192 | |||
5193 | #ifdef CONFIG_PM_RUNTIME | ||
5194 | static int e1000_runtime_suspend(struct device *dev) | ||
5195 | { | ||
5196 | struct pci_dev *pdev = to_pci_dev(dev); | ||
5197 | struct net_device *netdev = pci_get_drvdata(pdev); | ||
5198 | struct e1000_adapter *adapter = netdev_priv(netdev); | ||
5199 | |||
5200 | if (e1000e_pm_ready(adapter)) { | ||
5201 | bool wake; | ||
5202 | |||
5203 | __e1000_shutdown(pdev, &wake, true); | ||
5204 | } | ||
5205 | |||
5206 | return 0; | ||
5207 | } | ||
5208 | |||
5209 | static int e1000_idle(struct device *dev) | ||
5210 | { | ||
5211 | struct pci_dev *pdev = to_pci_dev(dev); | ||
5212 | struct net_device *netdev = pci_get_drvdata(pdev); | ||
5213 | struct e1000_adapter *adapter = netdev_priv(netdev); | ||
5214 | |||
5215 | if (!e1000e_pm_ready(adapter)) | ||
5216 | return 0; | ||
5217 | |||
5218 | if (adapter->idle_check) { | ||
5219 | adapter->idle_check = false; | ||
5220 | if (!e1000e_has_link(adapter)) | ||
5221 | pm_schedule_suspend(dev, MSEC_PER_SEC); | ||
5222 | } | ||
5223 | |||
5224 | return -EBUSY; | ||
5225 | } | ||
5226 | |||
5227 | static int e1000_runtime_resume(struct device *dev) | ||
5228 | { | ||
5229 | struct pci_dev *pdev = to_pci_dev(dev); | ||
5230 | struct net_device *netdev = pci_get_drvdata(pdev); | ||
5231 | struct e1000_adapter *adapter = netdev_priv(netdev); | ||
5232 | |||
5233 | if (!e1000e_pm_ready(adapter)) | ||
5234 | return 0; | ||
5235 | |||
5236 | adapter->idle_check = !dev->power.runtime_auto; | ||
5237 | return __e1000_resume(pdev); | ||
5238 | } | ||
5239 | #endif /* CONFIG_PM_RUNTIME */ | ||
5240 | #endif /* CONFIG_PM_OPS */ | ||
4728 | 5241 | ||
4729 | static void e1000_shutdown(struct pci_dev *pdev) | 5242 | static void e1000_shutdown(struct pci_dev *pdev) |
4730 | { | 5243 | { |
4731 | bool wake = false; | 5244 | bool wake = false; |
4732 | 5245 | ||
4733 | __e1000_shutdown(pdev, &wake); | 5246 | __e1000_shutdown(pdev, &wake, false); |
4734 | 5247 | ||
4735 | if (system_state == SYSTEM_POWER_OFF) | 5248 | if (system_state == SYSTEM_POWER_OFF) |
4736 | e1000_complete_shutdown(pdev, false, wake); | 5249 | e1000_complete_shutdown(pdev, false, wake); |
@@ -4795,7 +5308,8 @@ static pci_ers_result_t e1000_io_slot_reset(struct pci_dev *pdev) | |||
4795 | int err; | 5308 | int err; |
4796 | pci_ers_result_t result; | 5309 | pci_ers_result_t result; |
4797 | 5310 | ||
4798 | e1000e_disable_l1aspm(pdev); | 5311 | if (adapter->flags2 & FLAG2_DISABLE_ASPM_L1) |
5312 | e1000e_disable_aspm(pdev, PCIE_LINK_STATE_L1); | ||
4799 | err = pci_enable_device_mem(pdev); | 5313 | err = pci_enable_device_mem(pdev); |
4800 | if (err) { | 5314 | if (err) { |
4801 | dev_err(&pdev->dev, | 5315 | dev_err(&pdev->dev, |
@@ -4803,8 +5317,8 @@ static pci_ers_result_t e1000_io_slot_reset(struct pci_dev *pdev) | |||
4803 | result = PCI_ERS_RESULT_DISCONNECT; | 5317 | result = PCI_ERS_RESULT_DISCONNECT; |
4804 | } else { | 5318 | } else { |
4805 | pci_set_master(pdev); | 5319 | pci_set_master(pdev); |
5320 | pdev->state_saved = true; | ||
4806 | pci_restore_state(pdev); | 5321 | pci_restore_state(pdev); |
4807 | pci_save_state(pdev); | ||
4808 | 5322 | ||
4809 | pci_enable_wake(pdev, PCI_D3hot, 0); | 5323 | pci_enable_wake(pdev, PCI_D3hot, 0); |
4810 | pci_enable_wake(pdev, PCI_D3cold, 0); | 5324 | pci_enable_wake(pdev, PCI_D3cold, 0); |
@@ -4832,7 +5346,7 @@ static void e1000_io_resume(struct pci_dev *pdev) | |||
4832 | struct net_device *netdev = pci_get_drvdata(pdev); | 5346 | struct net_device *netdev = pci_get_drvdata(pdev); |
4833 | struct e1000_adapter *adapter = netdev_priv(netdev); | 5347 | struct e1000_adapter *adapter = netdev_priv(netdev); |
4834 | 5348 | ||
4835 | e1000_init_manageability(adapter); | 5349 | e1000_init_manageability_pt(adapter); |
4836 | 5350 | ||
4837 | if (netif_running(netdev)) { | 5351 | if (netif_running(netdev)) { |
4838 | if (e1000e_up(adapter)) { | 5352 | if (e1000e_up(adapter)) { |
@@ -4889,13 +5403,6 @@ static void e1000_eeprom_checks(struct e1000_adapter *adapter) | |||
4889 | dev_warn(&adapter->pdev->dev, | 5403 | dev_warn(&adapter->pdev->dev, |
4890 | "Warning: detected DSPD enabled in EEPROM\n"); | 5404 | "Warning: detected DSPD enabled in EEPROM\n"); |
4891 | } | 5405 | } |
4892 | |||
4893 | ret_val = e1000_read_nvm(hw, NVM_INIT_3GIO_3, 1, &buf); | ||
4894 | if (!ret_val && (le16_to_cpu(buf) & (3 << 2))) { | ||
4895 | /* ASPM enable */ | ||
4896 | dev_warn(&adapter->pdev->dev, | ||
4897 | "Warning: detected ASPM enabled in EEPROM\n"); | ||
4898 | } | ||
4899 | } | 5406 | } |
4900 | 5407 | ||
4901 | static const struct net_device_ops e1000e_netdev_ops = { | 5408 | static const struct net_device_ops e1000e_netdev_ops = { |
@@ -4944,23 +5451,24 @@ static int __devinit e1000_probe(struct pci_dev *pdev, | |||
4944 | u16 eeprom_data = 0; | 5451 | u16 eeprom_data = 0; |
4945 | u16 eeprom_apme_mask = E1000_EEPROM_APME; | 5452 | u16 eeprom_apme_mask = E1000_EEPROM_APME; |
4946 | 5453 | ||
4947 | e1000e_disable_l1aspm(pdev); | 5454 | if (ei->flags2 & FLAG2_DISABLE_ASPM_L1) |
5455 | e1000e_disable_aspm(pdev, PCIE_LINK_STATE_L1); | ||
4948 | 5456 | ||
4949 | err = pci_enable_device_mem(pdev); | 5457 | err = pci_enable_device_mem(pdev); |
4950 | if (err) | 5458 | if (err) |
4951 | return err; | 5459 | return err; |
4952 | 5460 | ||
4953 | pci_using_dac = 0; | 5461 | pci_using_dac = 0; |
4954 | err = pci_set_dma_mask(pdev, DMA_BIT_MASK(64)); | 5462 | err = dma_set_mask(&pdev->dev, DMA_BIT_MASK(64)); |
4955 | if (!err) { | 5463 | if (!err) { |
4956 | err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64)); | 5464 | err = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(64)); |
4957 | if (!err) | 5465 | if (!err) |
4958 | pci_using_dac = 1; | 5466 | pci_using_dac = 1; |
4959 | } else { | 5467 | } else { |
4960 | err = pci_set_dma_mask(pdev, DMA_BIT_MASK(32)); | 5468 | err = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32)); |
4961 | if (err) { | 5469 | if (err) { |
4962 | err = pci_set_consistent_dma_mask(pdev, | 5470 | err = dma_set_coherent_mask(&pdev->dev, |
4963 | DMA_BIT_MASK(32)); | 5471 | DMA_BIT_MASK(32)); |
4964 | if (err) { | 5472 | if (err) { |
4965 | dev_err(&pdev->dev, "No usable DMA " | 5473 | dev_err(&pdev->dev, "No usable DMA " |
4966 | "configuration, aborting\n"); | 5474 | "configuration, aborting\n"); |
@@ -4991,6 +5499,8 @@ static int __devinit e1000_probe(struct pci_dev *pdev, | |||
4991 | 5499 | ||
4992 | SET_NETDEV_DEV(netdev, &pdev->dev); | 5500 | SET_NETDEV_DEV(netdev, &pdev->dev); |
4993 | 5501 | ||
5502 | netdev->irq = pdev->irq; | ||
5503 | |||
4994 | pci_set_drvdata(pdev, netdev); | 5504 | pci_set_drvdata(pdev, netdev); |
4995 | adapter = netdev_priv(netdev); | 5505 | adapter = netdev_priv(netdev); |
4996 | hw = &adapter->hw; | 5506 | hw = &adapter->hw; |
@@ -5211,6 +5721,12 @@ static int __devinit e1000_probe(struct pci_dev *pdev, | |||
5211 | 5721 | ||
5212 | e1000_print_device_info(adapter); | 5722 | e1000_print_device_info(adapter); |
5213 | 5723 | ||
5724 | if (pci_dev_run_wake(pdev)) { | ||
5725 | pm_runtime_set_active(&pdev->dev); | ||
5726 | pm_runtime_enable(&pdev->dev); | ||
5727 | } | ||
5728 | pm_schedule_suspend(&pdev->dev, MSEC_PER_SEC); | ||
5729 | |||
5214 | return 0; | 5730 | return 0; |
5215 | 5731 | ||
5216 | err_register: | 5732 | err_register: |
@@ -5253,12 +5769,16 @@ static void __devexit e1000_remove(struct pci_dev *pdev) | |||
5253 | { | 5769 | { |
5254 | struct net_device *netdev = pci_get_drvdata(pdev); | 5770 | struct net_device *netdev = pci_get_drvdata(pdev); |
5255 | struct e1000_adapter *adapter = netdev_priv(netdev); | 5771 | struct e1000_adapter *adapter = netdev_priv(netdev); |
5772 | bool down = test_bit(__E1000_DOWN, &adapter->state); | ||
5773 | |||
5774 | pm_runtime_get_sync(&pdev->dev); | ||
5256 | 5775 | ||
5257 | /* | 5776 | /* |
5258 | * flush_scheduled work may reschedule our watchdog task, so | 5777 | * flush_scheduled work may reschedule our watchdog task, so |
5259 | * explicitly disable watchdog tasks from being rescheduled | 5778 | * explicitly disable watchdog tasks from being rescheduled |
5260 | */ | 5779 | */ |
5261 | set_bit(__E1000_DOWN, &adapter->state); | 5780 | if (!down) |
5781 | set_bit(__E1000_DOWN, &adapter->state); | ||
5262 | del_timer_sync(&adapter->watchdog_timer); | 5782 | del_timer_sync(&adapter->watchdog_timer); |
5263 | del_timer_sync(&adapter->phy_info_timer); | 5783 | del_timer_sync(&adapter->phy_info_timer); |
5264 | 5784 | ||
@@ -5272,8 +5792,17 @@ static void __devexit e1000_remove(struct pci_dev *pdev) | |||
5272 | if (!(netdev->flags & IFF_UP)) | 5792 | if (!(netdev->flags & IFF_UP)) |
5273 | e1000_power_down_phy(adapter); | 5793 | e1000_power_down_phy(adapter); |
5274 | 5794 | ||
5795 | /* Don't lie to e1000_close() down the road. */ | ||
5796 | if (!down) | ||
5797 | clear_bit(__E1000_DOWN, &adapter->state); | ||
5275 | unregister_netdev(netdev); | 5798 | unregister_netdev(netdev); |
5276 | 5799 | ||
5800 | if (pci_dev_run_wake(pdev)) { | ||
5801 | pm_runtime_disable(&pdev->dev); | ||
5802 | pm_runtime_set_suspended(&pdev->dev); | ||
5803 | } | ||
5804 | pm_runtime_put_noidle(&pdev->dev); | ||
5805 | |||
5277 | /* | 5806 | /* |
5278 | * Release control of h/w to f/w. If f/w is AMT enabled, this | 5807 | * Release control of h/w to f/w. If f/w is AMT enabled, this |
5279 | * would have already happened in close and is redundant. | 5808 | * would have already happened in close and is redundant. |
@@ -5363,6 +5892,7 @@ static DEFINE_PCI_DEVICE_TABLE(e1000_pci_tbl) = { | |||
5363 | 5892 | ||
5364 | { PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH10_D_BM_LM), board_ich10lan }, | 5893 | { PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH10_D_BM_LM), board_ich10lan }, |
5365 | { PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH10_D_BM_LF), board_ich10lan }, | 5894 | { PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH10_D_BM_LF), board_ich10lan }, |
5895 | { PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH10_D_BM_V), board_ich10lan }, | ||
5366 | 5896 | ||
5367 | { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_M_HV_LM), board_pchlan }, | 5897 | { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_M_HV_LM), board_pchlan }, |
5368 | { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_M_HV_LC), board_pchlan }, | 5898 | { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_M_HV_LC), board_pchlan }, |
@@ -5373,16 +5903,22 @@ static DEFINE_PCI_DEVICE_TABLE(e1000_pci_tbl) = { | |||
5373 | }; | 5903 | }; |
5374 | MODULE_DEVICE_TABLE(pci, e1000_pci_tbl); | 5904 | MODULE_DEVICE_TABLE(pci, e1000_pci_tbl); |
5375 | 5905 | ||
5906 | #ifdef CONFIG_PM_OPS | ||
5907 | static const struct dev_pm_ops e1000_pm_ops = { | ||
5908 | SET_SYSTEM_SLEEP_PM_OPS(e1000_suspend, e1000_resume) | ||
5909 | SET_RUNTIME_PM_OPS(e1000_runtime_suspend, | ||
5910 | e1000_runtime_resume, e1000_idle) | ||
5911 | }; | ||
5912 | #endif | ||
5913 | |||
5376 | /* PCI Device API Driver */ | 5914 | /* PCI Device API Driver */ |
5377 | static struct pci_driver e1000_driver = { | 5915 | static struct pci_driver e1000_driver = { |
5378 | .name = e1000e_driver_name, | 5916 | .name = e1000e_driver_name, |
5379 | .id_table = e1000_pci_tbl, | 5917 | .id_table = e1000_pci_tbl, |
5380 | .probe = e1000_probe, | 5918 | .probe = e1000_probe, |
5381 | .remove = __devexit_p(e1000_remove), | 5919 | .remove = __devexit_p(e1000_remove), |
5382 | #ifdef CONFIG_PM | 5920 | #ifdef CONFIG_PM_OPS |
5383 | /* Power Management Hooks */ | 5921 | .driver.pm = &e1000_pm_ops, |
5384 | .suspend = e1000_suspend, | ||
5385 | .resume = e1000_resume, | ||
5386 | #endif | 5922 | #endif |
5387 | .shutdown = e1000_shutdown, | 5923 | .shutdown = e1000_shutdown, |
5388 | .err_handler = &e1000_err_handler | 5924 | .err_handler = &e1000_err_handler |
@@ -5397,10 +5933,9 @@ static struct pci_driver e1000_driver = { | |||
5397 | static int __init e1000_init_module(void) | 5933 | static int __init e1000_init_module(void) |
5398 | { | 5934 | { |
5399 | int ret; | 5935 | int ret; |
5400 | printk(KERN_INFO "%s: Intel(R) PRO/1000 Network Driver - %s\n", | 5936 | pr_info("Intel(R) PRO/1000 Network Driver - %s\n", |
5401 | e1000e_driver_name, e1000e_driver_version); | 5937 | e1000e_driver_version); |
5402 | printk(KERN_INFO "%s: Copyright (c) 1999 - 2009 Intel Corporation.\n", | 5938 | pr_info("Copyright (c) 1999 - 2009 Intel Corporation.\n"); |
5403 | e1000e_driver_name); | ||
5404 | ret = pci_register_driver(&e1000_driver); | 5939 | ret = pci_register_driver(&e1000_driver); |
5405 | 5940 | ||
5406 | return ret; | 5941 | return ret; |
diff --git a/drivers/net/e1000e/param.c b/drivers/net/e1000e/param.c index 2e399778cae5..a150e48a117f 100644 --- a/drivers/net/e1000e/param.c +++ b/drivers/net/e1000e/param.c | |||
@@ -248,7 +248,7 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter) | |||
248 | } | 248 | } |
249 | 249 | ||
250 | { /* Transmit Interrupt Delay */ | 250 | { /* Transmit Interrupt Delay */ |
251 | const struct e1000_option opt = { | 251 | static const struct e1000_option opt = { |
252 | .type = range_option, | 252 | .type = range_option, |
253 | .name = "Transmit Interrupt Delay", | 253 | .name = "Transmit Interrupt Delay", |
254 | .err = "using default of " | 254 | .err = "using default of " |
@@ -267,7 +267,7 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter) | |||
267 | } | 267 | } |
268 | } | 268 | } |
269 | { /* Transmit Absolute Interrupt Delay */ | 269 | { /* Transmit Absolute Interrupt Delay */ |
270 | const struct e1000_option opt = { | 270 | static const struct e1000_option opt = { |
271 | .type = range_option, | 271 | .type = range_option, |
272 | .name = "Transmit Absolute Interrupt Delay", | 272 | .name = "Transmit Absolute Interrupt Delay", |
273 | .err = "using default of " | 273 | .err = "using default of " |
@@ -286,7 +286,7 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter) | |||
286 | } | 286 | } |
287 | } | 287 | } |
288 | { /* Receive Interrupt Delay */ | 288 | { /* Receive Interrupt Delay */ |
289 | struct e1000_option opt = { | 289 | static struct e1000_option opt = { |
290 | .type = range_option, | 290 | .type = range_option, |
291 | .name = "Receive Interrupt Delay", | 291 | .name = "Receive Interrupt Delay", |
292 | .err = "using default of " | 292 | .err = "using default of " |
@@ -305,7 +305,7 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter) | |||
305 | } | 305 | } |
306 | } | 306 | } |
307 | { /* Receive Absolute Interrupt Delay */ | 307 | { /* Receive Absolute Interrupt Delay */ |
308 | const struct e1000_option opt = { | 308 | static const struct e1000_option opt = { |
309 | .type = range_option, | 309 | .type = range_option, |
310 | .name = "Receive Absolute Interrupt Delay", | 310 | .name = "Receive Absolute Interrupt Delay", |
311 | .err = "using default of " | 311 | .err = "using default of " |
@@ -324,7 +324,7 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter) | |||
324 | } | 324 | } |
325 | } | 325 | } |
326 | { /* Interrupt Throttling Rate */ | 326 | { /* Interrupt Throttling Rate */ |
327 | const struct e1000_option opt = { | 327 | static const struct e1000_option opt = { |
328 | .type = range_option, | 328 | .type = range_option, |
329 | .name = "Interrupt Throttling Rate (ints/sec)", | 329 | .name = "Interrupt Throttling Rate (ints/sec)", |
330 | .err = "using default of " | 330 | .err = "using default of " |
@@ -351,6 +351,11 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter) | |||
351 | adapter->itr_setting = adapter->itr; | 351 | adapter->itr_setting = adapter->itr; |
352 | adapter->itr = 20000; | 352 | adapter->itr = 20000; |
353 | break; | 353 | break; |
354 | case 4: | ||
355 | e_info("%s set to simplified (2000-8000 ints) " | ||
356 | "mode\n", opt.name); | ||
357 | adapter->itr_setting = 4; | ||
358 | break; | ||
354 | default: | 359 | default: |
355 | /* | 360 | /* |
356 | * Save the setting, because the dynamic bits | 361 | * Save the setting, because the dynamic bits |
@@ -381,7 +386,7 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter) | |||
381 | } | 386 | } |
382 | } | 387 | } |
383 | { /* Interrupt Mode */ | 388 | { /* Interrupt Mode */ |
384 | struct e1000_option opt = { | 389 | static struct e1000_option opt = { |
385 | .type = range_option, | 390 | .type = range_option, |
386 | .name = "Interrupt Mode", | 391 | .name = "Interrupt Mode", |
387 | .err = "defaulting to 2 (MSI-X)", | 392 | .err = "defaulting to 2 (MSI-X)", |
@@ -399,7 +404,7 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter) | |||
399 | } | 404 | } |
400 | } | 405 | } |
401 | { /* Smart Power Down */ | 406 | { /* Smart Power Down */ |
402 | const struct e1000_option opt = { | 407 | static const struct e1000_option opt = { |
403 | .type = enable_option, | 408 | .type = enable_option, |
404 | .name = "PHY Smart Power Down", | 409 | .name = "PHY Smart Power Down", |
405 | .err = "defaulting to Disabled", | 410 | .err = "defaulting to Disabled", |
@@ -415,7 +420,7 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter) | |||
415 | } | 420 | } |
416 | } | 421 | } |
417 | { /* CRC Stripping */ | 422 | { /* CRC Stripping */ |
418 | const struct e1000_option opt = { | 423 | static const struct e1000_option opt = { |
419 | .type = enable_option, | 424 | .type = enable_option, |
420 | .name = "CRC Stripping", | 425 | .name = "CRC Stripping", |
421 | .err = "defaulting to enabled", | 426 | .err = "defaulting to enabled", |
@@ -432,7 +437,7 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter) | |||
432 | } | 437 | } |
433 | } | 438 | } |
434 | { /* Kumeran Lock Loss Workaround */ | 439 | { /* Kumeran Lock Loss Workaround */ |
435 | const struct e1000_option opt = { | 440 | static const struct e1000_option opt = { |
436 | .type = enable_option, | 441 | .type = enable_option, |
437 | .name = "Kumeran Lock Loss Workaround", | 442 | .name = "Kumeran Lock Loss Workaround", |
438 | .err = "defaulting to Enabled", | 443 | .err = "defaulting to Enabled", |
@@ -452,7 +457,7 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter) | |||
452 | } | 457 | } |
453 | } | 458 | } |
454 | { /* Write-protect NVM */ | 459 | { /* Write-protect NVM */ |
455 | const struct e1000_option opt = { | 460 | static const struct e1000_option opt = { |
456 | .type = enable_option, | 461 | .type = enable_option, |
457 | .name = "Write-protect NVM", | 462 | .name = "Write-protect NVM", |
458 | .err = "defaulting to Enabled", | 463 | .err = "defaulting to Enabled", |
diff --git a/drivers/net/e1000e/phy.c b/drivers/net/e1000e/phy.c index 7f3ceb9dad6a..b4ac82d51b20 100644 --- a/drivers/net/e1000e/phy.c +++ b/drivers/net/e1000e/phy.c | |||
@@ -3116,9 +3116,7 @@ s32 e1000_check_polarity_82577(struct e1000_hw *hw) | |||
3116 | * e1000_phy_force_speed_duplex_82577 - Force speed/duplex for I82577 PHY | 3116 | * e1000_phy_force_speed_duplex_82577 - Force speed/duplex for I82577 PHY |
3117 | * @hw: pointer to the HW structure | 3117 | * @hw: pointer to the HW structure |
3118 | * | 3118 | * |
3119 | * Calls the PHY setup function to force speed and duplex. Clears the | 3119 | * Calls the PHY setup function to force speed and duplex. |
3120 | * auto-crossover to force MDI manually. Waits for link and returns | ||
3121 | * successful if link up is successful, else -E1000_ERR_PHY (-2). | ||
3122 | **/ | 3120 | **/ |
3123 | s32 e1000_phy_force_speed_duplex_82577(struct e1000_hw *hw) | 3121 | s32 e1000_phy_force_speed_duplex_82577(struct e1000_hw *hw) |
3124 | { | 3122 | { |
@@ -3137,23 +3135,6 @@ s32 e1000_phy_force_speed_duplex_82577(struct e1000_hw *hw) | |||
3137 | if (ret_val) | 3135 | if (ret_val) |
3138 | goto out; | 3136 | goto out; |
3139 | 3137 | ||
3140 | /* | ||
3141 | * Clear Auto-Crossover to force MDI manually. 82577 requires MDI | ||
3142 | * forced whenever speed and duplex are forced. | ||
3143 | */ | ||
3144 | ret_val = phy->ops.read_reg(hw, I82577_PHY_CTRL_2, &phy_data); | ||
3145 | if (ret_val) | ||
3146 | goto out; | ||
3147 | |||
3148 | phy_data &= ~I82577_PHY_CTRL2_AUTO_MDIX; | ||
3149 | phy_data &= ~I82577_PHY_CTRL2_FORCE_MDI_MDIX; | ||
3150 | |||
3151 | ret_val = phy->ops.write_reg(hw, I82577_PHY_CTRL_2, phy_data); | ||
3152 | if (ret_val) | ||
3153 | goto out; | ||
3154 | |||
3155 | e_dbg("I82577_PHY_CTRL_2: %X\n", phy_data); | ||
3156 | |||
3157 | udelay(1); | 3138 | udelay(1); |
3158 | 3139 | ||
3159 | if (phy->autoneg_wait_to_complete) { | 3140 | if (phy->autoneg_wait_to_complete) { |