Commit 28318676 authored by Christopher Goldfarb's avatar Christopher Goldfarb Committed by Jeff Garzik

e1000 net drvr update 3/13:

Search and replace of adapter->shared with adapter->hw 
throughout the driver.  This matches the naming used in 
e1000_hw.c and is more correct.
parent 09377d52
...@@ -219,7 +219,7 @@ struct e1000_adapter { ...@@ -219,7 +219,7 @@ struct e1000_adapter {
struct net_device_stats net_stats; struct net_device_stats net_stats;
/* structs defined in e1000_hw.h */ /* structs defined in e1000_hw.h */
struct e1000_hw shared; struct e1000_hw hw;
struct e1000_hw_stats stats; struct e1000_hw_stats stats;
struct e1000_phy_info phy_info; struct e1000_phy_info phy_info;
struct e1000_phy_stats phy_stats; struct e1000_phy_stats phy_stats;
......
...@@ -88,9 +88,9 @@ extern void e1000_enable_WOL(struct e1000_adapter *adapter); ...@@ -88,9 +88,9 @@ extern void e1000_enable_WOL(struct e1000_adapter *adapter);
static void static void
e1000_ethtool_gset(struct e1000_adapter *adapter, struct ethtool_cmd *ecmd) e1000_ethtool_gset(struct e1000_adapter *adapter, struct ethtool_cmd *ecmd)
{ {
struct e1000_hw *shared = &adapter->shared; struct e1000_hw *hw = &adapter->hw;
if(shared->media_type == e1000_media_type_copper) { if(hw->media_type == e1000_media_type_copper) {
ecmd->supported = (SUPPORTED_10baseT_Half | ecmd->supported = (SUPPORTED_10baseT_Half |
SUPPORTED_10baseT_Full | SUPPORTED_10baseT_Full |
...@@ -102,18 +102,18 @@ e1000_ethtool_gset(struct e1000_adapter *adapter, struct ethtool_cmd *ecmd) ...@@ -102,18 +102,18 @@ e1000_ethtool_gset(struct e1000_adapter *adapter, struct ethtool_cmd *ecmd)
ecmd->advertising = ADVERTISED_TP; ecmd->advertising = ADVERTISED_TP;
if(shared->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 |= shared->autoneg_advertised; ecmd->advertising |= hw->autoneg_advertised;
} }
ecmd->port = PORT_TP; ecmd->port = PORT_TP;
ecmd->phy_address = shared->phy_addr; ecmd->phy_address = hw->phy_addr;
if(shared->mac_type == e1000_82543) if(hw->mac_type == e1000_82543)
ecmd->transceiver = XCVR_EXTERNAL; ecmd->transceiver = XCVR_EXTERNAL;
else else
ecmd->transceiver = XCVR_INTERNAL; ecmd->transceiver = XCVR_INTERNAL;
...@@ -134,7 +134,7 @@ e1000_ethtool_gset(struct e1000_adapter *adapter, struct ethtool_cmd *ecmd) ...@@ -134,7 +134,7 @@ e1000_ethtool_gset(struct e1000_adapter *adapter, struct ethtool_cmd *ecmd)
if(netif_carrier_ok(adapter->netdev)) { if(netif_carrier_ok(adapter->netdev)) {
e1000_get_speed_and_duplex(shared, &adapter->link_speed, e1000_get_speed_and_duplex(hw, &adapter->link_speed,
&adapter->link_duplex); &adapter->link_duplex);
ecmd->speed = adapter->link_speed; ecmd->speed = adapter->link_speed;
...@@ -150,7 +150,7 @@ e1000_ethtool_gset(struct e1000_adapter *adapter, struct ethtool_cmd *ecmd) ...@@ -150,7 +150,7 @@ e1000_ethtool_gset(struct e1000_adapter *adapter, struct ethtool_cmd *ecmd)
ecmd->duplex = -1; ecmd->duplex = -1;
} }
ecmd->autoneg = (shared->autoneg ? AUTONEG_ENABLE : AUTONEG_DISABLE); ecmd->autoneg = (hw->autoneg ? AUTONEG_ENABLE : AUTONEG_DISABLE);
return; return;
} }
...@@ -158,29 +158,29 @@ e1000_ethtool_gset(struct e1000_adapter *adapter, struct ethtool_cmd *ecmd) ...@@ -158,29 +158,29 @@ e1000_ethtool_gset(struct e1000_adapter *adapter, struct ethtool_cmd *ecmd)
static int static int
e1000_ethtool_sset(struct e1000_adapter *adapter, struct ethtool_cmd *ecmd) e1000_ethtool_sset(struct e1000_adapter *adapter, struct ethtool_cmd *ecmd)
{ {
struct e1000_hw *shared = &adapter->shared; struct e1000_hw *hw = &adapter->hw;
if(ecmd->autoneg == AUTONEG_ENABLE) { if(ecmd->autoneg == AUTONEG_ENABLE) {
shared->autoneg = 1; hw->autoneg = 1;
shared->autoneg_advertised = (ecmd->advertising & 0x002F); hw->autoneg_advertised = (ecmd->advertising & 0x002F);
} else { } else {
shared->autoneg = 0; hw->autoneg = 0;
switch(ecmd->speed + ecmd->duplex) { switch(ecmd->speed + ecmd->duplex) {
case SPEED_10 + DUPLEX_HALF: case SPEED_10 + DUPLEX_HALF:
shared->forced_speed_duplex = e1000_10_half; hw->forced_speed_duplex = e1000_10_half;
break; break;
case SPEED_10 + DUPLEX_FULL: case SPEED_10 + DUPLEX_FULL:
shared->forced_speed_duplex = e1000_10_full; hw->forced_speed_duplex = e1000_10_full;
break; break;
case SPEED_100 + DUPLEX_HALF: case SPEED_100 + DUPLEX_HALF:
shared->forced_speed_duplex = e1000_100_half; hw->forced_speed_duplex = e1000_100_half;
break; break;
case SPEED_100 + DUPLEX_FULL: case SPEED_100 + DUPLEX_FULL:
shared->forced_speed_duplex = e1000_100_full; hw->forced_speed_duplex = e1000_100_full;
break; break;
case SPEED_1000 + DUPLEX_FULL: case SPEED_1000 + DUPLEX_FULL:
shared->autoneg = 1; hw->autoneg = 1;
shared->autoneg_advertised = ADVERTISE_1000_FULL; hw->autoneg_advertised = ADVERTISE_1000_FULL;
break; break;
case SPEED_1000 + DUPLEX_HALF: /* not supported */ case SPEED_1000 + DUPLEX_HALF: /* not supported */
default: default:
...@@ -197,10 +197,10 @@ e1000_ethtool_sset(struct e1000_adapter *adapter, struct ethtool_cmd *ecmd) ...@@ -197,10 +197,10 @@ e1000_ethtool_sset(struct e1000_adapter *adapter, struct ethtool_cmd *ecmd)
} }
static inline int static inline int
e1000_eeprom_size(struct e1000_hw *shared) e1000_eeprom_size(struct e1000_hw *hw)
{ {
if((shared->mac_type > e1000_82544) && if((hw->mac_type > e1000_82544) &&
(E1000_READ_REG(shared, EECD) & E1000_EECD_SIZE)) (E1000_READ_REG(hw, EECD) & E1000_EECD_SIZE))
return 512; return 512;
else else
return 128; return 128;
...@@ -214,7 +214,7 @@ e1000_ethtool_gdrvinfo(struct e1000_adapter *adapter, ...@@ -214,7 +214,7 @@ e1000_ethtool_gdrvinfo(struct e1000_adapter *adapter,
strncpy(drvinfo->version, e1000_driver_version, 32); strncpy(drvinfo->version, e1000_driver_version, 32);
strncpy(drvinfo->fw_version, "", 32); strncpy(drvinfo->fw_version, "", 32);
strncpy(drvinfo->bus_info, adapter->pdev->slot_name, 32); strncpy(drvinfo->bus_info, adapter->pdev->slot_name, 32);
drvinfo->eedump_len = e1000_eeprom_size(&adapter->shared); drvinfo->eedump_len = e1000_eeprom_size(&adapter->hw);
return; return;
} }
...@@ -222,26 +222,26 @@ static void ...@@ -222,26 +222,26 @@ static void
e1000_ethtool_geeprom(struct e1000_adapter *adapter, e1000_ethtool_geeprom(struct e1000_adapter *adapter,
struct ethtool_eeprom *eeprom, uint16_t *eeprom_buff) struct ethtool_eeprom *eeprom, uint16_t *eeprom_buff)
{ {
struct e1000_hw *shared = &adapter->shared; struct e1000_hw *hw = &adapter->hw;
int i, max_len; int i, max_len;
eeprom->magic = shared->vendor_id | (shared->device_id << 16); eeprom->magic = hw->vendor_id | (hw->device_id << 16);
max_len = e1000_eeprom_size(shared); max_len = e1000_eeprom_size(hw);
if ((eeprom->offset + eeprom->len) > max_len) if ((eeprom->offset + eeprom->len) > max_len)
eeprom->len = (max_len - eeprom->offset); eeprom->len = (max_len - eeprom->offset);
for(i = 0; i < max_len; i++) for(i = 0; i < max_len; i++)
e1000_read_eeprom(&adapter->shared, i, &eeprom_buff[i]); e1000_read_eeprom(&adapter->hw, i, &eeprom_buff[i]);
} }
static void static void
e1000_ethtool_gwol(struct e1000_adapter *adapter, struct ethtool_wolinfo *wol) e1000_ethtool_gwol(struct e1000_adapter *adapter, struct ethtool_wolinfo *wol)
{ {
struct e1000_hw *shared = &adapter->shared; struct e1000_hw *hw = &adapter->hw;
if(shared->mac_type < e1000_82544) { if(hw->mac_type < e1000_82544) {
wol->supported = 0; wol->supported = 0;
wol->wolopts = 0; wol->wolopts = 0;
return; return;
...@@ -268,9 +268,9 @@ e1000_ethtool_gwol(struct e1000_adapter *adapter, struct ethtool_wolinfo *wol) ...@@ -268,9 +268,9 @@ e1000_ethtool_gwol(struct e1000_adapter *adapter, struct ethtool_wolinfo *wol)
static int static int
e1000_ethtool_swol(struct e1000_adapter *adapter, struct ethtool_wolinfo *wol) e1000_ethtool_swol(struct e1000_adapter *adapter, struct ethtool_wolinfo *wol)
{ {
struct e1000_hw *shared = &adapter->shared; struct e1000_hw *hw = &adapter->hw;
if(shared->mac_type < e1000_82544) if(hw->mac_type < e1000_82544)
return wol->wolopts == 0 ? 0 : -EOPNOTSUPP; return wol->wolopts == 0 ? 0 : -EOPNOTSUPP;
adapter->wol = 0; adapter->wol = 0;
......
...@@ -282,15 +282,15 @@ e1000_reset(struct e1000_adapter *adapter) ...@@ -282,15 +282,15 @@ e1000_reset(struct e1000_adapter *adapter)
*/ */
if(adapter->rx_buffer_len > E1000_RXBUFFER_8192) if(adapter->rx_buffer_len > E1000_RXBUFFER_8192)
E1000_WRITE_REG(&adapter->shared, PBA, E1000_JUMBO_PBA); E1000_WRITE_REG(&adapter->hw, PBA, E1000_JUMBO_PBA);
else else
E1000_WRITE_REG(&adapter->shared, PBA, E1000_DEFAULT_PBA); E1000_WRITE_REG(&adapter->hw, PBA, E1000_DEFAULT_PBA);
adapter->shared.fc = adapter->shared.original_fc; adapter->hw.fc = adapter->hw.original_fc;
e1000_reset_hw(&adapter->shared); e1000_reset_hw(&adapter->hw);
e1000_init_hw(&adapter->shared); e1000_init_hw(&adapter->hw);
e1000_reset_adaptive(&adapter->shared); e1000_reset_adaptive(&adapter->hw);
e1000_phy_get_info(&adapter->shared, &adapter->phy_info); e1000_phy_get_info(&adapter->hw, &adapter->phy_info);
e1000_enable_WOL(adapter); e1000_enable_WOL(adapter);
} }
...@@ -347,13 +347,13 @@ e1000_probe(struct pci_dev *pdev, ...@@ -347,13 +347,13 @@ e1000_probe(struct pci_dev *pdev,
adapter = netdev->priv; adapter = netdev->priv;
adapter->netdev = netdev; adapter->netdev = netdev;
adapter->pdev = pdev; adapter->pdev = pdev;
adapter->shared.back = adapter; adapter->hw.back = adapter;
mmio_start = pci_resource_start(pdev, BAR_0); mmio_start = pci_resource_start(pdev, BAR_0);
mmio_len = pci_resource_len(pdev, BAR_0); mmio_len = pci_resource_len(pdev, BAR_0);
adapter->shared.hw_addr = ioremap(mmio_start, mmio_len); adapter->hw.hw_addr = ioremap(mmio_start, mmio_len);
if(!adapter->shared.hw_addr) if(!adapter->hw.hw_addr)
goto err_ioremap; goto err_ioremap;
netdev->open = &e1000_open; netdev->open = &e1000_open;
...@@ -377,7 +377,7 @@ e1000_probe(struct pci_dev *pdev, ...@@ -377,7 +377,7 @@ e1000_probe(struct pci_dev *pdev,
e1000_sw_init(adapter); e1000_sw_init(adapter);
if(adapter->shared.mac_type >= e1000_82543) { if(adapter->hw.mac_type >= e1000_82543) {
netdev->features = NETIF_F_SG | NETIF_F_HW_CSUM; netdev->features = NETIF_F_SG | NETIF_F_HW_CSUM;
} else { } else {
netdev->features = NETIF_F_SG; netdev->features = NETIF_F_SG;
...@@ -388,19 +388,19 @@ e1000_probe(struct pci_dev *pdev, ...@@ -388,19 +388,19 @@ e1000_probe(struct pci_dev *pdev,
/* make sure the EEPROM is good */ /* make sure the EEPROM is good */
if(e1000_validate_eeprom_checksum(&adapter->shared) < 0) if(e1000_validate_eeprom_checksum(&adapter->hw) < 0)
goto err_eeprom; goto err_eeprom;
/* copy the MAC address out of the EEPROM */ /* copy the MAC address out of the EEPROM */
e1000_read_mac_addr(&adapter->shared); e1000_read_mac_addr(&adapter->hw);
memcpy(netdev->dev_addr, adapter->shared.mac_addr, netdev->addr_len); memcpy(netdev->dev_addr, adapter->hw.mac_addr, netdev->addr_len);
if(!is_valid_ether_addr(netdev->dev_addr)) if(!is_valid_ether_addr(netdev->dev_addr))
goto err_eeprom; goto err_eeprom;
e1000_read_part_num(&adapter->shared, &(adapter->part_num)); e1000_read_part_num(&adapter->hw, &(adapter->part_num));
e1000_get_bus_info(&adapter->shared); e1000_get_bus_info(&adapter->hw);
init_timer(&adapter->watchdog_timer); init_timer(&adapter->watchdog_timer);
adapter->watchdog_timer.function = &e1000_watchdog; adapter->watchdog_timer.function = &e1000_watchdog;
...@@ -429,7 +429,7 @@ e1000_probe(struct pci_dev *pdev, ...@@ -429,7 +429,7 @@ e1000_probe(struct pci_dev *pdev,
return 0; return 0;
err_eeprom: err_eeprom:
iounmap(adapter->shared.hw_addr); iounmap(adapter->hw.hw_addr);
err_ioremap: err_ioremap:
pci_release_regions(pdev); pci_release_regions(pdev);
kfree(netdev); kfree(netdev);
...@@ -459,11 +459,11 @@ e1000_remove(struct pci_dev *pdev) ...@@ -459,11 +459,11 @@ e1000_remove(struct pci_dev *pdev)
unregister_netdev(netdev); unregister_netdev(netdev);
e1000_phy_hw_reset(&adapter->shared); e1000_phy_hw_reset(&adapter->hw);
e1000_proc_dev_free(adapter); e1000_proc_dev_free(adapter);
iounmap(adapter->shared.hw_addr); iounmap(adapter->hw.hw_addr);
pci_release_regions(pdev); pci_release_regions(pdev);
kfree(netdev); kfree(netdev);
...@@ -482,17 +482,17 @@ e1000_remove(struct pci_dev *pdev) ...@@ -482,17 +482,17 @@ e1000_remove(struct pci_dev *pdev)
static void __devinit static void __devinit
e1000_sw_init(struct e1000_adapter *adapter) e1000_sw_init(struct e1000_adapter *adapter)
{ {
struct e1000_hw *shared = &adapter->shared; struct e1000_hw *hw = &adapter->hw;
struct net_device *netdev = adapter->netdev; struct net_device *netdev = adapter->netdev;
struct pci_dev *pdev = adapter->pdev; struct pci_dev *pdev = adapter->pdev;
/* PCI config space info */ /* PCI config space info */
uint16_t *vendor = &shared->vendor_id; uint16_t *vendor = &hw->vendor_id;
uint16_t *device = &shared->device_id; uint16_t *device = &hw->device_id;
uint16_t *subvendor = &shared->subsystem_vendor_id; uint16_t *subvendor = &hw->subsystem_vendor_id;
uint16_t *subsystem = &shared->subsystem_id; uint16_t *subsystem = &hw->subsystem_id;
uint8_t *revision = &shared->revision_id; uint8_t *revision = &hw->revision_id;
pci_read_config_word(pdev, PCI_VENDOR_ID, vendor); pci_read_config_word(pdev, PCI_VENDOR_ID, vendor);
pci_read_config_word(pdev, PCI_DEVICE_ID, device); pci_read_config_word(pdev, PCI_DEVICE_ID, device);
...@@ -500,11 +500,11 @@ e1000_sw_init(struct e1000_adapter *adapter) ...@@ -500,11 +500,11 @@ e1000_sw_init(struct e1000_adapter *adapter)
pci_read_config_word(pdev, PCI_SUBSYSTEM_VENDOR_ID, subvendor); pci_read_config_word(pdev, PCI_SUBSYSTEM_VENDOR_ID, subvendor);
pci_read_config_word(pdev, PCI_SUBSYSTEM_ID, subsystem); pci_read_config_word(pdev, PCI_SUBSYSTEM_ID, subsystem);
pci_read_config_word(pdev, PCI_COMMAND, &shared->pci_cmd_word); pci_read_config_word(pdev, PCI_COMMAND, &hw->pci_cmd_word);
adapter->rx_buffer_len = E1000_RXBUFFER_2048; adapter->rx_buffer_len = E1000_RXBUFFER_2048;
shared->max_frame_size = netdev->mtu + ENET_HEADER_SIZE + CRC_LENGTH; hw->max_frame_size = netdev->mtu + ENET_HEADER_SIZE + CRC_LENGTH;
shared->min_frame_size = MINIMUM_ETHERNET_PACKET_SIZE + CRC_LENGTH; hw->min_frame_size = MINIMUM_ETHERNET_PACKET_SIZE + CRC_LENGTH;
/* identify the MAC */ /* identify the MAC */
...@@ -512,28 +512,28 @@ e1000_sw_init(struct e1000_adapter *adapter) ...@@ -512,28 +512,28 @@ e1000_sw_init(struct e1000_adapter *adapter)
case E1000_DEV_ID_82542: case E1000_DEV_ID_82542:
switch (*revision) { switch (*revision) {
case E1000_82542_2_0_REV_ID: case E1000_82542_2_0_REV_ID:
shared->mac_type = e1000_82542_rev2_0; hw->mac_type = e1000_82542_rev2_0;
break; break;
case E1000_82542_2_1_REV_ID: case E1000_82542_2_1_REV_ID:
shared->mac_type = e1000_82542_rev2_1; hw->mac_type = e1000_82542_rev2_1;
break; break;
default: default:
shared->mac_type = e1000_82542_rev2_0; hw->mac_type = e1000_82542_rev2_0;
E1000_ERR("Could not identify 82542 revision\n"); E1000_ERR("Could not identify 82542 revision\n");
} }
break; break;
case E1000_DEV_ID_82543GC_FIBER: case E1000_DEV_ID_82543GC_FIBER:
case E1000_DEV_ID_82543GC_COPPER: case E1000_DEV_ID_82543GC_COPPER:
shared->mac_type = e1000_82543; hw->mac_type = e1000_82543;
break; break;
case E1000_DEV_ID_82544EI_COPPER: case E1000_DEV_ID_82544EI_COPPER:
case E1000_DEV_ID_82544EI_FIBER: case E1000_DEV_ID_82544EI_FIBER:
case E1000_DEV_ID_82544GC_COPPER: case E1000_DEV_ID_82544GC_COPPER:
case E1000_DEV_ID_82544GC_LOM: case E1000_DEV_ID_82544GC_LOM:
shared->mac_type = e1000_82544; hw->mac_type = e1000_82544;
break; break;
case E1000_DEV_ID_82540EM: case E1000_DEV_ID_82540EM:
shared->mac_type = e1000_82540; hw->mac_type = e1000_82540;
break; break;
default: default:
/* should never have loaded on this device */ /* should never have loaded on this device */
...@@ -542,31 +542,31 @@ e1000_sw_init(struct e1000_adapter *adapter) ...@@ -542,31 +542,31 @@ e1000_sw_init(struct e1000_adapter *adapter)
/* flow control settings */ /* flow control settings */
shared->fc_high_water = FC_DEFAULT_HI_THRESH; hw->fc_high_water = FC_DEFAULT_HI_THRESH;
shared->fc_low_water = FC_DEFAULT_LO_THRESH; hw->fc_low_water = FC_DEFAULT_LO_THRESH;
shared->fc_pause_time = FC_DEFAULT_TX_TIMER; hw->fc_pause_time = FC_DEFAULT_TX_TIMER;
shared->fc_send_xon = 1; hw->fc_send_xon = 1;
/* Media type - copper or fiber */ /* Media type - copper or fiber */
if(shared->mac_type >= e1000_82543) { if(hw->mac_type >= e1000_82543) {
uint32_t status = E1000_READ_REG(shared, STATUS); uint32_t status = E1000_READ_REG(hw, STATUS);
if(status & E1000_STATUS_TBIMODE) if(status & E1000_STATUS_TBIMODE)
shared->media_type = e1000_media_type_fiber; hw->media_type = e1000_media_type_fiber;
else else
shared->media_type = e1000_media_type_copper; hw->media_type = e1000_media_type_copper;
} else { } else {
shared->media_type = e1000_media_type_fiber; hw->media_type = e1000_media_type_fiber;
} }
if(shared->mac_type < e1000_82543) if(hw->mac_type < e1000_82543)
shared->report_tx_early = 0; hw->report_tx_early = 0;
else else
shared->report_tx_early = 1; hw->report_tx_early = 1;
shared->wait_autoneg_complete = FALSE; hw->wait_autoneg_complete = FALSE;
shared->tbi_compatibility_en = TRUE; hw->tbi_compatibility_en = TRUE;
atomic_set(&adapter->irq_sem, 1); atomic_set(&adapter->irq_sem, 1);
spin_lock_init(&adapter->stats_lock); spin_lock_init(&adapter->stats_lock);
...@@ -697,19 +697,19 @@ e1000_configure_tx(struct e1000_adapter *adapter) ...@@ -697,19 +697,19 @@ e1000_configure_tx(struct e1000_adapter *adapter)
uint32_t tdlen = adapter->tx_ring.count * sizeof(struct e1000_tx_desc); uint32_t tdlen = adapter->tx_ring.count * sizeof(struct e1000_tx_desc);
uint32_t tctl, tipg; uint32_t tctl, tipg;
E1000_WRITE_REG(&adapter->shared, TDBAL, (tdba & 0x00000000FFFFFFFF)); E1000_WRITE_REG(&adapter->hw, TDBAL, (tdba & 0x00000000FFFFFFFF));
E1000_WRITE_REG(&adapter->shared, TDBAH, (tdba >> 32)); E1000_WRITE_REG(&adapter->hw, TDBAH, (tdba >> 32));
E1000_WRITE_REG(&adapter->shared, TDLEN, tdlen); E1000_WRITE_REG(&adapter->hw, TDLEN, tdlen);
/* Setup the HW Tx Head and Tail descriptor pointers */ /* Setup the HW Tx Head and Tail descriptor pointers */
E1000_WRITE_REG(&adapter->shared, TDH, 0); E1000_WRITE_REG(&adapter->hw, TDH, 0);
E1000_WRITE_REG(&adapter->shared, TDT, 0); E1000_WRITE_REG(&adapter->hw, TDT, 0);
/* Set the default values for the Tx Inter Packet Gap timer */ /* Set the default values for the Tx Inter Packet Gap timer */
switch (adapter->shared.mac_type) { switch (adapter->hw.mac_type) {
case e1000_82542_rev2_0: case e1000_82542_rev2_0:
case e1000_82542_rev2_1: case e1000_82542_rev2_1:
tipg = DEFAULT_82542_TIPG_IPGT; tipg = DEFAULT_82542_TIPG_IPGT;
...@@ -717,18 +717,18 @@ e1000_configure_tx(struct e1000_adapter *adapter) ...@@ -717,18 +717,18 @@ e1000_configure_tx(struct e1000_adapter *adapter)
tipg |= DEFAULT_82542_TIPG_IPGR2 << E1000_TIPG_IPGR2_SHIFT; tipg |= DEFAULT_82542_TIPG_IPGR2 << E1000_TIPG_IPGR2_SHIFT;
break; break;
default: default:
if(adapter->shared.media_type == e1000_media_type_fiber) if(adapter->hw.media_type == e1000_media_type_fiber)
tipg = DEFAULT_82543_TIPG_IPGT_FIBER; tipg = DEFAULT_82543_TIPG_IPGT_FIBER;
else else
tipg = DEFAULT_82543_TIPG_IPGT_COPPER; tipg = DEFAULT_82543_TIPG_IPGT_COPPER;
tipg |= DEFAULT_82543_TIPG_IPGR1 << E1000_TIPG_IPGR1_SHIFT; tipg |= DEFAULT_82543_TIPG_IPGR1 << E1000_TIPG_IPGR1_SHIFT;
tipg |= DEFAULT_82543_TIPG_IPGR2 << E1000_TIPG_IPGR2_SHIFT; tipg |= DEFAULT_82543_TIPG_IPGR2 << E1000_TIPG_IPGR2_SHIFT;
} }
E1000_WRITE_REG(&adapter->shared, TIPG, tipg); E1000_WRITE_REG(&adapter->hw, TIPG, tipg);
/* Set the Tx Interrupt Delay register */ /* Set the Tx Interrupt Delay register */
E1000_WRITE_REG(&adapter->shared, TIDV, adapter->tx_int_delay); E1000_WRITE_REG(&adapter->hw, TIDV, adapter->tx_int_delay);
/* Program the Transmit Control Register */ /* Program the Transmit Control Register */
...@@ -741,14 +741,14 @@ e1000_configure_tx(struct e1000_adapter *adapter) ...@@ -741,14 +741,14 @@ e1000_configure_tx(struct e1000_adapter *adapter)
tctl |= E1000_HDX_COLLISION_DISTANCE << E1000_COLD_SHIFT; tctl |= E1000_HDX_COLLISION_DISTANCE << E1000_COLD_SHIFT;
} }
E1000_WRITE_REG(&adapter->shared, TCTL, tctl); E1000_WRITE_REG(&adapter->hw, TCTL, tctl);
/* Setup Transmit Descriptor Settings for this adapter */ /* Setup Transmit Descriptor Settings for this adapter */
adapter->txd_cmd = E1000_TXD_CMD_IFCS; adapter->txd_cmd = E1000_TXD_CMD_IFCS;
if(adapter->tx_int_delay > 0) if(adapter->tx_int_delay > 0)
adapter->txd_cmd |= E1000_TXD_CMD_IDE; adapter->txd_cmd |= E1000_TXD_CMD_IDE;
if(adapter->shared.report_tx_early == 1) if(adapter->hw.report_tx_early == 1)
adapter->txd_cmd |= E1000_TXD_CMD_RS; adapter->txd_cmd |= E1000_TXD_CMD_RS;
else else
adapter->txd_cmd |= E1000_TXD_CMD_RPS; adapter->txd_cmd |= E1000_TXD_CMD_RPS;
...@@ -813,9 +813,9 @@ e1000_setup_rctl(struct e1000_adapter *adapter) ...@@ -813,9 +813,9 @@ e1000_setup_rctl(struct e1000_adapter *adapter)
/* Setup the Receive Control Register */ /* Setup the Receive Control Register */
rctl = E1000_RCTL_EN | E1000_RCTL_BAM | rctl = E1000_RCTL_EN | E1000_RCTL_BAM |
E1000_RCTL_LBM_NO | E1000_RCTL_RDMTS_HALF | E1000_RCTL_LBM_NO | E1000_RCTL_RDMTS_HALF |
(adapter->shared.mc_filter_type << E1000_RCTL_MO_SHIFT); (adapter->hw.mc_filter_type << E1000_RCTL_MO_SHIFT);
if(adapter->shared.tbi_compatibility_on == 1) if(adapter->hw.tbi_compatibility_on == 1)
rctl |= E1000_RCTL_SBP; rctl |= E1000_RCTL_SBP;
switch (adapter->rx_buffer_len) { switch (adapter->rx_buffer_len) {
...@@ -834,7 +834,7 @@ e1000_setup_rctl(struct e1000_adapter *adapter) ...@@ -834,7 +834,7 @@ e1000_setup_rctl(struct e1000_adapter *adapter)
break; break;
} }
E1000_WRITE_REG(&adapter->shared, RCTL, rctl); E1000_WRITE_REG(&adapter->hw, RCTL, rctl);
} }
/** /**
...@@ -854,47 +854,47 @@ e1000_configure_rx(struct e1000_adapter *adapter) ...@@ -854,47 +854,47 @@ e1000_configure_rx(struct e1000_adapter *adapter)
/* make sure receives are disabled while setting up the descriptors */ /* make sure receives are disabled while setting up the descriptors */
rctl = E1000_READ_REG(&adapter->shared, RCTL); rctl = E1000_READ_REG(&adapter->hw, RCTL);
E1000_WRITE_REG(&adapter->shared, RCTL, rctl & ~E1000_RCTL_EN); E1000_WRITE_REG(&adapter->hw, RCTL, rctl & ~E1000_RCTL_EN);
/* set the Receive Delay Timer Register */ /* set the Receive Delay Timer Register */
if(adapter->shared.mac_type == e1000_82540) { if(adapter->hw.mac_type == e1000_82540) {
E1000_WRITE_REG(&adapter->shared, RADV, adapter->rx_int_delay); E1000_WRITE_REG(&adapter->hw, RADV, adapter->rx_int_delay);
E1000_WRITE_REG(&adapter->shared, RDTR, 64); E1000_WRITE_REG(&adapter->hw, RDTR, 64);
/* Set the interrupt throttling rate. Value is calculated /* Set the interrupt throttling rate. Value is calculated
* as DEFAULT_ITR = 1/(MAX_INTS_PER_SEC * 256ns) */ * as DEFAULT_ITR = 1/(MAX_INTS_PER_SEC * 256ns) */
#define MAX_INTS_PER_SEC 8000 #define MAX_INTS_PER_SEC 8000
#define DEFAULT_ITR 1000000000/(MAX_INTS_PER_SEC * 256) #define DEFAULT_ITR 1000000000/(MAX_INTS_PER_SEC * 256)
E1000_WRITE_REG(&adapter->shared, ITR, DEFAULT_ITR); E1000_WRITE_REG(&adapter->hw, ITR, DEFAULT_ITR);
} else { } else {
E1000_WRITE_REG(&adapter->shared, RDTR, adapter->rx_int_delay); E1000_WRITE_REG(&adapter->hw, RDTR, adapter->rx_int_delay);
} }
/* Setup the Base and Length of the Rx Descriptor Ring */ /* Setup the Base and Length of the Rx Descriptor Ring */
E1000_WRITE_REG(&adapter->shared, RDBAL, (rdba & 0x00000000FFFFFFFF)); E1000_WRITE_REG(&adapter->hw, RDBAL, (rdba & 0x00000000FFFFFFFF));
E1000_WRITE_REG(&adapter->shared, RDBAH, (rdba >> 32)); E1000_WRITE_REG(&adapter->hw, RDBAH, (rdba >> 32));
E1000_WRITE_REG(&adapter->shared, RDLEN, rdlen); E1000_WRITE_REG(&adapter->hw, RDLEN, rdlen);
/* Setup the HW Rx Head and Tail Descriptor Pointers */ /* Setup the HW Rx Head and Tail Descriptor Pointers */
E1000_WRITE_REG(&adapter->shared, RDH, 0); E1000_WRITE_REG(&adapter->hw, RDH, 0);
E1000_WRITE_REG(&adapter->shared, RDT, 0); E1000_WRITE_REG(&adapter->hw, RDT, 0);
/* Enable 82543 Receive Checksum Offload for TCP and UDP */ /* Enable 82543 Receive Checksum Offload for TCP and UDP */
if((adapter->shared.mac_type >= e1000_82543) && if((adapter->hw.mac_type >= e1000_82543) &&
(adapter->rx_csum == TRUE)) { (adapter->rx_csum == TRUE)) {
rxcsum = E1000_READ_REG(&adapter->shared, RXCSUM); rxcsum = E1000_READ_REG(&adapter->hw, RXCSUM);
rxcsum |= E1000_RXCSUM_TUOFL; rxcsum |= E1000_RXCSUM_TUOFL;
E1000_WRITE_REG(&adapter->shared, RXCSUM, rxcsum); E1000_WRITE_REG(&adapter->hw, RXCSUM, rxcsum);
} }
/* Enable Receives */ /* Enable Receives */
E1000_WRITE_REG(&adapter->shared, RCTL, rctl); E1000_WRITE_REG(&adapter->hw, RCTL, rctl);
return; return;
} }
...@@ -963,8 +963,8 @@ e1000_clean_tx_ring(struct e1000_adapter *adapter) ...@@ -963,8 +963,8 @@ e1000_clean_tx_ring(struct e1000_adapter *adapter)
adapter->tx_ring.next_to_use = 0; adapter->tx_ring.next_to_use = 0;
adapter->tx_ring.next_to_clean = 0; adapter->tx_ring.next_to_clean = 0;
E1000_WRITE_REG(&adapter->shared, TDH, 0); E1000_WRITE_REG(&adapter->hw, TDH, 0);
E1000_WRITE_REG(&adapter->shared, TDT, 0); E1000_WRITE_REG(&adapter->hw, TDT, 0);
return; return;
} }
...@@ -1033,8 +1033,8 @@ e1000_clean_rx_ring(struct e1000_adapter *adapter) ...@@ -1033,8 +1033,8 @@ e1000_clean_rx_ring(struct e1000_adapter *adapter)
adapter->rx_ring.next_to_clean = 0; adapter->rx_ring.next_to_clean = 0;
adapter->rx_ring.next_to_use = 0; adapter->rx_ring.next_to_use = 0;
E1000_WRITE_REG(&adapter->shared, RDH, 0); E1000_WRITE_REG(&adapter->hw, RDH, 0);
E1000_WRITE_REG(&adapter->shared, RDT, 0); E1000_WRITE_REG(&adapter->hw, RDT, 0);
return; return;
} }
...@@ -1047,7 +1047,7 @@ e1000_enter_82542_rst(struct e1000_adapter *adapter) ...@@ -1047,7 +1047,7 @@ e1000_enter_82542_rst(struct e1000_adapter *adapter)
{ {
struct pci_dev *pdev = adapter->pdev; struct pci_dev *pdev = adapter->pdev;
struct net_device *netdev = adapter->netdev; struct net_device *netdev = adapter->netdev;
uint16_t pci_command_word = adapter->shared.pci_cmd_word; uint16_t pci_command_word = adapter->hw.pci_cmd_word;
uint32_t rctl; uint32_t rctl;
if(pci_command_word & PCI_COMMAND_INVALIDATE) { if(pci_command_word & PCI_COMMAND_INVALIDATE) {
...@@ -1055,9 +1055,9 @@ e1000_enter_82542_rst(struct e1000_adapter *adapter) ...@@ -1055,9 +1055,9 @@ e1000_enter_82542_rst(struct e1000_adapter *adapter)
pci_write_config_word(pdev, PCI_COMMAND, pci_command_word); pci_write_config_word(pdev, PCI_COMMAND, pci_command_word);
} }
rctl = E1000_READ_REG(&adapter->shared, RCTL); rctl = E1000_READ_REG(&adapter->hw, RCTL);
rctl |= E1000_RCTL_RST; rctl |= E1000_RCTL_RST;
E1000_WRITE_REG(&adapter->shared, RCTL, rctl); E1000_WRITE_REG(&adapter->hw, RCTL, rctl);
msec_delay(5); msec_delay(5);
if(netif_running(netdev)) if(netif_running(netdev))
...@@ -1070,12 +1070,12 @@ e1000_leave_82542_rst(struct e1000_adapter *adapter) ...@@ -1070,12 +1070,12 @@ e1000_leave_82542_rst(struct e1000_adapter *adapter)
{ {
struct pci_dev *pdev = adapter->pdev; struct pci_dev *pdev = adapter->pdev;
struct net_device *netdev = adapter->netdev; struct net_device *netdev = adapter->netdev;
uint16_t pci_command_word = adapter->shared.pci_cmd_word; uint16_t pci_command_word = adapter->hw.pci_cmd_word;
uint32_t rctl; uint32_t rctl;
rctl = E1000_READ_REG(&adapter->shared, RCTL); rctl = E1000_READ_REG(&adapter->hw, RCTL);
rctl &= ~E1000_RCTL_RST; rctl &= ~E1000_RCTL_RST;
E1000_WRITE_REG(&adapter->shared, RCTL, rctl); E1000_WRITE_REG(&adapter->hw, RCTL, rctl);
msec_delay(5); msec_delay(5);
if(pci_command_word & PCI_COMMAND_INVALIDATE) if(pci_command_word & PCI_COMMAND_INVALIDATE)
...@@ -1104,15 +1104,15 @@ e1000_set_mac(struct net_device *netdev, void *p) ...@@ -1104,15 +1104,15 @@ e1000_set_mac(struct net_device *netdev, void *p)
/* 82542 2.0 needs to be in reset to write receive address registers */ /* 82542 2.0 needs to be in reset to write receive address registers */
if(adapter->shared.mac_type == e1000_82542_rev2_0) if(adapter->hw.mac_type == e1000_82542_rev2_0)
e1000_enter_82542_rst(adapter); e1000_enter_82542_rst(adapter);
memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len); memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
memcpy(adapter->shared.mac_addr, addr->sa_data, netdev->addr_len); memcpy(adapter->hw.mac_addr, addr->sa_data, netdev->addr_len);
e1000_rar_set(&adapter->shared, adapter->shared.mac_addr, 0); e1000_rar_set(&adapter->hw, adapter->hw.mac_addr, 0);
if(adapter->shared.mac_type == e1000_82542_rev2_0) if(adapter->hw.mac_type == e1000_82542_rev2_0)
e1000_leave_82542_rst(adapter); e1000_leave_82542_rst(adapter);
return 0; return 0;
...@@ -1132,7 +1132,7 @@ static void ...@@ -1132,7 +1132,7 @@ static void
e1000_set_multi(struct net_device *netdev) e1000_set_multi(struct net_device *netdev)
{ {
struct e1000_adapter *adapter = netdev->priv; struct e1000_adapter *adapter = netdev->priv;
struct e1000_hw *shared = &adapter->shared; struct e1000_hw *hw = &adapter->hw;
struct dev_mc_list *mc_ptr; struct dev_mc_list *mc_ptr;
uint32_t rctl; uint32_t rctl;
uint32_t hash_value; uint32_t hash_value;
...@@ -1140,7 +1140,7 @@ e1000_set_multi(struct net_device *netdev) ...@@ -1140,7 +1140,7 @@ e1000_set_multi(struct net_device *netdev)
/* Check for Promiscuous and All Multicast modes */ /* Check for Promiscuous and All Multicast modes */
rctl = E1000_READ_REG(shared, RCTL); rctl = E1000_READ_REG(hw, RCTL);
if(netdev->flags & IFF_PROMISC) { if(netdev->flags & IFF_PROMISC) {
rctl |= (E1000_RCTL_UPE | E1000_RCTL_MPE); rctl |= (E1000_RCTL_UPE | E1000_RCTL_MPE);
...@@ -1151,11 +1151,11 @@ e1000_set_multi(struct net_device *netdev) ...@@ -1151,11 +1151,11 @@ e1000_set_multi(struct net_device *netdev)
rctl &= ~(E1000_RCTL_UPE | E1000_RCTL_MPE); rctl &= ~(E1000_RCTL_UPE | E1000_RCTL_MPE);
} }
E1000_WRITE_REG(shared, RCTL, rctl); E1000_WRITE_REG(hw, RCTL, rctl);
/* 82542 2.0 needs to be in reset to write receive address registers */ /* 82542 2.0 needs to be in reset to write receive address registers */
if(shared->mac_type == e1000_82542_rev2_0) if(hw->mac_type == e1000_82542_rev2_0)
e1000_enter_82542_rst(adapter); e1000_enter_82542_rst(adapter);
/* load the first 15 multicast address into the exact filters 1-15 /* load the first 15 multicast address into the exact filters 1-15
...@@ -1166,27 +1166,27 @@ e1000_set_multi(struct net_device *netdev) ...@@ -1166,27 +1166,27 @@ e1000_set_multi(struct net_device *netdev)
for(i = 1; i < E1000_RAR_ENTRIES; i++) { for(i = 1; i < E1000_RAR_ENTRIES; i++) {
if(mc_ptr) { if(mc_ptr) {
e1000_rar_set(shared, mc_ptr->dmi_addr, i); e1000_rar_set(hw, mc_ptr->dmi_addr, i);
mc_ptr = mc_ptr->next; mc_ptr = mc_ptr->next;
} else { } else {
E1000_WRITE_REG_ARRAY(shared, RA, i << 1, 0); E1000_WRITE_REG_ARRAY(hw, RA, i << 1, 0);
E1000_WRITE_REG_ARRAY(shared, RA, (i << 1) + 1, 0); E1000_WRITE_REG_ARRAY(hw, RA, (i << 1) + 1, 0);
} }
} }
/* clear the old settings from the multicast hash table */ /* clear the old settings from the multicast hash table */
for(i = 0; i < E1000_NUM_MTA_REGISTERS; i++) for(i = 0; i < E1000_NUM_MTA_REGISTERS; i++)
E1000_WRITE_REG_ARRAY(shared, MTA, i, 0); E1000_WRITE_REG_ARRAY(hw, MTA, i, 0);
/* load any remaining addresses into the hash table */ /* load any remaining addresses into the hash table */
for(; mc_ptr; mc_ptr = mc_ptr->next) { for(; mc_ptr; mc_ptr = mc_ptr->next) {
hash_value = e1000_hash_mc_addr(shared, mc_ptr->dmi_addr); hash_value = e1000_hash_mc_addr(hw, mc_ptr->dmi_addr);
e1000_mta_set(shared, hash_value); e1000_mta_set(hw, hash_value);
} }
if(shared->mac_type == e1000_82542_rev2_0) if(hw->mac_type == e1000_82542_rev2_0)
e1000_leave_82542_rst(adapter); e1000_leave_82542_rst(adapter);
return; return;
} }
...@@ -1198,7 +1198,7 @@ static void ...@@ -1198,7 +1198,7 @@ static void
e1000_update_phy_info(unsigned long data) e1000_update_phy_info(unsigned long data)
{ {
struct e1000_adapter *adapter = (struct e1000_adapter *) data; struct e1000_adapter *adapter = (struct e1000_adapter *) data;
e1000_phy_get_info(&adapter->shared, &adapter->phy_info); e1000_phy_get_info(&adapter->hw, &adapter->phy_info);
return; return;
} }
...@@ -1213,11 +1213,11 @@ e1000_watchdog(unsigned long data) ...@@ -1213,11 +1213,11 @@ e1000_watchdog(unsigned long data)
struct e1000_adapter *adapter = (struct e1000_adapter *) data; struct e1000_adapter *adapter = (struct e1000_adapter *) data;
struct net_device *netdev = adapter->netdev; struct net_device *netdev = adapter->netdev;
e1000_check_for_link(&adapter->shared); e1000_check_for_link(&adapter->hw);
if(E1000_READ_REG(&adapter->shared, STATUS) & E1000_STATUS_LU) { if(E1000_READ_REG(&adapter->hw, STATUS) & E1000_STATUS_LU) {
if(!netif_carrier_ok(netdev)) { if(!netif_carrier_ok(netdev)) {
e1000_get_speed_and_duplex(&adapter->shared, e1000_get_speed_and_duplex(&adapter->hw,
&adapter->link_speed, &adapter->link_speed,
&adapter->link_duplex); &adapter->link_duplex);
...@@ -1304,7 +1304,7 @@ e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev) ...@@ -1304,7 +1304,7 @@ e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
if (time_after(netdev->trans_start, adapter->trans_finish + HZ) && if (time_after(netdev->trans_start, adapter->trans_finish + HZ) &&
/* If transmitting XOFFs, we're not really hung */ /* If transmitting XOFFs, we're not really hung */
!(E1000_READ_REG(&adapter->shared, STATUS) & E1000_STATUS_TXOFF)) { !(E1000_READ_REG(&adapter->hw, STATUS) & E1000_STATUS_TXOFF)) {
adapter->trans_finish = jiffies; adapter->trans_finish = jiffies;
netif_stop_queue(netdev); netif_stop_queue(netdev);
return 1; return 1;
...@@ -1395,7 +1395,7 @@ e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev) ...@@ -1395,7 +1395,7 @@ e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
/* Move the HW Tx Tail Pointer */ /* Move the HW Tx Tail Pointer */
E1000_WRITE_REG(&adapter->shared, TDT, i); E1000_WRITE_REG(&adapter->hw, TDT, i);
netdev->trans_start = jiffies; netdev->trans_start = jiffies;
...@@ -1460,7 +1460,7 @@ e1000_change_mtu(struct net_device *netdev, int new_mtu) ...@@ -1460,7 +1460,7 @@ e1000_change_mtu(struct net_device *netdev, int new_mtu)
if(max_frame <= MAXIMUM_ETHERNET_PACKET_SIZE + CRC_LENGTH) { if(max_frame <= MAXIMUM_ETHERNET_PACKET_SIZE + CRC_LENGTH) {
adapter->rx_buffer_len = E1000_RXBUFFER_2048; adapter->rx_buffer_len = E1000_RXBUFFER_2048;
} else if(adapter->shared.mac_type < e1000_82543) { } else if(adapter->hw.mac_type < e1000_82543) {
E1000_ERR("Jumbo Frames not supported on 82542\n"); E1000_ERR("Jumbo Frames not supported on 82542\n");
return -EINVAL; return -EINVAL;
...@@ -1486,7 +1486,7 @@ e1000_change_mtu(struct net_device *netdev, int new_mtu) ...@@ -1486,7 +1486,7 @@ e1000_change_mtu(struct net_device *netdev, int new_mtu)
} }
netdev->mtu = new_mtu; netdev->mtu = new_mtu;
adapter->shared.max_frame_size = max_frame; adapter->hw.max_frame_size = max_frame;
return 0; return 0;
} }
...@@ -1499,7 +1499,7 @@ e1000_change_mtu(struct net_device *netdev, int new_mtu) ...@@ -1499,7 +1499,7 @@ e1000_change_mtu(struct net_device *netdev, int new_mtu)
static void static void
e1000_update_stats(struct e1000_adapter *adapter) e1000_update_stats(struct e1000_adapter *adapter)
{ {
struct e1000_hw *shared = &adapter->shared; struct e1000_hw *hw = &adapter->hw;
unsigned long flags; unsigned long flags;
uint16_t phy_tmp; uint16_t phy_tmp;
...@@ -1512,68 +1512,68 @@ e1000_update_stats(struct e1000_adapter *adapter) ...@@ -1512,68 +1512,68 @@ e1000_update_stats(struct e1000_adapter *adapter)
* be written while holding adapter->stats_lock * be written while holding adapter->stats_lock
*/ */
adapter->stats.crcerrs += E1000_READ_REG(shared, CRCERRS); adapter->stats.crcerrs += E1000_READ_REG(hw, CRCERRS);
adapter->stats.gprc += E1000_READ_REG(shared, GPRC); adapter->stats.gprc += E1000_READ_REG(hw, GPRC);
adapter->stats.gorcl += E1000_READ_REG(shared, GORCL); adapter->stats.gorcl += E1000_READ_REG(hw, GORCL);
adapter->stats.gorch += E1000_READ_REG(shared, GORCH); adapter->stats.gorch += E1000_READ_REG(hw, GORCH);
adapter->stats.bprc += E1000_READ_REG(shared, BPRC); adapter->stats.bprc += E1000_READ_REG(hw, BPRC);
adapter->stats.mprc += E1000_READ_REG(shared, MPRC); adapter->stats.mprc += E1000_READ_REG(hw, MPRC);
adapter->stats.roc += E1000_READ_REG(shared, ROC); adapter->stats.roc += E1000_READ_REG(hw, ROC);
adapter->stats.prc64 += E1000_READ_REG(shared, PRC64); adapter->stats.prc64 += E1000_READ_REG(hw, PRC64);
adapter->stats.prc127 += E1000_READ_REG(shared, PRC127); adapter->stats.prc127 += E1000_READ_REG(hw, PRC127);
adapter->stats.prc255 += E1000_READ_REG(shared, PRC255); adapter->stats.prc255 += E1000_READ_REG(hw, PRC255);
adapter->stats.prc511 += E1000_READ_REG(shared, PRC511); adapter->stats.prc511 += E1000_READ_REG(hw, PRC511);
adapter->stats.prc1023 += E1000_READ_REG(shared, PRC1023); adapter->stats.prc1023 += E1000_READ_REG(hw, PRC1023);
adapter->stats.prc1522 += E1000_READ_REG(shared, PRC1522); adapter->stats.prc1522 += E1000_READ_REG(hw, PRC1522);
spin_unlock_irqrestore(&adapter->stats_lock, flags); spin_unlock_irqrestore(&adapter->stats_lock, flags);
/* the rest of the counters are only modified here */ /* the rest of the counters are only modified here */
adapter->stats.symerrs += E1000_READ_REG(shared, SYMERRS); adapter->stats.symerrs += E1000_READ_REG(hw, SYMERRS);
adapter->stats.mpc += E1000_READ_REG(shared, MPC); adapter->stats.mpc += E1000_READ_REG(hw, MPC);
adapter->stats.scc += E1000_READ_REG(shared, SCC); adapter->stats.scc += E1000_READ_REG(hw, SCC);
adapter->stats.ecol += E1000_READ_REG(shared, ECOL); adapter->stats.ecol += E1000_READ_REG(hw, ECOL);
adapter->stats.mcc += E1000_READ_REG(shared, MCC); adapter->stats.mcc += E1000_READ_REG(hw, MCC);
adapter->stats.latecol += E1000_READ_REG(shared, LATECOL); adapter->stats.latecol += E1000_READ_REG(hw, LATECOL);
adapter->stats.colc += E1000_READ_REG(shared, COLC); adapter->stats.colc += E1000_READ_REG(hw, COLC);
adapter->stats.dc += E1000_READ_REG(shared, DC); adapter->stats.dc += E1000_READ_REG(hw, DC);
adapter->stats.sec += E1000_READ_REG(shared, SEC); adapter->stats.sec += E1000_READ_REG(hw, SEC);
adapter->stats.rlec += E1000_READ_REG(shared, RLEC); adapter->stats.rlec += E1000_READ_REG(hw, RLEC);
adapter->stats.xonrxc += E1000_READ_REG(shared, XONRXC); adapter->stats.xonrxc += E1000_READ_REG(hw, XONRXC);
adapter->stats.xontxc += E1000_READ_REG(shared, XONTXC); adapter->stats.xontxc += E1000_READ_REG(hw, XONTXC);
adapter->stats.xoffrxc += E1000_READ_REG(shared, XOFFRXC); adapter->stats.xoffrxc += E1000_READ_REG(hw, XOFFRXC);
adapter->stats.xofftxc += E1000_READ_REG(shared, XOFFTXC); adapter->stats.xofftxc += E1000_READ_REG(hw, XOFFTXC);
adapter->stats.fcruc += E1000_READ_REG(shared, FCRUC); adapter->stats.fcruc += E1000_READ_REG(hw, FCRUC);
adapter->stats.gptc += E1000_READ_REG(shared, GPTC); adapter->stats.gptc += E1000_READ_REG(hw, GPTC);
adapter->stats.gotcl += E1000_READ_REG(shared, GOTCL); adapter->stats.gotcl += E1000_READ_REG(hw, GOTCL);
adapter->stats.gotch += E1000_READ_REG(shared, GOTCH); adapter->stats.gotch += E1000_READ_REG(hw, GOTCH);
adapter->stats.rnbc += E1000_READ_REG(shared, RNBC); adapter->stats.rnbc += E1000_READ_REG(hw, RNBC);
adapter->stats.ruc += E1000_READ_REG(shared, RUC); adapter->stats.ruc += E1000_READ_REG(hw, RUC);
adapter->stats.rfc += E1000_READ_REG(shared, RFC); adapter->stats.rfc += E1000_READ_REG(hw, RFC);
adapter->stats.rjc += E1000_READ_REG(shared, RJC); adapter->stats.rjc += E1000_READ_REG(hw, RJC);
adapter->stats.torl += E1000_READ_REG(shared, TORL); adapter->stats.torl += E1000_READ_REG(hw, TORL);
adapter->stats.torh += E1000_READ_REG(shared, TORH); adapter->stats.torh += E1000_READ_REG(hw, TORH);
adapter->stats.totl += E1000_READ_REG(shared, TOTL); adapter->stats.totl += E1000_READ_REG(hw, TOTL);
adapter->stats.toth += E1000_READ_REG(shared, TOTH); adapter->stats.toth += E1000_READ_REG(hw, TOTH);
adapter->stats.tpr += E1000_READ_REG(shared, TPR); adapter->stats.tpr += E1000_READ_REG(hw, TPR);
adapter->stats.tpt += E1000_READ_REG(shared, TPT); adapter->stats.tpt += E1000_READ_REG(hw, TPT);
adapter->stats.ptc64 += E1000_READ_REG(shared, PTC64); adapter->stats.ptc64 += E1000_READ_REG(hw, PTC64);
adapter->stats.ptc127 += E1000_READ_REG(shared, PTC127); adapter->stats.ptc127 += E1000_READ_REG(hw, PTC127);
adapter->stats.ptc255 += E1000_READ_REG(shared, PTC255); adapter->stats.ptc255 += E1000_READ_REG(hw, PTC255);
adapter->stats.ptc511 += E1000_READ_REG(shared, PTC511); adapter->stats.ptc511 += E1000_READ_REG(hw, PTC511);
adapter->stats.ptc1023 += E1000_READ_REG(shared, PTC1023); adapter->stats.ptc1023 += E1000_READ_REG(hw, PTC1023);
adapter->stats.ptc1522 += E1000_READ_REG(shared, PTC1522); adapter->stats.ptc1522 += E1000_READ_REG(hw, PTC1522);
adapter->stats.mptc += E1000_READ_REG(shared, MPTC); adapter->stats.mptc += E1000_READ_REG(hw, MPTC);
adapter->stats.bptc += E1000_READ_REG(shared, BPTC); adapter->stats.bptc += E1000_READ_REG(hw, BPTC);
if(adapter->shared.mac_type >= e1000_82543) { if(adapter->hw.mac_type >= e1000_82543) {
adapter->stats.algnerrc += E1000_READ_REG(shared, ALGNERRC); adapter->stats.algnerrc += E1000_READ_REG(hw, ALGNERRC);
adapter->stats.rxerrc += E1000_READ_REG(shared, RXERRC); adapter->stats.rxerrc += E1000_READ_REG(hw, RXERRC);
adapter->stats.tncrs += E1000_READ_REG(shared, TNCRS); adapter->stats.tncrs += E1000_READ_REG(hw, TNCRS);
adapter->stats.cexterr += E1000_READ_REG(shared, CEXTERR); adapter->stats.cexterr += E1000_READ_REG(hw, CEXTERR);
adapter->stats.tsctc += E1000_READ_REG(shared, TSCTC); adapter->stats.tsctc += E1000_READ_REG(hw, TSCTC);
adapter->stats.tsctfc += E1000_READ_REG(shared, TSCTFC); adapter->stats.tsctfc += E1000_READ_REG(hw, TSCTFC);
} }
/* Fill out the OS statistics structure */ /* Fill out the OS statistics structure */
...@@ -1609,14 +1609,14 @@ e1000_update_stats(struct e1000_adapter *adapter) ...@@ -1609,14 +1609,14 @@ e1000_update_stats(struct e1000_adapter *adapter)
/* Phy Stats */ /* Phy Stats */
if(shared->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(shared, PHY_1000T_STATUS, &phy_tmp))) { (!e1000_read_phy_reg(hw, PHY_1000T_STATUS, &phy_tmp))) {
phy_tmp &= PHY_IDLE_ERROR_COUNT_MASK; phy_tmp &= PHY_IDLE_ERROR_COUNT_MASK;
adapter->phy_stats.idle_errors += phy_tmp; adapter->phy_stats.idle_errors += phy_tmp;
} }
if(!e1000_read_phy_reg(shared, M88E1000_RX_ERR_CNTR, &phy_tmp)) if(!e1000_read_phy_reg(hw, M88E1000_RX_ERR_CNTR, &phy_tmp))
adapter->phy_stats.receive_errors += phy_tmp; adapter->phy_stats.receive_errors += phy_tmp;
} }
} }
...@@ -1630,7 +1630,7 @@ static inline void ...@@ -1630,7 +1630,7 @@ static inline void
e1000_irq_disable(struct e1000_adapter *adapter) e1000_irq_disable(struct e1000_adapter *adapter)
{ {
atomic_inc(&adapter->irq_sem); atomic_inc(&adapter->irq_sem);
E1000_WRITE_REG(&adapter->shared, IMC, ~0); E1000_WRITE_REG(&adapter->hw, IMC, ~0);
synchronize_irq(); synchronize_irq();
return; return;
} }
...@@ -1644,7 +1644,7 @@ static inline void ...@@ -1644,7 +1644,7 @@ static inline void
e1000_irq_enable(struct e1000_adapter *adapter) e1000_irq_enable(struct e1000_adapter *adapter)
{ {
if(atomic_dec_and_test(&adapter->irq_sem)) if(atomic_dec_and_test(&adapter->irq_sem))
E1000_WRITE_REG(&adapter->shared, IMS, IMS_ENABLE_MASK); E1000_WRITE_REG(&adapter->hw, IMS, IMS_ENABLE_MASK);
return; return;
} }
...@@ -1663,11 +1663,11 @@ e1000_intr(int irq, void *data, struct pt_regs *regs) ...@@ -1663,11 +1663,11 @@ e1000_intr(int irq, void *data, struct pt_regs *regs)
uint32_t icr; uint32_t icr;
int i = E1000_MAX_INTR; int i = E1000_MAX_INTR;
while(i && (icr = E1000_READ_REG(&adapter->shared, ICR))) { while(i && (icr = E1000_READ_REG(&adapter->hw, ICR))) {
if(icr & (E1000_ICR_RXSEQ | E1000_ICR_LSC)) { if(icr & (E1000_ICR_RXSEQ | E1000_ICR_LSC)) {
/* run the watchdog ASAP */ /* run the watchdog ASAP */
adapter->shared.get_link_status = 1; adapter->hw.get_link_status = 1;
mod_timer(&adapter->watchdog_timer, jiffies); mod_timer(&adapter->watchdog_timer, jiffies);
} }
...@@ -1789,12 +1789,12 @@ e1000_clean_rx_irq(struct e1000_adapter *adapter) ...@@ -1789,12 +1789,12 @@ e1000_clean_rx_irq(struct e1000_adapter *adapter)
last_byte = *(skb->data + length - 1); last_byte = *(skb->data + length - 1);
if(TBI_ACCEPT(&adapter->shared, rx_desc->status, if(TBI_ACCEPT(&adapter->hw, rx_desc->status,
rx_desc->errors, length, last_byte)) { rx_desc->errors, length, last_byte)) {
spin_lock_irqsave(&adapter->stats_lock, flags); spin_lock_irqsave(&adapter->stats_lock, flags);
e1000_tbi_adjust_stats(&adapter->shared, e1000_tbi_adjust_stats(&adapter->hw,
&adapter->stats, &adapter->stats,
length, skb->data); length, skb->data);
...@@ -1896,7 +1896,7 @@ e1000_alloc_rx_buffers(struct e1000_adapter *adapter) ...@@ -1896,7 +1896,7 @@ e1000_alloc_rx_buffers(struct e1000_adapter *adapter)
rx_desc->buffer_addr = cpu_to_le64(rx_ring->buffer_info[i].dma); rx_desc->buffer_addr = cpu_to_le64(rx_ring->buffer_info[i].dma);
/* move tail */ /* move tail */
E1000_WRITE_REG(&adapter->shared, RDT, i); E1000_WRITE_REG(&adapter->hw, RDT, i);
atomic_dec(&rx_ring->unused); atomic_dec(&rx_ring->unused);
...@@ -1938,7 +1938,7 @@ e1000_rx_checksum(struct e1000_adapter *adapter, ...@@ -1938,7 +1938,7 @@ e1000_rx_checksum(struct e1000_adapter *adapter,
struct sk_buff *skb) struct sk_buff *skb)
{ {
/* 82543 or newer only */ /* 82543 or newer only */
if((adapter->shared.mac_type < e1000_82543) || if((adapter->hw.mac_type < e1000_82543) ||
/* Ignore Checksum bit is set */ /* Ignore Checksum bit is set */
(rx_desc->status & E1000_RXD_STAT_IXSM) || (rx_desc->status & E1000_RXD_STAT_IXSM) ||
/* TCP Checksum has not been calculated */ /* TCP Checksum has not been calculated */
...@@ -1972,26 +1972,26 @@ e1000_enable_WOL(struct e1000_adapter *adapter) ...@@ -1972,26 +1972,26 @@ e1000_enable_WOL(struct e1000_adapter *adapter)
{ {
uint32_t wuc; uint32_t wuc;
if(adapter->shared.mac_type < e1000_82544) if(adapter->hw.mac_type < e1000_82544)
return; return;
if(adapter->wol) { if(adapter->wol) {
wuc = E1000_WUC_APME | E1000_WUC_PME_EN | wuc = E1000_WUC_APME | E1000_WUC_PME_EN |
E1000_WUC_PME_STATUS | E1000_WUC_APMPME; E1000_WUC_PME_STATUS | E1000_WUC_APMPME;
E1000_WRITE_REG(&adapter->shared, WUC, wuc); E1000_WRITE_REG(&adapter->hw, WUC, wuc);
E1000_WRITE_REG(&adapter->shared, WUFC, adapter->wol); E1000_WRITE_REG(&adapter->hw, WUFC, adapter->wol);
} }
return; return;
} }
void void
e1000_write_pci_cfg(struct e1000_hw *shared, e1000_write_pci_cfg(struct e1000_hw *hw,
uint32_t reg, uint16_t *value) uint32_t reg, uint16_t *value)
{ {
struct e1000_adapter *adapter = shared->back; struct e1000_adapter *adapter = hw->back;
pci_write_config_word(adapter->pdev, reg, *value); pci_write_config_word(adapter->pdev, reg, *value);
return; return;
......
...@@ -367,7 +367,7 @@ e1000_check_options(struct e1000_adapter *adapter) ...@@ -367,7 +367,7 @@ e1000_check_options(struct e1000_adapter *adapter)
arg: { r: { min: MIN_TXD }} arg: { r: { min: MIN_TXD }}
}; };
struct e1000_desc_ring *tx_ring = &adapter->tx_ring; struct e1000_desc_ring *tx_ring = &adapter->tx_ring;
e1000_mac_type mac_type = adapter->shared.mac_type; e1000_mac_type mac_type = adapter->hw.mac_type;
opt.arg.r.max = mac_type < e1000_82544 ? MAX_TXD : MAX_82544_TXD; opt.arg.r.max = mac_type < e1000_82544 ? MAX_TXD : MAX_82544_TXD;
tx_ring->count = TxDescriptors[bd]; tx_ring->count = TxDescriptors[bd];
...@@ -383,7 +383,7 @@ e1000_check_options(struct e1000_adapter *adapter) ...@@ -383,7 +383,7 @@ e1000_check_options(struct e1000_adapter *adapter)
arg: { r: { min: MIN_RXD }} arg: { r: { min: MIN_RXD }}
}; };
struct e1000_desc_ring *rx_ring = &adapter->rx_ring; struct e1000_desc_ring *rx_ring = &adapter->rx_ring;
e1000_mac_type mac_type = adapter->shared.mac_type; e1000_mac_type mac_type = adapter->hw.mac_type;
opt.arg.r.max = mac_type < e1000_82544 ? MAX_RXD : MAX_82544_RXD; opt.arg.r.max = mac_type < e1000_82544 ? MAX_RXD : MAX_82544_RXD;
rx_ring->count = RxDescriptors[bd]; rx_ring->count = RxDescriptors[bd];
...@@ -421,7 +421,7 @@ e1000_check_options(struct e1000_adapter *adapter) ...@@ -421,7 +421,7 @@ e1000_check_options(struct e1000_adapter *adapter)
int fc = FlowControl[bd]; int fc = FlowControl[bd];
e1000_validate_option(&fc, &opt); e1000_validate_option(&fc, &opt);
adapter->shared.fc = adapter->shared.original_fc = fc; adapter->hw.fc = adapter->hw.original_fc = fc;
} }
{ /* Transmit Interrupt Delay */ { /* Transmit Interrupt Delay */
struct e1000_option opt = { struct e1000_option opt = {
...@@ -443,7 +443,7 @@ e1000_check_options(struct e1000_adapter *adapter) ...@@ -443,7 +443,7 @@ e1000_check_options(struct e1000_adapter *adapter)
name: "Receive Interrupt Delay", name: "Receive Interrupt Delay",
arg: { r: { min: MIN_RXDELAY, max: MAX_RXDELAY }} arg: { r: { min: MIN_RXDELAY, max: MAX_RXDELAY }}
}; };
e1000_mac_type mac_type = adapter->shared.mac_type; e1000_mac_type mac_type = adapter->hw.mac_type;
opt.def = mac_type < e1000_82540 ? DEFAULT_RDTR : DEFAULT_RADV; opt.def = mac_type < e1000_82540 ? DEFAULT_RDTR : DEFAULT_RADV;
opt.err = mac_type < e1000_82540 ? rdtr : radv; opt.err = mac_type < e1000_82540 ? rdtr : radv;
...@@ -451,7 +451,7 @@ e1000_check_options(struct e1000_adapter *adapter) ...@@ -451,7 +451,7 @@ e1000_check_options(struct e1000_adapter *adapter)
e1000_validate_option(&adapter->rx_int_delay, &opt); e1000_validate_option(&adapter->rx_int_delay, &opt);
} }
switch(adapter->shared.media_type) { switch(adapter->hw.media_type) {
case e1000_media_type_fiber: case e1000_media_type_fiber:
e1000_check_fiber_options(adapter); e1000_check_fiber_options(adapter);
break; break;
...@@ -540,7 +540,7 @@ e1000_check_copper_options(struct e1000_adapter *adapter) ...@@ -540,7 +540,7 @@ e1000_check_copper_options(struct e1000_adapter *adapter)
printk(KERN_INFO printk(KERN_INFO
"AutoNeg specified along with Speed or Duplex, " "AutoNeg specified along with Speed or Duplex, "
"parameter ignored\n"); "parameter ignored\n");
adapter->shared.autoneg_advertised = AUTONEG_ADV_DEFAULT; adapter->hw.autoneg_advertised = AUTONEG_ADV_DEFAULT;
} else { /* Autoneg */ } else { /* Autoneg */
struct e1000_opt_list an_list[] = struct e1000_opt_list an_list[] =
#define AA "Autoneg advertising " #define AA "Autoneg advertising "
...@@ -586,12 +586,12 @@ e1000_check_copper_options(struct e1000_adapter *adapter) ...@@ -586,12 +586,12 @@ e1000_check_copper_options(struct e1000_adapter *adapter)
int an = AutoNeg[bd]; int an = AutoNeg[bd];
e1000_validate_option(&an, &opt); e1000_validate_option(&an, &opt);
adapter->shared.autoneg_advertised = an; adapter->hw.autoneg_advertised = an;
} }
switch (speed + dplx) { switch (speed + dplx) {
case 0: case 0:
adapter->shared.autoneg = 1; adapter->hw.autoneg = 1;
if(Speed[bd] != OPTION_UNSET || Duplex[bd] != OPTION_UNSET) if(Speed[bd] != OPTION_UNSET || Duplex[bd] != OPTION_UNSET)
printk(KERN_INFO printk(KERN_INFO
"Speed and duplex autonegotiation enabled\n"); "Speed and duplex autonegotiation enabled\n");
...@@ -599,75 +599,75 @@ e1000_check_copper_options(struct e1000_adapter *adapter) ...@@ -599,75 +599,75 @@ e1000_check_copper_options(struct e1000_adapter *adapter)
case HALF_DUPLEX: case HALF_DUPLEX:
printk(KERN_INFO "Half Duplex specified without Speed\n"); printk(KERN_INFO "Half Duplex specified without Speed\n");
printk(KERN_INFO "Using Autonegotiation at Half Duplex only\n"); printk(KERN_INFO "Using Autonegotiation at Half Duplex only\n");
adapter->shared.autoneg = 1; adapter->hw.autoneg = 1;
adapter->shared.autoneg_advertised = ADVERTISE_10_HALF | adapter->hw.autoneg_advertised = ADVERTISE_10_HALF |
ADVERTISE_100_HALF; ADVERTISE_100_HALF;
break; break;
case FULL_DUPLEX: case FULL_DUPLEX:
printk(KERN_INFO "Full Duplex specified without Speed\n"); printk(KERN_INFO "Full Duplex specified without Speed\n");
printk(KERN_INFO "Using Autonegotiation at Full Duplex only\n"); printk(KERN_INFO "Using Autonegotiation at Full Duplex only\n");
adapter->shared.autoneg = 1; adapter->hw.autoneg = 1;
adapter->shared.autoneg_advertised = ADVERTISE_10_FULL | adapter->hw.autoneg_advertised = ADVERTISE_10_FULL |
ADVERTISE_100_FULL | ADVERTISE_100_FULL |
ADVERTISE_1000_FULL; ADVERTISE_1000_FULL;
break; break;
case SPEED_10: case SPEED_10:
printk(KERN_INFO "10 Mbps Speed specified without Duplex\n"); printk(KERN_INFO "10 Mbps Speed specified without Duplex\n");
printk(KERN_INFO "Using Autonegotiation at 10 Mbps only\n"); printk(KERN_INFO "Using Autonegotiation at 10 Mbps only\n");
adapter->shared.autoneg = 1; adapter->hw.autoneg = 1;
adapter->shared.autoneg_advertised = ADVERTISE_10_HALF | adapter->hw.autoneg_advertised = ADVERTISE_10_HALF |
ADVERTISE_10_FULL; ADVERTISE_10_FULL;
break; break;
case SPEED_10 + HALF_DUPLEX: case SPEED_10 + HALF_DUPLEX:
printk(KERN_INFO "Forcing to 10 Mbps Half Duplex\n"); printk(KERN_INFO "Forcing to 10 Mbps Half Duplex\n");
adapter->shared.autoneg = 0; adapter->hw.autoneg = 0;
adapter->shared.forced_speed_duplex = e1000_10_half; adapter->hw.forced_speed_duplex = e1000_10_half;
adapter->shared.autoneg_advertised = 0; adapter->hw.autoneg_advertised = 0;
break; break;
case SPEED_10 + FULL_DUPLEX: case SPEED_10 + FULL_DUPLEX:
printk(KERN_INFO "Forcing to 10 Mbps Full Duplex\n"); printk(KERN_INFO "Forcing to 10 Mbps Full Duplex\n");
adapter->shared.autoneg = 0; adapter->hw.autoneg = 0;
adapter->shared.forced_speed_duplex = e1000_10_full; adapter->hw.forced_speed_duplex = e1000_10_full;
adapter->shared.autoneg_advertised = 0; adapter->hw.autoneg_advertised = 0;
break; break;
case SPEED_100: case SPEED_100:
printk(KERN_INFO "100 Mbps Speed specified without Duplex\n"); printk(KERN_INFO "100 Mbps Speed specified without Duplex\n");
printk(KERN_INFO "Using Autonegotiation at 100 Mbps only\n"); printk(KERN_INFO "Using Autonegotiation at 100 Mbps only\n");
adapter->shared.autoneg = 1; adapter->hw.autoneg = 1;
adapter->shared.autoneg_advertised = ADVERTISE_100_HALF | adapter->hw.autoneg_advertised = ADVERTISE_100_HALF |
ADVERTISE_100_FULL; ADVERTISE_100_FULL;
break; break;
case SPEED_100 + HALF_DUPLEX: case SPEED_100 + HALF_DUPLEX:
printk(KERN_INFO "Forcing to 100 Mbps Half Duplex\n"); printk(KERN_INFO "Forcing to 100 Mbps Half Duplex\n");
adapter->shared.autoneg = 0; adapter->hw.autoneg = 0;
adapter->shared.forced_speed_duplex = e1000_100_half; adapter->hw.forced_speed_duplex = e1000_100_half;
adapter->shared.autoneg_advertised = 0; adapter->hw.autoneg_advertised = 0;
break; break;
case SPEED_100 + FULL_DUPLEX: case SPEED_100 + FULL_DUPLEX:
printk(KERN_INFO "Forcing to 100 Mbps Full Duplex\n"); printk(KERN_INFO "Forcing to 100 Mbps Full Duplex\n");
adapter->shared.autoneg = 0; adapter->hw.autoneg = 0;
adapter->shared.forced_speed_duplex = e1000_100_full; adapter->hw.forced_speed_duplex = e1000_100_full;
adapter->shared.autoneg_advertised = 0; adapter->hw.autoneg_advertised = 0;
break; break;
case SPEED_1000: case SPEED_1000:
printk(KERN_INFO "1000 Mbps Speed specified without Duplex\n"); printk(KERN_INFO "1000 Mbps Speed specified without Duplex\n");
printk(KERN_INFO printk(KERN_INFO
"Using Autonegotiation at 1000 Mbps Full Duplex only\n"); "Using Autonegotiation at 1000 Mbps Full Duplex only\n");
adapter->shared.autoneg = 1; adapter->hw.autoneg = 1;
adapter->shared.autoneg_advertised = ADVERTISE_1000_FULL; adapter->hw.autoneg_advertised = ADVERTISE_1000_FULL;
break; break;
case SPEED_1000 + HALF_DUPLEX: case SPEED_1000 + HALF_DUPLEX:
printk(KERN_INFO "Half Duplex is not supported at 1000 Mbps\n"); printk(KERN_INFO "Half Duplex is not supported at 1000 Mbps\n");
printk(KERN_INFO printk(KERN_INFO
"Using Autonegotiation at 1000 Mbps Full Duplex only\n"); "Using Autonegotiation at 1000 Mbps Full Duplex only\n");
adapter->shared.autoneg = 1; adapter->hw.autoneg = 1;
adapter->shared.autoneg_advertised = ADVERTISE_1000_FULL; adapter->hw.autoneg_advertised = ADVERTISE_1000_FULL;
break; break;
case SPEED_1000 + FULL_DUPLEX: case SPEED_1000 + FULL_DUPLEX:
printk(KERN_INFO printk(KERN_INFO
"Using Autonegotiation at 1000 Mbps Full Duplex only\n"); "Using Autonegotiation at 1000 Mbps Full Duplex only\n");
adapter->shared.autoneg = 1; adapter->hw.autoneg = 1;
adapter->shared.autoneg_advertised = ADVERTISE_1000_FULL; adapter->hw.autoneg_advertised = ADVERTISE_1000_FULL;
break; break;
default: default:
BUG(); BUG();
...@@ -686,7 +686,7 @@ e1000_check_copper_options(struct e1000_adapter *adapter) ...@@ -686,7 +686,7 @@ e1000_check_copper_options(struct e1000_adapter *adapter)
int mdix = MdiX[bd]; int mdix = MdiX[bd];
e1000_validate_option(&mdix, &opt); e1000_validate_option(&mdix, &opt);
adapter->shared.mdix = mdix; adapter->hw.mdix = mdix;
} }
{ /* Automatic Correction for Reverse Cable Polarity */ { /* Automatic Correction for Reverse Cable Polarity */
/* option is actually to disable polarity correction, /* option is actually to disable polarity correction,
...@@ -700,11 +700,11 @@ e1000_check_copper_options(struct e1000_adapter *adapter) ...@@ -700,11 +700,11 @@ e1000_check_copper_options(struct e1000_adapter *adapter)
int dpc = DisablePolarityCorrection[bd]; int dpc = DisablePolarityCorrection[bd];
e1000_validate_option(&dpc, &opt); e1000_validate_option(&dpc, &opt);
adapter->shared.disable_polarity_correction = dpc; adapter->hw.disable_polarity_correction = dpc;
} }
/* Speed, AutoNeg and MDI/MDI-X must all play nice */ /* Speed, AutoNeg and MDI/MDI-X must all play nice */
if (e1000_validate_mdi_setting(&(adapter->shared)) < 0) { if (e1000_validate_mdi_setting(&(adapter->hw)) < 0) {
printk(KERN_INFO "Speed, AutoNeg and MDI-X specifications are " printk(KERN_INFO "Speed, AutoNeg and MDI-X specifications are "
"incompatible. Setting MDI-X to a compatible value.\n"); "incompatible. Setting MDI-X to a compatible value.\n");
} }
......
...@@ -490,7 +490,7 @@ e1000_proc_media_type(void *data, size_t len, char *buf) ...@@ -490,7 +490,7 @@ e1000_proc_media_type(void *data, size_t len, char *buf)
{ {
struct e1000_adapter *adapter = data; struct e1000_adapter *adapter = data;
sprintf(buf, sprintf(buf,
adapter->shared.media_type == e1000_media_type_copper ? adapter->hw.media_type == e1000_media_type_copper ?
"Copper" : "Fiber"); "Copper" : "Fiber");
return buf; return buf;
} }
...@@ -591,7 +591,7 @@ e1000_proc_rx_status(void *data, size_t len, char *buf) ...@@ -591,7 +591,7 @@ e1000_proc_rx_status(void *data, size_t len, char *buf)
static void __devinit static void __devinit
e1000_proc_list_setup(struct e1000_adapter *adapter) e1000_proc_list_setup(struct e1000_adapter *adapter)
{ {
struct e1000_hw *shared = &adapter->shared; struct e1000_hw *hw = &adapter->hw;
struct list_head *proc_list_head = &adapter->proc_list_head; struct list_head *proc_list_head = &adapter->proc_list_head;
INIT_LIST_HEAD(proc_list_head); INIT_LIST_HEAD(proc_list_head);
...@@ -600,21 +600,21 @@ e1000_proc_list_setup(struct e1000_adapter *adapter) ...@@ -600,21 +600,21 @@ e1000_proc_list_setup(struct e1000_adapter *adapter)
LIST_ADD_F("Part_Number", &adapter->part_num, e1000_proc_part_number); LIST_ADD_F("Part_Number", &adapter->part_num, e1000_proc_part_number);
LIST_ADD_S("Driver_Name", e1000_driver_name); LIST_ADD_S("Driver_Name", e1000_driver_name);
LIST_ADD_S("Driver_Version", e1000_driver_version); LIST_ADD_S("Driver_Version", e1000_driver_version);
LIST_ADD_H("PCI_Vendor", &shared->vendor_id); LIST_ADD_H("PCI_Vendor", &hw->vendor_id);
LIST_ADD_H("PCI_Device_ID", &shared->device_id); LIST_ADD_H("PCI_Device_ID", &hw->device_id);
LIST_ADD_H("PCI_Subsystem_Vendor", &shared->subsystem_vendor_id); LIST_ADD_H("PCI_Subsystem_Vendor", &hw->subsystem_vendor_id);
LIST_ADD_H("PCI_Subsystem_ID", &shared->subsystem_id); LIST_ADD_H("PCI_Subsystem_ID", &hw->subsystem_id);
LIST_ADD_H("PCI_Revision_ID", &shared->revision_id); LIST_ADD_H("PCI_Revision_ID", &hw->revision_id);
LIST_ADD_U("PCI_Bus", &adapter->pdev->bus->number); LIST_ADD_U("PCI_Bus", &adapter->pdev->bus->number);
LIST_ADD_F("PCI_Slot", adapter, e1000_proc_slot); LIST_ADD_F("PCI_Slot", adapter, e1000_proc_slot);
if(adapter->shared.mac_type >= e1000_82543) { if(adapter->hw.mac_type >= e1000_82543) {
LIST_ADD_F("PCI_Bus_Type", LIST_ADD_F("PCI_Bus_Type",
&shared->bus_type, e1000_proc_bus_type); &hw->bus_type, e1000_proc_bus_type);
LIST_ADD_F("PCI_Bus_Speed", LIST_ADD_F("PCI_Bus_Speed",
&shared->bus_speed, e1000_proc_bus_speed); &hw->bus_speed, e1000_proc_bus_speed);
LIST_ADD_F("PCI_Bus_Width", LIST_ADD_F("PCI_Bus_Width",
&shared->bus_width, e1000_proc_bus_width); &hw->bus_width, e1000_proc_bus_width);
} }
LIST_ADD_U("IRQ", &adapter->pdev->irq); LIST_ADD_U("IRQ", &adapter->pdev->irq);
...@@ -622,7 +622,7 @@ e1000_proc_list_setup(struct e1000_adapter *adapter) ...@@ -622,7 +622,7 @@ e1000_proc_list_setup(struct e1000_adapter *adapter)
LIST_ADD_F("Current_HWaddr", LIST_ADD_F("Current_HWaddr",
adapter->netdev->dev_addr, e1000_proc_hwaddr); adapter->netdev->dev_addr, e1000_proc_hwaddr);
LIST_ADD_F("Permanent_HWaddr", LIST_ADD_F("Permanent_HWaddr",
adapter->shared.perm_mac_addr, e1000_proc_hwaddr); adapter->hw.perm_mac_addr, e1000_proc_hwaddr);
LIST_ADD_BLANK(); LIST_ADD_BLANK();
...@@ -669,7 +669,7 @@ e1000_proc_list_setup(struct e1000_adapter *adapter) ...@@ -669,7 +669,7 @@ e1000_proc_list_setup(struct e1000_adapter *adapter)
LIST_ADD_U("Rx_Short_Length_Errors", &adapter->stats.ruc); LIST_ADD_U("Rx_Short_Length_Errors", &adapter->stats.ruc);
/* The 82542 does not have an alignment error count register */ /* The 82542 does not have an alignment error count register */
if(adapter->shared.mac_type >= e1000_82543) if(adapter->hw.mac_type >= e1000_82543)
LIST_ADD_U("Rx_Align_Errors", &adapter->stats.algnerrc); LIST_ADD_U("Rx_Align_Errors", &adapter->stats.algnerrc);
LIST_ADD_U("Rx_Flow_Control_XON", &adapter->stats.xonrxc); LIST_ADD_U("Rx_Flow_Control_XON", &adapter->stats.xonrxc);
...@@ -683,7 +683,7 @@ e1000_proc_list_setup(struct e1000_adapter *adapter) ...@@ -683,7 +683,7 @@ e1000_proc_list_setup(struct e1000_adapter *adapter)
/* Cable diags */ /* Cable diags */
LIST_ADD_F("PHY_Media_Type", adapter, e1000_proc_media_type); LIST_ADD_F("PHY_Media_Type", adapter, e1000_proc_media_type);
if(adapter->shared.media_type == e1000_media_type_copper) { if(adapter->hw.media_type == e1000_media_type_copper) {
LIST_ADD_F("PHY_Cable_Length", LIST_ADD_F("PHY_Cable_Length",
adapter, e1000_proc_cable_length); adapter, e1000_proc_cable_length);
LIST_ADD_F("PHY_Extended_10Base_T_Distance", LIST_ADD_F("PHY_Extended_10Base_T_Distance",
......
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