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 {
struct net_device_stats net_stats;
/* structs defined in e1000_hw.h */
struct e1000_hw shared;
struct e1000_hw hw;
struct e1000_hw_stats stats;
struct e1000_phy_info phy_info;
struct e1000_phy_stats phy_stats;
......
......@@ -88,9 +88,9 @@ extern void e1000_enable_WOL(struct e1000_adapter *adapter);
static void
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 |
SUPPORTED_10baseT_Full |
......@@ -102,18 +102,18 @@ e1000_ethtool_gset(struct e1000_adapter *adapter, struct ethtool_cmd *ecmd)
ecmd->advertising = ADVERTISED_TP;
if(shared->autoneg == 1) {
if(hw->autoneg == 1) {
ecmd->advertising |= ADVERTISED_Autoneg;
/* the e1000 autoneg seems to match ethtool nicely */
ecmd->advertising |= shared->autoneg_advertised;
ecmd->advertising |= hw->autoneg_advertised;
}
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;
else
ecmd->transceiver = XCVR_INTERNAL;
......@@ -134,7 +134,7 @@ e1000_ethtool_gset(struct e1000_adapter *adapter, struct ethtool_cmd *ecmd)
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);
ecmd->speed = adapter->link_speed;
......@@ -150,7 +150,7 @@ e1000_ethtool_gset(struct e1000_adapter *adapter, struct ethtool_cmd *ecmd)
ecmd->duplex = -1;
}
ecmd->autoneg = (shared->autoneg ? AUTONEG_ENABLE : AUTONEG_DISABLE);
ecmd->autoneg = (hw->autoneg ? AUTONEG_ENABLE : AUTONEG_DISABLE);
return;
}
......@@ -158,29 +158,29 @@ e1000_ethtool_gset(struct e1000_adapter *adapter, struct ethtool_cmd *ecmd)
static int
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) {
shared->autoneg = 1;
shared->autoneg_advertised = (ecmd->advertising & 0x002F);
hw->autoneg = 1;
hw->autoneg_advertised = (ecmd->advertising & 0x002F);
} else {
shared->autoneg = 0;
hw->autoneg = 0;
switch(ecmd->speed + ecmd->duplex) {
case SPEED_10 + DUPLEX_HALF:
shared->forced_speed_duplex = e1000_10_half;
hw->forced_speed_duplex = e1000_10_half;
break;
case SPEED_10 + DUPLEX_FULL:
shared->forced_speed_duplex = e1000_10_full;
hw->forced_speed_duplex = e1000_10_full;
break;
case SPEED_100 + DUPLEX_HALF:
shared->forced_speed_duplex = e1000_100_half;
hw->forced_speed_duplex = e1000_100_half;
break;
case SPEED_100 + DUPLEX_FULL:
shared->forced_speed_duplex = e1000_100_full;
hw->forced_speed_duplex = e1000_100_full;
break;
case SPEED_1000 + DUPLEX_FULL:
shared->autoneg = 1;
shared->autoneg_advertised = ADVERTISE_1000_FULL;
hw->autoneg = 1;
hw->autoneg_advertised = ADVERTISE_1000_FULL;
break;
case SPEED_1000 + DUPLEX_HALF: /* not supported */
default:
......@@ -197,10 +197,10 @@ e1000_ethtool_sset(struct e1000_adapter *adapter, struct ethtool_cmd *ecmd)
}
static inline int
e1000_eeprom_size(struct e1000_hw *shared)
e1000_eeprom_size(struct e1000_hw *hw)
{
if((shared->mac_type > e1000_82544) &&
(E1000_READ_REG(shared, EECD) & E1000_EECD_SIZE))
if((hw->mac_type > e1000_82544) &&
(E1000_READ_REG(hw, EECD) & E1000_EECD_SIZE))
return 512;
else
return 128;
......@@ -214,7 +214,7 @@ e1000_ethtool_gdrvinfo(struct e1000_adapter *adapter,
strncpy(drvinfo->version, e1000_driver_version, 32);
strncpy(drvinfo->fw_version, "", 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;
}
......@@ -222,26 +222,26 @@ static void
e1000_ethtool_geeprom(struct e1000_adapter *adapter,
struct ethtool_eeprom *eeprom, uint16_t *eeprom_buff)
{
struct e1000_hw *shared = &adapter->shared;
struct e1000_hw *hw = &adapter->hw;
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)
eeprom->len = (max_len - eeprom->offset);
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
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->wolopts = 0;
return;
......@@ -268,9 +268,9 @@ e1000_ethtool_gwol(struct e1000_adapter *adapter, struct ethtool_wolinfo *wol)
static int
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;
adapter->wol = 0;
......
This diff is collapsed.
......@@ -367,7 +367,7 @@ e1000_check_options(struct e1000_adapter *adapter)
arg: { r: { min: MIN_TXD }}
};
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;
tx_ring->count = TxDescriptors[bd];
......@@ -383,7 +383,7 @@ e1000_check_options(struct e1000_adapter *adapter)
arg: { r: { min: MIN_RXD }}
};
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;
rx_ring->count = RxDescriptors[bd];
......@@ -421,7 +421,7 @@ e1000_check_options(struct e1000_adapter *adapter)
int fc = FlowControl[bd];
e1000_validate_option(&fc, &opt);
adapter->shared.fc = adapter->shared.original_fc = fc;
adapter->hw.fc = adapter->hw.original_fc = fc;
}
{ /* Transmit Interrupt Delay */
struct e1000_option opt = {
......@@ -443,7 +443,7 @@ e1000_check_options(struct e1000_adapter *adapter)
name: "Receive Interrupt Delay",
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.err = mac_type < e1000_82540 ? rdtr : radv;
......@@ -451,7 +451,7 @@ e1000_check_options(struct e1000_adapter *adapter)
e1000_validate_option(&adapter->rx_int_delay, &opt);
}
switch(adapter->shared.media_type) {
switch(adapter->hw.media_type) {
case e1000_media_type_fiber:
e1000_check_fiber_options(adapter);
break;
......@@ -540,7 +540,7 @@ e1000_check_copper_options(struct e1000_adapter *adapter)
printk(KERN_INFO
"AutoNeg specified along with Speed or Duplex, "
"parameter ignored\n");
adapter->shared.autoneg_advertised = AUTONEG_ADV_DEFAULT;
adapter->hw.autoneg_advertised = AUTONEG_ADV_DEFAULT;
} else { /* Autoneg */
struct e1000_opt_list an_list[] =
#define AA "Autoneg advertising "
......@@ -586,12 +586,12 @@ e1000_check_copper_options(struct e1000_adapter *adapter)
int an = AutoNeg[bd];
e1000_validate_option(&an, &opt);
adapter->shared.autoneg_advertised = an;
adapter->hw.autoneg_advertised = an;
}
switch (speed + dplx) {
case 0:
adapter->shared.autoneg = 1;
adapter->hw.autoneg = 1;
if(Speed[bd] != OPTION_UNSET || Duplex[bd] != OPTION_UNSET)
printk(KERN_INFO
"Speed and duplex autonegotiation enabled\n");
......@@ -599,75 +599,75 @@ e1000_check_copper_options(struct e1000_adapter *adapter)
case HALF_DUPLEX:
printk(KERN_INFO "Half Duplex specified without Speed\n");
printk(KERN_INFO "Using Autonegotiation at Half Duplex only\n");
adapter->shared.autoneg = 1;
adapter->shared.autoneg_advertised = ADVERTISE_10_HALF |
adapter->hw.autoneg = 1;
adapter->hw.autoneg_advertised = ADVERTISE_10_HALF |
ADVERTISE_100_HALF;
break;
case FULL_DUPLEX:
printk(KERN_INFO "Full Duplex specified without Speed\n");
printk(KERN_INFO "Using Autonegotiation at Full Duplex only\n");
adapter->shared.autoneg = 1;
adapter->shared.autoneg_advertised = ADVERTISE_10_FULL |
adapter->hw.autoneg = 1;
adapter->hw.autoneg_advertised = ADVERTISE_10_FULL |
ADVERTISE_100_FULL |
ADVERTISE_1000_FULL;
break;
case SPEED_10:
printk(KERN_INFO "10 Mbps Speed specified without Duplex\n");
printk(KERN_INFO "Using Autonegotiation at 10 Mbps only\n");
adapter->shared.autoneg = 1;
adapter->shared.autoneg_advertised = ADVERTISE_10_HALF |
adapter->hw.autoneg = 1;
adapter->hw.autoneg_advertised = ADVERTISE_10_HALF |
ADVERTISE_10_FULL;
break;
case SPEED_10 + HALF_DUPLEX:
printk(KERN_INFO "Forcing to 10 Mbps Half Duplex\n");
adapter->shared.autoneg = 0;
adapter->shared.forced_speed_duplex = e1000_10_half;
adapter->shared.autoneg_advertised = 0;
adapter->hw.autoneg = 0;
adapter->hw.forced_speed_duplex = e1000_10_half;
adapter->hw.autoneg_advertised = 0;
break;
case SPEED_10 + FULL_DUPLEX:
printk(KERN_INFO "Forcing to 10 Mbps Full Duplex\n");
adapter->shared.autoneg = 0;
adapter->shared.forced_speed_duplex = e1000_10_full;
adapter->shared.autoneg_advertised = 0;
adapter->hw.autoneg = 0;
adapter->hw.forced_speed_duplex = e1000_10_full;
adapter->hw.autoneg_advertised = 0;
break;
case SPEED_100:
printk(KERN_INFO "100 Mbps Speed specified without Duplex\n");
printk(KERN_INFO "Using Autonegotiation at 100 Mbps only\n");
adapter->shared.autoneg = 1;
adapter->shared.autoneg_advertised = ADVERTISE_100_HALF |
adapter->hw.autoneg = 1;
adapter->hw.autoneg_advertised = ADVERTISE_100_HALF |
ADVERTISE_100_FULL;
break;
case SPEED_100 + HALF_DUPLEX:
printk(KERN_INFO "Forcing to 100 Mbps Half Duplex\n");
adapter->shared.autoneg = 0;
adapter->shared.forced_speed_duplex = e1000_100_half;
adapter->shared.autoneg_advertised = 0;
adapter->hw.autoneg = 0;
adapter->hw.forced_speed_duplex = e1000_100_half;
adapter->hw.autoneg_advertised = 0;
break;
case SPEED_100 + FULL_DUPLEX:
printk(KERN_INFO "Forcing to 100 Mbps Full Duplex\n");
adapter->shared.autoneg = 0;
adapter->shared.forced_speed_duplex = e1000_100_full;
adapter->shared.autoneg_advertised = 0;
adapter->hw.autoneg = 0;
adapter->hw.forced_speed_duplex = e1000_100_full;
adapter->hw.autoneg_advertised = 0;
break;
case SPEED_1000:
printk(KERN_INFO "1000 Mbps Speed specified without Duplex\n");
printk(KERN_INFO
"Using Autonegotiation at 1000 Mbps Full Duplex only\n");
adapter->shared.autoneg = 1;
adapter->shared.autoneg_advertised = ADVERTISE_1000_FULL;
adapter->hw.autoneg = 1;
adapter->hw.autoneg_advertised = ADVERTISE_1000_FULL;
break;
case SPEED_1000 + HALF_DUPLEX:
printk(KERN_INFO "Half Duplex is not supported at 1000 Mbps\n");
printk(KERN_INFO
"Using Autonegotiation at 1000 Mbps Full Duplex only\n");
adapter->shared.autoneg = 1;
adapter->shared.autoneg_advertised = ADVERTISE_1000_FULL;
adapter->hw.autoneg = 1;
adapter->hw.autoneg_advertised = ADVERTISE_1000_FULL;
break;
case SPEED_1000 + FULL_DUPLEX:
printk(KERN_INFO
"Using Autonegotiation at 1000 Mbps Full Duplex only\n");
adapter->shared.autoneg = 1;
adapter->shared.autoneg_advertised = ADVERTISE_1000_FULL;
adapter->hw.autoneg = 1;
adapter->hw.autoneg_advertised = ADVERTISE_1000_FULL;
break;
default:
BUG();
......@@ -686,7 +686,7 @@ e1000_check_copper_options(struct e1000_adapter *adapter)
int mdix = MdiX[bd];
e1000_validate_option(&mdix, &opt);
adapter->shared.mdix = mdix;
adapter->hw.mdix = mdix;
}
{ /* Automatic Correction for Reverse Cable Polarity */
/* option is actually to disable polarity correction,
......@@ -700,11 +700,11 @@ e1000_check_copper_options(struct e1000_adapter *adapter)
int dpc = DisablePolarityCorrection[bd];
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 */
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 "
"incompatible. Setting MDI-X to a compatible value.\n");
}
......
......@@ -490,7 +490,7 @@ e1000_proc_media_type(void *data, size_t len, char *buf)
{
struct e1000_adapter *adapter = data;
sprintf(buf,
adapter->shared.media_type == e1000_media_type_copper ?
adapter->hw.media_type == e1000_media_type_copper ?
"Copper" : "Fiber");
return buf;
}
......@@ -591,7 +591,7 @@ e1000_proc_rx_status(void *data, size_t len, char *buf)
static void __devinit
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;
INIT_LIST_HEAD(proc_list_head);
......@@ -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_S("Driver_Name", e1000_driver_name);
LIST_ADD_S("Driver_Version", e1000_driver_version);
LIST_ADD_H("PCI_Vendor", &shared->vendor_id);
LIST_ADD_H("PCI_Device_ID", &shared->device_id);
LIST_ADD_H("PCI_Subsystem_Vendor", &shared->subsystem_vendor_id);
LIST_ADD_H("PCI_Subsystem_ID", &shared->subsystem_id);
LIST_ADD_H("PCI_Revision_ID", &shared->revision_id);
LIST_ADD_H("PCI_Vendor", &hw->vendor_id);
LIST_ADD_H("PCI_Device_ID", &hw->device_id);
LIST_ADD_H("PCI_Subsystem_Vendor", &hw->subsystem_vendor_id);
LIST_ADD_H("PCI_Subsystem_ID", &hw->subsystem_id);
LIST_ADD_H("PCI_Revision_ID", &hw->revision_id);
LIST_ADD_U("PCI_Bus", &adapter->pdev->bus->number);
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",
&shared->bus_type, e1000_proc_bus_type);
&hw->bus_type, e1000_proc_bus_type);
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",
&shared->bus_width, e1000_proc_bus_width);
&hw->bus_width, e1000_proc_bus_width);
}
LIST_ADD_U("IRQ", &adapter->pdev->irq);
......@@ -622,7 +622,7 @@ e1000_proc_list_setup(struct e1000_adapter *adapter)
LIST_ADD_F("Current_HWaddr",
adapter->netdev->dev_addr, e1000_proc_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();
......@@ -669,7 +669,7 @@ e1000_proc_list_setup(struct e1000_adapter *adapter)
LIST_ADD_U("Rx_Short_Length_Errors", &adapter->stats.ruc);
/* 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_Flow_Control_XON", &adapter->stats.xonrxc);
......@@ -683,7 +683,7 @@ e1000_proc_list_setup(struct e1000_adapter *adapter)
/* Cable diags */
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",
adapter, e1000_proc_cable_length);
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