Commit cd9f63e2 authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://gkernel.bkbits.net/net-drivers-2.6

into ppc970.osdl.org:/home/torvalds/v2.6/linux
parents 64416848 4f591d72
Linux* Base Driver for the Intel(R) PRO/100 Family of Adapters
==============================================================
March 15, 2004
September 13, 2004
Contents
========
- In This Release
- Supported Adapters
- Identifying Your Adapter
- Driver Configuration Parameters
- Additional Configurations
- Support
......@@ -16,26 +18,140 @@ In This Release
===============
This file describes the Linux* Base Driver for the Intel(R) PRO/100 Family of
Adapters, version 3.x.x. This driver includes support for Itanium(TM)-based
systems.
Adapters, version 3.2.x. This driver includes support for Itanium(TM)2 and
EM64T systems.
Supported Adapters
==================
To verify that your adapter is supported, find the board ID number on the
adapter. Look for a label that has a barcode and a number in the format
A12345-001. Match this to the list of numbers above.
Identifying Your Adapter
========================
For more information on how to identify your adapter, go to the Adapter &
Driver ID Guide at:
http://support.intel.com/support/network/adapter/pro100/21397.htm
For the latest Intel PRO/100 network driver for Linux, see:
For the latest Intel network drivers for Linux, refer to the following
website. In the search field, enter your adapter name or type, or use the
networking link on the left to search for your adapter:
http://downloadfinder.intel.com/scripts-df/support_intel.asp
Driver Configuration Parameters
===============================
The default value for each parameter is generally the recommended setting,
unless otherwise noted.
Rx Descriptors: Number of receive descriptors. A receive descriptor is a data
structure that describes a receive buffer and its attributes to the network
controller. The data in the descriptor is used by the controller to write
data from the controller to host memory. In the 3.0.x driver the valid
range for this parameter is 64-256. The default value is 64. This parameter
can be changed using the command
ethtool -G eth? rx n, where n is the number of desired rx descriptors.
Tx Descriptors: Number of transmit descriptors. A transmit descriptor is a
data structure that describes a transmit buffer and its attributes to the
network controller. The data in the descriptor is used by the controller to
read data from the host memory to the controller. In the 3.0.x driver the
valid range for this parameter is 64-256. The default value is 64. This
parameter can be changed using the command
ethtool -G eth? tx n, where n is the number of desired tx descriptors.
Speed/Duplex: The driver auto-negotiates the link speed and duplex settings by
default. Ethtool can be used as follows to force speed/duplex.
ethtool -s eth? autoneg off speed {10|100} duplex {full|half}
NOTE: setting the speed/duplex to incorrect values will cause the link to
fail.
Event Log Message Level: The driver uses the message level flag to log events
to syslog. The message level can be set at driver load time. It can also be
set using the command
ethtool -s eth? msglvl n
Additional Configurations
=========================
Configuring the Driver on Different Distributions
-------------------------------------------------
Configuring a network driver to load properly when the system is started is
distribution dependent. Typically, the configuration process involves adding
an alias line to /etc/modules.conf as well as editing other system startup
scripts and/or configuration files. Many popular Linux distributions ship
with tools to make these changes for you. To learn the proper way to
configure a network device for your system, refer to your distribution
documentation. If during this process you are asked for the driver or module
name, the name for the Linux Base Driver for the Intel PRO/100 Family of
Adapters is e100.
As an example, if you install the e100 driver for two PRO/100 adapters
(eth0 and eth1), add the following to modules.conf:
alias eth0 e100
alias eth1 e100
Viewing Link Messages
---------------------
In order to see link messages and other Intel driver information on your
console, you must set the dmesg level up to six. This can be done by
entering the following on the command line before loading the e100 driver:
dmesg -n 8
If you wish to see all messages issued by the driver, including debug
messages, set the dmesg level to eight.
NOTE: This setting is not saved across reboots.
Ethtool
-------
The driver utilizes the ethtool interface for driver configuration and
diagnostics, as well as displaying statistical information. Ethtool
version 1.6 or later is required for this functionality.
The latest release of ethtool can be found at:
http://sf.net/projects/gkernel.
After ethtool is installed, ethtool-copy.h must be copied and renamed to
ethtool.h in your kernel source tree at <linux_kernel_src>/include/linux.
Backup the original ethtool.h as needed before copying. The driver then
must be recompiled in order to take advantage of the latest ethtool
features.
NOTE: This driver uses mii support from the kernel. As a result, when
there is no link, ethtool will report speed/duplex to be 10/half.
NOTE: Ethtool 1.6 only supports a limited set of ethtool options. Support
for a more complete ethtool feature set can be enabled by upgrading
ethtool to ethtool-1.8.1.
Enabling Wake on LAN* (WoL)
---------------------------
WoL is provided through the Ethtool* utility. Ethtool is included with Red
Hat* 8.0. For other Linux distributions, download and install Ethtool from
the following website: http://sourceforge.net/projects/gkernel.
For instructions on enabling WoL with Ethtool, refer to the Ethtool man
page.
WoL will be enabled on the system during the next shut down or reboot. For
this driver version, in order to enable WoL, the e100 driver must be
loaded when shutting down or rebooting the system.
NAPI
----
NAPI (Rx polling mode) is supported in the e100 driver. NAPI is enabled
or disabled based on the configuration of the kernel.
See www.cyberus.ca/~hadi/usenix-paper.tgz for more information on NAPI.
Support
=======
......
This diff is collapsed.
Linux* Base Driver for the Intel(R) PRO/10GbE Family of Adapters
================================================================
January 06, 2003
September 13, 2004
Contents
========
- In This Release
- Supported Adapters
- Identifying Your Adapter
- Command Line Parameters
- Improving Performance
- Support
......@@ -18,36 +18,23 @@ In This Release
===============
This file describes the Linux* Base Driver for the Intel(R) PRO/10GbE Family
of Adapters, version 1.0.x. This driver is intended for 2.4.x kernels; it is
known to build properly on 2.4.x kernels through 2.4.18. Intel focused
testing on Intel architectures running kernels 2.4.18. This driver includes
support for Itanium(TM)-based systems.
of Adapters, version 1.0.x. This driver includes support for Itanium(TM)2 and
EM64T systems.
For questions related to hardware requirements, refer to the documentation
supplied with your Intel PRO/10GbE adapter. All hardware requirements listed
apply to use with Linux.
Supported Adapters
==================
The following Intel network adapters are compatible with the drivers in this
release:
Controller Adapter Name Board IDs
---------- ------------ ---------
82597EX Intel(R) PRO/10GbE LR Server Adapter A82505-xxx
Identifying Your Adapter
========================
To verify your Intel adapter is supported, find the board ID number on the
adapter. Look for a label that has a barcode and a number in the format
A12345-001. Match this to the list of numbers above.
A12345-001.
For more information on how to identify your adapter, go to the Adapter &
Driver ID Guide at:
Use the above information and the Adapter & Driver ID Guide at:
http://support.intel.com/support/network/adapter/pro100/21397.htm
http://support.intel.com/support/network/adapter/pro100/21397.htm
For the latest Intel network drivers for Linux, go to:
......@@ -72,8 +59,9 @@ loads the ixgb driver with 80 TX resources for the first adapter and 128 TX
resources for the second adapter.
The default value for each parameter is generally the recommended setting,
unless otherwise noted.
unless otherwise noted. Also, if the driver is statically built into the
kernel, the driver is loaded with the default values for all the parameters.
Ethtool can be used to change some of the parameters at runtime.
FlowControl
Valid Range: 0-3 (0=none, 1=Rx only, 2=Tx only, 3=Rx&Tx)
......@@ -125,7 +113,6 @@ Default Value: 1
offload for transmitted packets (both UDP and TCP) to the adapter
hardware.
Improving Performance
=====================
......
......@@ -2887,7 +2887,7 @@ static void vortex_get_drvinfo(struct net_device *dev,
}
static struct ethtool_ops vortex_ethtool_ops = {
.get_drvinfo = vortex_get_drvinfo,
.get_drvinfo = vortex_get_drvinfo,
};
#ifdef CONFIG_PCI
......
......@@ -1413,66 +1413,17 @@ config E100
depends on NET_PCI && PCI
select MII
---help---
This driver supports Intel(R) PRO/100 family of adapters, which
includes:
Controller Adapter Name Board IDs
---------- ------------ ---------
82558 PRO/100+ PCI Adapter 668081-xxx,
689661-xxx
82558 PRO/100+ Management Adapter 691334-xxx,
701738-xxx,
721383-xxx
82558 PRO/100+ Dual Port Server Adapter 714303-xxx,
711269-xxx,
A28276-xxx
82558 PRO/100+ PCI Server Adapter 710550-xxx
82550 PRO/100 S Server Adapter 752438-xxx
82559 A56831-xxx,
A10563-xxx,
A12171-xxx,
A12321-xxx,
A12320-xxx,
A12170-xxx
748568-xxx
748565-xxx
82550 PRO/100 S Desktop Adapter 751767-xxx
82559 748592-xxx,
A12167-xxx,
A12318-xxx,
A12317-xxx,
A12165-xxx,
748569-xxx
82559 PRO/100+ Server Adapter 729757-xxx
82559 PRO/100 S Management Adapter 748566-xxx,
748564-xxx
82550 PRO/100 S Dual Port Server Adapter A56831-xxx
82551 PRO/100 M Desktop Adapter A80897-xxx
PRO/100 S Advanced Management Adapter
747842-xxx,
745171-xxx
CNR PRO/100 VE Desktop Adapter A10386-xxx,
A10725-xxx,
A23801-xxx,
A19716-xxx
PRO/100 VM Desktop Adapter A14323-xxx,
A19725-xxx,
A23801-xxx,
A22220-xxx,
A23796-xxx
This driver supports Intel(R) PRO/100 family of adapters.
To verify that your adapter is supported, find the board ID number
on the adapter. Look for a label that has a barcode and a number
in the format 123456-001 (six digits hyphen three digits). Match
this to the list of numbers above.
in the format 123456-001 (six digits hyphen three digits).
For more information on how to identify your adapter, go to the
Adapter & Driver ID Guide at:
Use the above information and the Adapter & Driver ID Guide at:
http://support.intel.com/support/network/adapter/pro100/21397.htm
to identify the adapter.
For the latest Intel PRO/100 network driver for Linux, see:
http://appsr.intel.com/scripts-df/support_intel.asp
......@@ -1730,7 +1681,7 @@ config VIA_RHINE
(e.g. VT8235).
To compile this driver as a module, choose M here. The module
will be called via-rhine.
will be called via-velocity.
config VIA_RHINE_MMIO
bool "Use MMIO instead of PIO"
......@@ -1742,18 +1693,6 @@ config VIA_RHINE_MMIO
If unsure, say Y.
config VIA_VELOCITY
tristate "VIA Velocity support"
depends on NET_PCI && PCI
select CRC32
select CRC_CCITT
select MII
help
If you have a VIA "Velocity" based network card say Y here.
To compile this driver as a module, choose M here. The module
will be called via-velocity.
config LAN_SAA9730
bool "Philips SAA9730 Ethernet support (EXPERIMENTAL)"
depends on NET_PCI && EXPERIMENTAL && MIPS
......@@ -1933,29 +1872,8 @@ config E1000
depends on PCI
---help---
This driver supports Intel(R) PRO/1000 gigabit ethernet family of
adapters, which includes:
Controller Adapter Name Board IDs
---------- ------------ ---------
82542 PRO/1000 Gigabit Server Adapter 700262-xxx,
717037-xxx
82543 PRO/1000 F Server Adapter 738640-xxx,
A38888-xxx
82543 PRO/1000 T Server Adapter A19845-xxx,
A33948-xxx
82544 PRO/1000 XT Server Adapter A51580-xxx
82544 PRO/1000 XF Server Adapter A50484-xxx
82544 PRO/1000 T Desktop Adapter A62947-xxx
82540 PRO/1000 MT Desktop Adapter A78408-xxx
82541 PRO/1000 MT Desktop Adapter C91016-xxx
82545 PRO/1000 MT Server Adapter A92165-xxx
82546 PRO/1000 MT Dual Port Server Adapter A92111-xxx
82545 PRO/1000 MF Server Adapter A91622-xxx
82545 PRO/1000 MF Server Adapter(LX) A91624-xxx
82546 PRO/1000 MF Dual Port Server Adapter A91620-xxx
For more information on how to identify your adapter, go to the
Adapter & Driver ID Guide at:
adapters. For more information on how to identify your adapter, go
to the Adapter & Driver ID Guide at:
<http://support.intel.com/support/network/adapter/pro100/21397.htm>
......@@ -2140,6 +2058,18 @@ config SK98LIN
say M here and read Documentation/kbuild/modules.txt. The module will
be called sk98lin. This is recommended.
config VIA_VELOCITY
tristate "VIA Velocity support"
depends on NET_PCI && PCI
select CRC32
select CRC_CCITT
select MII
help
If you have a VIA "Velocity" based network card say Y here.
To compile this driver as a module, choose M here. The module
will be called via-velocity.
config TIGON3
tristate "Broadcom Tigon3 support"
depends on PCI
......@@ -2202,14 +2132,8 @@ config IXGB
depends on PCI
---help---
This driver supports Intel(R) PRO/10GbE family of
adapters, which includes:
Controller Adapter Name Board IDs
---------- ------------ ---------
82597EX Intel(R) PRO/10GbE LR Server Adapter A82505-xxx
For more information on how to identify your adapter, go to the
Adapter & Driver ID Guide at:
adapters. For more information on how to identify your adapter, go
to the Adapter & Driver ID Guide at:
<http://support.intel.com/support/network/adapter/pro100/21397.htm>
......
......@@ -77,7 +77,7 @@ static void __init dummy_setup(struct net_device *dev)
static int dummy_xmit(struct sk_buff *skb, struct net_device *dev)
{
struct net_device_stats *stats = dev->priv;
struct net_device_stats *stats = netdev_priv(dev);
stats->tx_packets++;
stats->tx_bytes+=skb->len;
......@@ -88,7 +88,7 @@ static int dummy_xmit(struct sk_buff *skb, struct net_device *dev)
static struct net_device_stats *dummy_get_stats(struct net_device *dev)
{
return dev->priv;
return netdev_priv(dev);
}
static struct net_device **dummies;
......
......@@ -64,7 +64,6 @@
#include <linux/udp.h>
#include <net/pkt_sched.h>
#include <linux/list.h>
#include <linux/rtnetlink.h>
#include <linux/reboot.h>
#ifdef NETIF_F_TSO
#include <net/checksum.h>
......@@ -73,7 +72,6 @@
#include <linux/mii.h>
#include <linux/ethtool.h>
#include <linux/if_vlan.h>
#include <linux/moduleparam.h>
#define BAR_0 0
#define BAR_1 1
......
......@@ -249,7 +249,8 @@ e1000_set_pauseparam(struct net_device *netdev,
e1000_reset(adapter);
}
else
return e1000_force_mac_fc(hw);
return ((hw->media_type == e1000_media_type_fiber) ?
e1000_setup_link(hw) : e1000_force_mac_fc(hw));
return 0;
}
......@@ -592,6 +593,9 @@ e1000_set_ringparam(struct net_device *netdev,
tx_old = adapter->tx_ring;
rx_old = adapter->rx_ring;
if ((ring->rx_mini_pending) || (ring->rx_jumbo_pending))
return -EINVAL;
if(netif_running(adapter->netdev))
e1000_down(adapter);
......@@ -637,7 +641,6 @@ e1000_set_ringparam(struct net_device *netdev,
return err;
}
#define REG_PATTERN_TEST(R, M, W) \
{ \
uint32_t pat, value; \
......@@ -1017,8 +1020,8 @@ e1000_setup_desc_rings(struct e1000_adapter *adapter)
struct e1000_rx_desc *rx_desc = E1000_RX_DESC(*rxdr, i);
struct sk_buff *skb;
if(!(skb = alloc_skb(E1000_RXBUFFER_2048 + NET_IP_ALIGN,
GFP_KERNEL))) {
if(!(skb = alloc_skb(E1000_RXBUFFER_2048 + NET_IP_ALIGN,
GFP_KERNEL))) {
ret_val = 6;
goto err_nomem;
}
......@@ -1442,6 +1445,8 @@ e1000_get_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
case E1000_DEV_ID_82543GC_COPPER:
case E1000_DEV_ID_82544EI_FIBER:
case E1000_DEV_ID_82546EB_QUAD_COPPER:
case E1000_DEV_ID_82545EM_FIBER:
case E1000_DEV_ID_82545EM_COPPER:
wol->supported = 0;
wol->wolopts = 0;
return;
......
......@@ -65,6 +65,7 @@ static void e1000_release_eeprom(struct e1000_hw *hw);
static void e1000_standby_eeprom(struct e1000_hw *hw);
static int32_t e1000_id_led_init(struct e1000_hw * hw);
static int32_t e1000_set_vco_speed(struct e1000_hw *hw);
static int32_t e1000_polarity_reversal_workaround(struct e1000_hw *hw);
static int32_t e1000_set_phy_mode(struct e1000_hw *hw);
/* IGP cable length table */
......@@ -1594,6 +1595,15 @@ e1000_phy_force_speed_duplex(struct e1000_hw *hw)
ret_val = e1000_write_phy_reg(hw, M88E1000_PHY_SPEC_CTRL, phy_data);
if(ret_val)
return ret_val;
if((hw->mac_type == e1000_82544 || hw->mac_type == e1000_82543) &&
(!hw->autoneg) &&
(hw->forced_speed_duplex == e1000_10_full ||
hw->forced_speed_duplex == e1000_10_half)) {
ret_val = e1000_polarity_reversal_workaround(hw);
if(ret_val)
return ret_val;
}
}
return E1000_SUCCESS;
}
......@@ -1983,6 +1993,7 @@ e1000_check_for_link(struct e1000_hw *hw)
uint32_t ctrl;
uint32_t status;
uint32_t rctl;
uint32_t icr;
uint32_t signal = 0;
int32_t ret_val;
uint16_t phy_data;
......@@ -2032,6 +2043,25 @@ e1000_check_for_link(struct e1000_hw *hw)
* link-up */
e1000_check_downshift(hw);
/* If we are on 82544 or 82543 silicon and speed/duplex
* are forced to 10H or 10F, then we will implement the polarity
* reversal workaround. We disable interrupts first, and upon
* returning, place the devices interrupt state to its previous
* value except for the link status change interrupt which will
* happen due to the execution of this workaround.
*/
if((hw->mac_type == e1000_82544 || hw->mac_type == e1000_82543) &&
(!hw->autoneg) &&
(hw->forced_speed_duplex == e1000_10_full ||
hw->forced_speed_duplex == e1000_10_half)) {
E1000_WRITE_REG(hw, IMC, 0xffffffff);
ret_val = e1000_polarity_reversal_workaround(hw);
icr = E1000_READ_REG(hw, ICR);
E1000_WRITE_REG(hw, ICS, (icr & ~E1000_ICS_LSC));
E1000_WRITE_REG(hw, IMS, IMS_ENABLE_MASK);
}
} else {
/* No link detected */
e1000_config_dsp_after_link_change(hw, FALSE);
......@@ -5191,28 +5221,88 @@ e1000_set_vco_speed(struct e1000_hw *hw)
return E1000_SUCCESS;
}
/******************************************************************************
* Verifies the hardware needs to allow ARPs to be processed by the host
*
* hw - Struct containing variables accessed by shared code
*
* returns: - TRUE/FALSE
*
*****************************************************************************/
uint32_t
e1000_enable_mng_pass_thru(struct e1000_hw *hw)
static int32_t
e1000_polarity_reversal_workaround(struct e1000_hw *hw)
{
uint32_t manc;
int32_t ret_val;
uint16_t mii_status_reg;
uint16_t i;
if (hw->asf_firmware_present) {
manc = E1000_READ_REG(hw, MANC);
/* Polarity reversal workaround for forced 10F/10H links. */
/* Disable the transmitter on the PHY */
ret_val = e1000_write_phy_reg(hw, M88E1000_PHY_PAGE_SELECT, 0x0019);
if(ret_val)
return ret_val;
ret_val = e1000_write_phy_reg(hw, M88E1000_PHY_GEN_CONTROL, 0xFFFF);
if(ret_val)
return ret_val;
ret_val = e1000_write_phy_reg(hw, M88E1000_PHY_PAGE_SELECT, 0x0000);
if(ret_val)
return ret_val;
/* This loop will early-out if the NO link condition has been met. */
for(i = PHY_FORCE_TIME; i > 0; i--) {
/* Read the MII Status Register and wait for Link Status bit
* to be clear.
*/
ret_val = e1000_read_phy_reg(hw, PHY_STATUS, &mii_status_reg);
if(ret_val)
return ret_val;
ret_val = e1000_read_phy_reg(hw, PHY_STATUS, &mii_status_reg);
if(ret_val)
return ret_val;
if((mii_status_reg & ~MII_SR_LINK_STATUS) == 0) break;
msec_delay_irq(100);
}
/* Recommended delay time after link has been lost */
msec_delay_irq(1000);
/* Now we will re-enable th transmitter on the PHY */
ret_val = e1000_write_phy_reg(hw, M88E1000_PHY_PAGE_SELECT, 0x0019);
if(ret_val)
return ret_val;
msec_delay_irq(50);
ret_val = e1000_write_phy_reg(hw, M88E1000_PHY_GEN_CONTROL, 0xFFF0);
if(ret_val)
return ret_val;
msec_delay_irq(50);
ret_val = e1000_write_phy_reg(hw, M88E1000_PHY_GEN_CONTROL, 0xFF00);
if(ret_val)
return ret_val;
msec_delay_irq(50);
ret_val = e1000_write_phy_reg(hw, M88E1000_PHY_GEN_CONTROL, 0x0000);
if(ret_val)
return ret_val;
if (!(manc & E1000_MANC_RCV_TCO_EN) ||
!(manc & E1000_MANC_EN_MAC_ADDR_FILTER))
return FALSE;
if ((manc & E1000_MANC_SMBUS_EN) && !(manc & E1000_MANC_ASF_EN))
return TRUE;
ret_val = e1000_write_phy_reg(hw, M88E1000_PHY_PAGE_SELECT, 0x0000);
if(ret_val)
return ret_val;
/* This loop will early-out if the link condition has been met. */
for(i = PHY_FORCE_TIME; i > 0; i--) {
/* Read the MII Status Register and wait for Link Status bit
* to be set.
*/
ret_val = e1000_read_phy_reg(hw, PHY_STATUS, &mii_status_reg);
if(ret_val)
return ret_val;
ret_val = e1000_read_phy_reg(hw, PHY_STATUS, &mii_status_reg);
if(ret_val)
return ret_val;
if(mii_status_reg & MII_SR_LINK_STATUS) break;
msec_delay_irq(100);
}
return FALSE;
return E1000_SUCCESS;
}
......@@ -48,7 +48,7 @@ char e1000_driver_string[] = "Intel(R) PRO/1000 Network Driver";
#else
#define DRIVERNAPI "-NAPI"
#endif
char e1000_driver_version[] = "5.3.19-k2"DRIVERNAPI;
char e1000_driver_version[] = "5.5.4-k2"DRIVERNAPI;
char e1000_copyright[] = "Copyright (c) 1999-2004 Intel Corporation.";
/* e1000_pci_tbl - PCI Device ID Table
......@@ -311,7 +311,8 @@ e1000_down(struct e1000_adapter *adapter)
void
e1000_reset(struct e1000_adapter *adapter)
{
uint32_t pba, manc;
uint32_t pba;
/* Repartition Pba for greater than 9k mtu
* To take effect CTRL.RST is required.
*/
......@@ -354,12 +355,6 @@ e1000_reset(struct e1000_adapter *adapter)
e1000_reset_adaptive(&adapter->hw);
e1000_phy_get_info(&adapter->hw, &adapter->phy_info);
if(adapter->en_mng_pt) {
manc = E1000_READ_REG(&adapter->hw, MANC);
manc |= (E1000_MANC_ARP_EN | E1000_MANC_EN_MNG2HOST);
E1000_WRITE_REG(&adapter->hw, MANC, manc);
}
}
/**
......@@ -422,11 +417,6 @@ e1000_probe(struct pci_dev *pdev,
adapter->hw.back = adapter;
adapter->msg_enable = (1 << debug) - 1;
rtnl_lock();
/* we need to set the name early for the DPRINTK macro */
if(dev_alloc_name(netdev, netdev->name) < 0)
goto err_free_unlock;
mmio_start = pci_resource_start(pdev, BAR_0);
mmio_len = pci_resource_len(pdev, BAR_0);
......@@ -466,6 +456,7 @@ e1000_probe(struct pci_dev *pdev,
#ifdef CONFIG_NET_POLL_CONTROLLER
netdev->poll_controller = e1000_netpoll;
#endif
strcpy(netdev->name, pci_name(pdev));
netdev->mem_start = mmio_start;
netdev->mem_end = mmio_start + mmio_len;
......@@ -502,8 +493,6 @@ e1000_probe(struct pci_dev *pdev,
/* hard_start_xmit is safe against parallel locking */
netdev->features |= NETIF_F_LLTX;
adapter->en_mng_pt = e1000_enable_mng_pass_thru(&adapter->hw);
/* before reading the EEPROM, reset the controller to
* put the device in a known good starting state */
......@@ -553,7 +542,6 @@ e1000_probe(struct pci_dev *pdev,
netif_carrier_off(netdev);
netif_stop_queue(netdev);
DPRINTK(PROBE, INFO, "Intel(R) PRO/1000 Network Connection\n");
e1000_check_options(adapter);
/* Initial Wake on LAN setting
......@@ -586,12 +574,13 @@ e1000_probe(struct pci_dev *pdev,
/* reset the hardware with the new settings */
e1000_reset(adapter);
/* We're already holding the rtnl lock; call the no-lock version */
if((err = register_netdevice(netdev)))
strcpy(netdev->name, "eth%d");
if((err = register_netdev(netdev)))
goto err_register;
DPRINTK(PROBE, INFO, "Intel(R) PRO/1000 Network Connection\n");
cards_found++;
rtnl_unlock();
return 0;
err_register:
......@@ -599,8 +588,6 @@ e1000_probe(struct pci_dev *pdev,
err_eeprom:
iounmap(adapter->hw.hw_addr);
err_ioremap:
err_free_unlock:
rtnl_unlock();
free_netdev(netdev);
err_alloc_etherdev:
pci_release_regions(pdev);
......@@ -641,6 +628,8 @@ e1000_remove(struct pci_dev *pdev)
pci_release_regions(pdev);
free_netdev(netdev);
pci_disable_device(pdev);
}
/**
......@@ -2335,8 +2324,8 @@ e1000_clean_rx_irq(struct e1000_adapter *adapter)
if(unlikely(adapter->vlgrp &&
(rx_desc->status & E1000_RXD_STAT_VP))) {
vlan_hwaccel_receive_skb(skb, adapter->vlgrp,
le16_to_cpu(rx_desc->special &
E1000_RXD_SPC_VLAN_MASK));
le16_to_cpu(rx_desc->special) &
E1000_RXD_SPC_VLAN_MASK);
} else {
netif_receive_skb(skb);
}
......@@ -2344,8 +2333,8 @@ e1000_clean_rx_irq(struct e1000_adapter *adapter)
if(unlikely(adapter->vlgrp &&
(rx_desc->status & E1000_RXD_STAT_VP))) {
vlan_hwaccel_rx(skb, adapter->vlgrp,
le16_to_cpu(rx_desc->special &
E1000_RXD_SPC_VLAN_MASK));
le16_to_cpu(rx_desc->special) &
E1000_RXD_SPC_VLAN_MASK);
} else {
netif_rx(skb);
}
......@@ -2894,9 +2883,9 @@ e1000_resume(struct pci_dev *pdev)
{
struct net_device *netdev = pci_get_drvdata(pdev);
struct e1000_adapter *adapter = netdev->priv;
uint32_t manc;
uint32_t manc, ret;
pci_enable_device(pdev);
ret = pci_enable_device(pdev);
pci_set_power_state(pdev, 0);
pci_restore_state(pdev);
......
......@@ -49,6 +49,12 @@
set_current_state(TASK_UNINTERRUPTIBLE); \
schedule_timeout((x * HZ)/1000 + 2); \
} } while(0)
/* Some workarounds require millisecond delays and are run during interrupt
* context. Most notably, when establishing link, the phy may need tweaking
* but cannot process phy register reads/writes faster than millisecond
* intervals...and we establish link due to a "link status change" interrupt.
*/
#define msec_delay_irq(x) mdelay(x)
#endif
#define PCI_COMMAND_REGISTER PCI_COMMAND
......
......@@ -34,31 +34,21 @@
#define E1000_MAX_NIC 32
#define OPTION_UNSET -1
#define OPTION_UNSET -1
#define OPTION_DISABLED 0
#define OPTION_ENABLED 1
/* Module Parameters are always initialized to -1, so that the driver
* can tell the difference between no user specified value or the
* user asking for the default value.
* The true default values are loaded in when e1000_check_options is called.
*
* This is a GCC extension to ANSI C.
* See the item "Labeled Elements in Initializers" in the section
* "Extensions to the C Language Family" of the GCC documentation.
*/
#define E1000_PARAM_INIT { [0 ... E1000_MAX_NIC] = OPTION_UNSET }
/* All parameters are treated the same, as an integer array of values.
* This macro just reduces the need to repeat the same declaration code
* over and over (plus this helps to avoid typo bugs).
*/
#define E1000_PARAM(X, S) \
static const int __devinitdata X[E1000_MAX_NIC + 1] = E1000_PARAM_INIT; \
MODULE_PARM(X, "1-" __MODULE_STRING(E1000_MAX_NIC) "i"); \
MODULE_PARM_DESC(X, S);
#define E1000_PARAM_INIT { [0 ... E1000_MAX_NIC] = OPTION_UNSET }
#define E1000_PARAM(X, desc) \
static int __devinitdata X[E1000_MAX_NIC+1] = E1000_PARAM_INIT; \
static int num_##X = 0; \
module_param_array(X, int, &num_##X, 0); \
MODULE_PARM_DESC(X, desc);
/* Transmit Descriptor Count
*
......@@ -305,7 +295,6 @@ e1000_check_options(struct e1000_adapter *adapter)
DPRINTK(PROBE, NOTICE,
"Warning: no configuration for board #%i\n", bd);
DPRINTK(PROBE, NOTICE, "Using defaults for all values\n");
bd = E1000_MAX_NIC;
}
{ /* Transmit Descriptor Count */
......@@ -322,9 +311,14 @@ e1000_check_options(struct e1000_adapter *adapter)
opt.arg.r.max = mac_type < e1000_82544 ?
E1000_MAX_TXD : E1000_MAX_82544_TXD;
tx_ring->count = TxDescriptors[bd];
e1000_validate_option(&tx_ring->count, &opt, adapter);
E1000_ROUNDUP(tx_ring->count, REQ_TX_DESCRIPTOR_MULTIPLE);
if (num_TxDescriptors > bd) {
tx_ring->count = TxDescriptors[bd];
e1000_validate_option(&tx_ring->count, &opt, adapter);
E1000_ROUNDUP(tx_ring->count,
REQ_TX_DESCRIPTOR_MULTIPLE);
} else {
tx_ring->count = opt.def;
}
}
{ /* Receive Descriptor Count */
struct e1000_option opt = {
......@@ -340,9 +334,14 @@ e1000_check_options(struct e1000_adapter *adapter)
opt.arg.r.max = mac_type < e1000_82544 ? E1000_MAX_RXD :
E1000_MAX_82544_RXD;
rx_ring->count = RxDescriptors[bd];
e1000_validate_option(&rx_ring->count, &opt, adapter);
E1000_ROUNDUP(rx_ring->count, REQ_RX_DESCRIPTOR_MULTIPLE);
if (num_RxDescriptors > bd) {
rx_ring->count = RxDescriptors[bd];
e1000_validate_option(&rx_ring->count, &opt, adapter);
E1000_ROUNDUP(rx_ring->count,
REQ_RX_DESCRIPTOR_MULTIPLE);
} else {
rx_ring->count = opt.def;
}
}
{ /* Checksum Offload Enable/Disable */
struct e1000_option opt = {
......@@ -352,9 +351,13 @@ e1000_check_options(struct e1000_adapter *adapter)
.def = OPTION_ENABLED
};
int rx_csum = XsumRX[bd];
e1000_validate_option(&rx_csum, &opt, adapter);
adapter->rx_csum = rx_csum;
if (num_XsumRX > bd) {
int rx_csum = XsumRX[bd];
e1000_validate_option(&rx_csum, &opt, adapter);
adapter->rx_csum = rx_csum;
} else {
adapter->rx_csum = opt.def;
}
}
{ /* Flow Control */
......@@ -374,9 +377,13 @@ e1000_check_options(struct e1000_adapter *adapter)
.p = fc_list }}
};
int fc = FlowControl[bd];
e1000_validate_option(&fc, &opt, adapter);
adapter->hw.fc = adapter->hw.original_fc = fc;
if (num_FlowControl > bd) {
int fc = FlowControl[bd];
e1000_validate_option(&fc, &opt, adapter);
adapter->hw.fc = adapter->hw.original_fc = fc;
} else {
adapter->hw.fc = opt.def;
}
}
{ /* Transmit Interrupt Delay */
struct e1000_option opt = {
......@@ -388,8 +395,13 @@ e1000_check_options(struct e1000_adapter *adapter)
.max = MAX_TXDELAY }}
};
adapter->tx_int_delay = TxIntDelay[bd];
e1000_validate_option(&adapter->tx_int_delay, &opt, adapter);
if (num_TxIntDelay > bd) {
adapter->tx_int_delay = TxIntDelay[bd];
e1000_validate_option(&adapter->tx_int_delay, &opt,
adapter);
} else {
adapter->tx_int_delay = opt.def;
}
}
{ /* Transmit Absolute Interrupt Delay */
struct e1000_option opt = {
......@@ -401,8 +413,13 @@ e1000_check_options(struct e1000_adapter *adapter)
.max = MAX_TXABSDELAY }}
};
adapter->tx_abs_int_delay = TxAbsIntDelay[bd];
e1000_validate_option(&adapter->tx_abs_int_delay, &opt, adapter);
if (num_TxAbsIntDelay > bd) {
adapter->tx_abs_int_delay = TxAbsIntDelay[bd];
e1000_validate_option(&adapter->tx_abs_int_delay, &opt,
adapter);
} else {
adapter->tx_abs_int_delay = opt.def;
}
}
{ /* Receive Interrupt Delay */
struct e1000_option opt = {
......@@ -414,8 +431,13 @@ e1000_check_options(struct e1000_adapter *adapter)
.max = MAX_RXDELAY }}
};
adapter->rx_int_delay = RxIntDelay[bd];
e1000_validate_option(&adapter->rx_int_delay, &opt, adapter);
if (num_RxIntDelay > bd) {
adapter->rx_int_delay = RxIntDelay[bd];
e1000_validate_option(&adapter->rx_int_delay, &opt,
adapter);
} else {
adapter->rx_int_delay = opt.def;
}
}
{ /* Receive Absolute Interrupt Delay */
struct e1000_option opt = {
......@@ -427,8 +449,13 @@ e1000_check_options(struct e1000_adapter *adapter)
.max = MAX_RXABSDELAY }}
};
adapter->rx_abs_int_delay = RxAbsIntDelay[bd];
e1000_validate_option(&adapter->rx_abs_int_delay, &opt, adapter);
if (num_RxAbsIntDelay > bd) {
adapter->rx_abs_int_delay = RxAbsIntDelay[bd];
e1000_validate_option(&adapter->rx_abs_int_delay, &opt,
adapter);
} else {
adapter->rx_abs_int_delay = opt.def;
}
}
{ /* Interrupt Throttling Rate */
struct e1000_option opt = {
......@@ -440,20 +467,27 @@ e1000_check_options(struct e1000_adapter *adapter)
.max = MAX_ITR }}
};
adapter->itr = InterruptThrottleRate[bd];
switch(adapter->itr) {
case -1:
if (num_InterruptThrottleRate > bd) {
adapter->itr = InterruptThrottleRate[bd];
switch(adapter->itr) {
case -1:
adapter->itr = 1;
break;
case 0:
DPRINTK(PROBE, INFO, "%s turned off\n",
opt.name);
break;
case 1:
DPRINTK(PROBE, INFO, "%s set to dynamic mode\n",
opt.name);
break;
default:
e1000_validate_option(&adapter->itr, &opt,
adapter);
break;
}
} else {
adapter->itr = 1;
break;
case 0:
DPRINTK(PROBE, INFO, "%s turned off\n", opt.name);
break;
case 1:
DPRINTK(PROBE, INFO, "%s set to dynamic mode\n", opt.name);
break;
default:
e1000_validate_option(&adapter->itr, &opt, adapter);
break;
}
}
......@@ -481,17 +515,17 @@ static void __devinit
e1000_check_fiber_options(struct e1000_adapter *adapter)
{
int bd = adapter->bd_number;
bd = bd > E1000_MAX_NIC ? E1000_MAX_NIC : bd;
if((Speed[bd] != OPTION_UNSET)) {
if(num_Speed > bd) {
DPRINTK(PROBE, INFO, "Speed not valid for fiber adapters, "
"parameter ignored\n");
}
if((Duplex[bd] != OPTION_UNSET)) {
if(num_Duplex > bd) {
DPRINTK(PROBE, INFO, "Duplex not valid for fiber adapters, "
"parameter ignored\n");
}
if((AutoNeg[bd] != OPTION_UNSET) && (AutoNeg[bd] != 0x20)) {
if((num_AutoNeg > bd) && (AutoNeg[bd] != 0x20)) {
DPRINTK(PROBE, INFO, "AutoNeg other than 1000/Full is "
"not valid for fiber adapters, "
"parameter ignored\n");
......@@ -510,7 +544,6 @@ e1000_check_copper_options(struct e1000_adapter *adapter)
{
int speed, dplx;
int bd = adapter->bd_number;
bd = bd > E1000_MAX_NIC ? E1000_MAX_NIC : bd;
{ /* Speed */
struct e1000_opt_list speed_list[] = {{ 0, "" },
......@@ -527,8 +560,12 @@ e1000_check_copper_options(struct e1000_adapter *adapter)
.p = speed_list }}
};
speed = Speed[bd];
e1000_validate_option(&speed, &opt, adapter);
if (num_Speed > bd) {
speed = Speed[bd];
e1000_validate_option(&speed, &opt, adapter);
} else {
speed = opt.def;
}
}
{ /* Duplex */
struct e1000_opt_list dplx_list[] = {{ 0, "" },
......@@ -544,11 +581,15 @@ e1000_check_copper_options(struct e1000_adapter *adapter)
.p = dplx_list }}
};
dplx = Duplex[bd];
e1000_validate_option(&dplx, &opt, adapter);
if (num_Duplex > bd) {
dplx = Duplex[bd];
e1000_validate_option(&dplx, &opt, adapter);
} else {
dplx = opt.def;
}
}
if(AutoNeg[bd] != OPTION_UNSET && (speed != 0 || dplx != 0)) {
if((num_AutoNeg > bd) && (speed != 0 || dplx != 0)) {
DPRINTK(PROBE, INFO,
"AutoNeg specified along with Speed or Duplex, "
"parameter ignored\n");
......@@ -605,7 +646,7 @@ e1000_check_copper_options(struct e1000_adapter *adapter)
switch (speed + dplx) {
case 0:
adapter->hw.autoneg = adapter->fc_autoneg = 1;
if(Speed[bd] != OPTION_UNSET || Duplex[bd] != OPTION_UNSET)
if((num_Speed > bd) && (speed != 0 || dplx != 0))
DPRINTK(PROBE, INFO,
"Speed and duplex autonegotiation enabled\n");
break;
......
......@@ -164,12 +164,12 @@ static char version[] __initdata =
static void __init eql_setup(struct net_device *dev)
{
equalizer_t *eql = dev->priv;
equalizer_t *eql = netdev_priv(dev);
SET_MODULE_OWNER(dev);
init_timer(&eql->timer);
eql->timer.data = (unsigned long) dev->priv;
eql->timer.data = (unsigned long) eql;
eql->timer.expires = jiffies + EQL_DEFAULT_RESCHED_IVAL;
eql->timer.function = eql_timer;
......@@ -197,7 +197,7 @@ static void __init eql_setup(struct net_device *dev)
static int eql_open(struct net_device *dev)
{
equalizer_t *eql = dev->priv;
equalizer_t *eql = netdev_priv(dev);
/* XXX We should force this off automatically for the user. */
printk(KERN_INFO "%s: remember to turn off Van-Jacobson compression on "
......@@ -241,7 +241,7 @@ static void eql_kill_slave_queue(slave_queue_t *queue)
static int eql_close(struct net_device *dev)
{
equalizer_t *eql = dev->priv;
equalizer_t *eql = netdev_priv(dev);
/*
* The timer has to be stopped first before we start hacking away
......@@ -326,7 +326,7 @@ static slave_t *__eql_schedule_slaves(slave_queue_t *queue)
static int eql_slave_xmit(struct sk_buff *skb, struct net_device *dev)
{
equalizer_t *eql = dev->priv;
equalizer_t *eql = netdev_priv(dev);
slave_t *slave;
spin_lock(&eql->queue.lock);
......@@ -352,7 +352,7 @@ static int eql_slave_xmit(struct sk_buff *skb, struct net_device *dev)
static struct net_device_stats * eql_get_stats(struct net_device *dev)
{
equalizer_t *eql = dev->priv;
equalizer_t *eql = netdev_priv(dev);
return &eql->stats;
}
......@@ -378,7 +378,7 @@ static slave_t *__eql_find_slave_dev(slave_queue_t *queue, struct net_device *de
static inline int eql_is_full(slave_queue_t *queue)
{
equalizer_t *eql = queue->master_dev->priv;
equalizer_t *eql = netdev_priv(queue->master_dev);
if (queue->num_slaves >= eql->max_slaves)
return 1;
......@@ -420,7 +420,7 @@ static int eql_enslave(struct net_device *master_dev, slaving_request_t __user *
if (!eql_is_master(slave_dev) &&
!eql_is_slave(slave_dev)) {
slave_t *s = kmalloc(sizeof(*s), GFP_KERNEL);
equalizer_t *eql = master_dev->priv;
equalizer_t *eql = netdev_priv(master_dev);
int ret;
if (!s) {
......@@ -453,7 +453,7 @@ static int eql_enslave(struct net_device *master_dev, slaving_request_t __user *
static int eql_emancipate(struct net_device *master_dev, slaving_request_t __user *srqp)
{
equalizer_t *eql = master_dev->priv;
equalizer_t *eql = netdev_priv(master_dev);
struct net_device *slave_dev;
slaving_request_t srq;
int ret;
......@@ -485,7 +485,7 @@ static int eql_emancipate(struct net_device *master_dev, slaving_request_t __use
static int eql_g_slave_cfg(struct net_device *dev, slave_config_t __user *scp)
{
equalizer_t *eql = dev->priv;
equalizer_t *eql = netdev_priv(dev);
slave_t *slave;
struct net_device *slave_dev;
slave_config_t sc;
......@@ -539,7 +539,7 @@ static int eql_s_slave_cfg(struct net_device *dev, slave_config_t __user *scp)
if (!slave_dev)
return ret;
eql = dev->priv;
eql = netdev_priv(dev);
spin_lock_bh(&eql->queue.lock);
if (eql_is_slave(slave_dev)) {
slave = __eql_find_slave_dev(&eql->queue, slave_dev);
......@@ -561,7 +561,7 @@ static int eql_g_master_cfg(struct net_device *dev, master_config_t __user *mcp)
master_config_t mc;
if (eql_is_master(dev)) {
eql = dev->priv;
eql = netdev_priv(dev);
mc.max_slaves = eql->max_slaves;
mc.min_slaves = eql->min_slaves;
if (copy_to_user(mcp, &mc, sizeof (master_config_t)))
......@@ -580,7 +580,7 @@ static int eql_s_master_cfg(struct net_device *dev, master_config_t __user *mcp)
return -EFAULT;
if (eql_is_master(dev)) {
eql = dev->priv;
eql = netdev_priv(dev);
eql->max_slaves = mc.max_slaves;
eql->min_slaves = mc.min_slaves;
return 0;
......
......@@ -549,6 +549,8 @@ static int hdlcdrv_close(struct net_device *dev)
netif_stop_queue(dev);
netif_stop_queue(dev);
if (s->ops && s->ops->close)
i = s->ops->close(dev);
if (s->skb)
......
......@@ -30,7 +30,7 @@
char ixgb_driver_name[] = "ixgb";
char ixgb_driver_string[] = "Intel(R) PRO/10GbE Network Driver";
char ixgb_driver_version[] = "1.0.66";
char ixgb_driver_version[] = "1.0.66-k2";
char ixgb_copyright[] = "Copyright (c) 2001-2004 Intel Corporation.";
/* ixgb_pci_tbl - PCI Device ID Table
......@@ -1614,8 +1614,12 @@ static irqreturn_t ixgb_intr(int irq, void *data, struct pt_regs *regs)
}
#else
for (i = 0; i < IXGB_MAX_INTR; i++)
if (!ixgb_clean_rx_irq(adapter) & !ixgb_clean_tx_irq(adapter))
if (ixgb_clean_rx_irq(adapter) == FALSE)
break;
for (i = 0; i < IXGB_MAX_INTR; i++)
if (ixgb_clean_tx_irq(adapter) == FALSE)
break;
/* if RAIDC:EN == 1 and ICR:RXDMT0 == 1, we need to
* set IMS:RXDMT0 to 1 to restart the RBD timer (POLL)
*/
......@@ -1676,7 +1680,7 @@ static boolean_t ixgb_clean_tx_irq(struct ixgb_adapter *adapter)
eop = tx_ring->buffer_info[i].next_to_watch;
eop_desc = IXGB_TX_DESC(*tx_ring, eop);
while (eop_desc->status & cpu_to_le32(IXGB_TX_DESC_STATUS_DD)) {
while (eop_desc->status & IXGB_TX_DESC_STATUS_DD) {
for (cleaned = FALSE; !cleaned;) {
tx_desc = IXGB_TX_DESC(*tx_ring, i);
......
......@@ -42,10 +42,6 @@
#include "8390.h"
#if (LINUX_VERSION_CODE < 0x02030e)
#define net_device device
#endif
#define WD_START_PG 0x00 /* First page of TX buffer */
#define CABLETRON_RX_START_PG 0x00 /* First page of RX buffer */
#define CABLETRON_RX_STOP_PG 0x30 /* Last page +1 of RX ring */
......
......@@ -653,12 +653,43 @@ static void __devexit ne2k_pci_remove_one (struct pci_dev *pdev)
pci_set_drvdata(pdev, NULL);
}
#ifdef CONFIG_PM
static int ne2k_pci_suspend (struct pci_dev *pdev, u32 state)
{
struct net_device *dev = pci_get_drvdata (pdev);
netif_device_detach(dev);
pci_save_state(pdev);
pci_set_power_state(pdev, state);
return 0;
}
static int ne2k_pci_resume (struct pci_dev *pdev)
{
struct net_device *dev = pci_get_drvdata (pdev);
pci_set_power_state(pdev, 0);
pci_restore_state(pdev);
NS8390_init(dev, 1);
netif_device_attach(dev);
return 0;
}
#endif /* CONFIG_PM */
static struct pci_driver ne2k_driver = {
.name = DRV_NAME,
.probe = ne2k_pci_init_one,
.remove = __devexit_p(ne2k_pci_remove_one),
.id_table = ne2k_pci_tbl,
#ifdef CONFIG_PM
.suspend = ne2k_pci_suspend,
.resume = ne2k_pci_resume,
#endif /* CONFIG_PM */
};
......
......@@ -64,6 +64,8 @@
* tuning
* 0.20 - fix stupid RFEN thinko. i am such a smurf.
*
* 20040828 0.21 - add hardware vlan accleration
* by Neil Horman <nhorman@redhat.com>
* Driver Overview
* ===============
*
......@@ -92,7 +94,9 @@
//#define dprintk printk
#define dprintk(x...) do { } while (0)
#include <linux/config.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/types.h>
#include <linux/pci.h>
#include <linux/netdevice.h>
......@@ -108,6 +112,7 @@
#include <linux/prefetch.h>
#include <linux/ethtool.h>
#include <linux/timer.h>
#include <linux/if_vlan.h>
#include <asm/io.h>
#include <asm/uaccess.h>
......@@ -115,7 +120,7 @@
#define DRV_NAME "ns83820"
/* Global parameters. See MODULE_PARM near the bottom. */
/* Global parameters. See module_param near the bottom. */
static int ihr = 2;
static int reset_phy = 0;
static int lnksts = 0; /* CFG_LNKSTS bit polarity */
......@@ -138,6 +143,9 @@ static int lnksts = 0; /* CFG_LNKSTS bit polarity */
/* tunables */
#define RX_BUF_SIZE 1500 /* 8192 */
#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
#define NS83820_VLAN_ACCEL_SUPPORT
#endif
/* Must not exceed ~65000. */
#define NR_RX_DESC 64
......@@ -262,6 +270,8 @@ static int lnksts = 0; /* CFG_LNKSTS bit polarity */
#define EXTSTS_UDPPKT 0x00200000
#define EXTSTS_TCPPKT 0x00080000
#define EXTSTS_IPPKT 0x00020000
#define EXTSTS_VPKT 0x00010000
#define EXTSTS_VTG_MASK 0x0000ffff
#define SPDSTS_POLARITY (CFG_SPDSTS1 | CFG_SPDSTS0 | CFG_DUPSTS | (lnksts ? CFG_LNKSTS : 0))
......@@ -403,6 +413,7 @@ static int lnksts = 0; /* CFG_LNKSTS bit polarity */
#define CMDSTS_INTR 0x20000000
#define CMDSTS_ERR 0x10000000
#define CMDSTS_OK 0x08000000
#define CMDSTS_RUNT 0x00200000
#define CMDSTS_LEN_MASK 0x0000ffff
#define CMDSTS_DEST_MASK 0x01800000
......@@ -432,6 +443,10 @@ struct ns83820 {
struct pci_dev *pci_dev;
#ifdef NS83820_VLAN_ACCEL_SUPPORT
struct vlan_group *vlgrp;
#endif
struct rx_info rx_info;
struct tasklet_struct rx_tasklet;
......@@ -494,6 +509,33 @@ static inline void kick_rx(struct net_device *ndev)
(((NR_TX_DESC-2 + dev->tx_done_idx - dev->tx_free_idx) % NR_TX_DESC) > MIN_TX_DESC_FREE)
#ifdef NS83820_VLAN_ACCEL_SUPPORT
static void ns83820_vlan_rx_register(struct net_device *ndev, struct vlan_group *grp)
{
struct ns83820 *dev = PRIV(ndev);
spin_lock_irq(&dev->misc_lock);
spin_lock(&dev->tx_lock);
dev->vlgrp = grp;
spin_unlock(&dev->tx_lock);
spin_unlock_irq(&dev->misc_lock);
}
static void ns83820_vlan_rx_kill_vid(struct net_device *ndev, unsigned short vid)
{
struct ns83820 *dev = PRIV(ndev);
spin_lock_irq(&dev->misc_lock);
spin_lock(&dev->tx_lock);
if (dev->vlgrp)
dev->vlgrp->vlan_devices[vid] = NULL;
spin_unlock(&dev->tx_lock);
spin_unlock_irq(&dev->misc_lock);
}
#endif
/* Packet Receiver
*
* The hardware supports linked lists of receive descriptors for
......@@ -836,6 +878,7 @@ static void fastcall rx_irq(struct net_device *ndev)
struct ns83820 *dev = PRIV(ndev);
struct rx_info *info = &dev->rx_info;
unsigned next_rx;
int rx_rc, len;
u32 cmdsts, *desc;
unsigned long flags;
int nr = 0;
......@@ -876,8 +919,24 @@ static void fastcall rx_irq(struct net_device *ndev)
pci_unmap_single(dev->pci_dev, bufptr,
RX_BUF_SIZE, PCI_DMA_FROMDEVICE);
len = cmdsts & CMDSTS_LEN_MASK;
#ifdef NS83820_VLAN_ACCEL_SUPPORT
/* NH: As was mentioned below, this chip is kinda
* brain dead about vlan tag stripping. Frames
* that are 64 bytes with a vlan header appended
* like arp frames, or pings, are flagged as Runts
* when the tag is stripped and hardware. This
* also means that the OK bit in the descriptor
* is cleared when the frame comes in so we have
* to do a specific length check here to make sure
* the frame would have been ok, had we not stripped
* the tag.
*/
if (likely((CMDSTS_OK & cmdsts) ||
((cmdsts & CMDSTS_RUNT) && len >= 56))) {
#else
if (likely(CMDSTS_OK & cmdsts)) {
int len = cmdsts & 0xffff;
#endif
skb_put(skb, len);
if (unlikely(!skb))
goto netdev_mangle_me_harder_failed;
......@@ -891,7 +950,18 @@ static void fastcall rx_irq(struct net_device *ndev)
skb->ip_summed = CHECKSUM_NONE;
}
skb->protocol = eth_type_trans(skb, ndev);
if (NET_RX_DROP == netif_rx(skb)) {
#ifdef NS83820_VLAN_ACCEL_SUPPORT
if(extsts & EXTSTS_VPKT) {
unsigned short tag;
tag = ntohs(extsts & EXTSTS_VTG_MASK);
rx_rc = vlan_hwaccel_rx(skb,dev->vlgrp,tag);
} else {
rx_rc = netif_rx(skb);
}
#else
rx_rc = netif_rx(skb);
#endif
if (NET_RX_DROP == rx_rc) {
netdev_mangle_me_harder_failed:
dev->stats.rx_dropped ++;
}
......@@ -1099,6 +1169,17 @@ static int ns83820_hard_start_xmit(struct sk_buff *skb, struct net_device *ndev)
extsts |= EXTSTS_UDPPKT;
}
#ifdef NS83820_VLAN_ACCEL_SUPPORT
if(vlan_tx_tag_present(skb)) {
/* fetch the vlan tag info out of the
* ancilliary data if the vlan code
* is using hw vlan acceleration
*/
short tag = vlan_tx_tag_get(skb);
extsts |= (EXTSTS_VPKT | htons(tag));
}
#endif
len = skb->len;
if (nr_frags)
len -= skb->data_len;
......@@ -1854,7 +1935,6 @@ static int __devinit ns83820_init_one(struct pci_dev *pci_dev, const struct pci_
SET_ETHTOOL_OPS(ndev, &ops);
ndev->tx_timeout = ns83820_tx_timeout;
ndev->watchdog_timeo = 5 * HZ;
pci_set_drvdata(pci_dev, ndev);
ns83820_do_reset(dev, CR_RST);
......@@ -1980,11 +2060,25 @@ static int __devinit ns83820_init_one(struct pci_dev *pci_dev, const struct pci_
* a ping with a VLAN header) then the card, strips the 4 byte VLAN
* tag and then checks the packet size, so if RXCFG_ARP is not enabled,
* it discrards it!. These guys......
* also turn on tag stripping if hardware acceleration is enabled
*/
writel(VRCR_IPEN | VRCR_VTDEN, dev->base + VRCR);
#ifdef NS83820_VLAN_ACCEL_SUPPORT
#define VRCR_INIT_VALUE (VRCR_IPEN|VRCR_VTDEN|VRCR_VTREN)
#else
#define VRCR_INIT_VALUE (VRCR_IPEN|VRCR_VTDEN)
#endif
writel(VRCR_INIT_VALUE, dev->base + VRCR);
/* Enable per-packet TCP/UDP/IP checksumming */
writel(VTCR_PPCHK, dev->base + VTCR);
/* Enable per-packet TCP/UDP/IP checksumming
* and per packet vlan tag insertion if
* vlan hardware acceleration is enabled
*/
#ifdef NS83820_VLAN_ACCEL_SUPPORT
#define VTCR_INIT_VALUE (VTCR_PPCHK|VTCR_VPPTI)
#else
#define VTCR_INIT_VALUE VTCR_PPCHK
#endif
writel(VTCR_INIT_VALUE, dev->base + VTCR);
/* Ramit : Enable async and sync pause frames */
/* writel(0, dev->base + PCR); */
......@@ -2001,6 +2095,13 @@ static int __devinit ns83820_init_one(struct pci_dev *pci_dev, const struct pci_
ndev->features |= NETIF_F_SG;
ndev->features |= NETIF_F_IP_CSUM;
#ifdef NS83820_VLAN_ACCEL_SUPPORT
/* We also support hardware vlan acceleration */
ndev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
ndev->vlan_rx_register = ns83820_vlan_rx_register;
ndev->vlan_rx_kill_vid = ns83820_vlan_rx_kill_vid;
#endif
if (using_dac) {
printk(KERN_INFO "%s: using 64 bit addressing.\n",
ndev->name);
......@@ -2109,13 +2210,13 @@ MODULE_LICENSE("GPL");
MODULE_DEVICE_TABLE(pci, ns83820_pci_tbl);
MODULE_PARM(lnksts, "i");
module_param(lnksts, int, 0);
MODULE_PARM_DESC(lnksts, "Polarity of LNKSTS bit");
MODULE_PARM(ihr, "i");
module_param(ihr, int, 0);
MODULE_PARM_DESC(ihr, "Time in 100 us increments to delay interrupts (range 0-127)");
MODULE_PARM(reset_phy, "i");
module_param(reset_phy, int, 0);
MODULE_PARM_DESC(reset_phy, "Set to 1 to reset the PHY on startup");
module_init(ns83820_init);
......
......@@ -359,9 +359,9 @@ struct pcnet32_private {
struct net_device_stats stats;
char tx_full;
int options;
int shared_irq:1, /* shared irq possible */
dxsuflo:1, /* disable transmit stop on uflo */
mii:1; /* mii port available */
unsigned int shared_irq:1, /* shared irq possible */
dxsuflo:1, /* disable transmit stop on uflo */
mii:1; /* mii port available */
struct net_device *next;
struct mii_if_info mii_if;
struct timer_list watchdog_timer;
......
......@@ -262,13 +262,12 @@ static int __devinit sis630e_get_mac_addr(struct pci_dev * pci_dev,
u8 reg;
int i;
isa_bridge = pci_find_device(PCI_VENDOR_ID_SI, 0x0008, isa_bridge);
isa_bridge = pci_get_device(PCI_VENDOR_ID_SI, 0x0008, isa_bridge);
if (!isa_bridge)
isa_bridge = pci_get_device(PCI_VENDOR_ID_SI, 0x0018, isa_bridge);
if (!isa_bridge) {
isa_bridge = pci_find_device(PCI_VENDOR_ID_SI, 0x0018, isa_bridge);
if (!isa_bridge) {
printk("%s: Can not find ISA bridge\n", net_dev->name);
return 0;
}
printk("%s: Can not find ISA bridge\n", net_dev->name);
return 0;
}
pci_read_config_byte(isa_bridge, 0x48, &reg);
pci_write_config_byte(isa_bridge, 0x48, reg | 0x40);
......@@ -278,6 +277,7 @@ static int __devinit sis630e_get_mac_addr(struct pci_dev * pci_dev,
((u8 *)(net_dev->dev_addr))[i] = inb(0x71);
}
pci_write_config_byte(isa_bridge, 0x48, reg & ~0x40);
pci_dev_put(isa_bridge);
return 1;
}
......@@ -488,9 +488,11 @@ static int __devinit sis900_probe(struct pci_dev *pci_dev,
}
/* save our host bridge revision */
dev = pci_find_device(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_630, NULL);
if (dev)
dev = pci_get_device(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_630, NULL);
if (dev) {
pci_read_config_byte(dev, PCI_CLASS_REVISION, &sis_priv->host_bridge_rev);
pci_dev_put(dev);
}
/* print some information about our NIC */
printk(KERN_INFO "%s: %s at %#lx, IRQ %d, ", net_dev->name,
......
......@@ -1901,7 +1901,8 @@ void smt_send_mbuf(struct s_smc *smc, SMbuf *mb, int fc)
}
if (!smc->hw.mac_ring_is_up || frag_count > queue->tx_free) {
if (frame_status &= ~LAN_TX) {
frame_status &= ~LAN_TX;
if (frame_status) {
DB_TX("Ring is down: terminate LAN_TX",0,0,2) ;
}
else {
......
......@@ -57,6 +57,7 @@
#define SL_CHECK_TRANSMIT
#include <linux/config.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <asm/system.h>
#include <asm/uaccess.h>
......@@ -85,8 +86,8 @@
static struct net_device **slip_devs;
int slip_maxdev = SL_NRUNIT; /* Can be overridden with insmod! */
MODULE_PARM(slip_maxdev, "i");
static int slip_maxdev = SL_NRUNIT;
module_param(slip_maxdev, int, 0);
MODULE_PARM_DESC(slip_maxdev, "Maximum number of slip devices");
static int slip_esc(unsigned char *p, unsigned char *d, int len);
......@@ -458,13 +459,11 @@ static void slip_write_wakeup(struct tty_struct *tty)
static void sl_tx_timeout(struct net_device *dev)
{
struct slip *sl = (struct slip*)(dev->priv);
struct slip *sl = netdev_priv(dev);
spin_lock(&sl->lock);
if (netif_queue_stopped(dev)) {
struct slip *sl = (struct slip*)(dev->priv);
if (!netif_running(dev))
goto out;
......@@ -494,7 +493,7 @@ static void sl_tx_timeout(struct net_device *dev)
static int
sl_xmit(struct sk_buff *skb, struct net_device *dev)
{
struct slip *sl = (struct slip*)(dev->priv);
struct slip *sl = netdev_priv(dev);
spin_lock(&sl->lock);
if (!netif_running(dev)) {
......@@ -528,7 +527,7 @@ sl_xmit(struct sk_buff *skb, struct net_device *dev)
static int
sl_close(struct net_device *dev)
{
struct slip *sl = (struct slip*)(dev->priv);
struct slip *sl = netdev_priv(dev);
spin_lock_bh(&sl->lock);
if (sl->tty) {
......@@ -547,7 +546,7 @@ sl_close(struct net_device *dev)
static int sl_open(struct net_device *dev)
{
struct slip *sl = (struct slip*)(dev->priv);
struct slip *sl = netdev_priv(dev);
if (sl->tty==NULL)
return -ENODEV;
......@@ -561,7 +560,7 @@ static int sl_open(struct net_device *dev)
static int sl_change_mtu(struct net_device *dev, int new_mtu)
{
struct slip *sl = (struct slip*)(dev->priv);
struct slip *sl = netdev_priv(dev);
if (new_mtu < 68 || new_mtu > 65534)
return -EINVAL;
......@@ -577,7 +576,7 @@ static struct net_device_stats *
sl_get_stats(struct net_device *dev)
{
static struct net_device_stats stats;
struct slip *sl = (struct slip*)(dev->priv);
struct slip *sl = netdev_priv(dev);
#ifdef SL_INCLUDE_CSLIP
struct slcompress *comp;
#endif
......@@ -612,7 +611,7 @@ sl_get_stats(struct net_device *dev)
static int sl_init(struct net_device *dev)
{
struct slip *sl = (struct slip*)(dev->priv);
struct slip *sl = netdev_priv(dev);
/*
* Finish setting up the DEVICE info.
......@@ -630,7 +629,7 @@ static int sl_init(struct net_device *dev)
static void sl_uninit(struct net_device *dev)
{
struct slip *sl = (struct slip*)(dev->priv);
struct slip *sl = netdev_priv(dev);
sl_free_bufs(sl);
}
......@@ -719,7 +718,7 @@ static void sl_sync(void)
if ((dev = slip_devs[i]) == NULL)
break;
sl = dev->priv;
sl = netdev_priv(dev);
if (sl->tty || sl->leased)
continue;
if (dev->flags&IFF_UP)
......@@ -746,7 +745,7 @@ sl_alloc(dev_t line)
if (dev == NULL)
break;
sl = dev->priv;
sl = netdev_priv(dev);
if (sl->leased) {
if (sl->line != line)
continue;
......@@ -788,7 +787,7 @@ sl_alloc(dev_t line)
i = sel;
dev = slip_devs[i];
if (score > 1) {
sl = dev->priv;
sl = netdev_priv(dev);
sl->flags &= (1 << SLF_INUSE);
return sl;
}
......@@ -799,7 +798,7 @@ sl_alloc(dev_t line)
return NULL;
if (dev) {
sl = dev->priv;
sl = netdev_priv(dev);
if (test_bit(SLF_INUSE, &sl->flags)) {
unregister_netdevice(dev);
dev = NULL;
......@@ -817,7 +816,7 @@ sl_alloc(dev_t line)
dev->base_addr = i;
}
sl = dev->priv;
sl = netdev_priv(dev);
/* Initialize channel control data */
sl->magic = SLIP_MAGIC;
......@@ -1260,7 +1259,7 @@ static int slip_ioctl(struct tty_struct *tty, struct file *file, unsigned int cm
static int sl_ioctl(struct net_device *dev,struct ifreq *rq,int cmd)
{
struct slip *sl = (struct slip*)(dev->priv);
struct slip *sl = netdev_priv(dev);
unsigned long *p = (unsigned long *)&rq->ifr_ifru;
if (sl == NULL) /* Allocation failed ?? */
......@@ -1406,7 +1405,7 @@ static void __exit slip_exit(void)
dev = slip_devs[i];
if (!dev)
continue;
sl = dev->priv;
sl = netdev_priv(dev);
spin_lock_bh(&sl->lock);
if (sl->tty) {
busy++;
......@@ -1423,7 +1422,7 @@ static void __exit slip_exit(void)
continue;
slip_devs[i] = NULL;
sl = dev->priv;
sl = netdev_priv(dev);
if (sl->tty) {
printk(KERN_ERR "%s: tty discipline still running\n",
dev->name);
......
......@@ -1401,7 +1401,6 @@ static void olympic_arb_cmd(struct net_device *dev)
u16 lan_status = 0, lan_status_diff ; /* Initialize to stop compiler warning */
u8 fdx_prot_error ;
u16 next_ptr;
int i ;
arb_block = (olympic_priv->olympic_lap + olympic_priv->arb) ;
asb_block = (olympic_priv->olympic_lap + olympic_priv->asb) ;
......
......@@ -1208,8 +1208,7 @@ static void de_adapter_wake (struct de_private *de)
pci_write_config_dword(de->pdev, PCIPM, pmctl);
/* de4x5.c delays, so we do too */
current->state = TASK_UNINTERRUPTIBLE;
schedule_timeout(msecs_to_jiffies(10));
msleep(10);
}
}
......
......@@ -5089,7 +5089,7 @@ mii_get_phy(struct net_device *dev)
lp->useMII = TRUE;
/* Search the MII address space for possible PHY devices */
for (n=0, lp->mii_cnt=0, i=1; !((i==1) && (n==1)); i=(++i)%DE4X5_MAX_MII) {
for (n=0, lp->mii_cnt=0, i=1; !((i==1) && (n==1)); i=(i+1)%DE4X5_MAX_MII) {
lp->phy[lp->active].addr = i;
if (i==0) n++; /* Count cycles */
while (de4x5_reset_phy(dev)<0) udelay(100);/* Wait for reset */
......
......@@ -1221,6 +1221,11 @@ static int __devinit tulip_init_one (struct pci_dev *pdev,
struct tulip_private *tp;
/* See note below on the multiport cards. */
static unsigned char last_phys_addr[6] = {0x00, 'L', 'i', 'n', 'u', 'x'};
static struct pci_device_id early_486_chipsets[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82424) },
{ PCI_DEVICE(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_496) },
{ },
};
static int last_irq;
static int multiport_cnt; /* For four-port boards w/one EEPROM */
u8 chip_rev;
......@@ -1274,17 +1279,15 @@ static int __devinit tulip_init_one (struct pci_dev *pdev,
* without the workarounds being on.
*/
/* Intel Saturn. Switch to 8 long words burst, 8 long word cache aligned
Aries might need this too. The Saturn errata are not pretty reading but
thankfully it's an old 486 chipset.
/* 1. Intel Saturn. Switch to 8 long words burst, 8 long word cache
aligned. Aries might need this too. The Saturn errata are not
pretty reading but thankfully it's an old 486 chipset.
2. The dreaded SiS496 486 chipset. Same workaround as Intel
Saturn.
*/
if (pci_find_device(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82424, NULL)) {
csr0 = MRL | MRM | (8 << BurstLenShift) | (1 << CALShift);
force_csr0 = 1;
}
/* The dreaded SiS496 486 chipset. Same workaround as above. */
if (pci_find_device(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_496, NULL)) {
if (pci_dev_present(early_486_chipsets)) {
csr0 = MRL | MRM | (8 << BurstLenShift) | (1 << CALShift);
force_csr0 = 1;
}
......
......@@ -117,6 +117,9 @@ static int xircom_open(struct net_device *dev);
static int xircom_close(struct net_device *dev);
static void xircom_up(struct xircom_private *card);
static struct net_device_stats *xircom_get_stats(struct net_device *dev);
#if CONFIG_NET_POLL_CONTROLLER
static void xircom_poll_controller(struct net_device *dev);
#endif
static void investigate_read_descriptor(struct net_device *dev,struct xircom_private *card, int descnr, unsigned int bufferoffset);
static void investigate_write_descriptor(struct net_device *dev, struct xircom_private *card, int descnr, unsigned int bufferoffset);
......@@ -269,6 +272,9 @@ static int __devinit xircom_probe(struct pci_dev *pdev, const struct pci_device_
dev->stop = &xircom_close;
dev->get_stats = &xircom_get_stats;
dev->priv = private;
#ifdef CONFIG_NET_POLL_CONTROLLER
dev->poll_controller = &xircom_poll_controller;
#endif
SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops);
pci_set_drvdata(pdev, dev);
......@@ -500,6 +506,14 @@ static struct net_device_stats *xircom_get_stats(struct net_device *dev)
}
#ifdef CONFIG_NET_POLL_CONTROLLER
static void xircom_poll_controller(struct net_device *dev)
{
disable_irq(dev->irq);
xircom_interrupt(dev->irq, dev, NULL);
enable_irq(dev->irq);
}
#endif
static void initialize_card(struct xircom_private *card)
......
......@@ -930,8 +930,6 @@ extern void netdev_state_change(struct net_device *dev);
/* Load a device via the kmod */
extern void dev_load(const char *name);
extern void dev_mcast_init(void);
extern int netdev_register_fc(struct net_device *dev, void (*stimul)(struct net_device *dev));
extern void netdev_unregister_fc(int bit);
extern int netdev_max_backlog;
extern int weight_p;
extern unsigned long netdev_fc_xoff;
......
......@@ -564,24 +564,6 @@ config WAN_ROUTER
If unsure, say N.
config NET_HW_FLOWCONTROL
bool "Forwarding between high speed interfaces"
depends on EXPERIMENTAL
---help---
This option enables NIC (Network Interface Card) hardware throttling
during periods of extreme congestion. At the moment only a couple
of device drivers support it (really only one -- tulip, a modified
8390 driver can be found at
<ftp://ftp.tux.org/pub/net/ip-routing/fastroute/fastroute-8390.tar.gz>).
Really, this option is applicable to any machine attached to a fast
enough network, and even a 10 Mb NIC is able to kill a not very slow
box, such as a 120MHz Pentium.
However, do not say Y here if you did not experience any serious
problems.
menu "QoS and/or fair queueing"
config NET_SCHED
......
......@@ -1390,66 +1390,6 @@ int mod_cong = 290;
DEFINE_PER_CPU(struct netif_rx_stats, netdev_rx_stat) = { 0, };
#ifdef CONFIG_NET_HW_FLOWCONTROL
atomic_t netdev_dropping = ATOMIC_INIT(0);
static unsigned long netdev_fc_mask = 1;
unsigned long netdev_fc_xoff;
spinlock_t netdev_fc_lock = SPIN_LOCK_UNLOCKED;
static struct
{
void (*stimul)(struct net_device *);
struct net_device *dev;
} netdev_fc_slots[BITS_PER_LONG];
int netdev_register_fc(struct net_device *dev,
void (*stimul)(struct net_device *dev))
{
int bit = 0;
unsigned long flags;
spin_lock_irqsave(&netdev_fc_lock, flags);
if (netdev_fc_mask != ~0UL) {
bit = ffz(netdev_fc_mask);
netdev_fc_slots[bit].stimul = stimul;
netdev_fc_slots[bit].dev = dev;
set_bit(bit, &netdev_fc_mask);
clear_bit(bit, &netdev_fc_xoff);
}
spin_unlock_irqrestore(&netdev_fc_lock, flags);
return bit;
}
void netdev_unregister_fc(int bit)
{
unsigned long flags;
spin_lock_irqsave(&netdev_fc_lock, flags);
if (bit > 0) {
netdev_fc_slots[bit].stimul = NULL;
netdev_fc_slots[bit].dev = NULL;
clear_bit(bit, &netdev_fc_mask);
clear_bit(bit, &netdev_fc_xoff);
}
spin_unlock_irqrestore(&netdev_fc_lock, flags);
}
static void netdev_wakeup(void)
{
unsigned long xoff;
spin_lock(&netdev_fc_lock);
xoff = netdev_fc_xoff;
netdev_fc_xoff = 0;
while (xoff) {
int i = ffz(~xoff);
xoff &= ~(1 << i);
netdev_fc_slots[i].stimul(netdev_fc_slots[i].dev);
}
spin_unlock(&netdev_fc_lock);
}
#endif
static void get_sample_stats(int cpu)
{
#ifdef RAND_LIE
......@@ -1559,13 +1499,8 @@ int netif_rx(struct sk_buff *skb)
return queue->cng_level;
}
if (queue->throttle) {
if (queue->throttle)
queue->throttle = 0;
#ifdef CONFIG_NET_HW_FLOWCONTROL
if (atomic_dec_and_test(&netdev_dropping))
netdev_wakeup();
#endif
}
netif_rx_schedule(&queue->backlog_dev);
goto enqueue;
......@@ -1574,9 +1509,6 @@ int netif_rx(struct sk_buff *skb)
if (!queue->throttle) {
queue->throttle = 1;
__get_cpu_var(netdev_rx_stat).throttled++;
#ifdef CONFIG_NET_HW_FLOWCONTROL
atomic_inc(&netdev_dropping);
#endif
}
drop:
......@@ -1848,16 +1780,6 @@ static int process_backlog(struct net_device *backlog_dev, int *budget)
if (work >= quota || jiffies - start_time > 1)
break;
#ifdef CONFIG_NET_HW_FLOWCONTROL
if (queue->throttle &&
queue->input_pkt_queue.qlen < no_cong_thresh ) {
queue->throttle = 0;
if (atomic_dec_and_test(&netdev_dropping)) {
netdev_wakeup();
break;
}
}
#endif
}
backlog_dev->quota -= work;
......@@ -1872,13 +1794,8 @@ static int process_backlog(struct net_device *backlog_dev, int *budget)
smp_mb__before_clear_bit();
netif_poll_enable(backlog_dev);
if (queue->throttle) {
if (queue->throttle)
queue->throttle = 0;
#ifdef CONFIG_NET_HW_FLOWCONTROL
if (atomic_dec_and_test(&netdev_dropping))
netdev_wakeup();
#endif
}
local_irq_enable();
return 0;
}
......@@ -3365,12 +3282,6 @@ EXPORT_SYMBOL(br_handle_frame_hook);
#ifdef CONFIG_KMOD
EXPORT_SYMBOL(dev_load);
#endif
#ifdef CONFIG_NET_HW_FLOWCONTROL
EXPORT_SYMBOL(netdev_dropping);
EXPORT_SYMBOL(netdev_fc_xoff);
EXPORT_SYMBOL(netdev_register_fc);
EXPORT_SYMBOL(netdev_unregister_fc);
#endif
#ifdef CONFIG_NET_CLS_ACT
EXPORT_SYMBOL(ing_filter);
......
......@@ -234,7 +234,7 @@ static void irlan_client_ctrl_disconnect_indication(void *instance, void *sap,
ASSERT(tsap == self->client.tsap_ctrl, return;);
/* Remove frames queued on the control channel */
while ((skb = skb_dequeue(&self->client.txq))) {
while ((skb = skb_dequeue(&self->client.txq)) != NULL) {
dev_kfree_skb(skb);
}
self->client.tx_busy = FALSE;
......
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