Commit 90fb5135 authored by Auke Kok's avatar Auke Kok Committed by Jeff Garzik

e1000: whitespace changes, comments, typos

Small whitespace changes, comment changes, typo fixes.
Signed-off-by: default avatarAuke Kok <auke-jan.h.kok@intel.com>
parent a362bf57
...@@ -133,9 +133,7 @@ e1000_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd) ...@@ -133,9 +133,7 @@ e1000_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
if (hw->autoneg == 1) { if (hw->autoneg == 1) {
ecmd->advertising |= ADVERTISED_Autoneg; ecmd->advertising |= ADVERTISED_Autoneg;
/* the e1000 autoneg seems to match ethtool nicely */ /* the e1000 autoneg seems to match ethtool nicely */
ecmd->advertising |= hw->autoneg_advertised; ecmd->advertising |= hw->autoneg_advertised;
} }
...@@ -802,12 +800,14 @@ e1000_reg_test(struct e1000_adapter *adapter, uint64_t *data) ...@@ -802,12 +800,14 @@ e1000_reg_test(struct e1000_adapter *adapter, uint64_t *data)
} }
/* restore previous status */ /* restore previous status */
E1000_WRITE_REG(&adapter->hw, STATUS, before); E1000_WRITE_REG(&adapter->hw, STATUS, before);
if (adapter->hw.mac_type != e1000_ich8lan) { if (adapter->hw.mac_type != e1000_ich8lan) {
REG_PATTERN_TEST(FCAL, 0xFFFFFFFF, 0xFFFFFFFF); REG_PATTERN_TEST(FCAL, 0xFFFFFFFF, 0xFFFFFFFF);
REG_PATTERN_TEST(FCAH, 0x0000FFFF, 0xFFFFFFFF); REG_PATTERN_TEST(FCAH, 0x0000FFFF, 0xFFFFFFFF);
REG_PATTERN_TEST(FCT, 0x0000FFFF, 0xFFFFFFFF); REG_PATTERN_TEST(FCT, 0x0000FFFF, 0xFFFFFFFF);
REG_PATTERN_TEST(VET, 0x0000FFFF, 0xFFFFFFFF); REG_PATTERN_TEST(VET, 0x0000FFFF, 0xFFFFFFFF);
} }
REG_PATTERN_TEST(RDTR, 0x0000FFFF, 0xFFFFFFFF); REG_PATTERN_TEST(RDTR, 0x0000FFFF, 0xFFFFFFFF);
REG_PATTERN_TEST(RDBAH, 0xFFFFFFFF, 0xFFFFFFFF); REG_PATTERN_TEST(RDBAH, 0xFFFFFFFF, 0xFFFFFFFF);
REG_PATTERN_TEST(RDLEN, 0x000FFF80, 0x000FFFFF); REG_PATTERN_TEST(RDLEN, 0x000FFF80, 0x000FFFFF);
...@@ -820,6 +820,7 @@ e1000_reg_test(struct e1000_adapter *adapter, uint64_t *data) ...@@ -820,6 +820,7 @@ e1000_reg_test(struct e1000_adapter *adapter, uint64_t *data)
REG_PATTERN_TEST(TDLEN, 0x000FFF80, 0x000FFFFF); REG_PATTERN_TEST(TDLEN, 0x000FFF80, 0x000FFFFF);
REG_SET_AND_CHECK(RCTL, 0xFFFFFFFF, 0x00000000); REG_SET_AND_CHECK(RCTL, 0xFFFFFFFF, 0x00000000);
before = (adapter->hw.mac_type == e1000_ich8lan ? before = (adapter->hw.mac_type == e1000_ich8lan ?
0x06C3B33E : 0x06DFB3FE); 0x06C3B33E : 0x06DFB3FE);
REG_SET_AND_CHECK(RCTL, before, 0x003FFFFB); REG_SET_AND_CHECK(RCTL, before, 0x003FFFFB);
...@@ -883,8 +884,7 @@ e1000_eeprom_test(struct e1000_adapter *adapter, uint64_t *data) ...@@ -883,8 +884,7 @@ e1000_eeprom_test(struct e1000_adapter *adapter, uint64_t *data)
} }
static irqreturn_t static irqreturn_t
e1000_test_intr(int irq, e1000_test_intr(int irq, void *data)
void *data)
{ {
struct net_device *netdev = (struct net_device *) data; struct net_device *netdev = (struct net_device *) data;
struct e1000_adapter *adapter = netdev_priv(netdev); struct e1000_adapter *adapter = netdev_priv(netdev);
...@@ -905,8 +905,8 @@ e1000_intr_test(struct e1000_adapter *adapter, uint64_t *data) ...@@ -905,8 +905,8 @@ e1000_intr_test(struct e1000_adapter *adapter, uint64_t *data)
/* NOTE: we don't test MSI interrupts here, yet */ /* NOTE: we don't test MSI interrupts here, yet */
/* Hook up test interrupt handler just for this test */ /* Hook up test interrupt handler just for this test */
if (!request_irq(irq, &e1000_test_intr, IRQF_PROBE_SHARED, if (!request_irq(irq, &e1000_test_intr, IRQF_PROBE_SHARED, netdev->name,
netdev->name, netdev)) netdev))
shared_int = FALSE; shared_int = FALSE;
else if (request_irq(irq, &e1000_test_intr, IRQF_SHARED, else if (request_irq(irq, &e1000_test_intr, IRQF_SHARED,
netdev->name, netdev)) { netdev->name, netdev)) {
...@@ -925,6 +925,7 @@ e1000_intr_test(struct e1000_adapter *adapter, uint64_t *data) ...@@ -925,6 +925,7 @@ e1000_intr_test(struct e1000_adapter *adapter, uint64_t *data)
if (adapter->hw.mac_type == e1000_ich8lan && i == 8) if (adapter->hw.mac_type == e1000_ich8lan && i == 8)
continue; continue;
/* Interrupt to test */ /* Interrupt to test */
mask = 1 << i; mask = 1 << i;
...@@ -1674,7 +1675,7 @@ e1000_diag_test(struct net_device *netdev, ...@@ -1674,7 +1675,7 @@ e1000_diag_test(struct net_device *netdev,
if (e1000_link_test(adapter, &data[4])) if (e1000_link_test(adapter, &data[4]))
eth_test->flags |= ETH_TEST_FL_FAILED; eth_test->flags |= ETH_TEST_FL_FAILED;
/* Offline tests aren't run; pass by default */ /* Online tests aren't run; pass by default */
data[0] = 0; data[0] = 0;
data[1] = 0; data[1] = 0;
data[2] = 0; data[2] = 0;
......
...@@ -2367,6 +2367,7 @@ e1000_phy_force_speed_duplex(struct e1000_hw *hw) ...@@ -2367,6 +2367,7 @@ e1000_phy_force_speed_duplex(struct e1000_hw *hw)
/* Need to reset the PHY or these changes will be ignored */ /* Need to reset the PHY or these changes will be ignored */
mii_ctrl_reg |= MII_CR_RESET; mii_ctrl_reg |= MII_CR_RESET;
/* Disable MDI-X support for 10/100 */ /* Disable MDI-X support for 10/100 */
} else if (hw->phy_type == e1000_phy_ife) { } else if (hw->phy_type == e1000_phy_ife) {
ret_val = e1000_read_phy_reg(hw, IFE_PHY_MDIX_CONTROL, &phy_data); 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,6 +2380,7 @@ e1000_phy_force_speed_duplex(struct e1000_hw *hw)
ret_val = e1000_write_phy_reg(hw, IFE_PHY_MDIX_CONTROL, phy_data); ret_val = e1000_write_phy_reg(hw, IFE_PHY_MDIX_CONTROL, phy_data);
if (ret_val) if (ret_val)
return ret_val; return ret_val;
} else { } else {
/* Clear Auto-Crossover to force MDI manually. IGP requires MDI /* Clear Auto-Crossover to force MDI manually. IGP requires MDI
* forced whenever speed or duplex are forced. * forced whenever speed or duplex are forced.
...@@ -5841,6 +5843,7 @@ e1000_mta_set(struct e1000_hw *hw, ...@@ -5841,6 +5843,7 @@ e1000_mta_set(struct e1000_hw *hw,
hash_reg = (hash_value >> 5) & 0x7F; hash_reg = (hash_value >> 5) & 0x7F;
if (hw->mac_type == e1000_ich8lan) if (hw->mac_type == e1000_ich8lan)
hash_reg &= 0x1F; hash_reg &= 0x1F;
hash_bit = hash_value & 0x1F; hash_bit = hash_value & 0x1F;
mta = E1000_READ_REG_ARRAY(hw, MTA, hash_reg); mta = E1000_READ_REG_ARRAY(hw, MTA, hash_reg);
...@@ -6026,6 +6029,7 @@ e1000_id_led_init(struct e1000_hw * hw) ...@@ -6026,6 +6029,7 @@ e1000_id_led_init(struct e1000_hw * hw)
else else
eeprom_data = ID_LED_DEFAULT; eeprom_data = ID_LED_DEFAULT;
} }
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
temp = (eeprom_data >> (i << 2)) & led_mask; temp = (eeprom_data >> (i << 2)) & led_mask;
switch (temp) { switch (temp) {
...@@ -9013,5 +9017,3 @@ e1000_init_lcd_from_nvm(struct e1000_hw *hw) ...@@ -9013,5 +9017,3 @@ e1000_init_lcd_from_nvm(struct e1000_hw *hw)
return E1000_SUCCESS; return E1000_SUCCESS;
} }
...@@ -326,6 +326,7 @@ int32_t e1000_phy_hw_reset(struct e1000_hw *hw); ...@@ -326,6 +326,7 @@ int32_t e1000_phy_hw_reset(struct e1000_hw *hw);
int32_t e1000_phy_reset(struct e1000_hw *hw); int32_t e1000_phy_reset(struct e1000_hw *hw);
int32_t e1000_phy_get_info(struct e1000_hw *hw, struct e1000_phy_info *phy_info); int32_t e1000_phy_get_info(struct e1000_hw *hw, struct e1000_phy_info *phy_info);
int32_t e1000_validate_mdi_setting(struct e1000_hw *hw); int32_t e1000_validate_mdi_setting(struct e1000_hw *hw);
void e1000_phy_powerdown_workaround(struct e1000_hw *hw); void e1000_phy_powerdown_workaround(struct e1000_hw *hw);
/* EEPROM Functions */ /* EEPROM Functions */
...@@ -390,7 +391,6 @@ int32_t e1000_mng_write_dhcp_info(struct e1000_hw *hw, uint8_t *buffer, ...@@ -390,7 +391,6 @@ int32_t e1000_mng_write_dhcp_info(struct e1000_hw *hw, uint8_t *buffer,
uint16_t length); uint16_t length);
boolean_t e1000_check_mng_mode(struct e1000_hw *hw); boolean_t e1000_check_mng_mode(struct e1000_hw *hw);
boolean_t e1000_enable_tx_pkt_filtering(struct e1000_hw *hw); boolean_t e1000_enable_tx_pkt_filtering(struct e1000_hw *hw);
int32_t e1000_read_eeprom(struct e1000_hw *hw, uint16_t reg, uint16_t words, uint16_t *data); int32_t e1000_read_eeprom(struct e1000_hw *hw, uint16_t reg, uint16_t words, uint16_t *data);
int32_t e1000_validate_eeprom_checksum(struct e1000_hw *hw); int32_t e1000_validate_eeprom_checksum(struct e1000_hw *hw);
int32_t e1000_update_eeprom_checksum(struct e1000_hw *hw); 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,6 +576,7 @@ int32_t e1000_check_phy_reset_block(struct e1000_hw *hw);
* E1000_RAR_ENTRIES - 1 multicast addresses. * E1000_RAR_ENTRIES - 1 multicast addresses.
*/ */
#define E1000_RAR_ENTRIES 15 #define E1000_RAR_ENTRIES 15
#define E1000_RAR_ENTRIES_ICH8LAN 6 #define E1000_RAR_ENTRIES_ICH8LAN 6
#define MIN_NUMBER_OF_DESCRIPTORS 8 #define MIN_NUMBER_OF_DESCRIPTORS 8
...@@ -1335,9 +1336,9 @@ struct e1000_hw_stats { ...@@ -1335,9 +1336,9 @@ struct e1000_hw_stats {
uint64_t gotch; uint64_t gotch;
uint64_t rnbc; uint64_t rnbc;
uint64_t ruc; uint64_t ruc;
uint64_t rfc;
uint64_t roc; uint64_t roc;
uint64_t rlerrc; uint64_t rlerrc;
uint64_t rfc;
uint64_t rjc; uint64_t rjc;
uint64_t mgprc; uint64_t mgprc;
uint64_t mgpdc; uint64_t mgpdc;
......
...@@ -375,7 +375,7 @@ e1000_update_mng_vlan(struct e1000_adapter *adapter) ...@@ -375,7 +375,7 @@ e1000_update_mng_vlan(struct e1000_adapter *adapter)
* e1000_release_hw_control resets {CTRL_EXT|FWSM}:DRV_LOAD bit. * e1000_release_hw_control resets {CTRL_EXT|FWSM}:DRV_LOAD bit.
* For ASF and Pass Through versions of f/w this means that the * For ASF and Pass Through versions of f/w this means that the
* driver is no longer loaded. For AMT version (only with 82573) i * driver is no longer loaded. For AMT version (only with 82573) i
* of the f/w this means that the netowrk i/f is closed. * of the f/w this means that the network i/f is closed.
* *
**/ **/
...@@ -416,7 +416,7 @@ e1000_release_hw_control(struct e1000_adapter *adapter) ...@@ -416,7 +416,7 @@ e1000_release_hw_control(struct e1000_adapter *adapter)
* e1000_get_hw_control sets {CTRL_EXT|FWSM}:DRV_LOAD bit. * e1000_get_hw_control sets {CTRL_EXT|FWSM}:DRV_LOAD bit.
* For ASF and Pass Through versions of f/w this means that * For ASF and Pass Through versions of f/w this means that
* the driver is loaded. For AMT version (only with 82573) * the driver is loaded. For AMT version (only with 82573)
* of the f/w this means that the netowrk i/f is open. * of the f/w this means that the network i/f is open.
* *
**/ **/
...@@ -426,6 +426,7 @@ e1000_get_hw_control(struct e1000_adapter *adapter) ...@@ -426,6 +426,7 @@ e1000_get_hw_control(struct e1000_adapter *adapter)
uint32_t ctrl_ext; uint32_t ctrl_ext;
uint32_t swsm; uint32_t swsm;
uint32_t extcnf; uint32_t extcnf;
/* Let firmware know the driver has taken over */ /* Let firmware know the driver has taken over */
switch (adapter->hw.mac_type) { switch (adapter->hw.mac_type) {
case e1000_82571: case e1000_82571:
...@@ -1279,12 +1280,10 @@ e1000_open(struct net_device *netdev) ...@@ -1279,12 +1280,10 @@ e1000_open(struct net_device *netdev)
return -EBUSY; return -EBUSY;
/* allocate transmit descriptors */ /* allocate transmit descriptors */
if ((err = e1000_setup_all_tx_resources(adapter))) if ((err = e1000_setup_all_tx_resources(adapter)))
goto err_setup_tx; goto err_setup_tx;
/* allocate receive descriptors */ /* allocate receive descriptors */
if ((err = e1000_setup_all_rx_resources(adapter))) if ((err = e1000_setup_all_rx_resources(adapter)))
goto err_setup_rx; goto err_setup_rx;
...@@ -1569,6 +1568,8 @@ e1000_configure_tx(struct e1000_adapter *adapter) ...@@ -1569,6 +1568,8 @@ e1000_configure_tx(struct e1000_adapter *adapter)
if (hw->mac_type == e1000_82571 || hw->mac_type == e1000_82572) { if (hw->mac_type == e1000_82571 || hw->mac_type == e1000_82572) {
tarc = E1000_READ_REG(hw, TARC0); tarc = E1000_READ_REG(hw, TARC0);
/* set the speed mode bit, we'll clear it if we're not at
* gigabit link later */
tarc |= (1 << 21); tarc |= (1 << 21);
E1000_WRITE_REG(hw, TARC0, tarc); E1000_WRITE_REG(hw, TARC0, tarc);
} else if (hw->mac_type == e1000_80003es2lan) { } else if (hw->mac_type == e1000_80003es2lan) {
...@@ -2418,6 +2419,7 @@ e1000_watchdog(unsigned long data) ...@@ -2418,6 +2419,7 @@ e1000_watchdog(unsigned long data)
DPRINTK(LINK, INFO, DPRINTK(LINK, INFO,
"Gigabit has been disabled, downgrading speed\n"); "Gigabit has been disabled, downgrading speed\n");
} }
if (adapter->hw.mac_type == e1000_82573) { if (adapter->hw.mac_type == e1000_82573) {
e1000_enable_tx_pkt_filtering(&adapter->hw); e1000_enable_tx_pkt_filtering(&adapter->hw);
if (adapter->mng_vlan_id != adapter->hw.mng_cookie.vlan_id) if (adapter->mng_vlan_id != adapter->hw.mng_cookie.vlan_id)
...@@ -2462,10 +2464,9 @@ e1000_watchdog(unsigned long data) ...@@ -2462,10 +2464,9 @@ e1000_watchdog(unsigned long data)
if ((adapter->hw.mac_type == e1000_82571 || if ((adapter->hw.mac_type == e1000_82571 ||
adapter->hw.mac_type == e1000_82572) && adapter->hw.mac_type == e1000_82572) &&
txb2b == 0) { txb2b == 0) {
#define SPEED_MODE_BIT (1 << 21)
uint32_t tarc0; uint32_t tarc0;
tarc0 = E1000_READ_REG(&adapter->hw, TARC0); tarc0 = E1000_READ_REG(&adapter->hw, TARC0);
tarc0 &= ~SPEED_MODE_BIT; tarc0 &= ~(1 << 21);
E1000_WRITE_REG(&adapter->hw, TARC0, tarc0); E1000_WRITE_REG(&adapter->hw, TARC0, tarc0);
} }
...@@ -3394,7 +3395,6 @@ e1000_update_stats(struct e1000_adapter *adapter) ...@@ -3394,7 +3395,6 @@ e1000_update_stats(struct e1000_adapter *adapter)
} }
/* Fill out the OS statistics structure */ /* Fill out the OS statistics structure */
adapter->net_stats.rx_packets = adapter->stats.gprc; adapter->net_stats.rx_packets = adapter->stats.gprc;
adapter->net_stats.tx_packets = adapter->stats.gptc; adapter->net_stats.tx_packets = adapter->stats.gptc;
adapter->net_stats.rx_bytes = adapter->stats.gorcl; adapter->net_stats.rx_bytes = adapter->stats.gorcl;
...@@ -3426,7 +3426,6 @@ e1000_update_stats(struct e1000_adapter *adapter) ...@@ -3426,7 +3426,6 @@ e1000_update_stats(struct e1000_adapter *adapter)
/* Tx Dropped needs to be maintained elsewhere */ /* Tx Dropped needs to be maintained elsewhere */
/* Phy Stats */ /* Phy Stats */
if (hw->media_type == e1000_media_type_copper) { if (hw->media_type == e1000_media_type_copper) {
if ((adapter->link_speed == SPEED_1000) && if ((adapter->link_speed == SPEED_1000) &&
(!e1000_read_phy_reg(hw, PHY_1000T_STATUS, &phy_tmp))) { (!e1000_read_phy_reg(hw, PHY_1000T_STATUS, &phy_tmp))) {
...@@ -3502,6 +3501,8 @@ e1000_intr(int irq, void *data) ...@@ -3502,6 +3501,8 @@ e1000_intr(int irq, void *data)
if (likely(netif_rx_schedule_prep(netdev))) if (likely(netif_rx_schedule_prep(netdev)))
__netif_rx_schedule(netdev); __netif_rx_schedule(netdev);
else else
/* this really should not happen! if it does it is basically a
* bug, but not a hard error, so enable ints and continue */
e1000_irq_enable(adapter); e1000_irq_enable(adapter);
#else #else
/* Writing IMC and IMS is needed for 82547. /* Writing IMC and IMS is needed for 82547.
...@@ -3528,7 +3529,6 @@ e1000_intr(int irq, void *data) ...@@ -3528,7 +3529,6 @@ e1000_intr(int irq, void *data)
e1000_irq_enable(adapter); e1000_irq_enable(adapter);
#endif #endif
return IRQ_HANDLED; return IRQ_HANDLED;
} }
...@@ -3615,7 +3615,6 @@ e1000_clean_tx_irq(struct e1000_adapter *adapter, ...@@ -3615,7 +3615,6 @@ e1000_clean_tx_irq(struct e1000_adapter *adapter,
if (unlikely(++i == tx_ring->count)) i = 0; if (unlikely(++i == tx_ring->count)) i = 0;
} }
eop = tx_ring->buffer_info[i].next_to_watch; eop = tx_ring->buffer_info[i].next_to_watch;
eop_desc = E1000_TX_DESC(*tx_ring, eop); eop_desc = E1000_TX_DESC(*tx_ring, eop);
#ifdef CONFIG_E1000_NAPI #ifdef CONFIG_E1000_NAPI
...@@ -3760,6 +3759,7 @@ e1000_clean_rx_irq(struct e1000_adapter *adapter, ...@@ -3760,6 +3759,7 @@ e1000_clean_rx_irq(struct e1000_adapter *adapter,
while (rx_desc->status & E1000_RXD_STAT_DD) { while (rx_desc->status & E1000_RXD_STAT_DD) {
struct sk_buff *skb; struct sk_buff *skb;
u8 status; u8 status;
#ifdef CONFIG_E1000_NAPI #ifdef CONFIG_E1000_NAPI
if (*work_done >= work_to_do) if (*work_done >= work_to_do)
break; break;
...@@ -4511,7 +4511,6 @@ e1000_read_pcie_cap_reg(struct e1000_hw *hw, uint32_t reg, uint16_t *value) ...@@ -4511,7 +4511,6 @@ e1000_read_pcie_cap_reg(struct e1000_hw *hw, uint32_t reg, uint16_t *value)
return E1000_SUCCESS; return E1000_SUCCESS;
} }
void void
e1000_io_write(struct e1000_hw *hw, unsigned long port, uint32_t value) e1000_io_write(struct e1000_hw *hw, unsigned long port, uint32_t value)
{ {
...@@ -4552,8 +4551,10 @@ e1000_vlan_rx_register(struct net_device *netdev, struct vlan_group *grp) ...@@ -4552,8 +4551,10 @@ e1000_vlan_rx_register(struct net_device *netdev, struct vlan_group *grp)
rctl = E1000_READ_REG(&adapter->hw, RCTL); rctl = E1000_READ_REG(&adapter->hw, RCTL);
rctl &= ~E1000_RCTL_VFE; rctl &= ~E1000_RCTL_VFE;
E1000_WRITE_REG(&adapter->hw, RCTL, rctl); E1000_WRITE_REG(&adapter->hw, RCTL, rctl);
if (adapter->mng_vlan_id != (uint16_t)E1000_MNG_VLAN_NONE) { if (adapter->mng_vlan_id !=
e1000_vlan_rx_kill_vid(netdev, adapter->mng_vlan_id); (uint16_t)E1000_MNG_VLAN_NONE) {
e1000_vlan_rx_kill_vid(netdev,
adapter->mng_vlan_id);
adapter->mng_vlan_id = E1000_MNG_VLAN_NONE; adapter->mng_vlan_id = E1000_MNG_VLAN_NONE;
} }
} }
......
...@@ -119,5 +119,4 @@ typedef enum { ...@@ -119,5 +119,4 @@ typedef enum {
#define E1000_READ_ICH8_REG16(a, reg) ( \ #define E1000_READ_ICH8_REG16(a, reg) ( \
readw((a)->flash_address + reg)) readw((a)->flash_address + reg))
#endif /* _E1000_OSDEP_H_ */ #endif /* _E1000_OSDEP_H_ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment