Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
4e130235
Commit
4e130235
authored
May 29, 2002
by
Jeff Garzik
Browse files
Options
Browse Files
Download
Plain Diff
Merge mandrakesoft.com:/home/jgarzik/vanilla/linus-2.5
into mandrakesoft.com:/home/jgarzik/repo/net-drivers-2.5
parents
22775da0
1fe7560c
Changes
19
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
1177 additions
and
220 deletions
+1177
-220
Documentation/networking/e100.txt
Documentation/networking/e100.txt
+272
-0
Documentation/networking/e1000.txt
Documentation/networking/e1000.txt
+75
-46
MAINTAINERS
MAINTAINERS
+5
-0
drivers/net/Config.help
drivers/net/Config.help
+91
-12
drivers/net/e100/e100.h
drivers/net/e100/e100.h
+6
-3
drivers/net/e100/e100_config.c
drivers/net/e100/e100_config.c
+0
-2
drivers/net/e100/e100_main.c
drivers/net/e100/e100_main.c
+101
-4
drivers/net/e100/e100_proc.c
drivers/net/e100/e100_proc.c
+1
-1
drivers/net/e100/e100_test.c
drivers/net/e100/e100_test.c
+1
-7
drivers/net/e1000/Makefile
drivers/net/e1000/Makefile
+73
-0
drivers/net/e1000/e1000.h
drivers/net/e1000/e1000.h
+16
-6
drivers/net/e1000/e1000_ethtool.c
drivers/net/e1000/e1000_ethtool.c
+181
-34
drivers/net/e1000/e1000_hw.c
drivers/net/e1000/e1000_hw.c
+139
-30
drivers/net/e1000/e1000_hw.h
drivers/net/e1000/e1000_hw.h
+43
-6
drivers/net/e1000/e1000_main.c
drivers/net/e1000/e1000_main.c
+164
-65
drivers/net/e1000/e1000_osdep.h
drivers/net/e1000/e1000_osdep.h
+2
-0
drivers/net/eepro100.c
drivers/net/eepro100.c
+0
-2
drivers/net/pcnet32.c
drivers/net/pcnet32.c
+3
-2
include/linux/ethtool.h
include/linux/ethtool.h
+4
-0
No files found.
Documentation/networking/e100.txt
0 → 100644
View file @
4e130235
Linux* Base Driver for the Intel(R) PRO/100 Family of Adapters
==============================================================
April 9, 2002
Contents
========
- In This Release
- Supported Adapters
- Command Line Parameters
- CPU Cycle Saver
- Additional Configurations
- Support
In This Release
===============
This file describes the Linux* Base Driver for the Intel(R) PRO/100 Family of
Adapters, version 2.0.x. This driver includes support for Itanium(TM)-based
systems.
New for this release:
- Additional ethtool functionality, including link status test and EEPROM
read/write. A third-party application can use the ethtool interface to
get and set driver parameters.
- Support for Zero copy on 82550-based adapters. This feature provides
faster data throughput and significant CPU usage improvement in systems
that use the relevant system call (sendfile(2)).
- Support for large MTU-enabling interface (1504 bytes) with kernel's
VLAN module
- Support for polling on RX
- Support for Wake On LAN* on 82550 and 82559-based adapters
Supported Adapters
==================
The following Intel network adapters are compatible with the drivers
in this release:
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 (82550)
82559 A56831-xxx, A10563-xxx,
A12171-xxx, A12321-xxx,
A12320-xxx, A12170-xxx
748568-xxx (82559)
748565-xxx (82559)
82550 PRO/100 S Desktop Adapter 751767-xxx (82550)
82559 748592-xxx, A12167-xxx,
A12318-xxx, A12317-xxx,
A12165-xxx
748569-xxx (82559)
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
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.
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:
http://appsr.intel.com/scripts-df/support_intel.asp
Command Line Parameters
=======================
The following parameters are used by entering them on the command line with
the modprobe or insmod command. For example, with two Intel PRO/100 PCI
adapters, entering:
modprobe e100 TxDescriptors=32,128
loads the e100 driver with 32 TX resources for the first adapter and 128 TX
resources for the second adapter. This configuration favors the second
adapter. The driver supports up to 16 network adapters concurrently.
NOTE: Giving any command line option the value "-1" causes the driver to use
the appropriate default value for that option, as if no value was
specified.
BundleMax
Valid Range: 0x1-0xFFFF
Default Value: 6
This parameter holds the maximum number of packets in a bundle. Suggested
values range from 2 to 10. See "CPU Cycle Saver."
BundleSmallFr
Valid Range: 0-1 (0=off, 1=on)
Default Value: 0
The value 1 (on) causes small packets (less than 128 bytes) to be bundled.
See "CPU Cycle Saver."
e100_speed_duplex
Valid Range: 0-4 (1=10half;2=10full;3=100half;4=100full)
Default Value: 0
The default value of 0 is set to auto-negotiate if the link partner is set
to auto-negotiate. If the link partner is forced, e100_speed_duplex
defaults to half-duplex.
Example usage: insmod e100.o e100_speed_duplex=4,4 (for two adapters)
flow_control
Valid Range: 0-1 (0=off, 1=on)
Default Value: 0
This parameter controls the automatic generation(Tx) and response(Rx) to
Ethernet PAUSE frames. flow_control should NOT be set to 1 when the e100
adapter is connected to an interface that does not support Ethernet PAUSE
frames and when the e100_speed_duplex parameter is NOT set to zero.
IntDelay
Valid Range: 0-0xFFFF (0=off)
Default Value: 1536
This parameter holds the number of time units (in adapter terminology)
until the adapter generates an interrupt. The recommended value for
IntDelay is 0x600 (upon initialization). Suggested values range from
0x200h to 0x800. See "CPU Cycle Saver."
IFS
Valid Range: 0-1 (0=off, 1=on)
Default Value: 1
Inter Frame Spacing (IFS) aims to reduce the number of Ethernet frame
collisions by altering the time between frame transmissions. When IFS is
enabled the driver tries to find an optimal IFS value. However, some
switches function better when IFS is disabled.
PollingMaxWork
Valid Range: 1-1024 (max number of RxDescriptors)
Default Value: Specified number of RxDescriptors
This value specifies the maximum number of receive packets that are
processed on a single polling call. This parameter is invalid if
RxCongestionControl is set to 0.
RxCongestionControl
Valid Range: 0-1 (0=off, 1=on)
Default Value: 1
1 enables polling mode. When the link is congested, the driver can decide
to handle received packets by polling them, instead of waiting until
interrupts occur.
RxDescriptors
Valid Range: 8-1024
Default Value: 64
This parameter defines the number of receive descriptors allocated by
the driver. Increasing this value allows the driver to buffer more
incoming packets before the driver is required to service an interrupt.
The maximum value for Itanium-based systems is 64.
TxDescriptors
Valid Range: 19-1024
Default Value: 64
This value is the number of transmit descriptors allocated by the driver.
Increasing this value allows the protocol stack to queue more transmits at
the driver level. The maximum value for Itanium-based systems is 64.
ucode (not available for 82557-based adapters)
Valid Range: 0-1 (0=off, 1=on)
Default Value: 0 for 82558-based adapters
1 for 82559(and higher)-based adapters
On uploads the micro code to the adapter, which enables CPU Cycle Saver.
See the section "CPU Cycle Saver" below.
Example usage: insmod e100.o ucode=0 (does not reduce CPU usage)
XsumRX
Valid Range: 0-1 (0=off, 1=on)
Default Value: 1
On allows Rx checksum offloading for TCP/UDP packets. Requires that the
hardware support this feature.
CPU Cycle Saver
================
CPU Cycle Saver reduces CPU utilization by reducing the number of interrupts
that the adapter generates.
When CPU Cycle Saver is turned off, the adapter generates one interrupt for
every frame that is received. This means that the operating system stops what
it is doing and switches to the network driver in order to process the
receive.
When CPU Cycle Saver is on, the adapter does not generate an interrupt for
every frame it receives. Instead, it waits until it receives several frames
before generating an interrupt. This reduces the amount of time spent
switching to and from the driver.
CPU Cycle Saver consists of these arguments: IntDelay, BundleMax and
BundleSmallFr. When IntDelay is increased, the adapter waits longer for
frames to arrive before generating the interrupt. By increasing BundleMax,
the network adapter waits for the number of frames specified to arrive before
generating the interrupt. When BundleSmallFr is disabled, the adapter does
not bundle packets that are smaller than 128 bytes. Such small packets are
often, but not always, control packets that are better served immediately.
For most users, it is recommended that CPU Cycle Saver be used with the
default values specified in the Command Line Parameters section. However, in
some cases, performance problems may occur with CPU Cycle Saver. If such
problems are observed, we recommend turning off this feature by setting
ucode=0.
Support
=======
For general information and support, go to the Intel support website at:
http://support.intel.com
If an issue is identified with the released source code on the supported
kernel with a supported adapter, email the specific information related to
the issue to linux.nics@intel.com.
License
=======
This software program is released under the terms of a license agreement
between you ('Licensee') and Intel. Do not use or load this software or any
associated materials (collectively, the 'Software') until you have carefully
read the full terms and conditions of the LICENSE located in this software
package. By loading or using the Software, you agree to the terms of this
Agreement. If you do not agree with the terms of this Agreement, do not
install or use the Software.
* Other names and brands may be claimed as the property of others.
Documentation/networking/e1000.txt
View file @
4e130235
Linux* Base Driver for the Intel(R) PRO/1000 Family of Adapters
===============================================================
February 5
, 2002
April 23
, 2002
Contents
...
...
@@ -11,6 +11,7 @@ Contents
- Supported Adapters
- Command Line Parameters
- Speed and Duplex Configuration
- Additional Configurations
- Known Issues
- Support
...
...
@@ -19,17 +20,27 @@ In This Release
===============
This file describes the Linux* Base Driver for the Intel(R) PRO/1000 Family
of Adapters, version 4.2.x.
This driver includes support for
Itanium(TM)-based systems.
of Adapters, version 4.2.x.
This driver includes support for
Itanium(TM)-based systems.
This release version includes the following:
-
support for the ethtool 1.4
interface. A third-party application can use
-
Support for the ethtool 1.5
interface. A third-party application can use
the ethtool interface to get and set driver parameters.
- the zero copy feature. Zero copy provides faster information throughput.
By default, this feature is enabled if using a kernel that supports it.
Zero copy is not supported on the original PWLA8490 (plain) adapter.
- Zero copy. This feature provides faster data throughput. Enabled by
default in supporting kernels. It is not supported on the Intel(R)
PRO/1000 Gigabit Server Adapter.
New features include:
- Support for the 82545 and 82546-based adapters listed below
- Wake on LAN* support via ethtool for 82540, 82544, 82545, and 82546-
based adapters
- Adaptive IFS for increased performance at half duplex
Supported Adapters
...
...
@@ -38,21 +49,32 @@ Supported Adapters
The following Intel network adapters are compatible with the drivers in this
release:
Controller Adapter Name Board IDs
---------- ------------ ---------
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
8254
2 PRO/1000 Gigabit Server Adapter 700262-xxx, 71703
7-xxx
8254
4 PRO/1000 T Desktop Adapter A6294
7-xxx
82543 PRO/1000 F Server Adapter 738640-xxx, A38888-xxx,
A06512-xxx
82540 PRO/1000 MT Desktop Adapter A78408-xxx
8254
3 PRO/1000 T Server Adapter A19845-xxx, A33948
-xxx
8254
5 PRO/1000 MT Server Adapter A92165
-xxx
8254
4 PRO/1000 XT Server Adapter A51580
-xxx
8254
6 PRO/1000 MT Dual Port Server Adapter A92111
-xxx
8254
4 PRO/1000 XF Server Adapter A50484
-xxx
8254
5 PRO/1000 MF Server Adapter A91622
-xxx
82544 PRO/1000 T Desktop Adapter A62947-xxx
82545 PRO/1000 MF Server Adapter(LX) A91624-xxx
82546 PRO/1000 MF Dual Port Server Adapter A91620-xxx
To verify your Intel adapter is supported, find the board ID number on the
...
...
@@ -73,8 +95,8 @@ For the latest Intel network drivers for Linux, go to:
Command Line Parameters
=======================
If the driver is built as a module, the following parameters are used by
entering them on the command line with the modprobe or insmod command.
If the driver is built as a module, the following parameters are used by
entering them on the command line with the modprobe or insmod command.
For example, with two PRO/1000 PCI adapters, entering:
insmod e1000 TxDescriptors=80,128
...
...
@@ -86,14 +108,14 @@ For more information about the AutoNeg, Duplex, and Speed parameters, see the
"Speed and Duplex Configuration" section in this document.
AutoNeg (
Intel PRO/1000 T and PRO/1000 XT server adapter
s only)
Valid Range: 0-0x0F, 0x20-0x2F
AutoNeg (
adapters using copper connection
s only)
Valid Range: 0
x01
-0x0F, 0x20-0x2F
Default Value: 0x2F
This parameter is a bit mask that specifies which speed and duplex
settings the board advertises. When this parameter is used, the Speed and
Duplex parameters must not be specified.
Duplex (
Intel PRO/1000 T and PRO/1000 XT server adapter
s only)
Duplex (
adapters using copper connection
s only)
Valid Range: 0-2 (0=auto-negotiate, 1=half, 2=full)
Default Value: 0
Defines the direction in which data is allowed to flow. Can by either one
...
...
@@ -109,26 +131,27 @@ Default: Read flow control settings from the EEPROM
RxDescriptors
Valid Range: 80-256 for 82542 and 82543-based adapters
80-4096 for 8254
4
-based adapters
Default Value:
256
80-4096 for 8254
0, 82544, 82545, and 82546
-based adapters
Default Value:
80
This value is the number of receive descriptors allocated by the driver.
Increasing this value allows the driver to buffer more incoming packets.
Each descriptor is 16 bytes. A receive buffer is also allocated for each
descriptor and can be either 2048, 4096, 8192, or 16384 bytes, depending
on the MTU setting.
on the MTU setting.
The maximum MTU size is 16110.
RxIntDelay
Valid Range: 0-65535 (0=off)
Default Value: 64
Default Value: 64 (82542, 82543, and 82544-based adapters)
128 (82540, 82545, and 82546-based adapters)
This value delays the generation of receive interrupts in units of 1.024
microseconds. Receive interrupt reduction can improve CPU efficiency if
properly tuned for specific network traffic. Increasing this value adds
extra latency to frame reception and can end up decreasing the throughput
of TCP traffic.
If the system is reporting dropped receives, this value
of TCP traffic. If the system is reporting dropped receives, this value
may be set too high, causing the driver to run out of available receive
descriptors.
Speed (
Intel PRO/1000 T and PRO/1000 XT server adapter
s only)
Speed (
adapters using copper connection
s only)
Valid Settings: 0, 10, 100, 1000
Default Value: 0 (auto-negotiate at all supported speeds)
Speed forces the line speed to the specified value in megabits per second
...
...
@@ -138,21 +161,12 @@ Default Value: 0 (auto-negotiate at all supported speeds)
TxDescriptors
Valid Range: 80-256 for 82542 and 82543-based adapters
80-4096 for 8254
4
-based adapters
80-4096 for 8254
0, 82544, 82545, and 82546
-based adapters
Default Value: 256
This value is the number of transmit descriptors allocated by the driver.
Increasing this value allows the driver to queue more transmits. Each
descriptor is 16 bytes.
TxIntDelay
Valid Range: 0-65535 (0=off)
Default Value: 64
This value delays the generation of transmit interrupts in units of 1.024
microseconds. Transmit interrupt reduction can improve CPU efficiency if
properly tuned for specific network traffic. If the system is reporting
dropped transmits, this value may be set too high causing the driver to
run out of available transmit descriptors.
XsumRX (not available on the PRO/1000 Gigabit Server Adapter)
Valid Range: 0-1
Default Value: 1
...
...
@@ -163,9 +177,8 @@ Default Value: 1
Speed and Duplex Configuration
==============================
Three keywords are used to control the speed and duplex configuration of the
PRO/1000 T and PRO/1000 XT server adapters. These keywords are Speed, Duplex,
and AutoNeg.
Three keywords are used to control the speed and duplex configuration. These
keywords are Speed, Duplex, and AutoNeg.
If the board uses a fiber interface, these keywords are ignored, and the
fiber interface board only links at 1000 Mbps full-duplex.
...
...
@@ -199,16 +212,32 @@ set to auto-negotiate. If the link partner is forced speed/duplex, the
adapter MUST be forced to the same speed/duplex.
Additional Configurations
=========================
Jumbo Frames
------------
The driver supports Jumbo Frames for all adapters except 82542-based
adapters. Jumbo Frames support is enabled by changing the MTU to a value
larger than the default of 1500. Use the ifconfig command to increase the
MTU size. For example:
ifconfig ethx mtu 9000 up
Known Issues
============
Driver Hangs
Under Heavy Traffic Loads
--------------------------------------
Inconsistent Driver Behavior
Under Heavy Traffic Loads
--------------------------------------
----------------
Intel is aware that previously released e1000 drivers may hang under very
specific types of heavy traffic loads. This version includes a workaround
that resets the adapter automatically if a hang condition is detected. This
workaround ensures network traffic flow is not affected when a hang occurs.
Adapters based on the Intel 82543 and 82544 LAN controllers may hang (stop
transmitting) under certain network conditions. If this occurs a message
is logged in the system event log. In addition, the controller is
automatically reset, restoring the network connection. To eliminate the
potential for the hang change the RxIntDelay parameter to zero. For details
on the RxIntDelay parameter see the Command Line Parameters section.
Jumbo Frames System Requirement
-------------------------------
...
...
MAINTAINERS
View file @
4e130235
...
...
@@ -795,6 +795,11 @@ P: Tigran Aivazian
M: tigran@veritas.com
S: Maintained
INTEL PRO/100 ETHERNET SUPPORT
P: Scott Feldman
M: scott.feldman@intel.com
S: Supported
INTEL PRO/1000 GIGABIT ETHERNET SUPPORT
P: Chris Leech
M: christopher.leech@intel.com
...
...
drivers/net/Config.help
View file @
4e130235
...
...
@@ -828,18 +828,23 @@ CONFIG_E1000
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,
A06512-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
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
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:
...
...
@@ -1358,6 +1363,80 @@ CONFIG_EEPRO100
a module, say M here and read <file:Documentation/modules.txt> as
well as <file:Documentation/networking/net-modules.txt>.
CONFIG_E100
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
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.
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:
http://appsr.intel.com/scripts-df/support_intel.asp
More specific information on configuring the driver is in
<file:Documentation/networking/e100.txt>.
This driver is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
The module will be called e100.o. If you want to compile it as a
module, say M here and read <file:Documentation/modules.txt> as well
as <file:Documentation/networking/net-modules.txt>.
CONFIG_FEALNX
Say Y here to support the Mysom MTD-800 family of PCI-based Ethernet
cards. Specifications and data at
...
...
drivers/net/e100/e100.h
View file @
4e130235
...
...
@@ -503,6 +503,7 @@ enum led_state_e {
#define IS_BACHELOR 0x00000010
/* set if 82558 or newer board */
#define IS_ICH 0x00000020
#define DF_SPEED_FORCED 0x00000040
/* set if speed is forced */
#define LED_IS_ON 0x00000080
/* LED is turned ON by the driver */
typedef
struct
net_device_stats
net_dev_stats_t
;
...
...
@@ -909,7 +910,6 @@ struct ethtool_lpbk_data{
};
#endif
struct
e100_private
{
u32
flags
;
/* board management flags */
u32
tx_per_underrun
;
/* number of good tx frames per underrun */
...
...
@@ -998,8 +998,11 @@ struct e100_private {
u32
wolopts
;
u16
ip_lbytes
;
#endif
#ifdef ETHTOOL_TEST
struct
ethtool_lpbk_data
loopback
;
#ifdef ETHTOOL_TEST
struct
ethtool_lpbk_data
loopback
;
#endif
#ifdef ETHTOOL_PHYS_ID
struct
timer_list
blink_timer
;
/* led blink timer id */
#endif
#ifdef CONFIG_PM
...
...
drivers/net/e100/e100_config.c
View file @
4e130235
...
...
@@ -593,7 +593,6 @@ e100_config_wol(struct e100_private *bdp)
}
#endif
#ifdef ETHTOOL_TEST
/**
* e100_config_loopback_mode
* @bdp: atapter's private data struct
...
...
@@ -690,5 +689,4 @@ e100_config_dynamic_tbd(struct e100_private *bdp, unsigned char enable)
return
bc_changed
;
}
#endif
drivers/net/e100/e100_main.c
View file @
4e130235
...
...
@@ -163,6 +163,9 @@ static char *test_strings[] = {
"E100_LPBK_PHY_FAIL"
};
#endif
#ifdef ETHTOOL_PHYS_ID
static
int
e100_ethtool_led_blink
(
struct
net_device
*
,
struct
ifreq
*
);
#endif
#endif
/*E100_ETHTOOL_IOCTL */
...
...
@@ -182,7 +185,7 @@ static void e100_non_tx_background(unsigned long);
/* Global Data structures and variables */
char
e100_copyright
[]
__devinitdata
=
"Copyright (c) 2002 Intel Corporation"
;
#define E100_VERSION "2.0.
27-pre3
"
#define E100_VERSION "2.0.
30-k1
"
#define E100_FULL_DRIVER_NAME "Intel(R) PRO/100 Fast Ethernet Adapter - Loadable driver, ver "
...
...
@@ -691,9 +694,10 @@ e100_found1(struct pci_dev *pcid, const struct pci_device_id *ent)
#ifdef ETHTOOL_GWOL
/* Disabling all WOLs as initialization */
bdp
->
wolsupported
=
bdp
->
wolopts
=
0
;
if
(
bdp
->
rev_id
>=
D101MA_REV_ID
)
{
bdp
->
wolsupported
=
WAKE_PHY
|
WAKE_UCAST
|
WAKE_ARP
|
WAKE_MAGIC
;
if
(
bdp
->
rev_id
>=
D101A4_REV_ID
)
{
bdp
->
wolsupported
=
WAKE_PHY
|
WAKE_MAGIC
;
if
(
bdp
->
rev_id
>=
D101MA_REV_ID
)
bdp
->
wolsupported
|=
WAKE_UCAST
|
WAKE_ARP
;
bdp
->
wolopts
=
WAKE_MAGIC
;
}
#endif
...
...
@@ -3334,6 +3338,11 @@ e100_do_ethtool_ioctl(struct net_device *dev, struct ifreq *ifr)
case
ETHTOOL_GSTRINGS
:
rc
=
e100_ethtool_gstrings
(
dev
,
ifr
);
break
;
#endif
#ifdef ETHTOOL_PHYS_ID
case
ETHTOOL_PHYS_ID
:
rc
=
e100_ethtool_led_blink
(
dev
,
ifr
);
break
;
#endif
default:
break
;
...
...
@@ -3641,6 +3650,94 @@ e100_ethtool_eeprom(struct net_device *dev, struct ifreq *ifr)
}
#endif
#ifdef ETHTOOL_PHYS_ID
#define E100_BLINK_INTERVAL (HZ/4)
/**
* e100_led_control
* @bdp: atapter's private data struct
* @led_mdi_op: led operation
*
* Software control over adapter's led. The possible operations are:
* TURN LED OFF, TURN LED ON and RETURN LED CONTROL TO HARDWARE.
*/
static
void
e100_led_control
(
struct
e100_private
*
bdp
,
u16
led_mdi_op
)
{
spin_lock_bh
(
&
bdp
->
mdi_access_lock
);
e100_mdi_write
(
bdp
,
PHY_82555_LED_SWITCH_CONTROL
,
bdp
->
phy_addr
,
led_mdi_op
);
spin_unlock_bh
(
&
bdp
->
mdi_access_lock
);
}
/**
* e100_led_blink_callback
* @data: pointer to atapter's private data struct
*
* Blink timer callback function. Toggles ON/OFF led status bit and calls
* led hardware access function.
*/
static
void
e100_led_blink_callback
(
unsigned
long
data
)
{
struct
e100_private
*
bdp
=
(
struct
e100_private
*
)
data
;
if
(
bdp
->
flags
&
LED_IS_ON
)
{
bdp
->
flags
&=
~
LED_IS_ON
;
e100_led_control
(
bdp
,
PHY_82555_LED_OFF
);
}
else
{
bdp
->
flags
|=
LED_IS_ON
;
if
(
bdp
->
rev_id
>=
D101MA_REV_ID
)
e100_led_control
(
bdp
,
PHY_82555_LED_ON_559
);
else
e100_led_control
(
bdp
,
PHY_82555_LED_ON_PRE_559
);
}
mod_timer
(
&
bdp
->
blink_timer
,
jiffies
+
E100_BLINK_INTERVAL
);
}
/**
* e100_ethtool_led_blink
* @dev: pointer to atapter's net_device struct
* @ifr: pointer to ioctl request structure
*
* Blink led ioctl handler. Initialtes blink timer and sleeps until
* blink period expires. Than it kills timer and returns. The led control
* is returned back to hardware when blink timer is killed.
*/
static
int
e100_ethtool_led_blink
(
struct
net_device
*
dev
,
struct
ifreq
*
ifr
)
{
struct
e100_private
*
bdp
;
struct
ethtool_value
ecmd
;
bdp
=
dev
->
priv
;
if
(
copy_from_user
(
&
ecmd
,
ifr
->
ifr_data
,
sizeof
(
ecmd
)))
return
-
EFAULT
;
if
(
!
bdp
->
blink_timer
.
function
)
{
init_timer
(
&
bdp
->
blink_timer
);
bdp
->
blink_timer
.
function
=
e100_led_blink_callback
;
bdp
->
blink_timer
.
data
=
(
unsigned
long
)
bdp
;
}
mod_timer
(
&
bdp
->
blink_timer
,
jiffies
);
set_current_state
(
TASK_INTERRUPTIBLE
);
if
((
!
ecmd
.
data
)
||
(
ecmd
.
data
>
MAX_SCHEDULE_TIMEOUT
/
HZ
))
ecmd
.
data
=
MAX_SCHEDULE_TIMEOUT
/
HZ
;
schedule_timeout
(
ecmd
.
data
*
HZ
);
del_timer_sync
(
&
bdp
->
blink_timer
);
e100_led_control
(
bdp
,
PHY_82555_LED_NORMAL_CONTROL
);
return
0
;
}
#endif
static
inline
int
__devinit
e100_10BaseT_adapter
(
struct
e100_private
*
bdp
)
{
...
...
drivers/net/e100/e100_proc.c
View file @
4e130235
...
...
@@ -548,7 +548,7 @@ read_bundle_max_def(char *page, char **start, off_t off,
int
len
;
len
=
read_int_param
(
page
,
"CPU Saver Maximum Bundle"
,
"Sets
the value for
CPU saver's maximum value"
,
"Sets CPU saver's maximum value"
,
E100_DEFAULT_CPUSAVER_BUNDLE_MAX
,
0x1
,
0xFFFF
);
return
generic_read
(
page
,
start
,
off
,
count
,
eof
,
len
);
...
...
drivers/net/e100/e100_test.c
View file @
4e130235
...
...
@@ -69,6 +69,7 @@ AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY OR
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*******************************************************************************/
#include "e100.h"
#include "e100_config.h"
#ifdef ETHTOOL_TEST
...
...
@@ -458,10 +459,3 @@ e100_diag_loopback_free (struct e100_private *bdp)
#endif
drivers/net/e1000/Makefile
View file @
4e130235
################################################################################
#
# This software program is available to you under a choice of one of two
# licenses. You may choose to be licensed under either the GNU General Public
# License 2.0, June 1991, available at http://www.fsf.org/copyleft/gpl.html,
# or the Intel BSD + Patent License, the text of which follows:
#
# Recipient has requested a license and Intel Corporation ("Intel") is willing
# to grant a license for the software entitled Linux Base Driver for the
# Intel(R) PRO/1000 Family of Adapters (e1000) (the "Software") being provided
# by Intel Corporation. The following definitions apply to this license:
#
# "Licensed Patents" means patent claims licensable by Intel Corporation which
# are necessarily infringed by the use of sale of the Software alone or when
# combined with the operating system referred to below.
#
# "Recipient" means the party to whom Intel delivers this Software.
#
# "Licensee" means Recipient and those third parties that receive a license to
# any operating system available under the GNU General Public License 2.0 or
# later.
#
# Copyright (c) 1999 - 2002 Intel Corporation.
# All rights reserved.
#
# The license is provided to Recipient and Recipient's Licensees under the
# following terms.
#
# Redistribution and use in source and binary forms of the Software, with or
# without modification, are permitted provided that the following conditions
# are met:
#
# Redistributions of source code of the Software may retain the above
# copyright notice, this list of conditions and the following disclaimer.
#
# Redistributions in binary form of the Software may reproduce the above
# copyright notice, this list of conditions and the following disclaimer in
# the documentation and/or materials provided with the distribution.
#
# Neither the name of Intel Corporation nor the names of its contributors
# shall be used to endorse or promote products derived from this Software
# without specific prior written permission.
#
# Intel hereby grants Recipient and Licensees a non-exclusive, worldwide,
# royalty-free patent license under Licensed Patents to make, use, sell, offer
# to sell, import and otherwise transfer the Software, if any, in source code
# and object code form. This license shall include changes to the Software
# that are error corrections or other minor changes to the Software that do
# not add functionality or features when the Software is incorporated in any
# version of an operating system that has been distributed under the GNU
# General Public License 2.0 or later. This patent license shall apply to the
# combination of the Software and any operating system licensed under the GNU
# General Public License 2.0 or later if, at the time Intel provides the
# Software to Recipient, such addition of the Software to the then publicly
# available versions of such operating systems available under the GNU General
# Public License 2.0 or later (whether in gold, beta or alpha form) causes
# such combination to be covered by the Licensed Patents. The patent license
# shall not apply to any other combinations which include the Software. NO
# hardware per se is licensed hereunder.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MECHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR IT CONTRIBUTORS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# ANY LOSS OF USE; DATA, OR PROFITS; OR BUSINESS INTERUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY OR
# TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
################################################################################
#
# Makefile for the Intel(R) PRO/1000 ethernet driver
#
...
...
drivers/net/e1000/e1000.h
View file @
4e130235
...
...
@@ -107,18 +107,21 @@
#include <linux/udp.h>
#include <net/pkt_sched.h>
#include <linux/list.h>
#include <
asm/uaccess
.h>
#include <
linux/reboot
.h>
#include <linux/ethtool.h>
#ifdef NETIF_F_HW_VLAN_TX
#include <linux/if_vlan.h>
#endif
#define BAR_0 0
#define PCI_DMA_64BIT 0xffffffffffffffffULL
#define PCI_DMA_32BIT 0x00000000ffffffffULL
struct
e1000_adapter
;
#include "e1000_hw.h"
#define BAR_0 0
#if DBG
#define E1000_DBG(args...) printk(KERN_DEBUG "e1000: " args)
#else
...
...
@@ -156,6 +159,7 @@ struct e1000_buffer {
struct
sk_buff
*
skb
;
uint64_t
dma
;
unsigned
long
length
;
unsigned
long
time_stamp
;
};
struct
e1000_desc_ring
{
...
...
@@ -204,10 +208,13 @@ struct e1000_adapter {
spinlock_t
stats_lock
;
atomic_t
irq_sem
;
#ifdef ETHTOOL_PHYS_ID
struct
timer_list
blink_timer
;
unsigned
long
led_status
;
#endif
/* TX */
struct
e1000_desc_ring
tx_ring
;
unsigned
long
trans_finish
;
spinlock_t
tx_lock
;
uint32_t
txd_cmd
;
int
max_data_per_txd
;
...
...
@@ -228,6 +235,9 @@ struct e1000_adapter {
struct
e1000_hw_stats
stats
;
struct
e1000_phy_info
phy_info
;
struct
e1000_phy_stats
phy_stats
;
};
uint32_t
pci_state
[
16
];
};
#endif
/* _E1000_H_ */
drivers/net/e1000/e1000_ethtool.c
View file @
4e130235
...
...
@@ -75,7 +75,6 @@
#include "e1000.h"
#include <linux/ethtool.h>
#include <asm/uaccess.h>
extern
char
e1000_driver_name
[];
...
...
@@ -83,7 +82,6 @@ extern char e1000_driver_version[];
extern
int
e1000_up
(
struct
e1000_adapter
*
adapter
);
extern
void
e1000_down
(
struct
e1000_adapter
*
adapter
);
extern
void
e1000_enable_WOL
(
struct
e1000_adapter
*
adapter
);
static
void
e1000_ethtool_gset
(
struct
e1000_adapter
*
adapter
,
struct
ethtool_cmd
*
ecmd
)
...
...
@@ -128,7 +126,11 @@ e1000_ethtool_gset(struct e1000_adapter *adapter, struct ethtool_cmd *ecmd)
SUPPORTED_Autoneg
);
ecmd
->
port
=
PORT_FIBRE
;
ecmd
->
transceiver
=
XCVR_EXTERNAL
;
if
(
hw
->
mac_type
>=
e1000_82545
)
ecmd
->
transceiver
=
XCVR_INTERNAL
;
else
ecmd
->
transceiver
=
XCVR_EXTERNAL
;
}
if
(
netif_carrier_ok
(
adapter
->
netdev
))
{
...
...
@@ -211,9 +213,37 @@ e1000_ethtool_gdrvinfo(struct e1000_adapter *adapter,
strncpy
(
drvinfo
->
version
,
e1000_driver_version
,
32
);
strncpy
(
drvinfo
->
fw_version
,
""
,
32
);
strncpy
(
drvinfo
->
bus_info
,
adapter
->
pdev
->
slot_name
,
32
);
#define E1000_REGS_LEN 32
drvinfo
->
regdump_len
=
E1000_REGS_LEN
*
sizeof
(
uint32_t
);
drvinfo
->
eedump_len
=
e1000_eeprom_size
(
&
adapter
->
hw
);
}
static
void
e1000_ethtool_gregs
(
struct
e1000_adapter
*
adapter
,
struct
ethtool_regs
*
regs
,
uint32_t
*
regs_buff
)
{
struct
e1000_hw
*
hw
=
&
adapter
->
hw
;
regs
->
version
=
(
1
<<
24
)
|
(
hw
->
revision_id
<<
16
)
|
hw
->
device_id
;
regs_buff
[
0
]
=
E1000_READ_REG
(
hw
,
CTRL
);
regs_buff
[
1
]
=
E1000_READ_REG
(
hw
,
STATUS
);
regs_buff
[
2
]
=
E1000_READ_REG
(
hw
,
RCTL
);
regs_buff
[
3
]
=
E1000_READ_REG
(
hw
,
RDLEN
);
regs_buff
[
4
]
=
E1000_READ_REG
(
hw
,
RDH
);
regs_buff
[
5
]
=
E1000_READ_REG
(
hw
,
RDT
);
regs_buff
[
6
]
=
E1000_READ_REG
(
hw
,
RDTR
);
regs_buff
[
7
]
=
E1000_READ_REG
(
hw
,
TCTL
);
regs_buff
[
8
]
=
E1000_READ_REG
(
hw
,
TDLEN
);
regs_buff
[
9
]
=
E1000_READ_REG
(
hw
,
TDH
);
regs_buff
[
10
]
=
E1000_READ_REG
(
hw
,
TDT
);
regs_buff
[
11
]
=
E1000_READ_REG
(
hw
,
TIDV
);
return
;
}
static
void
e1000_ethtool_geeprom
(
struct
e1000_adapter
*
adapter
,
struct
ethtool_eeprom
*
eeprom
,
uint16_t
*
eeprom_buff
)
...
...
@@ -228,7 +258,7 @@ e1000_ethtool_geeprom(struct e1000_adapter *adapter,
if
((
eeprom
->
offset
+
eeprom
->
len
)
>
max_len
)
eeprom
->
len
=
(
max_len
-
eeprom
->
offset
);
for
(
i
=
0
;
i
<
max_len
;
i
++
)
for
(
i
=
0
;
i
<
(
max_len
>>
1
)
;
i
++
)
e1000_read_eeprom
(
&
adapter
->
hw
,
i
,
&
eeprom_buff
[
i
]);
}
...
...
@@ -236,27 +266,50 @@ static void
e1000_ethtool_gwol
(
struct
e1000_adapter
*
adapter
,
struct
ethtool_wolinfo
*
wol
)
{
struct
e1000_hw
*
hw
=
&
adapter
->
hw
;
if
(
hw
->
mac_type
<
e1000_82544
)
{
switch
(
adapter
->
hw
.
device_id
)
{
case
E1000_DEV_ID_82542
:
case
E1000_DEV_ID_82543GC_FIBER
:
case
E1000_DEV_ID_82543GC_COPPER
:
case
E1000_DEV_ID_82544EI_FIBER
:
default:
wol
->
supported
=
0
;
wol
->
wolopts
=
0
;
return
;
}
wol
->
supported
=
WAKE_PHY
|
WAKE_UCAST
|
WAKE_MCAST
|
WAKE_BCAST
|
WAKE_MAGIC
;
wol
->
wolopts
=
0
;
if
(
adapter
->
wol
&
E1000_WUFC_LNKC
)
wol
->
wolopts
|=
WAKE_PHY
;
if
(
adapter
->
wol
&
E1000_WUFC_EX
)
wol
->
wolopts
|=
WAKE_UCAST
;
if
(
adapter
->
wol
&
E1000_WUFC_MC
)
wol
->
wolopts
|=
WAKE_MCAST
;
if
(
adapter
->
wol
&
E1000_WUFC_BC
)
wol
->
wolopts
|=
WAKE_BCAST
;
if
(
adapter
->
wol
&
E1000_WUFC_MAG
)
wol
->
wolopts
|=
WAKE_MAGIC
;
case
E1000_DEV_ID_82546EB_FIBER
:
/* Wake events only supported on port A for dual fiber */
if
(
E1000_READ_REG
(
hw
,
STATUS
)
&
E1000_STATUS_FUNC_1
)
{
wol
->
supported
=
0
;
wol
->
wolopts
=
0
;
return
;
}
/* Fall Through */
case
E1000_DEV_ID_82544EI_COPPER
:
case
E1000_DEV_ID_82544GC_COPPER
:
case
E1000_DEV_ID_82544GC_LOM
:
case
E1000_DEV_ID_82540EM
:
case
E1000_DEV_ID_82540EM_LOM
:
case
E1000_DEV_ID_82545EM_COPPER
:
case
E1000_DEV_ID_82545EM_FIBER
:
case
E1000_DEV_ID_82546EB_COPPER
:
wol
->
supported
=
WAKE_PHY
|
WAKE_UCAST
|
WAKE_MCAST
|
WAKE_BCAST
|
WAKE_MAGIC
;
wol
->
wolopts
=
0
;
if
(
adapter
->
wol
&
E1000_WUFC_LNKC
)
wol
->
wolopts
|=
WAKE_PHY
;
if
(
adapter
->
wol
&
E1000_WUFC_EX
)
wol
->
wolopts
|=
WAKE_UCAST
;
if
(
adapter
->
wol
&
E1000_WUFC_MC
)
wol
->
wolopts
|=
WAKE_MCAST
;
if
(
adapter
->
wol
&
E1000_WUFC_BC
)
wol
->
wolopts
|=
WAKE_BCAST
;
if
(
adapter
->
wol
&
E1000_WUFC_MAG
)
wol
->
wolopts
|=
WAKE_MAGIC
;
return
;
}
}
static
int
...
...
@@ -264,25 +317,95 @@ e1000_ethtool_swol(struct e1000_adapter *adapter, struct ethtool_wolinfo *wol)
{
struct
e1000_hw
*
hw
=
&
adapter
->
hw
;
if
(
hw
->
mac_type
<
e1000_82544
)
switch
(
adapter
->
hw
.
device_id
)
{
case
E1000_DEV_ID_82542
:
case
E1000_DEV_ID_82543GC_FIBER
:
case
E1000_DEV_ID_82543GC_COPPER
:
case
E1000_DEV_ID_82544EI_FIBER
:
default:
return
wol
->
wolopts
?
-
EOPNOTSUPP
:
0
;
adapter
->
wol
=
0
;
case
E1000_DEV_ID_82546EB_FIBER
:
/* Wake events only supported on port A for dual fiber */
if
(
E1000_READ_REG
(
hw
,
STATUS
)
&
E1000_STATUS_FUNC_1
)
return
wol
->
wolopts
?
-
EOPNOTSUPP
:
0
;
/* Fall Through */
case
E1000_DEV_ID_82544EI_COPPER
:
case
E1000_DEV_ID_82544GC_COPPER
:
case
E1000_DEV_ID_82544GC_LOM
:
case
E1000_DEV_ID_82540EM
:
case
E1000_DEV_ID_82540EM_LOM
:
case
E1000_DEV_ID_82545EM_COPPER
:
case
E1000_DEV_ID_82545EM_FIBER
:
case
E1000_DEV_ID_82546EB_COPPER
:
if
(
wol
->
wolopts
&
WAKE_ARP
)
return
-
EOPNOTSUPP
;
adapter
->
wol
=
0
;
if
(
wol
->
wolopts
&
WAKE_PHY
)
adapter
->
wol
|=
E1000_WUFC_LNKC
;
if
(
wol
->
wolopts
&
WAKE_UCAST
)
adapter
->
wol
|=
E1000_WUFC_EX
;
if
(
wol
->
wolopts
&
WAKE_MCAST
)
adapter
->
wol
|=
E1000_WUFC_MC
;
if
(
wol
->
wolopts
&
WAKE_BCAST
)
adapter
->
wol
|=
E1000_WUFC_BC
;
if
(
wol
->
wolopts
&
WAKE_MAGIC
)
adapter
->
wol
|=
E1000_WUFC_MAG
;
}
return
0
;
}
#ifdef ETHTOOL_PHYS_ID
/* toggle LED 4 times per second = 2 "blinks" per second */
#define E1000_ID_INTERVAL (HZ/4)
/* bit defines for adapter->led_status */
#define E1000_LED_ON 0
static
void
e1000_led_blink_callback
(
unsigned
long
data
)
{
struct
e1000_adapter
*
adapter
=
(
struct
e1000_adapter
*
)
data
;
if
(
test_and_change_bit
(
E1000_LED_ON
,
&
adapter
->
led_status
))
e1000_led_off
(
&
adapter
->
hw
);
else
e1000_led_on
(
&
adapter
->
hw
);
mod_timer
(
&
adapter
->
blink_timer
,
jiffies
+
E1000_ID_INTERVAL
);
}
if
(
wol
->
wolopts
&
WAKE_PHY
)
adapter
->
wol
|=
E1000_WUFC_LNKC
;
if
(
wol
->
wolopts
&
WAKE_UCAST
)
adapter
->
wol
|=
E1000_WUFC_EX
;
if
(
wol
->
wolopts
&
WAKE_MCAST
)
adapter
->
wol
|=
E1000_WUFC_MC
;
if
(
wol
->
wolopts
&
WAKE_BCAST
)
adapter
->
wol
|=
E1000_WUFC_BC
;
if
(
wol
->
wolopts
&
WAKE_MAGIC
)
adapter
->
wol
|=
E1000_WUFC_MAG
;
static
int
e1000_ethtool_led_blink
(
struct
e1000_adapter
*
adapter
,
struct
ethtool_value
*
id
)
{
if
(
!
adapter
->
blink_timer
.
function
)
{
init_timer
(
&
adapter
->
blink_timer
);
adapter
->
blink_timer
.
function
=
e1000_led_blink_callback
;
adapter
->
blink_timer
.
data
=
(
unsigned
long
)
adapter
;
}
e1000_setup_led
(
&
adapter
->
hw
);
mod_timer
(
&
adapter
->
blink_timer
,
jiffies
);
set_current_state
(
TASK_INTERRUPTIBLE
);
if
(
id
->
data
)
schedule_timeout
(
id
->
data
*
HZ
);
else
schedule_timeout
(
MAX_SCHEDULE_TIMEOUT
);
del_timer_sync
(
&
adapter
->
blink_timer
);
e1000_led_off
(
&
adapter
->
hw
);
clear_bit
(
E1000_LED_ON
,
&
adapter
->
led_status
);
e1000_cleanup_led
(
&
adapter
->
hw
);
e1000_enable_WOL
(
adapter
);
return
0
;
}
#endif
/* ETHTOOL_PHYS_ID */
int
e1000_ethtool_ioctl
(
struct
net_device
*
netdev
,
struct
ifreq
*
ifr
)
...
...
@@ -317,6 +440,22 @@ e1000_ethtool_ioctl(struct net_device *netdev, struct ifreq *ifr)
return
-
EFAULT
;
return
0
;
}
case
ETHTOOL_GREGS
:
{
struct
ethtool_regs
regs
=
{
ETHTOOL_GREGS
};
uint32_t
regs_buff
[
E1000_REGS_LEN
];
if
(
copy_from_user
(
&
regs
,
addr
,
sizeof
(
regs
)))
return
-
EFAULT
;
e1000_ethtool_gregs
(
adapter
,
&
regs
,
regs_buff
);
if
(
copy_to_user
(
addr
,
&
regs
,
sizeof
(
regs
)))
return
-
EFAULT
;
addr
+=
offsetof
(
struct
ethtool_regs
,
data
);
if
(
copy_to_user
(
addr
,
regs_buff
,
regs
.
len
))
return
-
EFAULT
;
return
0
;
}
case
ETHTOOL_NWAY_RST
:
{
if
(
!
capable
(
CAP_NET_ADMIN
))
return
-
EPERM
;
...
...
@@ -324,6 +463,14 @@ e1000_ethtool_ioctl(struct net_device *netdev, struct ifreq *ifr)
e1000_up
(
adapter
);
return
0
;
}
#ifdef ETHTOOL_PHYS_ID
case
ETHTOOL_PHYS_ID
:
{
struct
ethtool_value
id
;
if
(
copy_from_user
(
&
id
,
addr
,
sizeof
(
id
)))
return
-
EFAULT
;
return
e1000_ethtool_led_blink
(
adapter
,
&
id
);
}
#endif
/* ETHTOOL_PHYS_ID */
case
ETHTOOL_GLINK
:
{
struct
ethtool_value
link
=
{
ETHTOOL_GLINK
};
link
.
data
=
netif_carrier_ok
(
netdev
);
...
...
drivers/net/e1000/e1000_hw.c
View file @
4e130235
...
...
@@ -93,6 +93,7 @@ static void e1000_shift_out_ee_bits(struct e1000_hw *hw, uint16_t data, uint16_t
static
uint16_t
e1000_shift_in_ee_bits
(
struct
e1000_hw
*
hw
);
static
void
e1000_setup_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
);
/******************************************************************************
* Reset the transmit and receive units; mask and clear all interrupts.
...
...
@@ -197,9 +198,20 @@ e1000_init_hw(struct e1000_hw *hw)
uint32_t
i
;
int32_t
ret_val
;
uint16_t
pci_cmd_word
;
uint16_t
pcix_cmd_word
;
uint16_t
pcix_stat_hi_word
;
uint16_t
cmd_mmrbc
;
uint16_t
stat_mmrbc
;
DEBUGFUNC
(
"e1000_init_hw"
);
/* Initialize Identification LED */
ret_val
=
e1000_id_led_init
(
hw
);
if
(
ret_val
<
0
)
{
DEBUGOUT
(
"Error Initializing Identification LED
\n
"
);
return
ret_val
;
}
/* Set the Media Type and exit with error if it is not valid. */
if
(
hw
->
mac_type
!=
e1000_82543
)
{
/* tbi_compatibility is only valid on 82543 */
...
...
@@ -264,6 +276,21 @@ e1000_init_hw(struct e1000_hw *hw)
E1000_WRITE_REG
(
hw
,
CTRL
,
ctrl
|
E1000_CTRL_PRIOR
);
}
/* Workaround for PCI-X problem when BIOS sets MMRBC incorrectly. */
if
(
hw
->
bus_type
==
e1000_bus_type_pcix
)
{
e1000_read_pci_cfg
(
hw
,
PCIX_COMMAND_REGISTER
,
&
pcix_cmd_word
);
e1000_read_pci_cfg
(
hw
,
PCIX_STATUS_REGISTER_HI
,
&
pcix_stat_hi_word
);
cmd_mmrbc
=
(
pcix_cmd_word
&
PCIX_COMMAND_MMRBC_MASK
)
>>
PCIX_COMMAND_MMRBC_SHIFT
;
stat_mmrbc
=
(
pcix_stat_hi_word
&
PCIX_STATUS_HI_MMRBC_MASK
)
>>
PCIX_STATUS_HI_MMRBC_SHIFT
;
if
(
cmd_mmrbc
>
stat_mmrbc
)
{
pcix_cmd_word
&=
~
PCIX_COMMAND_MMRBC_MASK
;
pcix_cmd_word
|=
stat_mmrbc
<<
PCIX_COMMAND_MMRBC_SHIFT
;
e1000_write_pci_cfg
(
hw
,
PCIX_COMMAND_REGISTER
,
&
pcix_cmd_word
);
}
}
/* Call a subroutine to configure the link and setup flow control. */
ret_val
=
e1000_setup_link
(
hw
);
...
...
@@ -541,6 +568,7 @@ e1000_setup_copper_link(struct e1000_hw *hw)
*/
if
(
hw
->
mac_type
>
e1000_82543
)
{
ctrl
|=
E1000_CTRL_SLU
;
ctrl
&=
~
(
E1000_CTRL_FRCSPD
|
E1000_CTRL_FRCDPX
);
E1000_WRITE_REG
(
hw
,
CTRL
,
ctrl
);
}
else
{
ctrl
|=
(
E1000_CTRL_FRCSPD
|
E1000_CTRL_FRCDPX
|
E1000_CTRL_SLU
);
...
...
@@ -2061,6 +2089,8 @@ e1000_detect_gig_phy(struct e1000_hw *hw)
if
(
hw
->
phy_id
==
M88E1000_I_PHY_ID
)
match
=
TRUE
;
break
;
case
e1000_82540
:
case
e1000_82545
:
case
e1000_82546
:
if
(
hw
->
phy_id
==
M88E1011_I_PHY_ID
)
match
=
TRUE
;
break
;
default:
...
...
@@ -2087,9 +2117,9 @@ e1000_phy_reset_dsp(struct e1000_hw *hw)
DEBUGFUNC
(
"e1000_phy_reset_dsp"
);
do
{
if
(
e1000_write_phy_reg
(
hw
,
29
,
0x1d
)
<
0
)
break
;
if
(
e1000_write_phy_reg
(
hw
,
30
,
0xc1
)
<
0
)
break
;
if
(
e1000_write_phy_reg
(
hw
,
30
,
0x00
)
<
0
)
break
;
if
(
e1000_write_phy_reg
(
hw
,
29
,
0x
00
1d
)
<
0
)
break
;
if
(
e1000_write_phy_reg
(
hw
,
30
,
0x
00
c1
)
<
0
)
break
;
if
(
e1000_write_phy_reg
(
hw
,
30
,
0x00
00
)
<
0
)
break
;
ret_val
=
0
;
}
while
(
0
);
...
...
@@ -2150,8 +2180,8 @@ e1000_phy_get_info(struct e1000_hw *hw,
M88E1000_PSSR_MDIX_SHIFT
;
if
(
phy_data
&
M88E1000_PSSR_1000MBS
)
{
/* Cable Length Estimation and Local/Remote Receiver Informatoion
* are only valid at 1000 Mbps
*/
* are only valid at 1000 Mbps
*/
phy_info
->
cable_length
=
((
phy_data
&
M88E1000_PSSR_CABLE_LENGTH
)
>>
M88E1000_PSSR_CABLE_LENGTH_SHIFT
);
if
(
e1000_read_phy_reg
(
hw
,
PHY_1000T_STATUS
,
&
phy_data
)
<
0
)
...
...
@@ -2521,6 +2551,13 @@ e1000_read_mac_addr(struct e1000_hw * hw)
hw
->
perm_mac_addr
[
i
]
=
(
uint8_t
)
(
eeprom_data
&
0x00FF
);
hw
->
perm_mac_addr
[
i
+
1
]
=
(
uint8_t
)
(
eeprom_data
>>
8
);
}
if
((
hw
->
mac_type
==
e1000_82546
)
&&
(
E1000_READ_REG
(
hw
,
STATUS
)
&
E1000_STATUS_FUNC_1
))
{
if
(
hw
->
perm_mac_addr
[
5
]
&
0x01
)
hw
->
perm_mac_addr
[
5
]
&=
~
(
0x01
);
else
hw
->
perm_mac_addr
[
5
]
|=
0x01
;
}
for
(
i
=
0
;
i
<
NODE_ADDRESS_SIZE
;
i
++
)
hw
->
mac_addr
[
i
]
=
hw
->
perm_mac_addr
[
i
];
return
0
;
...
...
@@ -2785,6 +2822,74 @@ e1000_clear_vfta(struct e1000_hw *hw)
E1000_WRITE_REG_ARRAY
(
hw
,
VFTA
,
offset
,
0
);
}
static
int32_t
e1000_id_led_init
(
struct
e1000_hw
*
hw
)
{
uint32_t
ledctl
;
const
uint32_t
ledctl_mask
=
0x000000FF
;
const
uint32_t
ledctl_on
=
E1000_LEDCTL_MODE_LED_ON
;
const
uint32_t
ledctl_off
=
E1000_LEDCTL_MODE_LED_OFF
;
uint16_t
eeprom_data
,
i
,
temp
;
const
uint16_t
led_mask
=
0x0F
;
DEBUGFUNC
(
"e1000_id_led_init"
);
if
(
hw
->
mac_type
<
e1000_82540
)
{
/* Nothing to do */
return
0
;
}
ledctl
=
E1000_READ_REG
(
hw
,
LEDCTL
);
hw
->
ledctl_default
=
ledctl
;
hw
->
ledctl_mode1
=
hw
->
ledctl_default
;
hw
->
ledctl_mode2
=
hw
->
ledctl_default
;
if
(
e1000_read_eeprom
(
hw
,
EEPROM_ID_LED_SETTINGS
,
&
eeprom_data
)
<
0
)
{
DEBUGOUT
(
"EEPROM Read Error
\n
"
);
return
-
E1000_ERR_EEPROM
;
}
if
((
eeprom_data
==
ID_LED_RESERVED_0000
)
||
(
eeprom_data
==
ID_LED_RESERVED_FFFF
))
eeprom_data
=
ID_LED_DEFAULT
;
for
(
i
=
0
;
i
<
4
;
i
++
)
{
temp
=
(
eeprom_data
>>
(
i
<<
2
))
&
led_mask
;
switch
(
temp
)
{
case
ID_LED_ON1_DEF2
:
case
ID_LED_ON1_ON2
:
case
ID_LED_ON1_OFF2
:
hw
->
ledctl_mode1
&=
~
(
ledctl_mask
<<
(
i
<<
3
));
hw
->
ledctl_mode1
|=
ledctl_on
<<
(
i
<<
3
);
break
;
case
ID_LED_OFF1_DEF2
:
case
ID_LED_OFF1_ON2
:
case
ID_LED_OFF1_OFF2
:
hw
->
ledctl_mode1
&=
~
(
ledctl_mask
<<
(
i
<<
3
));
hw
->
ledctl_mode1
|=
ledctl_off
<<
(
i
<<
3
);
break
;
default:
/* Do nothing */
break
;
}
switch
(
temp
)
{
case
ID_LED_DEF1_ON2
:
case
ID_LED_ON1_ON2
:
case
ID_LED_OFF1_ON2
:
hw
->
ledctl_mode2
&=
~
(
ledctl_mask
<<
(
i
<<
3
));
hw
->
ledctl_mode2
|=
ledctl_on
<<
(
i
<<
3
);
break
;
case
ID_LED_DEF1_OFF2
:
case
ID_LED_ON1_OFF2
:
case
ID_LED_OFF1_OFF2
:
hw
->
ledctl_mode2
&=
~
(
ledctl_mask
<<
(
i
<<
3
));
hw
->
ledctl_mode2
|=
ledctl_off
<<
(
i
<<
3
);
break
;
default:
/* Do nothing */
break
;
}
}
return
0
;
}
/******************************************************************************
* Prepares SW controlable LED for use and saves the current state of the LED.
*
...
...
@@ -2807,22 +2912,24 @@ e1000_setup_led(struct e1000_hw *hw)
case
E1000_DEV_ID_82544GC_LOM
:
/* No setup necessary */
break
;
case
E1000_DEV_ID_8254
0EM
:
case
E1000_DEV_ID_8254
0EM_LOM
:
case
E1000_DEV_ID_8254
5EM_FIBER
:
case
E1000_DEV_ID_8254
6EB_FIBER
:
ledctl
=
E1000_READ_REG
(
hw
,
LEDCTL
);
/* Save current LEDCTL settings */
hw
->
ledctl
=
ledctl
;
/* Turn off LED2 and LED3 */
ledctl
&=
~
(
E1000_LEDCTL_LED2_IVRT
|
E1000_LEDCTL_LED2_BLINK
|
E1000_LEDCTL_LED2_MODE_MASK
);
ledctl
|=
(
E1000_LEDCTL_MODE_LED_OFF
<<
E1000_LEDCTL_LED2_MODE_SHIFT
);
ledctl
&=
~
(
E1000_LEDCTL_LED3_IVRT
|
E1000_LEDCTL_LED3_BLINK
|
E1000_LEDCTL_LED3_MODE_MASK
);
ledctl
|=
(
E1000_LEDCTL_MODE_LED_OFF
<<
E1000_LEDCTL_LED3_MODE_SHIFT
);
hw
->
ledctl_default
=
ledctl
;
/* Turn off LED0 */
ledctl
&=
~
(
E1000_LEDCTL_LED0_IVRT
|
E1000_LEDCTL_LED0_BLINK
|
E1000_LEDCTL_LED0_MODE_MASK
);
ledctl
|=
(
E1000_LEDCTL_MODE_LED_OFF
<<
E1000_LEDCTL_LED0_MODE_SHIFT
);
E1000_WRITE_REG
(
hw
,
LEDCTL
,
ledctl
);
break
;
case
E1000_DEV_ID_82540EM
:
case
E1000_DEV_ID_82540EM_LOM
:
case
E1000_DEV_ID_82545EM_COPPER
:
case
E1000_DEV_ID_82546EB_COPPER
:
E1000_WRITE_REG
(
hw
,
LEDCTL
,
hw
->
ledctl_mode1
);
break
;
default:
DEBUGOUT
(
"Invalid device ID
\n
"
);
return
-
E1000_ERR_CONFIG
;
...
...
@@ -2852,8 +2959,12 @@ e1000_cleanup_led(struct e1000_hw *hw)
break
;
case
E1000_DEV_ID_82540EM
:
case
E1000_DEV_ID_82540EM_LOM
:
case
E1000_DEV_ID_82545EM_COPPER
:
case
E1000_DEV_ID_82545EM_FIBER
:
case
E1000_DEV_ID_82546EB_COPPER
:
case
E1000_DEV_ID_82546EB_FIBER
:
/* Restore LEDCTL settings */
E1000_WRITE_REG
(
hw
,
LEDCTL
,
hw
->
ledctl
);
E1000_WRITE_REG
(
hw
,
LEDCTL
,
hw
->
ledctl
_default
);
break
;
default:
DEBUGOUT
(
"Invalid device ID
\n
"
);
...
...
@@ -2871,7 +2982,6 @@ int32_t
e1000_led_on
(
struct
e1000_hw
*
hw
)
{
uint32_t
ctrl
;
uint32_t
ledctl
;
DEBUGFUNC
(
"e1000_led_on"
);
...
...
@@ -2889,6 +2999,8 @@ e1000_led_on(struct e1000_hw *hw)
case
E1000_DEV_ID_82544EI_COPPER
:
case
E1000_DEV_ID_82544GC_COPPER
:
case
E1000_DEV_ID_82544GC_LOM
:
case
E1000_DEV_ID_82545EM_FIBER
:
case
E1000_DEV_ID_82546EB_FIBER
:
ctrl
=
E1000_READ_REG
(
hw
,
CTRL
);
/* Clear SW Defineable Pin 0 to turn on the LED */
ctrl
&=
~
E1000_CTRL_SWDPIN0
;
...
...
@@ -2897,11 +3009,9 @@ e1000_led_on(struct e1000_hw *hw)
break
;
case
E1000_DEV_ID_82540EM
:
case
E1000_DEV_ID_82540EM_LOM
:
ledctl
=
E1000_READ_REG
(
hw
,
LEDCTL
);
/* Set LED 3 mode to on */
ledctl
&=
~
E1000_LEDCTL_LED3_MODE_MASK
;
ledctl
|=
(
E1000_LEDCTL_MODE_LED_ON
<<
E1000_LEDCTL_LED3_MODE_SHIFT
);
E1000_WRITE_REG
(
hw
,
LEDCTL
,
ledctl
);
case
E1000_DEV_ID_82545EM_COPPER
:
case
E1000_DEV_ID_82546EB_COPPER
:
E1000_WRITE_REG
(
hw
,
LEDCTL
,
hw
->
ledctl_mode2
);
break
;
default:
DEBUGOUT
(
"Invalid device ID
\n
"
);
...
...
@@ -2919,7 +3029,6 @@ int32_t
e1000_led_off
(
struct
e1000_hw
*
hw
)
{
uint32_t
ctrl
;
uint32_t
ledctl
;
DEBUGFUNC
(
"e1000_led_off"
);
...
...
@@ -2937,6 +3046,8 @@ e1000_led_off(struct e1000_hw *hw)
case
E1000_DEV_ID_82544EI_COPPER
:
case
E1000_DEV_ID_82544GC_COPPER
:
case
E1000_DEV_ID_82544GC_LOM
:
case
E1000_DEV_ID_82545EM_FIBER
:
case
E1000_DEV_ID_82546EB_FIBER
:
ctrl
=
E1000_READ_REG
(
hw
,
CTRL
);
/* Set SW Defineable Pin 0 to turn off the LED */
ctrl
|=
E1000_CTRL_SWDPIN0
;
...
...
@@ -2945,11 +3056,9 @@ e1000_led_off(struct e1000_hw *hw)
break
;
case
E1000_DEV_ID_82540EM
:
case
E1000_DEV_ID_82540EM_LOM
:
ledctl
=
E1000_READ_REG
(
hw
,
LEDCTL
);
/* Set LED 3 mode to off */
ledctl
&=
~
E1000_LEDCTL_LED3_MODE_MASK
;
ledctl
|=
(
E1000_LEDCTL_MODE_LED_OFF
<<
E1000_LEDCTL_LED3_MODE_SHIFT
);
E1000_WRITE_REG
(
hw
,
LEDCTL
,
ledctl
);
case
E1000_DEV_ID_82545EM_COPPER
:
case
E1000_DEV_ID_82546EB_COPPER
:
E1000_WRITE_REG
(
hw
,
LEDCTL
,
hw
->
ledctl_mode1
);
break
;
default:
DEBUGOUT
(
"Invalid device ID
\n
"
);
...
...
drivers/net/e1000/e1000_hw.h
View file @
4e130235
...
...
@@ -92,6 +92,8 @@ typedef enum {
e1000_82543
,
e1000_82544
,
e1000_82540
,
e1000_82545
,
e1000_82546
,
e1000_num_macs
}
e1000_mac_type
;
...
...
@@ -260,6 +262,7 @@ void e1000_reset_adaptive(struct e1000_hw *hw);
void
e1000_update_adaptive
(
struct
e1000_hw
*
hw
);
void
e1000_tbi_adjust_stats
(
struct
e1000_hw
*
hw
,
struct
e1000_hw_stats
*
stats
,
uint32_t
frame_len
,
uint8_t
*
mac_addr
);
void
e1000_get_bus_info
(
struct
e1000_hw
*
hw
);
void
e1000_read_pci_cfg
(
struct
e1000_hw
*
hw
,
uint32_t
reg
,
uint16_t
*
value
);
void
e1000_write_pci_cfg
(
struct
e1000_hw
*
hw
,
uint32_t
reg
,
uint16_t
*
value
);
/* PCI Device IDs */
...
...
@@ -272,7 +275,11 @@ void e1000_write_pci_cfg(struct e1000_hw *hw, uint32_t reg, uint16_t * value);
#define E1000_DEV_ID_82544GC_LOM 0x100D
#define E1000_DEV_ID_82540EM 0x100E
#define E1000_DEV_ID_82540EM_LOM 0x1015
#define NUM_DEV_IDS 9
#define E1000_DEV_ID_82545EM_COPPER 0x100F
#define E1000_DEV_ID_82545EM_FIBER 0x1011
#define E1000_DEV_ID_82546EB_COPPER 0x1010
#define E1000_DEV_ID_82546EB_FIBER 0x1012
#define NUM_DEV_IDS 13
#define NODE_ADDRESS_SIZE 6
#define ETH_LENGTH_OF_ADDRESS 6
...
...
@@ -882,7 +889,9 @@ struct e1000_hw {
uint32_t
num_mc_addrs
;
uint32_t
collision_delta
;
uint32_t
tx_packet_delta
;
uint32_t
ledctl
;
uint32_t
ledctl_default
;
uint32_t
ledctl_mode1
;
uint32_t
ledctl_mode2
;
uint16_t
autoneg_advertised
;
uint16_t
pci_cmd_word
;
uint16_t
fc_high_water
;
...
...
@@ -1324,10 +1333,28 @@ struct e1000_hw {
#define EEPROM_EWDS_OPCODE 0x10
/* EERPOM erast/write disable */
/* EEPROM Word Offsets */
#define EEPROM_INIT_CONTROL1_REG 0x000A
#define EEPROM_INIT_CONTROL2_REG 0x000F
#define EEPROM_FLASH_VERSION 0x0032
#define EEPROM_CHECKSUM_REG 0x003F
#define EEPROM_ID_LED_SETTINGS 0x0004
#define EEPROM_INIT_CONTROL1_REG 0x000A
#define EEPROM_INIT_CONTROL2_REG 0x000F
#define EEPROM_FLASH_VERSION 0x0032
#define EEPROM_CHECKSUM_REG 0x003F
/* Word definitions for ID LED Settings */
#define ID_LED_RESERVED_0000 0x0000
#define ID_LED_RESERVED_FFFF 0xFFFF
#define ID_LED_DEFAULT ((ID_LED_OFF1_ON2 << 12) | \
(ID_LED_OFF1_OFF2 << 8) | \
(ID_LED_DEF1_DEF2 << 4) | \
(ID_LED_DEF1_DEF2))
#define ID_LED_DEF1_DEF2 0x1
#define ID_LED_DEF1_ON2 0x2
#define ID_LED_DEF1_OFF2 0x3
#define ID_LED_ON1_DEF2 0x4
#define ID_LED_ON1_ON2 0x5
#define ID_LED_ON1_OFF2 0x6
#define ID_LED_OFF1_DEF2 0x7
#define ID_LED_OFF1_ON2 0x8
#define ID_LED_OFF1_OFF2 0x9
/* Mask bits for fields in Word 0x0a of the EEPROM */
#define EEPROM_WORD0A_ILOS 0x0010
...
...
@@ -1414,6 +1441,16 @@ struct e1000_hw {
#define FC_DEFAULT_LO_THRESH (0x4000)
/* 16KB */
#define FC_DEFAULT_TX_TIMER (0x100)
/* ~130 us */
/* PCIX Config space */
#define PCIX_COMMAND_REGISTER 0xE6
#define PCIX_STATUS_REGISTER_LO 0xE8
#define PCIX_STATUS_REGISTER_HI 0xEA
#define PCIX_COMMAND_MMRBC_MASK 0x000C
#define PCIX_COMMAND_MMRBC_SHIFT 0x2
#define PCIX_STATUS_HI_MMRBC_MASK 0x0060
#define PCIX_STATUS_HI_MMRBC_SHIFT 0x5
/* The number of bits that we need to shift right to move the "pause"
* bits from the EEPROM (bits 13:12) to the "pause" (bits 8:7) field
...
...
drivers/net/e1000/e1000_main.c
View file @
4e130235
...
...
@@ -76,7 +76,7 @@
char
e1000_driver_name
[]
=
"e1000"
;
char
e1000_driver_string
[]
=
"Intel(R) PRO/1000 Network Driver"
;
char
e1000_driver_version
[]
=
"4.2.
8
"
;
char
e1000_driver_version
[]
=
"4.2.
17-k1
"
;
char
e1000_copyright
[]
=
"Copyright (c) 1999-2002 Intel Corporation."
;
/* e1000_pci_tbl - PCI Device ID Table
...
...
@@ -114,6 +114,10 @@ static struct pci_device_id e1000_pci_tbl[] __devinitdata = {
{
0x8086
,
0x100C
,
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
},
{
0x8086
,
0x100F
,
PCI_ANY_ID
,
PCI_ANY_ID
,
0
,
0
,
0
},
{
0x8086
,
0x1011
,
PCI_ANY_ID
,
PCI_ANY_ID
,
0
,
0
,
0
},
{
0x8086
,
0x1010
,
PCI_ANY_ID
,
PCI_ANY_ID
,
0
,
0
,
0
},
{
0x8086
,
0x1012
,
PCI_ANY_ID
,
PCI_ANY_ID
,
0
,
0
,
0
},
/* required last entry */
{
0
,}
};
...
...
@@ -126,7 +130,7 @@ static char *e1000_strings[] = {
"IBM Mobile, Desktop & Server Adapters"
};
/*
e1000_main.c
Function Prototypes */
/*
Local
Function Prototypes */
int
e1000_up
(
struct
e1000_adapter
*
adapter
);
void
e1000_down
(
struct
e1000_adapter
*
adapter
);
...
...
@@ -169,13 +173,24 @@ static void e1000_leave_82542_rst(struct e1000_adapter *adapter);
static
inline
void
e1000_rx_checksum
(
struct
e1000_adapter
*
adapter
,
struct
e1000_rx_desc
*
rx_desc
,
struct
sk_buff
*
skb
);
void
e1000_enable_WOL
(
struct
e1000_adapter
*
adapter
);
#ifdef NETIF_F_HW_VLAN_TX
static
void
e1000_vlan_rx_register
(
struct
net_device
*
netdev
,
struct
vlan_group
*
grp
);
static
void
e1000_vlan_rx_add_vid
(
struct
net_device
*
netdev
,
uint16_t
vid
);
static
void
e1000_vlan_rx_kill_vid
(
struct
net_device
*
netdev
,
uint16_t
vid
);
#endif
static
int
e1000_notify_reboot
(
struct
notifier_block
*
,
unsigned
long
event
,
void
*
ptr
);
static
int
e1000_suspend
(
struct
pci_dev
*
pdev
,
uint32_t
state
);
#ifdef CONFIG_PM
static
int
e1000_resume
(
struct
pci_dev
*
pdev
);
#endif
struct
notifier_block
e1000_notifier
=
{
notifier_call:
e1000_notify_reboot
,
next:
NULL
,
priority:
0
};
/* Exported from other modules */
extern
void
e1000_check_options
(
struct
e1000_adapter
*
adapter
);
...
...
@@ -189,8 +204,10 @@ static struct pci_driver e1000_driver = {
probe:
e1000_probe
,
remove:
__devexit_p
(
e1000_remove
),
/* Power Managment Hooks */
suspend:
NULL
,
resume:
NULL
#ifdef CONFIG_PM
suspend:
e1000_suspend
,
resume:
e1000_resume
#endif
};
MODULE_AUTHOR
(
"Intel Corporation, <linux.nics@intel.com>"
);
...
...
@@ -207,12 +224,16 @@ MODULE_LICENSE("Dual BSD/GPL");
static
int
__init
e1000_init_module
(
void
)
{
int
ret
;
printk
(
KERN_INFO
"%s - version %s
\n
"
,
e1000_driver_string
,
e1000_driver_version
);
printk
(
KERN_INFO
"%s
\n
"
,
e1000_copyright
);
return
pci_module_init
(
&
e1000_driver
);
ret
=
pci_module_init
(
&
e1000_driver
);
if
(
ret
>=
0
)
register_reboot_notifier
(
&
e1000_notifier
);
return
ret
;
}
module_init
(
e1000_init_module
);
...
...
@@ -227,6 +248,7 @@ module_init(e1000_init_module);
static
void
__exit
e1000_exit_module
(
void
)
{
unregister_reboot_notifier
(
&
e1000_notifier
);
pci_unregister_driver
(
&
e1000_driver
);
}
...
...
@@ -290,11 +312,11 @@ e1000_reset(struct e1000_adapter *adapter)
adapter
->
hw
.
fc
=
adapter
->
hw
.
original_fc
;
e1000_reset_hw
(
&
adapter
->
hw
);
if
(
adapter
->
hw
.
mac_type
>=
e1000_82544
)
E1000_WRITE_REG
(
&
adapter
->
hw
,
WUC
,
0
);
e1000_init_hw
(
&
adapter
->
hw
);
e1000_reset_adaptive
(
&
adapter
->
hw
);
e1000_phy_get_info
(
&
adapter
->
hw
,
&
adapter
->
phy_info
);
e1000_enable_WOL
(
adapter
);
}
/**
...
...
@@ -324,10 +346,10 @@ e1000_probe(struct pci_dev *pdev,
if
((
i
=
pci_enable_device
(
pdev
)))
return
i
;
if
(
!
(
i
=
pci_set_dma_mask
(
pdev
,
(
u64
)
0xffffffffffffffff
)))
{
if
(
!
(
i
=
pci_set_dma_mask
(
pdev
,
PCI_DMA_64BIT
)))
{
pci_using_dac
=
1
;
}
else
{
if
((
i
=
pci_set_dma_mask
(
pdev
,
(
u64
)
0xffffffff
)))
{
if
((
i
=
pci_set_dma_mask
(
pdev
,
PCI_DMA_32BIT
)))
{
E1000_ERR
(
"No usable DMA configuration, aborting
\n
"
);
return
i
;
}
...
...
@@ -403,8 +425,10 @@ e1000_probe(struct pci_dev *pdev,
/* 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
"
);
goto
err_eeprom
;
}
/* copy the MAC address out of the EEPROM */
...
...
@@ -437,7 +461,7 @@ e1000_probe(struct pci_dev *pdev,
register_netdev
(
netdev
);
/* we're going to reset, so assume we have no link for now */
netif_carrier_off
(
netdev
);
netif_stop_queue
(
netdev
);
...
...
@@ -445,6 +469,15 @@ e1000_probe(struct pci_dev *pdev,
e1000_check_options
(
adapter
);
e1000_proc_dev_setup
(
adapter
);
/* Initial Wake on LAN setting
* If APM wake is enabled in the EEPROM,
* enable the ACPI Magic Packet filter
*/
if
((
adapter
->
hw
.
mac_type
>=
e1000_82544
)
&&
(
E1000_READ_REG
(
&
adapter
->
hw
,
WUC
)
&
E1000_WUC_APME
))
adapter
->
wol
|=
E1000_WUFC_MAG
;
/* reset the hardware with the new settings */
e1000_reset
(
adapter
);
...
...
@@ -555,6 +588,14 @@ e1000_sw_init(struct e1000_adapter *adapter)
case
E1000_DEV_ID_82540EM
:
hw
->
mac_type
=
e1000_82540
;
break
;
case
E1000_DEV_ID_82545EM_COPPER
:
case
E1000_DEV_ID_82545EM_FIBER
:
hw
->
mac_type
=
e1000_82545
;
break
;
case
E1000_DEV_ID_82546EB_COPPER
:
case
E1000_DEV_ID_82546EB_FIBER
:
hw
->
mac_type
=
e1000_82546
;
break
;
default:
/* should never have loaded on this device */
BUG
();
...
...
@@ -590,7 +631,6 @@ e1000_sw_init(struct e1000_adapter *adapter)
hw
->
adaptive_ifs
=
TRUE
;
atomic_set
(
&
adapter
->
irq_sem
,
1
);
spin_lock_init
(
&
adapter
->
tx_lock
);
spin_lock_init
(
&
adapter
->
stats_lock
);
}
...
...
@@ -715,7 +755,7 @@ e1000_configure_tx(struct e1000_adapter *adapter)
uint32_t
tdlen
=
adapter
->
tx_ring
.
count
*
sizeof
(
struct
e1000_tx_desc
);
uint32_t
tctl
,
tipg
;
E1000_WRITE_REG
(
&
adapter
->
hw
,
TDBAL
,
(
tdba
&
0x00000000
FFFFFFFF
));
E1000_WRITE_REG
(
&
adapter
->
hw
,
TDBAL
,
(
tdba
&
0x00000000
ffffffffULL
));
E1000_WRITE_REG
(
&
adapter
->
hw
,
TDBAH
,
(
tdba
>>
32
));
E1000_WRITE_REG
(
&
adapter
->
hw
,
TDLEN
,
tdlen
);
...
...
@@ -752,7 +792,7 @@ e1000_configure_tx(struct e1000_adapter *adapter)
tctl
=
E1000_READ_REG
(
&
adapter
->
hw
,
TCTL
);
tctl
&=
~
E1000_TCTL_CT
;
tctl
&=
~
E1000_TCTL_CT
;
tctl
|=
E1000_TCTL_EN
|
E1000_TCTL_PSP
|
(
E1000_COLLISION_THRESHOLD
<<
E1000_CT_SHIFT
);
...
...
@@ -875,7 +915,7 @@ e1000_configure_rx(struct e1000_adapter *adapter)
/* set the Receive Delay Timer Register */
if
(
adapter
->
hw
.
mac_type
=
=
e1000_82540
)
{
if
(
adapter
->
hw
.
mac_type
>
=
e1000_82540
)
{
E1000_WRITE_REG
(
&
adapter
->
hw
,
RADV
,
adapter
->
rx_int_delay
);
E1000_WRITE_REG
(
&
adapter
->
hw
,
RDTR
,
64
);
...
...
@@ -891,7 +931,7 @@ e1000_configure_rx(struct e1000_adapter *adapter)
/* Setup the Base and Length of the Rx Descriptor Ring */
E1000_WRITE_REG
(
&
adapter
->
hw
,
RDBAL
,
(
rdba
&
0x00000000
FFFFFFFF
));
E1000_WRITE_REG
(
&
adapter
->
hw
,
RDBAL
,
(
rdba
&
0x00000000
ffffffffULL
));
E1000_WRITE_REG
(
&
adapter
->
hw
,
RDBAH
,
(
rdba
>>
32
));
E1000_WRITE_REG
(
&
adapter
->
hw
,
RDLEN
,
rdlen
);
...
...
@@ -1212,6 +1252,8 @@ e1000_watchdog(unsigned long data)
{
struct
e1000_adapter
*
adapter
=
(
struct
e1000_adapter
*
)
data
;
struct
net_device
*
netdev
=
adapter
->
netdev
;
struct
e1000_desc_ring
*
txdr
=
&
adapter
->
tx_ring
;
int
i
;
e1000_check_for_link
(
&
adapter
->
hw
);
...
...
@@ -1228,7 +1270,6 @@ e1000_watchdog(unsigned long data)
"Full Duplex"
:
"Half Duplex"
);
netif_carrier_on
(
netdev
);
adapter
->
trans_finish
=
jiffies
;
netif_wake_queue
(
netdev
);
mod_timer
(
&
adapter
->
phy_info_timer
,
jiffies
+
2
*
HZ
);
}
...
...
@@ -1248,6 +1289,13 @@ e1000_watchdog(unsigned long data)
e1000_update_stats
(
adapter
);
e1000_update_adaptive
(
&
adapter
->
hw
);
/* Early detection of hung controller */
i
=
txdr
->
next_to_clean
;
if
(
txdr
->
buffer_info
[
i
].
dma
&&
time_after
(
jiffies
,
txdr
->
buffer_info
[
i
].
time_stamp
+
HZ
)
&&
!
(
E1000_READ_REG
(
&
adapter
->
hw
,
STATUS
)
&
E1000_STATUS_TXOFF
))
netif_stop_queue
(
netdev
);
/* Reset the timer */
mod_timer
(
&
adapter
->
watchdog_timer
,
jiffies
+
2
*
HZ
);
}
...
...
@@ -1310,6 +1358,7 @@ e1000_tx_map(struct e1000_adapter *adapter, struct sk_buff *skb)
skb
->
data
+
offset
,
size
,
PCI_DMA_TODEVICE
);
tx_ring
->
buffer_info
[
i
].
time_stamp
=
jiffies
;
len
-=
size
;
offset
+=
size
;
...
...
@@ -1388,20 +1437,11 @@ static int
e1000_xmit_frame
(
struct
sk_buff
*
skb
,
struct
net_device
*
netdev
)
{
struct
e1000_adapter
*
adapter
=
netdev
->
priv
;
unsigned
long
flags
;
int
tx_flags
=
0
,
count
;
int
f
;
if
(
time_after
(
netdev
->
trans_start
,
adapter
->
trans_finish
+
HZ
)
&&
!
(
E1000_READ_REG
(
&
adapter
->
hw
,
STATUS
)
&
E1000_STATUS_TXOFF
))
{
adapter
->
trans_finish
=
jiffies
;
netif_stop_queue
(
netdev
);
return
1
;
}
count
=
TXD_USE_COUNT
(
skb
->
len
-
skb
->
data_len
,
adapter
->
max_data_per_txd
);
for
(
f
=
0
;
f
<
skb_shinfo
(
skb
)
->
nr_frags
;
f
++
)
...
...
@@ -1410,14 +1450,10 @@ e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
if
(
skb
->
ip_summed
==
CHECKSUM_HW
)
count
++
;
spin_lock_irqsave
(
&
adapter
->
tx_lock
,
flags
);
e1000_clean_tx_irq
(
adapter
);
if
(
E1000_DESC_UNUSED
(
&
adapter
->
tx_ring
)
<
count
)
{
netif_stop_queue
(
netdev
);
spin_unlock_irqrestore
(
&
adapter
->
tx_lock
,
flags
);
return
1
;
}
spin_unlock_irqrestore
(
&
adapter
->
tx_lock
,
flags
);
if
(
e1000_tx_csum
(
adapter
,
skb
))
tx_flags
|=
E1000_TX_FLAGS_CSUM
;
...
...
@@ -1428,7 +1464,7 @@ e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
tx_flags
|=
(
vlan_tx_tag_get
(
skb
)
<<
E1000_TX_FLAGS_VLAN_SHIFT
);
}
#endif
count
=
e1000_tx_map
(
adapter
,
skb
);
e1000_tx_queue
(
adapter
,
count
,
tx_flags
);
...
...
@@ -1701,12 +1737,7 @@ e1000_intr(int irq, void *data, struct pt_regs *regs)
}
e1000_clean_rx_irq
(
adapter
);
if
((
icr
&
E1000_ICR_TXDW
)
&&
spin_trylock
(
&
adapter
->
tx_lock
))
{
e1000_clean_tx_irq
(
adapter
);
spin_unlock
(
&
adapter
->
tx_lock
);
}
e1000_clean_tx_irq
(
adapter
);
i
--
;
}
...
...
@@ -1753,8 +1784,6 @@ e1000_clean_tx_irq(struct e1000_adapter *adapter)
i
=
(
i
+
1
)
%
tx_ring
->
count
;
tx_desc
=
E1000_TX_DESC
(
*
tx_ring
,
i
);
adapter
->
trans_finish
=
jiffies
;
}
tx_ring
->
next_to_clean
=
i
;
...
...
@@ -1893,9 +1922,6 @@ e1000_alloc_rx_buffers(struct e1000_adapter *adapter)
int
reserve_len
;
int
i
;
if
(
!
netif_running
(
netdev
))
return
;
reserve_len
=
2
;
i
=
rx_ring
->
next_to_use
;
...
...
@@ -1991,32 +2017,16 @@ e1000_rx_checksum(struct e1000_adapter *adapter,
}
}
/**
* e1000_enable_WOL - Wake On Lan Support (Magic Pkt)
* @adapter: Adapter structure
**/
void
e1000_
enable_WOL
(
struct
e1000_adapter
*
adapter
)
e1000_
read_pci_cfg
(
struct
e1000_hw
*
hw
,
uint32_t
reg
,
uint16_t
*
value
)
{
uint32_t
wuc
;
if
(
adapter
->
hw
.
mac_type
<
e1000_82544
)
return
;
if
(
adapter
->
wol
)
{
wuc
=
E1000_WUC_APME
|
E1000_WUC_PME_EN
|
E1000_WUC_PME_STATUS
|
E1000_WUC_APMPME
;
E1000_WRITE_REG
(
&
adapter
->
hw
,
WUC
,
wuc
);
struct
e1000_adapter
*
adapter
=
hw
->
back
;
E1000_WRITE_REG
(
&
adapter
->
hw
,
WUFC
,
adapter
->
wol
);
}
pci_read_config_word
(
adapter
->
pdev
,
reg
,
value
);
}
void
e1000_write_pci_cfg
(
struct
e1000_hw
*
hw
,
uint32_t
reg
,
uint16_t
*
value
)
e1000_write_pci_cfg
(
struct
e1000_hw
*
hw
,
uint32_t
reg
,
uint16_t
*
value
)
{
struct
e1000_adapter
*
adapter
=
hw
->
back
;
...
...
@@ -2086,10 +2096,10 @@ e1000_vlan_rx_kill_vid(struct net_device *netdev, uint16_t vid)
uint32_t
vfta
,
index
;
e1000_irq_disable
(
adapter
);
if
(
adapter
->
vlgrp
)
adapter
->
vlgrp
->
vlan_devices
[
vid
]
=
NULL
;
e1000_irq_enable
(
adapter
);
/* remove VID from filter table*/
...
...
@@ -2101,4 +2111,93 @@ e1000_vlan_rx_kill_vid(struct net_device *netdev, uint16_t vid)
}
#endif
static
int
e1000_notify_reboot
(
struct
notifier_block
*
nb
,
unsigned
long
event
,
void
*
p
)
{
struct
pci_dev
*
pdev
=
NULL
;
switch
(
event
)
{
case
SYS_DOWN
:
case
SYS_HALT
:
case
SYS_POWER_OFF
:
pci_for_each_dev
(
pdev
)
{
if
(
pci_dev_driver
(
pdev
)
==
&
e1000_driver
)
e1000_suspend
(
pdev
,
3
);
}
}
return
NOTIFY_DONE
;
}
static
int
e1000_suspend
(
struct
pci_dev
*
pdev
,
uint32_t
state
)
{
struct
net_device
*
netdev
=
pci_get_drvdata
(
pdev
);
struct
e1000_adapter
*
adapter
=
netdev
->
priv
;
uint32_t
ctrl
,
ctrl_ext
,
rctl
;
netif_device_detach
(
netdev
);
if
(
netif_running
(
netdev
))
e1000_down
(
adapter
);
if
(
adapter
->
wol
)
{
e1000_setup_rctl
(
adapter
);
e1000_set_multi
(
netdev
);
if
(
adapter
->
wol
&
E1000_WUFC_MC
)
{
rctl
=
E1000_READ_REG
(
&
adapter
->
hw
,
RCTL
);
rctl
|=
E1000_RCTL_MPE
;
E1000_WRITE_REG
(
&
adapter
->
hw
,
RCTL
,
rctl
);
}
if
(
adapter
->
hw
.
media_type
==
e1000_media_type_fiber
)
{
#define E1000_CTRL_ADVD3WUC 0x00100000
ctrl
=
E1000_READ_REG
(
&
adapter
->
hw
,
CTRL
);
ctrl
|=
E1000_CTRL_ADVD3WUC
;
E1000_WRITE_REG
(
&
adapter
->
hw
,
CTRL
,
ctrl
);
ctrl_ext
=
E1000_READ_REG
(
&
adapter
->
hw
,
CTRL_EXT
);
ctrl_ext
|=
E1000_CTRL_EXT_SDP7_DATA
;
E1000_WRITE_REG
(
&
adapter
->
hw
,
CTRL_EXT
,
ctrl_ext
);
}
E1000_WRITE_REG
(
&
adapter
->
hw
,
WUC
,
0
);
E1000_WRITE_REG
(
&
adapter
->
hw
,
WUFC
,
adapter
->
wol
);
pci_enable_wake
(
pdev
,
3
,
1
);
}
else
{
E1000_WRITE_REG
(
&
adapter
->
hw
,
WUC
,
0
);
E1000_WRITE_REG
(
&
adapter
->
hw
,
WUFC
,
0
);
pci_enable_wake
(
pdev
,
3
,
0
);
}
pci_save_state
(
pdev
,
adapter
->
pci_state
);
pci_set_power_state
(
pdev
,
3
);
return
0
;
}
#ifdef CONFIG_PM
static
int
e1000_resume
(
struct
pci_dev
*
pdev
)
{
struct
net_device
*
netdev
=
pci_get_drvdata
(
pdev
);
struct
e1000_adapter
*
adapter
=
netdev
->
priv
;
pci_set_power_state
(
pdev
,
0
);
pci_restore_state
(
pdev
,
adapter
->
pci_state
);
pci_enable_wake
(
pdev
,
0
,
0
);
/* Clear the wakeup status bits */
E1000_WRITE_REG
(
&
adapter
->
hw
,
WUS
,
~
0
);
if
(
netif_running
(
netdev
))
e1000_up
(
adapter
);
netif_device_attach
(
netdev
);
return
0
;
}
#endif
/* e1000_main.c */
drivers/net/e1000/e1000_osdep.h
View file @
4e130235
...
...
@@ -86,12 +86,14 @@
#include <linux/interrupt.h>
#define usec_delay(x) udelay(x)
#ifndef msec_delay
#define msec_delay(x) do { if(in_interrupt()) { \
mdelay(x); \
} else { \
set_current_state(TASK_UNINTERRUPTIBLE); \
schedule_timeout((x * HZ)/1000); \
} } while(0)
#endif
#define PCI_COMMAND_REGISTER PCI_COMMAND
#define CMD_MEM_WRT_INVALIDATE PCI_COMMAND_INVALIDATE
...
...
drivers/net/eepro100.c
View file @
4e130235
...
...
@@ -524,10 +524,8 @@ static const char is_mii[] = { 0, 1, 1, 0, 1, 1, 0, 1 };
static
int
eepro100_init_one
(
struct
pci_dev
*
pdev
,
const
struct
pci_device_id
*
ent
);
static
void
eepro100_remove_one
(
struct
pci_dev
*
pdev
);
#ifdef CONFIG_PM
static
int
eepro100_suspend
(
struct
pci_dev
*
pdev
,
u32
state
);
static
int
eepro100_resume
(
struct
pci_dev
*
pdev
);
#endif
static
int
do_eeprom_cmd
(
long
ioaddr
,
int
cmd
,
int
cmd_len
);
static
int
mdio_read
(
long
ioaddr
,
int
phy_id
,
int
location
);
...
...
drivers/net/pcnet32.c
View file @
4e130235
...
...
@@ -845,8 +845,9 @@ pcnet32_open(struct net_device *dev)
if
(
lp
->
options
==
(
PCNET32_PORT_FD
|
PCNET32_PORT_AUI
))
val
|=
2
;
}
else
if
(
lp
->
options
&
PCNET32_PORT_ASEL
)
{
/* workaround for xSeries250 */
val
|=
3
;
/* workaround of xSeries250, turn on for 79C975 only */
i
=
((
lp
->
a
.
read_csr
(
ioaddr
,
88
)
|
(
lp
->
a
.
read_csr
(
ioaddr
,
89
)
<<
16
))
>>
12
)
&
0xffff
;
if
(
i
==
0x2627
)
val
|=
3
;
}
lp
->
a
.
write_bcr
(
ioaddr
,
9
,
val
);
}
...
...
include/linux/ethtool.h
View file @
4e130235
...
...
@@ -4,6 +4,9 @@
* Copyright (C) 1998 David S. Miller (davem@redhat.com)
* Copyright 2001 Jeff Garzik <jgarzik@mandrakesoft.com>
* Portions Copyright 2001 Sun Microsystems (thockin@sun.com)
* Portions Copyright 2002 Intel (eli.kupermann@intel.com,
* christopher.leech@intel.com,
* scott.feldman@intel.com)
*/
#ifndef _LINUX_ETHTOOL_H
...
...
@@ -268,6 +271,7 @@ struct ethtool_test {
* (ethtool_value), priv. */
#define ETHTOOL_TEST 0x0000001a
/* execute NIC self-test, priv. */
#define ETHTOOL_GSTRINGS 0x0000001b
/* get specified string set */
#define ETHTOOL_PHYS_ID 0x0000001c
/* identify the NIC */
/* compatibility with older code */
#define SPARC_ETH_GSET ETHTOOL_GSET
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment