diff options
author | Auke Kok <auke\-jan.h.kok@intel.com> | 2006-11-01 11:47:30 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-12-02 00:11:58 -0500 |
commit | 90fb51358a264f2f7e0cabdca6fc229bbc40cd91 (patch) | |
tree | d473bdee8cc4588eb610c596e14effd329e86fe4 /drivers/net | |
parent | a362bf57aa12835e4fa6af6960e5135b5626bc5b (diff) |
e1000: whitespace changes, comments, typos
Small whitespace changes, comment changes, typo fixes.
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/e1000/e1000_ethtool.c | 27 | ||||
-rw-r--r-- | drivers/net/e1000/e1000_hw.c | 6 | ||||
-rw-r--r-- | drivers/net/e1000/e1000_hw.h | 5 | ||||
-rw-r--r-- | drivers/net/e1000/e1000_main.c | 101 | ||||
-rw-r--r-- | drivers/net/e1000/e1000_osdep.h | 1 |
5 files changed, 72 insertions, 68 deletions
diff --git a/drivers/net/e1000/e1000_ethtool.c b/drivers/net/e1000/e1000_ethtool.c index c564adbd669b..82d2c78e1696 100644 --- a/drivers/net/e1000/e1000_ethtool.c +++ b/drivers/net/e1000/e1000_ethtool.c | |||
@@ -133,9 +133,7 @@ e1000_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd) | |||
133 | 133 | ||
134 | if (hw->autoneg == 1) { | 134 | if (hw->autoneg == 1) { |
135 | ecmd->advertising |= ADVERTISED_Autoneg; | 135 | ecmd->advertising |= ADVERTISED_Autoneg; |
136 | |||
137 | /* the e1000 autoneg seems to match ethtool nicely */ | 136 | /* the e1000 autoneg seems to match ethtool nicely */ |
138 | |||
139 | ecmd->advertising |= hw->autoneg_advertised; | 137 | ecmd->advertising |= hw->autoneg_advertised; |
140 | } | 138 | } |
141 | 139 | ||
@@ -285,7 +283,7 @@ e1000_set_pauseparam(struct net_device *netdev, | |||
285 | e1000_reset(adapter); | 283 | e1000_reset(adapter); |
286 | } else | 284 | } else |
287 | retval = ((hw->media_type == e1000_media_type_fiber) ? | 285 | retval = ((hw->media_type == e1000_media_type_fiber) ? |
288 | e1000_setup_link(hw) : e1000_force_mac_fc(hw)); | 286 | e1000_setup_link(hw) : e1000_force_mac_fc(hw)); |
289 | 287 | ||
290 | clear_bit(__E1000_RESETTING, &adapter->flags); | 288 | clear_bit(__E1000_RESETTING, &adapter->flags); |
291 | return retval; | 289 | return retval; |
@@ -774,7 +772,7 @@ e1000_reg_test(struct e1000_adapter *adapter, uint64_t *data) | |||
774 | /* The status register is Read Only, so a write should fail. | 772 | /* The status register is Read Only, so a write should fail. |
775 | * Some bits that get toggled are ignored. | 773 | * Some bits that get toggled are ignored. |
776 | */ | 774 | */ |
777 | switch (adapter->hw.mac_type) { | 775 | switch (adapter->hw.mac_type) { |
778 | /* there are several bits on newer hardware that are r/w */ | 776 | /* there are several bits on newer hardware that are r/w */ |
779 | case e1000_82571: | 777 | case e1000_82571: |
780 | case e1000_82572: | 778 | case e1000_82572: |
@@ -802,12 +800,14 @@ e1000_reg_test(struct e1000_adapter *adapter, uint64_t *data) | |||
802 | } | 800 | } |
803 | /* restore previous status */ | 801 | /* restore previous status */ |
804 | E1000_WRITE_REG(&adapter->hw, STATUS, before); | 802 | E1000_WRITE_REG(&adapter->hw, STATUS, before); |
803 | |||
805 | if (adapter->hw.mac_type != e1000_ich8lan) { | 804 | if (adapter->hw.mac_type != e1000_ich8lan) { |
806 | REG_PATTERN_TEST(FCAL, 0xFFFFFFFF, 0xFFFFFFFF); | 805 | REG_PATTERN_TEST(FCAL, 0xFFFFFFFF, 0xFFFFFFFF); |
807 | REG_PATTERN_TEST(FCAH, 0x0000FFFF, 0xFFFFFFFF); | 806 | REG_PATTERN_TEST(FCAH, 0x0000FFFF, 0xFFFFFFFF); |
808 | REG_PATTERN_TEST(FCT, 0x0000FFFF, 0xFFFFFFFF); | 807 | REG_PATTERN_TEST(FCT, 0x0000FFFF, 0xFFFFFFFF); |
809 | REG_PATTERN_TEST(VET, 0x0000FFFF, 0xFFFFFFFF); | 808 | REG_PATTERN_TEST(VET, 0x0000FFFF, 0xFFFFFFFF); |
810 | } | 809 | } |
810 | |||
811 | REG_PATTERN_TEST(RDTR, 0x0000FFFF, 0xFFFFFFFF); | 811 | REG_PATTERN_TEST(RDTR, 0x0000FFFF, 0xFFFFFFFF); |
812 | REG_PATTERN_TEST(RDBAH, 0xFFFFFFFF, 0xFFFFFFFF); | 812 | REG_PATTERN_TEST(RDBAH, 0xFFFFFFFF, 0xFFFFFFFF); |
813 | REG_PATTERN_TEST(RDLEN, 0x000FFF80, 0x000FFFFF); | 813 | REG_PATTERN_TEST(RDLEN, 0x000FFF80, 0x000FFFFF); |
@@ -820,8 +820,9 @@ e1000_reg_test(struct e1000_adapter *adapter, uint64_t *data) | |||
820 | REG_PATTERN_TEST(TDLEN, 0x000FFF80, 0x000FFFFF); | 820 | REG_PATTERN_TEST(TDLEN, 0x000FFF80, 0x000FFFFF); |
821 | 821 | ||
822 | REG_SET_AND_CHECK(RCTL, 0xFFFFFFFF, 0x00000000); | 822 | REG_SET_AND_CHECK(RCTL, 0xFFFFFFFF, 0x00000000); |
823 | |||
823 | before = (adapter->hw.mac_type == e1000_ich8lan ? | 824 | before = (adapter->hw.mac_type == e1000_ich8lan ? |
824 | 0x06C3B33E : 0x06DFB3FE); | 825 | 0x06C3B33E : 0x06DFB3FE); |
825 | REG_SET_AND_CHECK(RCTL, before, 0x003FFFFB); | 826 | REG_SET_AND_CHECK(RCTL, before, 0x003FFFFB); |
826 | REG_SET_AND_CHECK(TCTL, 0xFFFFFFFF, 0x00000000); | 827 | REG_SET_AND_CHECK(TCTL, 0xFFFFFFFF, 0x00000000); |
827 | 828 | ||
@@ -834,10 +835,10 @@ e1000_reg_test(struct e1000_adapter *adapter, uint64_t *data) | |||
834 | REG_PATTERN_TEST(TDBAL, 0xFFFFFFF0, 0xFFFFFFFF); | 835 | REG_PATTERN_TEST(TDBAL, 0xFFFFFFF0, 0xFFFFFFFF); |
835 | REG_PATTERN_TEST(TIDV, 0x0000FFFF, 0x0000FFFF); | 836 | REG_PATTERN_TEST(TIDV, 0x0000FFFF, 0x0000FFFF); |
836 | value = (adapter->hw.mac_type == e1000_ich8lan ? | 837 | value = (adapter->hw.mac_type == e1000_ich8lan ? |
837 | E1000_RAR_ENTRIES_ICH8LAN : E1000_RAR_ENTRIES); | 838 | E1000_RAR_ENTRIES_ICH8LAN : E1000_RAR_ENTRIES); |
838 | for (i = 0; i < value; i++) { | 839 | for (i = 0; i < value; i++) { |
839 | REG_PATTERN_TEST(RA + (((i << 1) + 1) << 2), 0x8003FFFF, | 840 | REG_PATTERN_TEST(RA + (((i << 1) + 1) << 2), 0x8003FFFF, |
840 | 0xFFFFFFFF); | 841 | 0xFFFFFFFF); |
841 | } | 842 | } |
842 | 843 | ||
843 | } else { | 844 | } else { |
@@ -883,8 +884,7 @@ e1000_eeprom_test(struct e1000_adapter *adapter, uint64_t *data) | |||
883 | } | 884 | } |
884 | 885 | ||
885 | static irqreturn_t | 886 | static irqreturn_t |
886 | e1000_test_intr(int irq, | 887 | e1000_test_intr(int irq, void *data) |
887 | void *data) | ||
888 | { | 888 | { |
889 | struct net_device *netdev = (struct net_device *) data; | 889 | struct net_device *netdev = (struct net_device *) data; |
890 | struct e1000_adapter *adapter = netdev_priv(netdev); | 890 | struct e1000_adapter *adapter = netdev_priv(netdev); |
@@ -905,11 +905,11 @@ e1000_intr_test(struct e1000_adapter *adapter, uint64_t *data) | |||
905 | 905 | ||
906 | /* NOTE: we don't test MSI interrupts here, yet */ | 906 | /* NOTE: we don't test MSI interrupts here, yet */ |
907 | /* Hook up test interrupt handler just for this test */ | 907 | /* Hook up test interrupt handler just for this test */ |
908 | if (!request_irq(irq, &e1000_test_intr, IRQF_PROBE_SHARED, | 908 | if (!request_irq(irq, &e1000_test_intr, IRQF_PROBE_SHARED, netdev->name, |
909 | netdev->name, netdev)) | 909 | netdev)) |
910 | shared_int = FALSE; | 910 | shared_int = FALSE; |
911 | else if (request_irq(irq, &e1000_test_intr, IRQF_SHARED, | 911 | else if (request_irq(irq, &e1000_test_intr, IRQF_SHARED, |
912 | netdev->name, netdev)) { | 912 | netdev->name, netdev)) { |
913 | *data = 1; | 913 | *data = 1; |
914 | return -1; | 914 | return -1; |
915 | } | 915 | } |
@@ -925,6 +925,7 @@ e1000_intr_test(struct e1000_adapter *adapter, uint64_t *data) | |||
925 | 925 | ||
926 | if (adapter->hw.mac_type == e1000_ich8lan && i == 8) | 926 | if (adapter->hw.mac_type == e1000_ich8lan && i == 8) |
927 | continue; | 927 | continue; |
928 | |||
928 | /* Interrupt to test */ | 929 | /* Interrupt to test */ |
929 | mask = 1 << i; | 930 | mask = 1 << i; |
930 | 931 | ||
@@ -1674,7 +1675,7 @@ e1000_diag_test(struct net_device *netdev, | |||
1674 | if (e1000_link_test(adapter, &data[4])) | 1675 | if (e1000_link_test(adapter, &data[4])) |
1675 | eth_test->flags |= ETH_TEST_FL_FAILED; | 1676 | eth_test->flags |= ETH_TEST_FL_FAILED; |
1676 | 1677 | ||
1677 | /* Offline tests aren't run; pass by default */ | 1678 | /* Online tests aren't run; pass by default */ |
1678 | data[0] = 0; | 1679 | data[0] = 0; |
1679 | data[1] = 0; | 1680 | data[1] = 0; |
1680 | data[2] = 0; | 1681 | data[2] = 0; |
diff --git a/drivers/net/e1000/e1000_hw.c b/drivers/net/e1000/e1000_hw.c index 796c4f7d4260..29e6f6aba9e2 100644 --- a/drivers/net/e1000/e1000_hw.c +++ b/drivers/net/e1000/e1000_hw.c | |||
@@ -2367,6 +2367,7 @@ e1000_phy_force_speed_duplex(struct e1000_hw *hw) | |||
2367 | 2367 | ||
2368 | /* Need to reset the PHY or these changes will be ignored */ | 2368 | /* Need to reset the PHY or these changes will be ignored */ |
2369 | mii_ctrl_reg |= MII_CR_RESET; | 2369 | mii_ctrl_reg |= MII_CR_RESET; |
2370 | |||
2370 | /* Disable MDI-X support for 10/100 */ | 2371 | /* Disable MDI-X support for 10/100 */ |
2371 | } else if (hw->phy_type == e1000_phy_ife) { | 2372 | } else if (hw->phy_type == e1000_phy_ife) { |
2372 | ret_val = e1000_read_phy_reg(hw, IFE_PHY_MDIX_CONTROL, &phy_data); | 2373 | ret_val = e1000_read_phy_reg(hw, IFE_PHY_MDIX_CONTROL, &phy_data); |
@@ -2379,6 +2380,7 @@ e1000_phy_force_speed_duplex(struct e1000_hw *hw) | |||
2379 | ret_val = e1000_write_phy_reg(hw, IFE_PHY_MDIX_CONTROL, phy_data); | 2380 | ret_val = e1000_write_phy_reg(hw, IFE_PHY_MDIX_CONTROL, phy_data); |
2380 | if (ret_val) | 2381 | if (ret_val) |
2381 | return ret_val; | 2382 | return ret_val; |
2383 | |||
2382 | } else { | 2384 | } else { |
2383 | /* Clear Auto-Crossover to force MDI manually. IGP requires MDI | 2385 | /* Clear Auto-Crossover to force MDI manually. IGP requires MDI |
2384 | * forced whenever speed or duplex are forced. | 2386 | * forced whenever speed or duplex are forced. |
@@ -5841,6 +5843,7 @@ e1000_mta_set(struct e1000_hw *hw, | |||
5841 | hash_reg = (hash_value >> 5) & 0x7F; | 5843 | hash_reg = (hash_value >> 5) & 0x7F; |
5842 | if (hw->mac_type == e1000_ich8lan) | 5844 | if (hw->mac_type == e1000_ich8lan) |
5843 | hash_reg &= 0x1F; | 5845 | hash_reg &= 0x1F; |
5846 | |||
5844 | hash_bit = hash_value & 0x1F; | 5847 | hash_bit = hash_value & 0x1F; |
5845 | 5848 | ||
5846 | mta = E1000_READ_REG_ARRAY(hw, MTA, hash_reg); | 5849 | mta = E1000_READ_REG_ARRAY(hw, MTA, hash_reg); |
@@ -6026,6 +6029,7 @@ e1000_id_led_init(struct e1000_hw * hw) | |||
6026 | else | 6029 | else |
6027 | eeprom_data = ID_LED_DEFAULT; | 6030 | eeprom_data = ID_LED_DEFAULT; |
6028 | } | 6031 | } |
6032 | |||
6029 | for (i = 0; i < 4; i++) { | 6033 | for (i = 0; i < 4; i++) { |
6030 | temp = (eeprom_data >> (i << 2)) & led_mask; | 6034 | temp = (eeprom_data >> (i << 2)) & led_mask; |
6031 | switch (temp) { | 6035 | switch (temp) { |
@@ -9013,5 +9017,3 @@ e1000_init_lcd_from_nvm(struct e1000_hw *hw) | |||
9013 | return E1000_SUCCESS; | 9017 | return E1000_SUCCESS; |
9014 | } | 9018 | } |
9015 | 9019 | ||
9016 | |||
9017 | |||
diff --git a/drivers/net/e1000/e1000_hw.h b/drivers/net/e1000/e1000_hw.h index 449a60303e07..b32a0c3cfd10 100644 --- a/drivers/net/e1000/e1000_hw.h +++ b/drivers/net/e1000/e1000_hw.h | |||
@@ -326,6 +326,7 @@ int32_t e1000_phy_hw_reset(struct e1000_hw *hw); | |||
326 | int32_t e1000_phy_reset(struct e1000_hw *hw); | 326 | int32_t e1000_phy_reset(struct e1000_hw *hw); |
327 | int32_t e1000_phy_get_info(struct e1000_hw *hw, struct e1000_phy_info *phy_info); | 327 | int32_t e1000_phy_get_info(struct e1000_hw *hw, struct e1000_phy_info *phy_info); |
328 | int32_t e1000_validate_mdi_setting(struct e1000_hw *hw); | 328 | int32_t e1000_validate_mdi_setting(struct e1000_hw *hw); |
329 | |||
329 | void e1000_phy_powerdown_workaround(struct e1000_hw *hw); | 330 | void e1000_phy_powerdown_workaround(struct e1000_hw *hw); |
330 | 331 | ||
331 | /* EEPROM Functions */ | 332 | /* EEPROM Functions */ |
@@ -390,7 +391,6 @@ int32_t e1000_mng_write_dhcp_info(struct e1000_hw *hw, uint8_t *buffer, | |||
390 | uint16_t length); | 391 | uint16_t length); |
391 | boolean_t e1000_check_mng_mode(struct e1000_hw *hw); | 392 | boolean_t e1000_check_mng_mode(struct e1000_hw *hw); |
392 | boolean_t e1000_enable_tx_pkt_filtering(struct e1000_hw *hw); | 393 | boolean_t e1000_enable_tx_pkt_filtering(struct e1000_hw *hw); |
393 | |||
394 | int32_t e1000_read_eeprom(struct e1000_hw *hw, uint16_t reg, uint16_t words, uint16_t *data); | 394 | int32_t e1000_read_eeprom(struct e1000_hw *hw, uint16_t reg, uint16_t words, uint16_t *data); |
395 | int32_t e1000_validate_eeprom_checksum(struct e1000_hw *hw); | 395 | int32_t e1000_validate_eeprom_checksum(struct e1000_hw *hw); |
396 | int32_t e1000_update_eeprom_checksum(struct e1000_hw *hw); | 396 | int32_t e1000_update_eeprom_checksum(struct e1000_hw *hw); |
@@ -576,6 +576,7 @@ int32_t e1000_check_phy_reset_block(struct e1000_hw *hw); | |||
576 | * E1000_RAR_ENTRIES - 1 multicast addresses. | 576 | * E1000_RAR_ENTRIES - 1 multicast addresses. |
577 | */ | 577 | */ |
578 | #define E1000_RAR_ENTRIES 15 | 578 | #define E1000_RAR_ENTRIES 15 |
579 | |||
579 | #define E1000_RAR_ENTRIES_ICH8LAN 6 | 580 | #define E1000_RAR_ENTRIES_ICH8LAN 6 |
580 | 581 | ||
581 | #define MIN_NUMBER_OF_DESCRIPTORS 8 | 582 | #define MIN_NUMBER_OF_DESCRIPTORS 8 |
@@ -1335,9 +1336,9 @@ struct e1000_hw_stats { | |||
1335 | uint64_t gotch; | 1336 | uint64_t gotch; |
1336 | uint64_t rnbc; | 1337 | uint64_t rnbc; |
1337 | uint64_t ruc; | 1338 | uint64_t ruc; |
1339 | uint64_t rfc; | ||
1338 | uint64_t roc; | 1340 | uint64_t roc; |
1339 | uint64_t rlerrc; | 1341 | uint64_t rlerrc; |
1340 | uint64_t rfc; | ||
1341 | uint64_t rjc; | 1342 | uint64_t rjc; |
1342 | uint64_t mgprc; | 1343 | uint64_t mgprc; |
1343 | uint64_t mgpdc; | 1344 | uint64_t mgpdc; |
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index 726ec5e88ab2..7b1c092d921c 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c | |||
@@ -375,7 +375,7 @@ e1000_update_mng_vlan(struct e1000_adapter *adapter) | |||
375 | * e1000_release_hw_control resets {CTRL_EXT|FWSM}:DRV_LOAD bit. | 375 | * e1000_release_hw_control resets {CTRL_EXT|FWSM}:DRV_LOAD bit. |
376 | * For ASF and Pass Through versions of f/w this means that the | 376 | * For ASF and Pass Through versions of f/w this means that the |
377 | * driver is no longer loaded. For AMT version (only with 82573) i | 377 | * driver is no longer loaded. For AMT version (only with 82573) i |
378 | * of the f/w this means that the netowrk i/f is closed. | 378 | * of the f/w this means that the network i/f is closed. |
379 | * | 379 | * |
380 | **/ | 380 | **/ |
381 | 381 | ||
@@ -416,7 +416,7 @@ e1000_release_hw_control(struct e1000_adapter *adapter) | |||
416 | * e1000_get_hw_control sets {CTRL_EXT|FWSM}:DRV_LOAD bit. | 416 | * e1000_get_hw_control sets {CTRL_EXT|FWSM}:DRV_LOAD bit. |
417 | * For ASF and Pass Through versions of f/w this means that | 417 | * For ASF and Pass Through versions of f/w this means that |
418 | * the driver is loaded. For AMT version (only with 82573) | 418 | * the driver is loaded. For AMT version (only with 82573) |
419 | * of the f/w this means that the netowrk i/f is open. | 419 | * of the f/w this means that the network i/f is open. |
420 | * | 420 | * |
421 | **/ | 421 | **/ |
422 | 422 | ||
@@ -426,6 +426,7 @@ e1000_get_hw_control(struct e1000_adapter *adapter) | |||
426 | uint32_t ctrl_ext; | 426 | uint32_t ctrl_ext; |
427 | uint32_t swsm; | 427 | uint32_t swsm; |
428 | uint32_t extcnf; | 428 | uint32_t extcnf; |
429 | |||
429 | /* Let firmware know the driver has taken over */ | 430 | /* Let firmware know the driver has taken over */ |
430 | switch (adapter->hw.mac_type) { | 431 | switch (adapter->hw.mac_type) { |
431 | case e1000_82571: | 432 | case e1000_82571: |
@@ -1279,12 +1280,10 @@ e1000_open(struct net_device *netdev) | |||
1279 | return -EBUSY; | 1280 | return -EBUSY; |
1280 | 1281 | ||
1281 | /* allocate transmit descriptors */ | 1282 | /* allocate transmit descriptors */ |
1282 | |||
1283 | if ((err = e1000_setup_all_tx_resources(adapter))) | 1283 | if ((err = e1000_setup_all_tx_resources(adapter))) |
1284 | goto err_setup_tx; | 1284 | goto err_setup_tx; |
1285 | 1285 | ||
1286 | /* allocate receive descriptors */ | 1286 | /* allocate receive descriptors */ |
1287 | |||
1288 | if ((err = e1000_setup_all_rx_resources(adapter))) | 1287 | if ((err = e1000_setup_all_rx_resources(adapter))) |
1289 | goto err_setup_rx; | 1288 | goto err_setup_rx; |
1290 | 1289 | ||
@@ -1569,6 +1568,8 @@ e1000_configure_tx(struct e1000_adapter *adapter) | |||
1569 | 1568 | ||
1570 | if (hw->mac_type == e1000_82571 || hw->mac_type == e1000_82572) { | 1569 | if (hw->mac_type == e1000_82571 || hw->mac_type == e1000_82572) { |
1571 | tarc = E1000_READ_REG(hw, TARC0); | 1570 | tarc = E1000_READ_REG(hw, TARC0); |
1571 | /* set the speed mode bit, we'll clear it if we're not at | ||
1572 | * gigabit link later */ | ||
1572 | tarc |= (1 << 21); | 1573 | tarc |= (1 << 21); |
1573 | E1000_WRITE_REG(hw, TARC0, tarc); | 1574 | E1000_WRITE_REG(hw, TARC0, tarc); |
1574 | } else if (hw->mac_type == e1000_80003es2lan) { | 1575 | } else if (hw->mac_type == e1000_80003es2lan) { |
@@ -2418,6 +2419,7 @@ e1000_watchdog(unsigned long data) | |||
2418 | DPRINTK(LINK, INFO, | 2419 | DPRINTK(LINK, INFO, |
2419 | "Gigabit has been disabled, downgrading speed\n"); | 2420 | "Gigabit has been disabled, downgrading speed\n"); |
2420 | } | 2421 | } |
2422 | |||
2421 | if (adapter->hw.mac_type == e1000_82573) { | 2423 | if (adapter->hw.mac_type == e1000_82573) { |
2422 | e1000_enable_tx_pkt_filtering(&adapter->hw); | 2424 | e1000_enable_tx_pkt_filtering(&adapter->hw); |
2423 | if (adapter->mng_vlan_id != adapter->hw.mng_cookie.vlan_id) | 2425 | if (adapter->mng_vlan_id != adapter->hw.mng_cookie.vlan_id) |
@@ -2462,13 +2464,12 @@ e1000_watchdog(unsigned long data) | |||
2462 | if ((adapter->hw.mac_type == e1000_82571 || | 2464 | if ((adapter->hw.mac_type == e1000_82571 || |
2463 | adapter->hw.mac_type == e1000_82572) && | 2465 | adapter->hw.mac_type == e1000_82572) && |
2464 | txb2b == 0) { | 2466 | txb2b == 0) { |
2465 | #define SPEED_MODE_BIT (1 << 21) | ||
2466 | uint32_t tarc0; | 2467 | uint32_t tarc0; |
2467 | tarc0 = E1000_READ_REG(&adapter->hw, TARC0); | 2468 | tarc0 = E1000_READ_REG(&adapter->hw, TARC0); |
2468 | tarc0 &= ~SPEED_MODE_BIT; | 2469 | tarc0 &= ~(1 << 21); |
2469 | E1000_WRITE_REG(&adapter->hw, TARC0, tarc0); | 2470 | E1000_WRITE_REG(&adapter->hw, TARC0, tarc0); |
2470 | } | 2471 | } |
2471 | 2472 | ||
2472 | #ifdef NETIF_F_TSO | 2473 | #ifdef NETIF_F_TSO |
2473 | /* disable TSO for pcie and 10/100 speeds, to avoid | 2474 | /* disable TSO for pcie and 10/100 speeds, to avoid |
2474 | * some hardware issues */ | 2475 | * some hardware issues */ |
@@ -3010,9 +3011,9 @@ e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
3010 | max_per_txd = min(mss << 2, max_per_txd); | 3011 | max_per_txd = min(mss << 2, max_per_txd); |
3011 | max_txd_pwr = fls(max_per_txd) - 1; | 3012 | max_txd_pwr = fls(max_per_txd) - 1; |
3012 | 3013 | ||
3013 | /* TSO Workaround for 82571/2/3 Controllers -- if skb->data | 3014 | /* TSO Workaround for 82571/2/3 Controllers -- if skb->data |
3014 | * points to just header, pull a few bytes of payload from | 3015 | * points to just header, pull a few bytes of payload from |
3015 | * frags into skb->data */ | 3016 | * frags into skb->data */ |
3016 | hdr_len = ((skb->h.raw - skb->data) + (skb->h.th->doff << 2)); | 3017 | hdr_len = ((skb->h.raw - skb->data) + (skb->h.th->doff << 2)); |
3017 | if (skb->data_len && (hdr_len == (skb->len - skb->data_len))) { | 3018 | if (skb->data_len && (hdr_len == (skb->len - skb->data_len))) { |
3018 | switch (adapter->hw.mac_type) { | 3019 | switch (adapter->hw.mac_type) { |
@@ -3316,12 +3317,12 @@ e1000_update_stats(struct e1000_adapter *adapter) | |||
3316 | adapter->stats.roc += E1000_READ_REG(hw, ROC); | 3317 | adapter->stats.roc += E1000_READ_REG(hw, ROC); |
3317 | 3318 | ||
3318 | if (adapter->hw.mac_type != e1000_ich8lan) { | 3319 | if (adapter->hw.mac_type != e1000_ich8lan) { |
3319 | adapter->stats.prc64 += E1000_READ_REG(hw, PRC64); | 3320 | adapter->stats.prc64 += E1000_READ_REG(hw, PRC64); |
3320 | adapter->stats.prc127 += E1000_READ_REG(hw, PRC127); | 3321 | adapter->stats.prc127 += E1000_READ_REG(hw, PRC127); |
3321 | adapter->stats.prc255 += E1000_READ_REG(hw, PRC255); | 3322 | adapter->stats.prc255 += E1000_READ_REG(hw, PRC255); |
3322 | adapter->stats.prc511 += E1000_READ_REG(hw, PRC511); | 3323 | adapter->stats.prc511 += E1000_READ_REG(hw, PRC511); |
3323 | adapter->stats.prc1023 += E1000_READ_REG(hw, PRC1023); | 3324 | adapter->stats.prc1023 += E1000_READ_REG(hw, PRC1023); |
3324 | adapter->stats.prc1522 += E1000_READ_REG(hw, PRC1522); | 3325 | adapter->stats.prc1522 += E1000_READ_REG(hw, PRC1522); |
3325 | } | 3326 | } |
3326 | 3327 | ||
3327 | adapter->stats.symerrs += E1000_READ_REG(hw, SYMERRS); | 3328 | adapter->stats.symerrs += E1000_READ_REG(hw, SYMERRS); |
@@ -3352,12 +3353,12 @@ e1000_update_stats(struct e1000_adapter *adapter) | |||
3352 | adapter->stats.tpr += E1000_READ_REG(hw, TPR); | 3353 | adapter->stats.tpr += E1000_READ_REG(hw, TPR); |
3353 | 3354 | ||
3354 | if (adapter->hw.mac_type != e1000_ich8lan) { | 3355 | if (adapter->hw.mac_type != e1000_ich8lan) { |
3355 | adapter->stats.ptc64 += E1000_READ_REG(hw, PTC64); | 3356 | adapter->stats.ptc64 += E1000_READ_REG(hw, PTC64); |
3356 | adapter->stats.ptc127 += E1000_READ_REG(hw, PTC127); | 3357 | adapter->stats.ptc127 += E1000_READ_REG(hw, PTC127); |
3357 | adapter->stats.ptc255 += E1000_READ_REG(hw, PTC255); | 3358 | adapter->stats.ptc255 += E1000_READ_REG(hw, PTC255); |
3358 | adapter->stats.ptc511 += E1000_READ_REG(hw, PTC511); | 3359 | adapter->stats.ptc511 += E1000_READ_REG(hw, PTC511); |
3359 | adapter->stats.ptc1023 += E1000_READ_REG(hw, PTC1023); | 3360 | adapter->stats.ptc1023 += E1000_READ_REG(hw, PTC1023); |
3360 | adapter->stats.ptc1522 += E1000_READ_REG(hw, PTC1522); | 3361 | adapter->stats.ptc1522 += E1000_READ_REG(hw, PTC1522); |
3361 | } | 3362 | } |
3362 | 3363 | ||
3363 | adapter->stats.mptc += E1000_READ_REG(hw, MPTC); | 3364 | adapter->stats.mptc += E1000_READ_REG(hw, MPTC); |
@@ -3383,18 +3384,17 @@ e1000_update_stats(struct e1000_adapter *adapter) | |||
3383 | adapter->stats.icrxoc += E1000_READ_REG(hw, ICRXOC); | 3384 | adapter->stats.icrxoc += E1000_READ_REG(hw, ICRXOC); |
3384 | 3385 | ||
3385 | if (adapter->hw.mac_type != e1000_ich8lan) { | 3386 | if (adapter->hw.mac_type != e1000_ich8lan) { |
3386 | adapter->stats.icrxptc += E1000_READ_REG(hw, ICRXPTC); | 3387 | adapter->stats.icrxptc += E1000_READ_REG(hw, ICRXPTC); |
3387 | adapter->stats.icrxatc += E1000_READ_REG(hw, ICRXATC); | 3388 | adapter->stats.icrxatc += E1000_READ_REG(hw, ICRXATC); |
3388 | adapter->stats.ictxptc += E1000_READ_REG(hw, ICTXPTC); | 3389 | adapter->stats.ictxptc += E1000_READ_REG(hw, ICTXPTC); |
3389 | adapter->stats.ictxatc += E1000_READ_REG(hw, ICTXATC); | 3390 | adapter->stats.ictxatc += E1000_READ_REG(hw, ICTXATC); |
3390 | adapter->stats.ictxqec += E1000_READ_REG(hw, ICTXQEC); | 3391 | adapter->stats.ictxqec += E1000_READ_REG(hw, ICTXQEC); |
3391 | adapter->stats.ictxqmtc += E1000_READ_REG(hw, ICTXQMTC); | 3392 | adapter->stats.ictxqmtc += E1000_READ_REG(hw, ICTXQMTC); |
3392 | adapter->stats.icrxdmtc += E1000_READ_REG(hw, ICRXDMTC); | 3393 | adapter->stats.icrxdmtc += E1000_READ_REG(hw, ICRXDMTC); |
3393 | } | 3394 | } |
3394 | } | 3395 | } |
3395 | 3396 | ||
3396 | /* Fill out the OS statistics structure */ | 3397 | /* Fill out the OS statistics structure */ |
3397 | |||
3398 | adapter->net_stats.rx_packets = adapter->stats.gprc; | 3398 | adapter->net_stats.rx_packets = adapter->stats.gprc; |
3399 | adapter->net_stats.tx_packets = adapter->stats.gptc; | 3399 | adapter->net_stats.tx_packets = adapter->stats.gptc; |
3400 | adapter->net_stats.rx_bytes = adapter->stats.gorcl; | 3400 | adapter->net_stats.rx_bytes = adapter->stats.gorcl; |
@@ -3426,7 +3426,6 @@ e1000_update_stats(struct e1000_adapter *adapter) | |||
3426 | /* Tx Dropped needs to be maintained elsewhere */ | 3426 | /* Tx Dropped needs to be maintained elsewhere */ |
3427 | 3427 | ||
3428 | /* Phy Stats */ | 3428 | /* Phy Stats */ |
3429 | |||
3430 | if (hw->media_type == e1000_media_type_copper) { | 3429 | if (hw->media_type == e1000_media_type_copper) { |
3431 | if ((adapter->link_speed == SPEED_1000) && | 3430 | if ((adapter->link_speed == SPEED_1000) && |
3432 | (!e1000_read_phy_reg(hw, PHY_1000T_STATUS, &phy_tmp))) { | 3431 | (!e1000_read_phy_reg(hw, PHY_1000T_STATUS, &phy_tmp))) { |
@@ -3502,6 +3501,8 @@ e1000_intr(int irq, void *data) | |||
3502 | if (likely(netif_rx_schedule_prep(netdev))) | 3501 | if (likely(netif_rx_schedule_prep(netdev))) |
3503 | __netif_rx_schedule(netdev); | 3502 | __netif_rx_schedule(netdev); |
3504 | else | 3503 | else |
3504 | /* this really should not happen! if it does it is basically a | ||
3505 | * bug, but not a hard error, so enable ints and continue */ | ||
3505 | e1000_irq_enable(adapter); | 3506 | e1000_irq_enable(adapter); |
3506 | #else | 3507 | #else |
3507 | /* Writing IMC and IMS is needed for 82547. | 3508 | /* Writing IMC and IMS is needed for 82547. |
@@ -3528,7 +3529,6 @@ e1000_intr(int irq, void *data) | |||
3528 | e1000_irq_enable(adapter); | 3529 | e1000_irq_enable(adapter); |
3529 | 3530 | ||
3530 | #endif | 3531 | #endif |
3531 | |||
3532 | return IRQ_HANDLED; | 3532 | return IRQ_HANDLED; |
3533 | } | 3533 | } |
3534 | 3534 | ||
@@ -3615,7 +3615,6 @@ e1000_clean_tx_irq(struct e1000_adapter *adapter, | |||
3615 | if (unlikely(++i == tx_ring->count)) i = 0; | 3615 | if (unlikely(++i == tx_ring->count)) i = 0; |
3616 | } | 3616 | } |
3617 | 3617 | ||
3618 | |||
3619 | eop = tx_ring->buffer_info[i].next_to_watch; | 3618 | eop = tx_ring->buffer_info[i].next_to_watch; |
3620 | eop_desc = E1000_TX_DESC(*tx_ring, eop); | 3619 | eop_desc = E1000_TX_DESC(*tx_ring, eop); |
3621 | #ifdef CONFIG_E1000_NAPI | 3620 | #ifdef CONFIG_E1000_NAPI |
@@ -3760,6 +3759,7 @@ e1000_clean_rx_irq(struct e1000_adapter *adapter, | |||
3760 | while (rx_desc->status & E1000_RXD_STAT_DD) { | 3759 | while (rx_desc->status & E1000_RXD_STAT_DD) { |
3761 | struct sk_buff *skb; | 3760 | struct sk_buff *skb; |
3762 | u8 status; | 3761 | u8 status; |
3762 | |||
3763 | #ifdef CONFIG_E1000_NAPI | 3763 | #ifdef CONFIG_E1000_NAPI |
3764 | if (*work_done >= work_to_do) | 3764 | if (*work_done >= work_to_do) |
3765 | break; | 3765 | break; |
@@ -3999,7 +3999,7 @@ e1000_clean_rx_irq_ps(struct e1000_adapter *adapter, | |||
3999 | goto copydone; | 3999 | goto copydone; |
4000 | } /* if */ | 4000 | } /* if */ |
4001 | } | 4001 | } |
4002 | 4002 | ||
4003 | for (j = 0; j < adapter->rx_ps_pages; j++) { | 4003 | for (j = 0; j < adapter->rx_ps_pages; j++) { |
4004 | if (!(length= le16_to_cpu(rx_desc->wb.upper.length[j]))) | 4004 | if (!(length= le16_to_cpu(rx_desc->wb.upper.length[j]))) |
4005 | break; | 4005 | break; |
@@ -4234,7 +4234,7 @@ e1000_alloc_rx_buffers_ps(struct e1000_adapter *adapter, | |||
4234 | } | 4234 | } |
4235 | 4235 | ||
4236 | skb = netdev_alloc_skb(netdev, | 4236 | skb = netdev_alloc_skb(netdev, |
4237 | adapter->rx_ps_bsize0 + NET_IP_ALIGN); | 4237 | adapter->rx_ps_bsize0 + NET_IP_ALIGN); |
4238 | 4238 | ||
4239 | if (unlikely(!skb)) { | 4239 | if (unlikely(!skb)) { |
4240 | adapter->alloc_rx_buff_failed++; | 4240 | adapter->alloc_rx_buff_failed++; |
@@ -4511,7 +4511,6 @@ e1000_read_pcie_cap_reg(struct e1000_hw *hw, uint32_t reg, uint16_t *value) | |||
4511 | return E1000_SUCCESS; | 4511 | return E1000_SUCCESS; |
4512 | } | 4512 | } |
4513 | 4513 | ||
4514 | |||
4515 | void | 4514 | void |
4516 | e1000_io_write(struct e1000_hw *hw, unsigned long port, uint32_t value) | 4515 | e1000_io_write(struct e1000_hw *hw, unsigned long port, uint32_t value) |
4517 | { | 4516 | { |
@@ -4534,12 +4533,12 @@ e1000_vlan_rx_register(struct net_device *netdev, struct vlan_group *grp) | |||
4534 | E1000_WRITE_REG(&adapter->hw, CTRL, ctrl); | 4533 | E1000_WRITE_REG(&adapter->hw, CTRL, ctrl); |
4535 | 4534 | ||
4536 | if (adapter->hw.mac_type != e1000_ich8lan) { | 4535 | if (adapter->hw.mac_type != e1000_ich8lan) { |
4537 | /* enable VLAN receive filtering */ | 4536 | /* enable VLAN receive filtering */ |
4538 | rctl = E1000_READ_REG(&adapter->hw, RCTL); | 4537 | rctl = E1000_READ_REG(&adapter->hw, RCTL); |
4539 | rctl |= E1000_RCTL_VFE; | 4538 | rctl |= E1000_RCTL_VFE; |
4540 | rctl &= ~E1000_RCTL_CFIEN; | 4539 | rctl &= ~E1000_RCTL_CFIEN; |
4541 | E1000_WRITE_REG(&adapter->hw, RCTL, rctl); | 4540 | E1000_WRITE_REG(&adapter->hw, RCTL, rctl); |
4542 | e1000_update_mng_vlan(adapter); | 4541 | e1000_update_mng_vlan(adapter); |
4543 | } | 4542 | } |
4544 | } else { | 4543 | } else { |
4545 | /* disable VLAN tag insert/strip */ | 4544 | /* disable VLAN tag insert/strip */ |
@@ -4548,14 +4547,16 @@ e1000_vlan_rx_register(struct net_device *netdev, struct vlan_group *grp) | |||
4548 | E1000_WRITE_REG(&adapter->hw, CTRL, ctrl); | 4547 | E1000_WRITE_REG(&adapter->hw, CTRL, ctrl); |
4549 | 4548 | ||
4550 | if (adapter->hw.mac_type != e1000_ich8lan) { | 4549 | if (adapter->hw.mac_type != e1000_ich8lan) { |
4551 | /* disable VLAN filtering */ | 4550 | /* disable VLAN filtering */ |
4552 | rctl = E1000_READ_REG(&adapter->hw, RCTL); | 4551 | rctl = E1000_READ_REG(&adapter->hw, RCTL); |
4553 | rctl &= ~E1000_RCTL_VFE; | 4552 | rctl &= ~E1000_RCTL_VFE; |
4554 | E1000_WRITE_REG(&adapter->hw, RCTL, rctl); | 4553 | E1000_WRITE_REG(&adapter->hw, RCTL, rctl); |
4555 | if (adapter->mng_vlan_id != (uint16_t)E1000_MNG_VLAN_NONE) { | 4554 | if (adapter->mng_vlan_id != |
4556 | e1000_vlan_rx_kill_vid(netdev, adapter->mng_vlan_id); | 4555 | (uint16_t)E1000_MNG_VLAN_NONE) { |
4557 | adapter->mng_vlan_id = E1000_MNG_VLAN_NONE; | 4556 | e1000_vlan_rx_kill_vid(netdev, |
4558 | } | 4557 | adapter->mng_vlan_id); |
4558 | adapter->mng_vlan_id = E1000_MNG_VLAN_NONE; | ||
4559 | } | ||
4559 | } | 4560 | } |
4560 | } | 4561 | } |
4561 | 4562 | ||
diff --git a/drivers/net/e1000/e1000_osdep.h b/drivers/net/e1000/e1000_osdep.h index a464cb290621..3b7eb7c20019 100644 --- a/drivers/net/e1000/e1000_osdep.h +++ b/drivers/net/e1000/e1000_osdep.h | |||
@@ -119,5 +119,4 @@ typedef enum { | |||
119 | #define E1000_READ_ICH8_REG16(a, reg) ( \ | 119 | #define E1000_READ_ICH8_REG16(a, reg) ( \ |
120 | readw((a)->flash_address + reg)) | 120 | readw((a)->flash_address + reg)) |
121 | 121 | ||
122 | |||
123 | #endif /* _E1000_OSDEP_H_ */ | 122 | #endif /* _E1000_OSDEP_H_ */ |