Commit a1360dde authored by Ganesh Venkatesan's avatar Ganesh Venkatesan Committed by Jeff Garzik

[PATCH] e1000 7/7: Support for ethtool msglevel based error

Also included are driver version update and change logs
parent 7190c16a
...@@ -71,6 +71,7 @@ ...@@ -71,6 +71,7 @@
#include <linux/mii.h> #include <linux/mii.h>
#include <linux/ethtool.h> #include <linux/ethtool.h>
#include <linux/if_vlan.h> #include <linux/if_vlan.h>
#include <linux/moduleparam.h>
#define BAR_0 0 #define BAR_0 0
#define BAR_1 1 #define BAR_1 1
...@@ -89,6 +90,12 @@ struct e1000_adapter; ...@@ -89,6 +90,12 @@ struct e1000_adapter;
#define E1000_ERR(args...) printk(KERN_ERR "e1000: " args) #define E1000_ERR(args...) printk(KERN_ERR "e1000: " args)
#define PFX "e1000: "
#define DPRINTK(nlevel, klevel, fmt, args...) \
(void)((NETIF_MSG_##nlevel & adapter->msg_enable) && \
printk(KERN_##klevel PFX "%s: %s: " fmt, adapter->netdev->name, \
__FUNCTION__ , ## args))
#define E1000_MAX_INTR 10 #define E1000_MAX_INTR 10
/* How many descriptors for TX and RX ? */ /* How many descriptors for TX and RX ? */
......
...@@ -27,55 +27,32 @@ ...@@ -27,55 +27,32 @@
*******************************************************************************/ *******************************************************************************/
#include "e1000.h" #include "e1000.h"
#include <linux/rtnetlink.h>
/* Change Log /* Change Log
* *
* 5.2.51 5/14/04
* o set default configuration to 'NAPI disabled'. NAPI enabled driver
* causes kernel panic when the interface is shutdown while data is being
* transferred.
* 5.2.47 5/04/04
* o fixed ethtool -t implementation
* 5.2.45 4/29/04
* o fixed ethtool -e implementation
* o Support for ethtool ops [Stephen Hemminger (shemminger@osdl.org)]
* 5.2.42 4/26/04
* o Added support for the DPRINTK macro for enhanced error logging. Some
* parts of the patch were supplied by Jon Mason.
* o Move the register_netdevice() donw in the probe routine due to a
* loading/unloading test issue.
* o Added a long RX byte count the the extra ethtool data members for BER
* testing purposes.
* 5.2.39 3/12/04 * 5.2.39 3/12/04
* o Added support to read/write eeprom data in proper order.
* By default device eeprom is always little-endian, word
* addressable
* o Disable TSO as the default for the driver until hangs
* reported against non-IA acrhs can be root-caused.
* o Back out the CSA fix for 82547 as it continues to cause
* systems lock-ups with production systems.
* o Fixed FC high/low water mark values to actually be in the
* range of the Rx FIFO area. It was a math error.
* [Dainis Jonitis (dainis_jonitis@exigengroup.lv)]
* o Handle failure to get new resources when doing ethtool
* ring paramater changes. Previously, driver would free old,
* but fails to allocate new, causing problems. Now, driver
* allocates new, and if sucessful, frees old.
* o Changed collision threshold from 16 to 15 to comply with IEEE
* spec.
* o Toggle chip-select when checking ready status on SPI eeproms.
* o Put PHY into class A mode to pass IEEE tests on some designs.
* Designs with EEPROM word 0x7, bit 15 set will have their PHYs
* set to class A mode, rather than the default class AB.
* o Handle failures of register_netdev. Stephen Hemminger
* [shemminger@osdl.org].
* o updated README & MAN pages, number of Transmit/Receive
* descriptors may be denied depending on system resources.
*
* 5.2.30 1/14/03
* o Set VLAN filtering to IEEE 802.1Q after reset so we don't break
* SoL connections that use VLANs.
* o Allow 1000/Full setting for AutoNeg param for Fiber connections
* Jon D Mason [jonmason@us.ibm.com].
* o Race between Tx queue and Tx clean fixed with a spin lock.
* o Added netpoll support.
* o Fixed endianess bug causing ethtool loopback diags to fail on ppc.
* o Use pdev->irq rather than netdev->irq in preparation for MSI support.
* o Report driver message on user override of InterruptThrottleRate
* module parameter.
* o Change I/O address storage from uint32_t to unsigned long.
* o Added ethtool RINGPARAM support.
*
* 5.2.22 10/15/03
*/ */
char e1000_driver_name[] = "e1000"; char e1000_driver_name[] = "e1000";
char e1000_driver_string[] = "Intel(R) PRO/1000 Network Driver"; char e1000_driver_string[] = "Intel(R) PRO/1000 Network Driver";
char e1000_driver_version[] = "5.2.39-k2"; char e1000_driver_version[] = "5.2.52-k2";
char e1000_copyright[] = "Copyright (c) 1999-2004 Intel Corporation."; char e1000_copyright[] = "Copyright (c) 1999-2004 Intel Corporation.";
/* e1000_pci_tbl - PCI Device ID Table /* e1000_pci_tbl - PCI Device ID Table
...@@ -225,6 +202,10 @@ MODULE_AUTHOR("Intel Corporation, <linux.nics@intel.com>"); ...@@ -225,6 +202,10 @@ MODULE_AUTHOR("Intel Corporation, <linux.nics@intel.com>");
MODULE_DESCRIPTION("Intel(R) PRO/1000 Network Driver"); MODULE_DESCRIPTION("Intel(R) PRO/1000 Network Driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
static int debug = 3;
module_param(debug, int, 0);
MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)");
/** /**
* e1000_init_module - Driver Registration Routine * e1000_init_module - Driver Registration Routine
* *
...@@ -420,6 +401,12 @@ e1000_probe(struct pci_dev *pdev, ...@@ -420,6 +401,12 @@ e1000_probe(struct pci_dev *pdev,
adapter->netdev = netdev; adapter->netdev = netdev;
adapter->pdev = pdev; adapter->pdev = pdev;
adapter->hw.back = adapter; adapter->hw.back = adapter;
adapter->msg_enable = (1 << debug) - 1;
rtnl_lock();
/* we need to set the name early since the DPRINTK macro needs it set */
if (dev_alloc_name(netdev, netdev->name) < 0)
goto err_free_unlock;
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);
...@@ -504,7 +491,7 @@ e1000_probe(struct pci_dev *pdev, ...@@ -504,7 +491,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->hw) < 0) { if(e1000_validate_eeprom_checksum(&adapter->hw) < 0) {
printk(KERN_ERR "The EEPROM Checksum Is Not Valid\n"); DPRINTK(PROBE, ERR, "The EEPROM Checksum Is Not Valid\n");
err = -EIO; err = -EIO;
goto err_eeprom; goto err_eeprom;
} }
...@@ -538,16 +525,12 @@ e1000_probe(struct pci_dev *pdev, ...@@ -538,16 +525,12 @@ e1000_probe(struct pci_dev *pdev,
INIT_WORK(&adapter->tx_timeout_task, INIT_WORK(&adapter->tx_timeout_task,
(void (*)(void *))e1000_tx_timeout_task, netdev); (void (*)(void *))e1000_tx_timeout_task, netdev);
if((err = register_netdev(netdev)))
goto err_register;
/* we're going to reset, so assume we have no link for now */ /* we're going to reset, so assume we have no link for now */
netif_carrier_off(netdev); netif_carrier_off(netdev);
netif_stop_queue(netdev); netif_stop_queue(netdev);
printk(KERN_INFO "%s: Intel(R) PRO/1000 Network Connection\n", DPRINTK(PROBE, INFO, "Intel(R) PRO/1000 Network Connection\n");
netdev->name);
e1000_check_options(adapter); e1000_check_options(adapter);
/* Initial Wake on LAN setting /* Initial Wake on LAN setting
...@@ -581,7 +564,12 @@ e1000_probe(struct pci_dev *pdev, ...@@ -581,7 +564,12 @@ e1000_probe(struct pci_dev *pdev,
e1000_reset(adapter); e1000_reset(adapter);
/* since we are holding the rtnl lock already, call the no-lock version */
if((err = register_netdevice(netdev)))
goto err_register;
cards_found++; cards_found++;
rtnl_unlock();
return 0; return 0;
err_register: err_register:
...@@ -589,6 +577,8 @@ e1000_probe(struct pci_dev *pdev, ...@@ -589,6 +577,8 @@ e1000_probe(struct pci_dev *pdev,
err_eeprom: err_eeprom:
iounmap(adapter->hw.hw_addr); iounmap(adapter->hw.hw_addr);
err_ioremap: err_ioremap:
err_free_unlock:
rtnl_unlock();
free_netdev(netdev); free_netdev(netdev);
err_alloc_etherdev: err_alloc_etherdev:
pci_release_regions(pdev); pci_release_regions(pdev);
...@@ -666,7 +656,7 @@ e1000_sw_init(struct e1000_adapter *adapter) ...@@ -666,7 +656,7 @@ e1000_sw_init(struct e1000_adapter *adapter)
/* identify the MAC */ /* identify the MAC */
if (e1000_set_mac_type(hw)) { if (e1000_set_mac_type(hw)) {
E1000_ERR("Unknown MAC Type\n"); DPRINTK(PROBE, ERR, "Unknown MAC Type\n");
return -EIO; return -EIO;
} }
...@@ -1393,9 +1383,8 @@ e1000_watchdog(unsigned long data) ...@@ -1393,9 +1383,8 @@ e1000_watchdog(unsigned long data)
&adapter->link_speed, &adapter->link_speed,
&adapter->link_duplex); &adapter->link_duplex);
printk(KERN_INFO DPRINTK(LINK, INFO, "NIC Link is Up %d Mbps %s\n",
"e1000: %s NIC Link is Up %d Mbps %s\n", adapter->link_speed,
netdev->name, adapter->link_speed,
adapter->link_duplex == FULL_DUPLEX ? adapter->link_duplex == FULL_DUPLEX ?
"Full Duplex" : "Half Duplex"); "Full Duplex" : "Half Duplex");
...@@ -1408,9 +1397,7 @@ e1000_watchdog(unsigned long data) ...@@ -1408,9 +1397,7 @@ e1000_watchdog(unsigned long data)
if(netif_carrier_ok(netdev)) { if(netif_carrier_ok(netdev)) {
adapter->link_speed = 0; adapter->link_speed = 0;
adapter->link_duplex = 0; adapter->link_duplex = 0;
printk(KERN_INFO DPRINTK(LINK, INFO, "NIC Link is Down\n");
"e1000: %s NIC Link is Down\n",
netdev->name);
netif_carrier_off(netdev); netif_carrier_off(netdev);
netif_stop_queue(netdev); netif_stop_queue(netdev);
mod_timer(&adapter->phy_info_timer, jiffies + 2 * HZ); mod_timer(&adapter->phy_info_timer, jiffies + 2 * HZ);
...@@ -1888,7 +1875,7 @@ e1000_change_mtu(struct net_device *netdev, int new_mtu) ...@@ -1888,7 +1875,7 @@ e1000_change_mtu(struct net_device *netdev, int new_mtu)
if((max_frame < MINIMUM_ETHERNET_FRAME_SIZE) || if((max_frame < MINIMUM_ETHERNET_FRAME_SIZE) ||
(max_frame > MAX_JUMBO_FRAME_SIZE)) { (max_frame > MAX_JUMBO_FRAME_SIZE)) {
E1000_ERR("Invalid MTU setting\n"); DPRINTK(PROBE, ERR, "Invalid MTU setting\n");
return -EINVAL; return -EINVAL;
} }
...@@ -1896,7 +1883,7 @@ e1000_change_mtu(struct net_device *netdev, int new_mtu) ...@@ -1896,7 +1883,7 @@ e1000_change_mtu(struct net_device *netdev, int new_mtu)
adapter->rx_buffer_len = E1000_RXBUFFER_2048; adapter->rx_buffer_len = E1000_RXBUFFER_2048;
} else if(adapter->hw.mac_type < e1000_82543) { } else if(adapter->hw.mac_type < e1000_82543) {
E1000_ERR("Jumbo Frames not supported on 82542\n"); DPRINTK(PROBE, ERR, "Jumbo Frames not supported on 82542\n");
return -EINVAL; return -EINVAL;
} else if(max_frame <= E1000_RXBUFFER_4096) { } else if(max_frame <= E1000_RXBUFFER_4096) {
...@@ -2282,7 +2269,8 @@ e1000_clean_rx_irq(struct e1000_adapter *adapter) ...@@ -2282,7 +2269,8 @@ e1000_clean_rx_irq(struct e1000_adapter *adapter)
/* All receives must fit into a single buffer */ /* All receives must fit into a single buffer */
E1000_DBG("Receive packet consumed multiple buffers\n"); E1000_DBG("%s: Receive packet consumed multiple buffers\n",
netdev->name);
dev_kfree_skb_irq(skb); dev_kfree_skb_irq(skb);
rx_desc->status = 0; rx_desc->status = 0;
......
...@@ -234,7 +234,8 @@ struct e1000_option { ...@@ -234,7 +234,8 @@ struct e1000_option {
}; };
static int __devinit static int __devinit
e1000_validate_option(int *value, struct e1000_option *opt) e1000_validate_option(int *value, struct e1000_option *opt,
struct e1000_adapter *adapter)
{ {
if(*value == OPTION_UNSET) { if(*value == OPTION_UNSET) {
*value = opt->def; *value = opt->def;
...@@ -245,16 +246,17 @@ e1000_validate_option(int *value, struct e1000_option *opt) ...@@ -245,16 +246,17 @@ e1000_validate_option(int *value, struct e1000_option *opt)
case enable_option: case enable_option:
switch (*value) { switch (*value) {
case OPTION_ENABLED: case OPTION_ENABLED:
printk(KERN_INFO "%s Enabled\n", opt->name); DPRINTK(PROBE, INFO, "%s Enabled\n", opt->name);
return 0; return 0;
case OPTION_DISABLED: case OPTION_DISABLED:
printk(KERN_INFO "%s Disabled\n", opt->name); DPRINTK(PROBE, INFO, "%s Disabled\n", opt->name);
return 0; return 0;
} }
break; break;
case range_option: case range_option:
if(*value >= opt->arg.r.min && *value <= opt->arg.r.max) { if(*value >= opt->arg.r.min && *value <= opt->arg.r.max) {
printk(KERN_INFO "%s set to %i\n", opt->name, *value); DPRINTK(PROBE, INFO,
"%s set to %i\n", opt->name, *value);
return 0; return 0;
} }
break; break;
...@@ -266,7 +268,7 @@ e1000_validate_option(int *value, struct e1000_option *opt) ...@@ -266,7 +268,7 @@ e1000_validate_option(int *value, struct e1000_option *opt)
ent = &opt->arg.l.p[i]; ent = &opt->arg.l.p[i];
if(*value == ent->i) { if(*value == ent->i) {
if(ent->str[0] != '\0') if(ent->str[0] != '\0')
printk(KERN_INFO "%s\n", ent->str); DPRINTK(PROBE, INFO, "%s\n", ent->str);
return 0; return 0;
} }
} }
...@@ -276,7 +278,7 @@ e1000_validate_option(int *value, struct e1000_option *opt) ...@@ -276,7 +278,7 @@ e1000_validate_option(int *value, struct e1000_option *opt)
BUG(); BUG();
} }
printk(KERN_INFO "Invalid %s specified (%i) %s\n", DPRINTK(PROBE, INFO, "Invalid %s specified (%i) %s\n",
opt->name, *value, opt->err); opt->name, *value, opt->err);
*value = opt->def; *value = opt->def;
return -1; return -1;
...@@ -300,9 +302,9 @@ e1000_check_options(struct e1000_adapter *adapter) ...@@ -300,9 +302,9 @@ e1000_check_options(struct e1000_adapter *adapter)
{ {
int bd = adapter->bd_number; int bd = adapter->bd_number;
if(bd >= E1000_MAX_NIC) { if(bd >= E1000_MAX_NIC) {
printk(KERN_NOTICE DPRINTK(PROBE, NOTICE,
"Warning: no configuration for board #%i\n", bd); "Warning: no configuration for board #%i\n", bd);
printk(KERN_NOTICE "Using defaults for all values\n"); DPRINTK(PROBE, NOTICE, "Using defaults for all values\n");
bd = E1000_MAX_NIC; bd = E1000_MAX_NIC;
} }
...@@ -321,7 +323,7 @@ e1000_check_options(struct e1000_adapter *adapter) ...@@ -321,7 +323,7 @@ e1000_check_options(struct e1000_adapter *adapter)
E1000_MAX_TXD : E1000_MAX_82544_TXD; E1000_MAX_TXD : E1000_MAX_82544_TXD;
tx_ring->count = TxDescriptors[bd]; tx_ring->count = TxDescriptors[bd];
e1000_validate_option(&tx_ring->count, &opt); e1000_validate_option(&tx_ring->count, &opt, adapter);
E1000_ROUNDUP(tx_ring->count, REQ_TX_DESCRIPTOR_MULTIPLE); E1000_ROUNDUP(tx_ring->count, REQ_TX_DESCRIPTOR_MULTIPLE);
} }
{ /* Receive Descriptor Count */ { /* Receive Descriptor Count */
...@@ -339,7 +341,7 @@ e1000_check_options(struct e1000_adapter *adapter) ...@@ -339,7 +341,7 @@ e1000_check_options(struct e1000_adapter *adapter)
E1000_MAX_82544_RXD; E1000_MAX_82544_RXD;
rx_ring->count = RxDescriptors[bd]; rx_ring->count = RxDescriptors[bd];
e1000_validate_option(&rx_ring->count, &opt); e1000_validate_option(&rx_ring->count, &opt, adapter);
E1000_ROUNDUP(rx_ring->count, REQ_RX_DESCRIPTOR_MULTIPLE); E1000_ROUNDUP(rx_ring->count, REQ_RX_DESCRIPTOR_MULTIPLE);
} }
{ /* Checksum Offload Enable/Disable */ { /* Checksum Offload Enable/Disable */
...@@ -351,7 +353,7 @@ e1000_check_options(struct e1000_adapter *adapter) ...@@ -351,7 +353,7 @@ e1000_check_options(struct e1000_adapter *adapter)
}; };
int rx_csum = XsumRX[bd]; int rx_csum = XsumRX[bd];
e1000_validate_option(&rx_csum, &opt); e1000_validate_option(&rx_csum, &opt, adapter);
adapter->rx_csum = rx_csum; adapter->rx_csum = rx_csum;
} }
{ /* Flow Control */ { /* Flow Control */
...@@ -373,7 +375,7 @@ e1000_check_options(struct e1000_adapter *adapter) ...@@ -373,7 +375,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);
adapter->hw.fc = adapter->hw.original_fc = fc; adapter->hw.fc = adapter->hw.original_fc = fc;
} }
{ /* Transmit Interrupt Delay */ { /* Transmit Interrupt Delay */
...@@ -387,7 +389,7 @@ e1000_check_options(struct e1000_adapter *adapter) ...@@ -387,7 +389,7 @@ e1000_check_options(struct e1000_adapter *adapter)
}; };
adapter->tx_int_delay = TxIntDelay[bd]; adapter->tx_int_delay = TxIntDelay[bd];
e1000_validate_option(&adapter->tx_int_delay, &opt); e1000_validate_option(&adapter->tx_int_delay, &opt, adapter);
} }
{ /* Transmit Absolute Interrupt Delay */ { /* Transmit Absolute Interrupt Delay */
struct e1000_option opt = { struct e1000_option opt = {
...@@ -400,7 +402,7 @@ e1000_check_options(struct e1000_adapter *adapter) ...@@ -400,7 +402,7 @@ e1000_check_options(struct e1000_adapter *adapter)
}; };
adapter->tx_abs_int_delay = TxAbsIntDelay[bd]; adapter->tx_abs_int_delay = TxAbsIntDelay[bd];
e1000_validate_option(&adapter->tx_abs_int_delay, &opt); e1000_validate_option(&adapter->tx_abs_int_delay, &opt, adapter);
} }
{ /* Receive Interrupt Delay */ { /* Receive Interrupt Delay */
struct e1000_option opt = { struct e1000_option opt = {
...@@ -413,7 +415,7 @@ e1000_check_options(struct e1000_adapter *adapter) ...@@ -413,7 +415,7 @@ e1000_check_options(struct e1000_adapter *adapter)
}; };
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, adapter);
} }
{ /* Receive Absolute Interrupt Delay */ { /* Receive Absolute Interrupt Delay */
struct e1000_option opt = { struct e1000_option opt = {
...@@ -426,7 +428,7 @@ e1000_check_options(struct e1000_adapter *adapter) ...@@ -426,7 +428,7 @@ e1000_check_options(struct e1000_adapter *adapter)
}; };
adapter->rx_abs_int_delay = RxAbsIntDelay[bd]; adapter->rx_abs_int_delay = RxAbsIntDelay[bd];
e1000_validate_option(&adapter->rx_abs_int_delay, &opt); e1000_validate_option(&adapter->rx_abs_int_delay, &opt, adapter);
} }
{ /* Interrupt Throttling Rate */ { /* Interrupt Throttling Rate */
struct e1000_option opt = { struct e1000_option opt = {
...@@ -444,13 +446,14 @@ e1000_check_options(struct e1000_adapter *adapter) ...@@ -444,13 +446,14 @@ e1000_check_options(struct e1000_adapter *adapter)
adapter->itr = 1; adapter->itr = 1;
break; break;
case 0: case 0:
printk(KERN_INFO "%s turned off\n", opt.name); DPRINTK(PROBE, INFO, "%s turned off\n", opt.name);
break; break;
case 1: case 1:
printk(KERN_INFO "%s set to dynamic mode\n", opt.name); DPRINTK(PROBE, INFO,
"%s set to dynamic mode\n", opt.name);
break; break;
default: default:
e1000_validate_option(&adapter->itr, &opt); e1000_validate_option(&adapter->itr, &opt, adapter);
break; break;
} }
} }
...@@ -482,15 +485,15 @@ e1000_check_fiber_options(struct e1000_adapter *adapter) ...@@ -482,15 +485,15 @@ e1000_check_fiber_options(struct e1000_adapter *adapter)
bd = bd > E1000_MAX_NIC ? E1000_MAX_NIC : bd; bd = bd > E1000_MAX_NIC ? E1000_MAX_NIC : bd;
if((Speed[bd] != OPTION_UNSET)) { if((Speed[bd] != OPTION_UNSET)) {
printk(KERN_INFO "Speed not valid for fiber adapters, " DPRINTK(PROBE, INFO, "Speed not valid for fiber adapters, "
"parameter ignored\n"); "parameter ignored\n");
} }
if((Duplex[bd] != OPTION_UNSET)) { if((Duplex[bd] != OPTION_UNSET)) {
printk(KERN_INFO "Duplex not valid for fiber adapters, " DPRINTK(PROBE, INFO, "Duplex not valid for fiber adapters, "
"parameter ignored\n"); "parameter ignored\n");
} }
if((AutoNeg[bd] != OPTION_UNSET) && (AutoNeg[bd] != 0x20)) { if((AutoNeg[bd] != OPTION_UNSET) && (AutoNeg[bd] != 0x20)) {
printk(KERN_INFO "AutoNeg other than Full/1000 is " DPRINTK(PROBE, INFO, "AutoNeg other than Full/1000 is "
"not valid for fiber adapters, parameter ignored\n"); "not valid for fiber adapters, parameter ignored\n");
} }
} }
...@@ -525,7 +528,7 @@ e1000_check_copper_options(struct e1000_adapter *adapter) ...@@ -525,7 +528,7 @@ e1000_check_copper_options(struct e1000_adapter *adapter)
}; };
speed = Speed[bd]; speed = Speed[bd];
e1000_validate_option(&speed, &opt); e1000_validate_option(&speed, &opt, adapter);
} }
{ /* Duplex */ { /* Duplex */
struct e1000_opt_list dplx_list[] = {{ 0, "" }, struct e1000_opt_list dplx_list[] = {{ 0, "" },
...@@ -542,11 +545,11 @@ e1000_check_copper_options(struct e1000_adapter *adapter) ...@@ -542,11 +545,11 @@ e1000_check_copper_options(struct e1000_adapter *adapter)
}; };
dplx = Duplex[bd]; dplx = Duplex[bd];
e1000_validate_option(&dplx, &opt); e1000_validate_option(&dplx, &opt, adapter);
} }
if(AutoNeg[bd] != OPTION_UNSET && (speed != 0 || dplx != 0)) { if(AutoNeg[bd] != OPTION_UNSET && (speed != 0 || dplx != 0)) {
printk(KERN_INFO DPRINTK(PROBE, INFO,
"AutoNeg specified along with Speed or Duplex, " "AutoNeg specified along with Speed or Duplex, "
"parameter ignored\n"); "parameter ignored\n");
adapter->hw.autoneg_advertised = AUTONEG_ADV_DEFAULT; adapter->hw.autoneg_advertised = AUTONEG_ADV_DEFAULT;
...@@ -595,7 +598,7 @@ e1000_check_copper_options(struct e1000_adapter *adapter) ...@@ -595,7 +598,7 @@ 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);
adapter->hw.autoneg_advertised = an; adapter->hw.autoneg_advertised = an;
} }
...@@ -603,78 +606,85 @@ e1000_check_copper_options(struct e1000_adapter *adapter) ...@@ -603,78 +606,85 @@ e1000_check_copper_options(struct e1000_adapter *adapter)
case 0: case 0:
adapter->hw.autoneg = adapter->fc_autoneg = 1; adapter->hw.autoneg = adapter->fc_autoneg = 1;
if(Speed[bd] != OPTION_UNSET || Duplex[bd] != OPTION_UNSET) if(Speed[bd] != OPTION_UNSET || Duplex[bd] != OPTION_UNSET)
printk(KERN_INFO DPRINTK(PROBE, INFO,
"Speed and duplex autonegotiation enabled\n"); "Speed and duplex autonegotiation enabled\n");
break; break;
case HALF_DUPLEX: case HALF_DUPLEX:
printk(KERN_INFO "Half Duplex specified without Speed\n"); DPRINTK(PROBE, INFO, "Half Duplex specified without Speed\n");
printk(KERN_INFO "Using Autonegotiation at Half Duplex only\n"); DPRINTK(PROBE, INFO,
"Using Autonegotiation at Half Duplex only\n");
adapter->hw.autoneg = adapter->fc_autoneg = 1; adapter->hw.autoneg = adapter->fc_autoneg = 1;
adapter->hw.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"); DPRINTK(PROBE, INFO, "Full Duplex specified without Speed\n");
printk(KERN_INFO "Using Autonegotiation at Full Duplex only\n"); DPRINTK(PROBE, INFO,
"Using Autonegotiation at Full Duplex only\n");
adapter->hw.autoneg = adapter->fc_autoneg = 1; adapter->hw.autoneg = adapter->fc_autoneg = 1;
adapter->hw.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"); DPRINTK(PROBE, INFO,
printk(KERN_INFO "Using Autonegotiation at 10 Mbps only\n"); "10 Mbps Speed specified without Duplex\n");
DPRINTK(PROBE, INFO, "Using Autonegotiation at 10 Mbps only\n");
adapter->hw.autoneg = adapter->fc_autoneg = 1; adapter->hw.autoneg = adapter->fc_autoneg = 1;
adapter->hw.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"); DPRINTK(PROBE, INFO, "Forcing to 10 Mbps Half Duplex\n");
adapter->hw.autoneg = adapter->fc_autoneg = 0; adapter->hw.autoneg = adapter->fc_autoneg = 0;
adapter->hw.forced_speed_duplex = e1000_10_half; adapter->hw.forced_speed_duplex = e1000_10_half;
adapter->hw.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"); DPRINTK(PROBE, INFO, "Forcing to 10 Mbps Full Duplex\n");
adapter->hw.autoneg = adapter->fc_autoneg = 0; adapter->hw.autoneg = adapter->fc_autoneg = 0;
adapter->hw.forced_speed_duplex = e1000_10_full; adapter->hw.forced_speed_duplex = e1000_10_full;
adapter->hw.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"); DPRINTK(PROBE, INFO,
printk(KERN_INFO "Using Autonegotiation at 100 Mbps only\n"); "100 Mbps Speed specified without Duplex\n");
DPRINTK(PROBE, INFO,
"Using Autonegotiation at 100 Mbps only\n");
adapter->hw.autoneg = adapter->fc_autoneg = 1; adapter->hw.autoneg = adapter->fc_autoneg = 1;
adapter->hw.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"); DPRINTK(PROBE, INFO, "Forcing to 100 Mbps Half Duplex\n");
adapter->hw.autoneg = adapter->fc_autoneg = 0; adapter->hw.autoneg = adapter->fc_autoneg = 0;
adapter->hw.forced_speed_duplex = e1000_100_half; adapter->hw.forced_speed_duplex = e1000_100_half;
adapter->hw.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"); DPRINTK(PROBE, INFO, "Forcing to 100 Mbps Full Duplex\n");
adapter->hw.autoneg = adapter->fc_autoneg = 0; adapter->hw.autoneg = adapter->fc_autoneg = 0;
adapter->hw.forced_speed_duplex = e1000_100_full; adapter->hw.forced_speed_duplex = e1000_100_full;
adapter->hw.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"); DPRINTK(PROBE, INFO,
printk(KERN_INFO "1000 Mbps Speed specified without Duplex\n");
DPRINTK(PROBE, INFO,
"Using Autonegotiation at 1000 Mbps Full Duplex only\n"); "Using Autonegotiation at 1000 Mbps Full Duplex only\n");
adapter->hw.autoneg = adapter->fc_autoneg = 1; adapter->hw.autoneg = adapter->fc_autoneg = 1;
adapter->hw.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"); DPRINTK(PROBE, INFO,
printk(KERN_INFO "Half Duplex is not supported at 1000 Mbps\n");
DPRINTK(PROBE, INFO,
"Using Autonegotiation at 1000 Mbps Full Duplex only\n"); "Using Autonegotiation at 1000 Mbps Full Duplex only\n");
adapter->hw.autoneg = adapter->fc_autoneg = 1; adapter->hw.autoneg = adapter->fc_autoneg = 1;
adapter->hw.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 DPRINTK(PROBE, INFO,
"Using Autonegotiation at 1000 Mbps Full Duplex only\n"); "Using Autonegotiation at 1000 Mbps Full Duplex only\n");
adapter->hw.autoneg = adapter->fc_autoneg = 1; adapter->hw.autoneg = adapter->fc_autoneg = 1;
adapter->hw.autoneg_advertised = ADVERTISE_1000_FULL; adapter->hw.autoneg_advertised = ADVERTISE_1000_FULL;
...@@ -685,7 +695,8 @@ e1000_check_copper_options(struct e1000_adapter *adapter) ...@@ -685,7 +695,8 @@ 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->hw)) < 0) { if (e1000_validate_mdi_setting(&(adapter->hw)) < 0) {
printk(KERN_INFO "Speed, AutoNeg and MDI-X specifications are " DPRINTK(PROBE, 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");
} }
} }
......
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