Commit 09377d52 authored by Christopher Goldfarb's avatar Christopher Goldfarb Committed by Jeff Garzik

e1000 net drvr update 2/13:

Update to low level hardware code.  Adds support for the new 
82540 device.  Replaces e1000_mac.c e1000_mac.h e1000_phy.c and 
e1000_phy.h with e1000_hw.c and e1000_hw.c.  Changes to the 
makefile, header includes, and some minor function syntax 
changes to get the driver working with the new code.
parent 6d87fb78
...@@ -9,8 +9,7 @@ ...@@ -9,8 +9,7 @@
O_TARGET := e1000.o O_TARGET := e1000.o
obj-y := e1000_main.o e1000_mac.o e1000_phy.o \ obj-y := e1000_main.o e1000_hw.o e1000_ethtool.o e1000_param.o e1000_proc.o
e1000_ethtool.o e1000_param.o e1000_proc.o
obj-m := $(O_TARGET) obj-m := $(O_TARGET)
include $(TOPDIR)/Rules.make include $(TOPDIR)/Rules.make
...@@ -111,8 +111,7 @@ ...@@ -111,8 +111,7 @@
struct e1000_adapter; struct e1000_adapter;
#include "e1000_mac.h" #include "e1000_hw.h"
#include "e1000_phy.h"
#define BAR_0 0 #define BAR_0 0
...@@ -219,9 +218,9 @@ struct e1000_adapter { ...@@ -219,9 +218,9 @@ struct e1000_adapter {
struct pci_dev *pdev; struct pci_dev *pdev;
struct net_device_stats net_stats; struct net_device_stats net_stats;
/* structs defined in e1000_mac.h or e1000_phy.h */ /* structs defined in e1000_hw.h */
struct e1000_shared_adapter shared; struct e1000_hw shared;
struct e1000_shared_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,7 +88,7 @@ extern void e1000_enable_WOL(struct e1000_adapter *adapter); ...@@ -88,7 +88,7 @@ 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_shared_adapter *shared = &adapter->shared; struct e1000_hw *shared = &adapter->shared;
if(shared->media_type == e1000_media_type_copper) { if(shared->media_type == e1000_media_type_copper) {
...@@ -158,7 +158,7 @@ e1000_ethtool_gset(struct e1000_adapter *adapter, struct ethtool_cmd *ecmd) ...@@ -158,7 +158,7 @@ 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_shared_adapter *shared = &adapter->shared; struct e1000_hw *shared = &adapter->shared;
if(ecmd->autoneg == AUTONEG_ENABLE) { if(ecmd->autoneg == AUTONEG_ENABLE) {
shared->autoneg = 1; shared->autoneg = 1;
...@@ -197,8 +197,12 @@ e1000_ethtool_sset(struct e1000_adapter *adapter, struct ethtool_cmd *ecmd) ...@@ -197,8 +197,12 @@ e1000_ethtool_sset(struct e1000_adapter *adapter, struct ethtool_cmd *ecmd)
} }
static inline int static inline int
e1000_eeprom_size(struct e1000_shared_adapter *shared) e1000_eeprom_size(struct e1000_hw *shared)
{ {
if((shared->mac_type > e1000_82544) &&
(E1000_READ_REG(shared, EECD) & E1000_EECD_SIZE))
return 512;
else
return 128; return 128;
} }
...@@ -218,7 +222,7 @@ static void ...@@ -218,7 +222,7 @@ 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_shared_adapter *shared = &adapter->shared; struct e1000_hw *shared = &adapter->shared;
int i, max_len; int i, max_len;
eeprom->magic = shared->vendor_id | (shared->device_id << 16); eeprom->magic = shared->vendor_id | (shared->device_id << 16);
...@@ -229,15 +233,13 @@ e1000_ethtool_geeprom(struct e1000_adapter *adapter, ...@@ -229,15 +233,13 @@ e1000_ethtool_geeprom(struct e1000_adapter *adapter,
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++)
eeprom_buff[i] = e1000_read_eeprom(&adapter->shared, i); e1000_read_eeprom(&adapter->shared, i, &eeprom_buff[i]);
return;
} }
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_shared_adapter *shared = &adapter->shared; struct e1000_hw *shared = &adapter->shared;
if(shared->mac_type < e1000_82544) { if(shared->mac_type < e1000_82544) {
wol->supported = 0; wol->supported = 0;
...@@ -266,7 +268,7 @@ e1000_ethtool_gwol(struct e1000_adapter *adapter, struct ethtool_wolinfo *wol) ...@@ -266,7 +268,7 @@ 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_shared_adapter *shared = &adapter->shared; struct e1000_hw *shared = &adapter->shared;
if(shared->mac_type < e1000_82544) if(shared->mac_type < e1000_82544)
return wol->wolopts == 0 ? 0 : -EOPNOTSUPP; return wol->wolopts == 0 ? 0 : -EOPNOTSUPP;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -99,6 +99,7 @@ static struct pci_device_id e1000_pci_tbl[] __devinitdata = { ...@@ -99,6 +99,7 @@ static struct pci_device_id e1000_pci_tbl[] __devinitdata = {
{0x8086, 0x1008, 0x8086, 0x1107, 0, 0, 0}, {0x8086, 0x1008, 0x8086, 0x1107, 0, 0, 0},
{0x8086, 0x1009, 0x8086, 0x1109, 0, 0, 0}, {0x8086, 0x1009, 0x8086, 0x1109, 0, 0, 0},
{0x8086, 0x100C, 0x8086, 0x1112, 0, 0, 0}, {0x8086, 0x100C, 0x8086, 0x1112, 0, 0, 0},
{0x8086, 0x100E, 0x8086, 0x001E, 0, 0, 0},
/* Compaq Gigabit Ethernet Server Adapter */ /* Compaq Gigabit Ethernet Server Adapter */
{0x8086, 0x1000, 0x0E11, PCI_ANY_ID, 0, 0, 1}, {0x8086, 0x1000, 0x0E11, PCI_ANY_ID, 0, 0, 1},
{0x8086, 0x1001, 0x0E11, PCI_ANY_ID, 0, 0, 1}, {0x8086, 0x1001, 0x0E11, PCI_ANY_ID, 0, 0, 1},
...@@ -115,6 +116,7 @@ static struct pci_device_id e1000_pci_tbl[] __devinitdata = { ...@@ -115,6 +116,7 @@ static struct pci_device_id e1000_pci_tbl[] __devinitdata = {
{0x8086, 0x1009, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, {0x8086, 0x1009, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{0x8086, 0x100C, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, {0x8086, 0x100C, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{0x8086, 0x100D, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, {0x8086, 0x100D, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{0x8086, 0x100E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
/* required last entry */ /* required last entry */
{0,} {0,}
}; };
...@@ -131,6 +133,8 @@ static char *e1000_strings[] = { ...@@ -131,6 +133,8 @@ static char *e1000_strings[] = {
int e1000_up(struct e1000_adapter *adapter); int e1000_up(struct e1000_adapter *adapter);
void e1000_down(struct e1000_adapter *adapter); void e1000_down(struct e1000_adapter *adapter);
void e1000_reset(struct e1000_adapter *adapter);
static int e1000_init_module(void); static int e1000_init_module(void);
static void e1000_exit_module(void); static void e1000_exit_module(void);
static int e1000_probe(struct pci_dev *pdev, const struct pci_device_id *ent); static int e1000_probe(struct pci_dev *pdev, const struct pci_device_id *ent);
...@@ -163,7 +167,6 @@ static void e1000_clean_tx_irq(struct e1000_adapter *adapter); ...@@ -163,7 +167,6 @@ static void e1000_clean_tx_irq(struct e1000_adapter *adapter);
static void e1000_clean_rx_irq(struct e1000_adapter *adapter); static void e1000_clean_rx_irq(struct e1000_adapter *adapter);
static void e1000_alloc_rx_buffers(struct e1000_adapter *adapter); static void e1000_alloc_rx_buffers(struct e1000_adapter *adapter);
static int e1000_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd); static int e1000_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd);
static void e1000_reset(struct e1000_adapter *adapter);
static void e1000_enter_82542_rst(struct e1000_adapter *adapter); static void e1000_enter_82542_rst(struct e1000_adapter *adapter);
static void e1000_leave_82542_rst(struct e1000_adapter *adapter); static void e1000_leave_82542_rst(struct e1000_adapter *adapter);
static inline void e1000_rx_checksum(struct e1000_adapter *adapter, static inline void e1000_rx_checksum(struct e1000_adapter *adapter,
...@@ -248,8 +251,6 @@ e1000_up(struct e1000_adapter *adapter) ...@@ -248,8 +251,6 @@ e1000_up(struct e1000_adapter *adapter)
e1000_configure_rx(adapter); e1000_configure_rx(adapter);
e1000_alloc_rx_buffers(adapter); e1000_alloc_rx_buffers(adapter);
e1000_clear_hw_cntrs(&adapter->shared);
mod_timer(&adapter->watchdog_timer, jiffies); mod_timer(&adapter->watchdog_timer, jiffies);
e1000_irq_enable(adapter); e1000_irq_enable(adapter);
...@@ -259,7 +260,6 @@ e1000_up(struct e1000_adapter *adapter) ...@@ -259,7 +260,6 @@ e1000_up(struct e1000_adapter *adapter)
void void
e1000_down(struct e1000_adapter *adapter) e1000_down(struct e1000_adapter *adapter)
{ {
struct e1000_shared_adapter *shared = &adapter->shared;
struct net_device *netdev = adapter->netdev; struct net_device *netdev = adapter->netdev;
e1000_irq_disable(adapter); e1000_irq_disable(adapter);
...@@ -269,64 +269,30 @@ e1000_down(struct e1000_adapter *adapter) ...@@ -269,64 +269,30 @@ e1000_down(struct e1000_adapter *adapter)
netif_carrier_off(netdev); netif_carrier_off(netdev);
netif_stop_queue(netdev); netif_stop_queue(netdev);
/* disable the transmit and receive units */ e1000_reset(adapter);
E1000_WRITE_REG(shared, RCTL, 0);
E1000_WRITE_REG(shared, TCTL, E1000_TCTL_PSP);
/* delay to allow PCI transactions to complete */
msec_delay(10);
e1000_clean_tx_ring(adapter); e1000_clean_tx_ring(adapter);
e1000_clean_rx_ring(adapter); e1000_clean_rx_ring(adapter);
e1000_reset(adapter);
} }
static void void
e1000_reset(struct e1000_adapter *adapter) e1000_reset(struct e1000_adapter *adapter)
{ {
struct e1000_shared_adapter *shared = &adapter->shared;
uint32_t ctrl_ext;
/* Repartition Pba for greater than 9k mtu /* Repartition Pba for greater than 9k mtu
* To take effect CTRL.RST is required. * To take effect CTRL.RST is required.
*/ */
if(adapter->rx_buffer_len > E1000_RXBUFFER_8192) if(adapter->rx_buffer_len > E1000_RXBUFFER_8192)
E1000_WRITE_REG(shared, PBA, E1000_JUMBO_PBA); E1000_WRITE_REG(&adapter->shared, PBA, E1000_JUMBO_PBA);
else else
E1000_WRITE_REG(shared, PBA, E1000_DEFAULT_PBA); E1000_WRITE_REG(&adapter->shared, PBA, E1000_DEFAULT_PBA);
/* 82542 2.0 needs MWI disabled while issuing a reset */
if(shared->mac_type == e1000_82542_rev2_0)
e1000_enter_82542_rst(adapter);
/* global reset */
E1000_WRITE_REG(shared, CTRL, E1000_CTRL_RST);
msec_delay(10);
/* EEPROM reload */
ctrl_ext = E1000_READ_REG(shared, CTRL_EXT); adapter->shared.fc = adapter->shared.original_fc;
ctrl_ext |= E1000_CTRL_EXT_EE_RST; e1000_reset_hw(&adapter->shared);
E1000_WRITE_REG(shared, CTRL_EXT, ctrl_ext); e1000_init_hw(&adapter->shared);
msec_delay(5); e1000_reset_adaptive(&adapter->shared);
e1000_phy_get_info(&adapter->shared, &adapter->phy_info);
if(shared->mac_type == e1000_82542_rev2_0)
e1000_leave_82542_rst(adapter);
shared->tbi_compatibility_on = FALSE;
shared->fc = shared->original_fc;
e1000_init_hw(shared);
e1000_enable_WOL(adapter); e1000_enable_WOL(adapter);
return;
} }
/** /**
...@@ -422,7 +388,7 @@ e1000_probe(struct pci_dev *pdev, ...@@ -422,7 +388,7 @@ 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)) if(e1000_validate_eeprom_checksum(&adapter->shared) < 0)
goto err_eeprom; goto err_eeprom;
/* copy the MAC address out of the EEPROM */ /* copy the MAC address out of the EEPROM */
...@@ -516,7 +482,7 @@ e1000_remove(struct pci_dev *pdev) ...@@ -516,7 +482,7 @@ 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_shared_adapter *shared = &adapter->shared; struct e1000_hw *shared = &adapter->shared;
struct net_device *netdev = adapter->netdev; struct net_device *netdev = adapter->netdev;
struct pci_dev *pdev = adapter->pdev; struct pci_dev *pdev = adapter->pdev;
...@@ -566,6 +532,9 @@ e1000_sw_init(struct e1000_adapter *adapter) ...@@ -566,6 +532,9 @@ e1000_sw_init(struct e1000_adapter *adapter)
case E1000_DEV_ID_82544GC_LOM: case E1000_DEV_ID_82544GC_LOM:
shared->mac_type = e1000_82544; shared->mac_type = e1000_82544;
break; break;
case E1000_DEV_ID_82540EM:
shared->mac_type = e1000_82540;
break;
default: default:
/* should never have loaded on this device */ /* should never have loaded on this device */
BUG(); BUG();
...@@ -890,8 +859,19 @@ e1000_configure_rx(struct e1000_adapter *adapter) ...@@ -890,8 +859,19 @@ e1000_configure_rx(struct e1000_adapter *adapter)
/* set the Receive Delay Timer Register */ /* set the Receive Delay Timer Register */
E1000_WRITE_REG(&adapter->shared, RDTR, if(adapter->shared.mac_type == e1000_82540) {
adapter->rx_int_delay | E1000_RDT_FPDB); E1000_WRITE_REG(&adapter->shared, RADV, adapter->rx_int_delay);
E1000_WRITE_REG(&adapter->shared, RDTR, 64);
/* Set the interrupt throttling rate. Value is calculated
* as DEFAULT_ITR = 1/(MAX_INTS_PER_SEC * 256ns) */
#define MAX_INTS_PER_SEC 8000
#define DEFAULT_ITR 1000000000/(MAX_INTS_PER_SEC * 256)
E1000_WRITE_REG(&adapter->shared, ITR, DEFAULT_ITR);
} else {
E1000_WRITE_REG(&adapter->shared, 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 */
...@@ -1152,7 +1132,7 @@ static void ...@@ -1152,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_shared_adapter *shared = &adapter->shared; struct e1000_hw *shared = &adapter->shared;
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;
...@@ -1519,8 +1499,9 @@ e1000_change_mtu(struct net_device *netdev, int new_mtu) ...@@ -1519,8 +1499,9 @@ 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_shared_adapter *shared = &adapter->shared; struct e1000_hw *shared = &adapter->shared;
unsigned long flags; unsigned long flags;
uint16_t phy_tmp;
#define PHY_IDLE_ERROR_COUNT_MASK 0x00FF #define PHY_IDLE_ERROR_COUNT_MASK 0x00FF
...@@ -1626,14 +1607,18 @@ e1000_update_stats(struct e1000_adapter *adapter) ...@@ -1626,14 +1607,18 @@ e1000_update_stats(struct e1000_adapter *adapter)
/* Tx Dropped needs to be maintained elsewhere */ /* Tx Dropped needs to be maintained elsewhere */
if(adapter->shared.media_type == e1000_media_type_copper) { /* Phy Stats */
adapter->phy_stats.idle_errors +=
(e1000_read_phy_reg(shared, PHY_1000T_STATUS) if(shared->media_type == e1000_media_type_copper) {
& PHY_IDLE_ERROR_COUNT_MASK); if((adapter->link_speed == SPEED_1000) &&
adapter->phy_stats.receive_errors += (!e1000_read_phy_reg(shared, PHY_1000T_STATUS, &phy_tmp))) {
e1000_read_phy_reg(shared, M88E1000_RX_ERR_CNTR); phy_tmp &= PHY_IDLE_ERROR_COUNT_MASK;
adapter->phy_stats.idle_errors += phy_tmp;
}
if(!e1000_read_phy_reg(shared, M88E1000_RX_ERR_CNTR, &phy_tmp))
adapter->phy_stats.receive_errors += phy_tmp;
} }
return;
} }
/** /**
...@@ -1804,7 +1789,7 @@ e1000_clean_rx_irq(struct e1000_adapter *adapter) ...@@ -1804,7 +1789,7 @@ 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->special, if(TBI_ACCEPT(&adapter->shared, 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);
...@@ -2003,7 +1988,7 @@ e1000_enable_WOL(struct e1000_adapter *adapter) ...@@ -2003,7 +1988,7 @@ e1000_enable_WOL(struct e1000_adapter *adapter)
} }
void void
e1000_write_pci_cfg(struct e1000_shared_adapter *shared, e1000_write_pci_cfg(struct e1000_hw *shared,
uint32_t reg, uint16_t *value) uint32_t reg, uint16_t *value)
{ {
struct e1000_adapter *adapter = shared->back; struct e1000_adapter *adapter = shared->back;
......
...@@ -205,7 +205,7 @@ E1000_PARAM(TxIntDelay, "Transmit Interrupt Delay"); ...@@ -205,7 +205,7 @@ E1000_PARAM(TxIntDelay, "Transmit Interrupt Delay");
* *
* Valid Range: 0-65535 * Valid Range: 0-65535
* *
* Default Value: 64 * Default Value: 64/128
*/ */
E1000_PARAM(RxIntDelay, "Receive Interrupt Delay"); E1000_PARAM(RxIntDelay, "Receive Interrupt Delay");
...@@ -255,9 +255,10 @@ E1000_PARAM(DisablePolarityCorrection, ...@@ -255,9 +255,10 @@ E1000_PARAM(DisablePolarityCorrection,
#define MAX_TIDV 0xFFFF #define MAX_TIDV 0xFFFF
#define MIN_TIDV 0 #define MIN_TIDV 0
#define DEFAULT_RIDV 64 #define DEFAULT_RDTR 64
#define MAX_RIDV 0xFFFF #define DEFAULT_RADV 128
#define MIN_RIDV 0 #define MAX_RXDELAY 0xFFFF
#define MIN_RXDELAY 0
#define DEFAULT_MDIX 0 #define DEFAULT_MDIX 0
#define MAX_MDIX 3 #define MAX_MDIX 3
...@@ -435,13 +436,16 @@ e1000_check_options(struct e1000_adapter *adapter) ...@@ -435,13 +436,16 @@ e1000_check_options(struct e1000_adapter *adapter)
e1000_validate_option(&adapter->tx_int_delay, &opt); e1000_validate_option(&adapter->tx_int_delay, &opt);
} }
{ /* Receive Interrupt Delay */ { /* Receive Interrupt Delay */
char *rdtr = "using default of " __MODULE_STRING(DEFAULT_RDTR);
char *radv = "using default of " __MODULE_STRING(DEFAULT_RADV);
struct e1000_option opt = { struct e1000_option opt = {
type: range_option, type: range_option,
name: "Receive Interrupt Delay", name: "Receive Interrupt Delay",
err: "using default of " __MODULE_STRING(DEFAULT_RIDV), arg: { r: { min: MIN_RXDELAY, max: MAX_RXDELAY }}
def: DEFAULT_RIDV,
arg: { r: { min: MIN_RIDV, max: MAX_RIDV }}
}; };
e1000_mac_type mac_type = adapter->shared.mac_type;
opt.def = mac_type < e1000_82540 ? DEFAULT_RDTR : DEFAULT_RADV;
opt.err = mac_type < e1000_82540 ? rdtr : radv;
adapter->rx_int_delay = RxIntDelay[bd]; adapter->rx_int_delay = RxIntDelay[bd];
e1000_validate_option(&adapter->rx_int_delay, &opt); e1000_validate_option(&adapter->rx_int_delay, &opt);
...@@ -700,7 +704,7 @@ e1000_check_copper_options(struct e1000_adapter *adapter) ...@@ -700,7 +704,7 @@ e1000_check_copper_options(struct e1000_adapter *adapter)
} }
/* 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))) { if (e1000_validate_mdi_setting(&(adapter->shared)) < 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");
} }
......
This diff is collapsed.
This diff is collapsed.
...@@ -546,18 +546,6 @@ e1000_proc_polarity_correction(void *data, size_t len, char *buf) ...@@ -546,18 +546,6 @@ e1000_proc_polarity_correction(void *data, size_t len, char *buf)
sprintf(buf, sprintf(buf,
correction == e1000_polarity_reversal_enabled ? "Disabled" : correction == e1000_polarity_reversal_enabled ? "Disabled" :
correction == e1000_polarity_reversal_disabled ? "Enabled" : correction == e1000_polarity_reversal_disabled ? "Enabled" :
"Undefined");
return buf;
}
static char *
e1000_proc_link_reset_enabled(void *data, size_t len, char *buf)
{
struct e1000_adapter *adapter = data;
e1000_down_no_idle link_reset = adapter->phy_info.link_reset;
sprintf(buf,
link_reset == e1000_down_no_idle_no_detect ? "Disabled" :
link_reset == e1000_down_no_idle_detect ? "Enabled" :
"Unknown"); "Unknown");
return buf; return buf;
} }
...@@ -567,7 +555,10 @@ e1000_proc_mdi_x_enabled(void *data, size_t len, char *buf) ...@@ -567,7 +555,10 @@ e1000_proc_mdi_x_enabled(void *data, size_t len, char *buf)
{ {
struct e1000_adapter *adapter = data; struct e1000_adapter *adapter = data;
e1000_auto_x_mode mdix_mode = adapter->phy_info.mdix_mode; e1000_auto_x_mode mdix_mode = adapter->phy_info.mdix_mode;
sprintf(buf, mdix_mode == 0 ? "MDI" : "MDI-X"); sprintf(buf,
mdix_mode == e1000_auto_x_mode_manual_mdi ? "MDI" :
mdix_mode == e1000_auto_x_mode_manual_mdix ? "MDI-X" :
"Unknown");
return buf; return buf;
} }
...@@ -600,7 +591,7 @@ e1000_proc_rx_status(void *data, size_t len, char *buf) ...@@ -600,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_shared_adapter *shared = &adapter->shared; struct e1000_hw *shared = &adapter->shared;
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);
...@@ -703,8 +694,6 @@ e1000_proc_list_setup(struct e1000_adapter *adapter) ...@@ -703,8 +694,6 @@ e1000_proc_list_setup(struct e1000_adapter *adapter)
adapter, e1000_proc_polarity_correction); adapter, e1000_proc_polarity_correction);
LIST_ADD_U("PHY_Idle_Errors", LIST_ADD_U("PHY_Idle_Errors",
&adapter->phy_stats.idle_errors); &adapter->phy_stats.idle_errors);
LIST_ADD_F("PHY_Link_Reset_Enabled",
adapter, e1000_proc_link_reset_enabled);
LIST_ADD_U("PHY_Receive_Errors", LIST_ADD_U("PHY_Receive_Errors",
&adapter->phy_stats.receive_errors); &adapter->phy_stats.receive_errors);
LIST_ADD_F("PHY_MDI_X_Enabled", LIST_ADD_F("PHY_MDI_X_Enabled",
......
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