Skip to content
Extraits de code Groupes Projets
Valider cbbe7795 rédigé par eddietwo's avatar eddietwo
Parcourir les fichiers

add initial version of 5.7.6 driver

parent 90b65b8a
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Affichage de
avec 17556 ajouts et 0 suppression
"This software program is licensed subject to the GNU General Public License
(GPL). Version 2, June 1991, available at
<http://www.fsf.org/copyleft/gpl.html>"
GNU General Public License
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
Everyone is permitted to copy and distribute verbatim copies of this license
document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your freedom to
share and change it. By contrast, the GNU General Public License is intended
to guarantee your freedom to share and change free software--to make sure
the software is free for all its users. This General Public License applies
to most of the Free Software Foundation's software and to any other program
whose authors commit to using it. (Some other Free Software Foundation
software is covered by the GNU Library General Public License instead.) You
can apply it to your programs, too.
When we speak of free software, we are referring to freedom, not price. Our
General Public Licenses are designed to make sure that you have the freedom
to distribute copies of free software (and charge for this service if you
wish), that you receive source code or can get it if you want it, that you
can change the software or use pieces of it in new free programs; and that
you know you can do these things.
To protect your rights, we need to make restrictions that forbid anyone to
deny you these rights or to ask you to surrender the rights. These
restrictions translate to certain responsibilities for you if you distribute
copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether gratis or
for a fee, you must give the recipients all the rights that you have. You
must make sure that they, too, receive or can get the source code. And you
must show them these terms so they know their rights.
We protect your rights with two steps: (1) copyright the software, and (2)
offer you this license which gives you legal permission to copy, distribute
and/or modify the software.
Also, for each author's protection and ours, we want to make certain that
everyone understands that there is no warranty for this free software. If
the software is modified by someone else and passed on, we want its
recipients to know that what they have is not the original, so that any
problems introduced by others will not reflect on the original authors'
reputations.
Finally, any free program is threatened constantly by software patents. We
wish to avoid the danger that redistributors of a free program will
individually obtain patent licenses, in effect making the program
proprietary. To prevent this, we have made it clear that any patent must be
licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and modification
follow.
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains a notice
placed by the copyright holder saying it may be distributed under the
terms of this General Public License. The "Program", below, refers to any
such program or work, and a "work based on the Program" means either the
Program or any derivative work under copyright law: that is to say, a
work containing the Program or a portion of it, either verbatim or with
modifications and/or translated into another language. (Hereinafter,
translation is included without limitation in the term "modification".)
Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of running
the Program is not restricted, and the output from the Program is covered
only if its contents constitute a work based on the Program (independent
of having been made by running the Program). Whether that is true depends
on what the Program does.
1. You may copy and distribute verbatim copies of the Program's source code
as you receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice and
disclaimer of warranty; keep intact all the notices that refer to this
License and to the absence of any warranty; and give any other recipients
of the Program a copy of this License along with the Program.
You may charge a fee for the physical act of transferring a copy, and you
may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion of it,
thus forming a work based on the Program, and copy and distribute such
modifications or work under the terms of Section 1 above, provided that
you also meet all of these conditions:
* a) You must cause the modified files to carry prominent notices stating
that you changed the files and the date of any change.
* b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any part
thereof, to be licensed as a whole at no charge to all third parties
under the terms of this License.
* c) If the modified program normally reads commands interactively when
run, you must cause it, when started running for such interactive
use in the most ordinary way, to print or display an announcement
including an appropriate copyright notice and a notice that there is
no warranty (or else, saying that you provide a warranty) and that
users may redistribute the program under these conditions, and
telling the user how to view a copy of this License. (Exception: if
the Program itself is interactive but does not normally print such
an announcement, your work based on the Program is not required to
print an announcement.)
These requirements apply to the modified work as a whole. If identifiable
sections of that work are not derived from the Program, and can be
reasonably considered independent and separate works in themselves, then
this License, and its terms, do not apply to those sections when you
distribute them as separate works. But when you distribute the same
sections as part of a whole which is a work based on the Program, the
distribution of the whole must be on the terms of this License, whose
permissions for other licensees extend to the entire whole, and thus to
each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of a
storage or distribution medium does not bring the other work under the
scope of this License.
3. You may copy and distribute the Program (or a work based on it, under
Section 2) in object code or executable form under the terms of Sections
1 and 2 above provided that you also do one of the following:
* a) Accompany it with the complete corresponding machine-readable source
code, which must be distributed under the terms of Sections 1 and 2
above on a medium customarily used for software interchange; or,
* b) Accompany it with a written offer, valid for at least three years,
to give any third party, for a charge no more than your cost of
physically performing source distribution, a complete machine-
readable copy of the corresponding source code, to be distributed
under the terms of Sections 1 and 2 above on a medium customarily
used for software interchange; or,
* c) Accompany it with the information you received as to the offer to
distribute corresponding source code. (This alternative is allowed
only for noncommercial distribution and only if you received the
program in object code or executable form with such an offer, in
accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source code
means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to control
compilation and installation of the executable. However, as a special
exception, the source code distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on which
the executable runs, unless that component itself accompanies the
executable.
If distribution of executable or object code is made by offering access
to copy from a designated place, then offering equivalent access to copy
the source code from the same place counts as distribution of the source
code, even though third parties are not compelled to copy the source
along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program except as
expressly provided under this License. Any attempt otherwise to copy,
modify, sublicense or distribute the Program is void, and will
automatically terminate your rights under this License. However, parties
who have received copies, or rights, from you under this License will not
have their licenses terminated so long as such parties remain in full
compliance.
5. You are not required to accept this License, since you have not signed
it. However, nothing else grants you permission to modify or distribute
the Program or its derivative works. These actions are prohibited by law
if you do not accept this License. Therefore, by modifying or
distributing the Program (or any work based on the Program), you
indicate your acceptance of this License to do so, and all its terms and
conditions for copying, distributing or modifying the Program or works
based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further restrictions
on the recipients' exercise of the rights granted herein. You are not
responsible for enforcing compliance by third parties to this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot distribute
so as to satisfy simultaneously your obligations under this License and
any other pertinent obligations, then as a consequence you may not
distribute the Program at all. For example, if a patent license would
not permit royalty-free redistribution of the Program by all those who
receive copies directly or indirectly through you, then the only way you
could satisfy both it and this License would be to refrain entirely from
distribution of the Program.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is implemented
by public license practices. Many people have made generous contributions
to the wide range of software distributed through that system in
reliance on consistent application of that system; it is up to the
author/donor to decide if he or she is willing to distribute software
through any other system and a licensee cannot impose that choice.
This section is intended to make thoroughly clear what is believed to be
a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in certain
countries either by patents or by copyrighted interfaces, the original
copyright holder who places the Program under this License may add an
explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions of
the General Public License from time to time. Such new versions will be
similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Program does not specify a version
number of this License, you may choose any version ever published by the
Free Software Foundation.
10. If you wish to incorporate parts of the Program into other free programs
whose distribution conditions are different, write to the author to ask
for permission. For software which is copyrighted by the Free Software
Foundation, write to the Free Software Foundation; we sometimes make
exceptions for this. Our decision will be guided by the two goals of
preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH
YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
NECESSARY SERVICING, REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR
DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL
DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM
(INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED
INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF
THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR
OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it free
software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest to
attach them to the start of each source file to most effectively convey the
exclusion of warranty; and each file should have at least the "copyright"
line and a pointer to where the full notice is found.
one line to give the program's name and an idea of what it does.
Copyright (C) yyyy name of author
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option)
any later version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc., 59
Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this when
it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author Gnomovision comes
with ABSOLUTELY NO WARRANTY; for details type 'show w'. This is free
software, and you are welcome to redistribute it under certain conditions;
type 'show c' for details.
The hypothetical commands 'show w' and 'show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may be
called something other than 'show w' and 'show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
'Gnomovision' (which makes passes at compilers) written by James Hacker.
signature of Ty Coon, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General Public
License instead of this License.
Ce diff est replié.
.\" 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.
.\"
.TH e1000 1 "August 18, 2004"
.SH NAME
e1000 \-This file describes the Linux* Base Driver for the Intel(R) PRO/1000 Family of Adapters.
.SH SYNOPSIS
.PD 0.4v
modprobe e1000 [<option>=<VAL1>,<VAL2>,...]
.br
insmod e1000 [<option>=<VAL1>,<VAL2>,...]
.PD 1v
.LP
.SH DESCRIPTION
This driver is intended for \fB2.4.x\fR and \fB2.6.x\fR kernels. Intel focused testing on Intel architectures running the \fB2.4.21\fR kernel. This driver includes support for Itanium(TM)2 and EM64T systems.
.LP
This driver is only supported as a loadable module at this time. Intel is not supplying patches against the kernel source to allow for static linking of the driver. For questions related to hardware requirements, refer to the documentation supplied with your Intel PRO/1000 adapter. All hardware requirements listed apply to use with Linux.
.LP
.SH OPTIONS
The following optional 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:
.IP
.B modprobe e1000 TxDescriptors=80,128
.LP
loads the e1000 driver with 80 TX descriptors for the first adapter and 128 TX descriptors for the second adapter.
.PP
.LP
.B AutoNeg
.IP
.B Valid Range:
0x01-0x0F, 0x20-0x2F
.br
.B Default Value:
0x2F
.IP
bit mask that specifies which speed and duplex settings the board advertises. When AutoNeg is not set to the default, the Speed and Duplex parameters must not be specified. This parameter only applies to adapters using copper connections.
.IP
See the section "Speed and Duplex Configuration" in Readme.
.LP
.B Duplex
.IP
.B Valid Range:
0-2 (0=auto-negotiate, 1=half, 2=full)
.br
.B Default Value:
0
.IP
defines the direction in which data is allowed to flow. Can by either one or two-directional. If both Duplex and the link partner are set to auto-negotiate, the board auto-detects the correct duplex. If the link partner is forced (either full or half), Duplex defaults to half-duplex. This parameter only applies to adapters using copper connections.
.IP
See the section "Speed and Duplex Configuration" in Readme.
.LP
.B FlowControl
.IP
.B Valid Range:
0-3 (0 = none, 1 = Rx only, 2 = Tx only, 3 = Rx and Tx)
.br
.B Default Value:
Read flow control settings from the EEPROM
.IP
controls the automatic generation(Tx) and response(Rx) to Ethernet PAUSE frames.
.LP
.B InterruptThrottleRate
.IP
.B Valid Range:
100-100000 (0=off, 1=dynamic)
.IP
.B Default Value:
8000
.IP
represents the maximum number of interrupts per second the controller generates. InterruptThrottleRate is another setting used in interrupt moderation. Dynamic mode uses a heuristic algorithm to adjust InterruptThrottleRate based on the current traffic load.
.IP
Un-supported Adapters: InterruptThrottleRate is NOT supported by 82542, 82543 or 82544-based adapters.
.IP
NOTE: InterruptThrottleRate takes precedence over the TxAbsIntDelay and RxAbsIntDelay parameters. In other words, minimizing the receive and/or transmit absolute delays does not force the controller to generate more interrupts than what the Interrupt Throttle Rate allows.
.IP
See the section "InterruptThrottleRate" in Readme.
.LP
.B RxDescriptors
.IP
.B Valid Range:
80-256 for 82542 and 82543-based adapters, 80-4096 for all other supported adapters
.br
.B Default Value:
256
.IP
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. The maximum MTU size is 16110.
.IP
NOTE: MTU designates the frame size. It only needs to be set for Jumbo Frames.
.LP
.B RxIntDelay
.IP
.B Valid Range:
0-65535 (0=off)
.br
.B Default Value:
0
.IP
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 may be set too high, causing the driver to run out of available receive descriptors.
.IP
CAUTION: When setting RxIntDelay to a value other than 0, adapters may hang (stop transmitting) under certain network conditions. If this occurs a NETDEV WATCHDOG 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 ensure that RxIntDelay is set to zero.
.LP
.B RxAbsIntDelay
(82540, 82545, and later adapters only)
.IP
.B Valid Range:
0-65535 (0=off)
.br
.B Default Value:
128
.IP
limits the delay in which a receive interrupt is generated (in units of 1.024 microseconds). Useful only if RxIntDelay is non-zero, this value ensures that an interrupt is generated after the initial packet is received within the set amount of time. Proper tuning, along with RxIntDelay, may improve traffic throughput in specific network conditions.
.LP
.B Speed
.IP
.B Valid Settings:
0, 10, 100, 1000
.br
.B Default Value:
0 (auto-negotiate at all supported speeds)
.IP
forces the line speed to the specified value in megabits per second (Mbps). If this parameter is not specified or is set to 0 and the link partner is set to auto-negotiate, the board auto-detects the correct speed. Duplex must also be set when Speed is set to either 10 or 100. This parameter only applies to adapters using copper connections.
.IP
See the section "Speed and Duplex Configuration" in Readme.
.LP
.B TxIntDelay
.IP
.B Valid Range:
0-65535 (0=off)
.br
.B Default Value:
64
.IP
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.
.LP
.B TxAbsIntDelay
(82540, 82545, and later adapters only)
.IP
.B Valid Range:
0-65535 (0=off)
.br
.B Default Value:
64
.IP
limits the delay in which a transmit interrupt is generated (in units of 1.024 microseconds). Useful only if TxIntDelay is non-zero, this value ensures that an interrupt is generated after the initial packet is sent on the wire within the set amount of time. Proper tuning, along with TxIntDelay, may improve traffic throughput in specific network conditions.
.LP
.B TxDescriptors
.IP
.B Valid Range:
80-256 for 82542 and 82543-based adapters, 80-4096 for all other supported adapters
.br
.B Default Value:
1024 for all other supported adapters
.IP
number of transmit descriptors allocated by the driver. Increasing this value allows the driver to queue more transmits. Each descriptor is 16 bytes.
.LP
.B XsumRX
.IP
.B Valid Range:
0-1
.br
.B Default Value:
1
.IP
enables IP checksum offload for received packets (both UDP and TCP) to the adapter hardware when set to 1. This parameter is not available on the 82542-based adapter.
.LP
.SH JUMBO FRAMES
.LP
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:
.IP
ifconfig ethx mtu 9000 up
.LP
NOTE: Jumbo Frames are supported at 1000 Mbps only. Using Jumbo Frames at 10 or 100 Mbps may result in poor performance or loss of link.
.SH Ethtool
.LP
The driver utilizes the ethtool interface for driver configuration and diagnostics, as well as displaying statistical information. Ethtool version 1.8.1 or later is required for this functionality.
.LP
The latest release of ethtool can be found from 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.
.LP
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.
.SH NAPI
.LP
NAPI (Rx polling mode) is supported in the e1000 driver. NAPI is enabled or disabled based on the configuration of the kernel. To enable NAPI, compile the driver module, passing in a configuration option:
.IP
make CFLAGS_EXTRA=-DCONFIG_E1000_NAPI install
.IP
To disable NAPI, compile the driver module, passing in the configuration option:
.IP
make CFLAGS_EXTRA=-DCONFIG_NO_E1000_NAPI install
.LP
See www.cyberus.ca/~hadi/usenix-paper.tgz for more information on NAPI.
.SH SUPPORT
.LP
For additional information, including supported adapters, building, and installation, see the Readme file included with the driver.
.LP
For general information, go to the Intel support website at:
.IP
.B http://support.intel.com
.LP
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.
.LP
Name: e1000
Summary: Intel(R) PRO/1000 driver for Linux
Version: 5.7.6
Release: 1
Source: %{name}-%{version}.tar.gz
Vendor: Intel Corporation
License: GPL
ExclusiveOS: linux
Group: System Environment/Kernel
Provides: %{name}
URL: http://support.intel.com/support/go/linux/e1000.htm
BuildRoot: %{_tmppath}/%{name}-%{version}-root
# macros for finding system files to update at install time (pci.ids, pcitable)
%define find() %(for f in %*; do if [ -e $f ]; then echo $f; break; fi; done)
%define _pciids /usr/share/pci.ids /usr/share/hwdata/pci.ids
%define _pcitable /usr/share/kudzu/pcitable /usr/share/hwdata/pcitable /dev/null
%define pciids %find %{_pciids}
%define pcitable %find %{_pcitable}
Requires: kernel, fileutils, findutils, gawk, bash
%description
This package contains the Linux driver for the
Intel(R) PRO/1000 Family of Server Adapters.
%prep
%setup
%build
mkdir -p %{buildroot}
SwitchRHKernel () {
CFLAGS_EXTRA=""
for K in $2 ; do
if [ $K == $1 ] ; then
CFLAGS_EXTRA="$CFLAGS_EXTRA -D__BOOT_KERNEL_$K=1"
else
CFLAGS_EXTRA="$CFLAGS_EXTRA -D__BOOT_KERNEL_$K=0"
fi
done
}
KV=$(uname -r)
KSP="/lib/modules/$KV/build
/usr/src/linux-$KV
/usr/src/linux-$(echo $KV | sed 's/-.*//')
/usr/src/kernel-headers-$KV
/usr/src/kernel-source-$KV
/usr/src/linux-$(echo $KV | sed 's/\([0-9]*\.[0-9]*\)\..*/\1/')
/usr/src/linux"
KSRC=$(for d in $KSP ; do [ -e $d/include/linux ] && echo $d; echo; done)
KSRC=$(echo $KSRC | awk '{ print $1 }')
if [ -e $KSRC/include/linux/rhconfig.h ] ; then
RHKL=$(grep 'BOOT_KERNEL_.* [01]' /boot/kernel.h |
sed 's/.*BOOT_KERNEL_\(.*\) [01]/\1/')
if echo $RHKL | grep BIGMEM
then
RHKL=$(echo $RHKL | sed 's/ENTERPRISE//')
fi
if echo $RHKL | grep HUGEMEM
then
RHKL=$(echo $RHKL | sed 's/BIGMEM//')
fi
for K in $RHKL ; do
SwitchRHKernel $K "$RHKL"
make -C src clean
make -C src INSTALL_MOD_PATH=%{buildroot} \
MANDIR=%{_mandir} CFLAGS_EXTRA="$CFLAGS_EXTRA" install
done
else
make -C src clean
make -C src INSTALL_MOD_PATH=%{buildroot} MANDIR=%{_mandir} install
fi
%install
# Append .new to driver name to avoid conflict with kernel RPM
cd %{buildroot}
find lib -name "e1000.*o" -exec mv {} {}.new \; \
-fprintf %{_builddir}/%{name}-%{version}/file.list "/%p.new\n"
%clean
rm -rf %{buildroot}
%files -f %{_builddir}/%{name}-%{version}/file.list
%defattr(-,root,root)
%{_mandir}/man7/e1000.7.gz
%doc LICENSE
%doc README
%doc ldistrib.txt
%doc file.list
%post
FL="%{_docdir}/%{name}-%{version}/file.list
%{_docdir}/%{name}/file.list"
FL=$(for d in $FL ; do if [ -e $d ]; then echo $d; break; fi; done)
if [ -d /usr/local/lib/%{name} ]; then
rm -rf /usr/local/lib/%{name}
fi
# Save old drivers (aka .o and .o.gz)
for k in $(sed 's/\/lib\/modules\/\([0-9a-zA-Z\.\-]*\).*/\1/' $FL) ;
do
d_drivers=/lib/modules/$k
d_usr=/usr/local/lib/%{name}/$k
mkdir -p $d_usr
cd $d_drivers; find . -name %{name}.*o -exec cp --parents {} $d_usr \; -exec rm -f {} \;
cd $d_drivers; find . -name %{name}_*.*o -exec cp --parents {} $d_usr \; -exec rm -f {} \;
cd $d_drivers; find . -name %{name}.*o.gz -exec cp --parents {} $d_usr \; -exec rm -f {} \;
cd $d_drivers; find . -name %{name}_*.*o.gz -exec cp --parents {} $d_usr \; -exec rm -f {} \;
done
# Add driver link
for f in $(sed 's/\.new$//' $FL) ; do
ln -f $f.new $f
done
# Check if kernel version rpm was built on IS the same as running kernel
BK_LIST=$(sed 's/\/lib\/modules\/\([0-9a-zA-Z\.\-]*\).*/\1/' $FL)
MATCH=no
for i in $BK_LIST
do
if [ $(uname -r) == $i ] ; then
MATCH=yes
break
fi
done
if [ $MATCH == no ] ; then
echo -n "WARNING: Running kernel is $(uname -r). "
echo -n "RPM supports kernels ( "
for i in $BK_LIST
do
echo -n "$i "
done
echo ")"
fi
if [ -f /etc/redhat-release ] ; then
cat <<END > %{_docdir}/%{name}-%{version}/pci.updates
# updates for the system pci.ids file
#
# IMPORTANT! Entries in this list must be sorted as they
# would appear in the system pci.ids file. Entries
# are sorted by ven, dev, subven, subdev
# (numerical order).
#
8086 Intel Corp.
1000 82542 Gigabit Ethernet Controller
0e11 b0df NC1632 Gigabit Ethernet Adapter (1000-SX)
0e11 b0e0 NC1633 Gigabit Ethernet Adapter (1000-LX)
0e11 b123 NC1634 Gigabit Ethernet Adapter (1000-SX)
1014 0119 Netfinity Gigabit Ethernet SX Adapter
8086 1000 PRO/1000 Gigabit Server Adapter
1001 82543GC Gigabit Ethernet Controller (Fiber)
0e11 004a NC6136 Gigabit Server Adapter
1014 01ea Netfinity Gigabit Ethernet SX Adapter
8086 1003 PRO/1000 F Server Adapter
1004 82543GC Gigabit Ethernet Controller (Copper)
0e11 0049 NC7132 Gigabit Upgrade Module
0e11 b1a4 NC7131 Gigabit Server Adapter
1014 10f2 Gigabit Ethernet Server Adapter
8086 1004 PRO/1000 T Server Adapter
8086 2004 PRO/1000 T Server Adapter
1008 82544EI Gigabit Ethernet Controller (Copper)
1014 0269 iSeries 1000/100/10 Ethernet Adapter
1028 011c PRO/1000 XT Network Connection
8086 1107 PRO/1000 XT Server Adapter
8086 2107 PRO/1000 XT Server Adapter
8086 2110 PRO/1000 XT Server Adapter
8086 3108 PRO/1000 XT Network Connection
1009 82544EI Gigabit Ethernet Controller (Fiber)
1014 0268 iSeries Gigabit Ethernet Adapter
8086 1109 PRO/1000 XF Server Adapter
8086 2109 PRO/1000 XF Server Adapter
100c 82544GC Gigabit Ethernet Controller (Copper)
8086 1112 PRO/1000 T Desktop Adapter
8086 2112 PRO/1000 T Desktop Adapter
100d 82544GC Gigabit Ethernet Controller (LOM)
1028 0123 PRO/1000 XT Network Connection
107b 891f 82544GC Based Network Connection
8086 110d 82544GC Based Network Connection
100e 82540EM Gigabit Ethernet Controller
1014 0265 PRO/1000 MT Network Connection
1014 0267 PRO/1000 MT Network Connection
1014 026a PRO/1000 MT Network Connection
107b 8920 PRO/1000 MT Desktop Adapter
8086 001e PRO/1000 MT Desktop Adapter
8086 002e PRO/1000 MT Desktop Adapter
100f 82545EM Gigabit Ethernet Controller (Copper)
1014 0269 iSeries 1000/100/10 Ethernet Adapter
1014 028e PRO/1000 MT Network Connection
8086 1000 PRO/1000 MT Network Connection
8086 1001 PRO/1000 MT Server Adapter
1010 82546EB Gigabit Ethernet Controller (Copper)
1014 027c PRO/1000 MT Dual Port Network Adapter
8086 1011 PRO/1000 MT Dual Port Server Adapter
8086 1012 PRO/1000 MT Dual Port Server Adapter
8086 101a PRO/1000 MT Dual Port Network Adapter
1011 82545EM Gigabit Ethernet Controller (Fiber)
1014 0268 iSeries Gigabit Ethernet Adapter
8086 1002 PRO/1000 MF Server Adapter
8086 1003 PRO/1000 MF Server Adapter (LX)
1012 82546EB Gigabit Ethernet Controller (Fiber)
8086 1012 PRO/1000 MF Dual Port Server Adapter
1013 82541EI Gigabit Ethernet Controller
8086 1013 PRO/1000 MT Desktop Adapter
1015 82540EM Gigabit Ethernet Controller (LOM)
8086 1015 PRO/1000 MT Mobile Connection
1016 82540EP Gigabit Ethernet Controller
1014 052c PRO/1000 MT Mobile Connection
1179 0001 PRO/1000 MT Mobile Connection
8086 1016 PRO/1000 MT Mobile Connection
1017 82540EP Gigabit Ethernet Controller
8086 1017 PR0/1000 MT Desktop Connection
1018 82541EI Gigabit Ethernet Controller
8086 1018 PRO/1000 MT Desktop Adapter
1019 82547EI Gigabit Ethernet Controller
8086 1019 PRO/1000 CT Desktop Connection
101d 82546EB Gigabit Ethernet Controller
8086 1000 PRO/1000 MT Quad Port Server Adapter
101e 82540EP Gigabit Ethernet Controller
1014 0549 PRO/1000 MT Mobile Connection
8086 101e PRO/1000 MT Mobile Connection
1026 82545GM Gigabit Ethernet Controller
8086 1000 PRO/1000 MT Server Connection
8086 1001 PRO/1000 MT Server Adapter
8086 1002 PRO/1000 MT Server Adapter
8086 1026 PRO/1000 MT Server Connection
1027 82545GM Gigabit Ethernet Controller
8086 1001 PRO/1000 MF Server Adapter(LX)
8086 1002 PRO/1000 MF Server Adapter(LX)
8086 1003 PRO/1000 MF Server Adapter(LX)
8086 1027 PRO/1000 MF Server Adapter
1028 82545GM Gigabit Ethernet Controller
8086 1028 PRO/1000 MB Server Adapter
1075 82547GI Gigabit Ethernet Controller
8086 0075 PRO/1000 CT Network Connection
8086 1075 PRO/1000 CT Network Connection
1076 82541GI/PI Gigabit Ethernet Controller
8086 0076 PRO/1000 MT Network Connection
8086 1076 PRO/1000 MT Network Connection
8086 1176 PRO/1000 MT Desktop Adapter
8086 1276 PRO/1000 MT Network Adapter
1077 82541GI Gigabit Ethernet Controller
1179 0001 PRO/1000 MT Mobile Connection
8086 0077 PRO/1000 MT Mobile Connection
8086 1077 PRO/1000 MT Mobile Connection
1078 82541ER Gigabit Ethernet Controller
8086 1078 PRO/1000 MT Network Connection
1079 82546GB Gigabit Ethernet Controller
8086 0079 PRO/1000 MT Dual Port Network Connection
8086 1079 PRO/1000 MT Dual Port Network Connection
8086 1179 PRO/1000 MT Dual Port Server Adapter
8086 117a PRO/1000 MT Dual Port Server Adapter
107a 82546GB Gigabit Ethernet Controller
8086 107a PRO/1000 MF Dual Port Server Adapter
8086 127a PRO/1000 MF Dual Port Server Adapter
107b 82546GB Gigabit Ethernet Controller
8086 007b PRO/1000 MB Dual Port Server Connection
8086 107b PRO/1000 MB Dual Port Server Connection
107c 82541PI Gigabit Ethernet Controller
8086 1376 PRO/1000 GT Desktop Adapter
8086 1476 PRO/1000 GT Desktop Adapter
108a 82546GB Gigabit Ethernet Controller
8086 108a PRO/1000 P Dual Port Server Adapter
8086 118a PRO/1000 P Dual Port Server Adapter
END
#Yes, this really needs bash
bash -s %{pciids} \
%{pcitable} \
%{_docdir}/%{name}-%{version}/pci.updates \
%{_docdir}/%{name}-%{version}/pci.ids.new \
%{_docdir}/%{name}-%{version}/pcitable.new \
%{name} \
<<"END"
#! /bin/bash
# $1 = system pci.ids file to update
# $2 = system pcitable file to update
# $3 = file with new entries in pci.ids file format
# $4 = pci.ids output file
# $5 = pcitable output file
# $6 = driver name for use in pcitable file
exec 3<$1
exec 4<$2
exec 5<$3
exec 6>$4
exec 7>$5
driver=$6
IFS=
# pattern matching strings
ID="[[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]]"
VEN="${ID}*"
DEV=" ${ID}*"
SUB=" ${ID}*"
TABLE_DEV="0x${ID} 0x${ID} \"*"
TABLE_SUB="0x${ID} 0x${ID} 0x${ID} 0x${ID} \"*"
line=
table_line=
ids_in=
table_in=
vendor=
device=
subdev=
subdev=
ven_str=
dev_str=
sub_str=
# force a sub-shell to fork with a new stdin
# this is needed if the shell is reading these instructions from stdin
while true
do
# get the first line of each data file to jump start things
exec 0<&3
read -r ids_in
exec 0<&4
read -r table_in
# outer loop reads lines from the updates file
exec 0<&5
while read -r line
do
# vendor entry
if [[ $line == $VEN ]]
then
vendor=0x${line:0:4}
ven_str=${line#${line:0:6}}
# add entry to pci.ids
exec 0<&3
exec 1>&6
while [[ $ids_in != $VEN ||
0x${ids_in:0:4} < $vendor ]]
do
echo "$ids_in"
read -r ids_in
done
echo "$line"
if [[ 0x${ids_in:0:4} == $vendor ]]
then
read -r ids_in
fi
# device entry
elif [[ $line == $DEV ]]
then
device=0x${line:1:4}
dev_str=${line#${line:0:7}}
table_line="$vendor $device \"$driver\" \"$ven_str|$dev_str\""
# add entry to pci.ids
exec 0<&3
exec 1>&6
while [[ $ids_in != $DEV ||
0x${ids_in:1:4} < $device ]]
do
if [[ $ids_in == $VEN ]]
then
break
fi
echo "$ids_in"
read -r ids_in
done
echo "$line"
if [[ 0x${ids_in:1:4} == $device ]]
then
read -r ids_in
fi
# add entry to pcitable
exec 0<&4
exec 1>&7
while [[ $table_in != $TABLE_DEV ||
${table_in:0:6} < $vendor ||
( ${table_in:0:6} == $vendor &&
${table_in:7:6} < $device ) ]]
do
echo "$table_in"
read -r table_in
done
echo "$table_line"
if [[ ${table_in:0:6} == $vendor &&
${table_in:7:6} == $device ]]
then
read -r table_in
fi
# subsystem entry
elif [[ $line == $SUB ]]
then
subven=0x${line:2:4}
subdev=0x${line:7:4}
sub_str=${line#${line:0:13}}
table_line="$vendor $device $subven $subdev \"$driver\" \"$ven_str|$sub_str\""
# add entry to pci.ids
exec 0<&3
exec 1>&6
while [[ $ids_in != $SUB ||
0x${ids_in:2:4} < $subven ||
( 0x${ids_in:2:4} == $subven &&
0x${ids_in:7:4} < $subdev ) ]]
do
if [[ $ids_in == $VEN ||
$ids_in == $DEV ]]
then
break
fi
if [[ ! (${ids_in:2:4} == "1014" &&
${ids_in:7:4} == "052C") ]]
then
echo "$ids_in"
fi
read -r ids_in
done
echo "$line"
if [[ 0x${ids_in:2:4} == $subven &&
0x${ids_in:7:4} == $subdev ]]
then
read -r ids_in
fi
# add entry to pcitable
exec 0<&4
exec 1>&7
while [[ $table_in != $TABLE_SUB ||
${table_in:14:6} < $subven ||
( ${table_in:14:6} == $subven &&
${table_in:21:6} < $subdev ) ]]
do
if [[ $table_in == $TABLE_DEV ]]
then
break
fi
if [[ ! (${table_in:14:6} == "0x1014" &&
${table_in:21:6} == "0x052C") ]]
then
echo "$table_in"
fi
read -r table_in
done
echo "$table_line"
if [[ ${table_in:14:6} == $subven &&
${table_in:21:6} == $subdev ]]
then
read -r table_in
fi
fi
exec 0<&5
done
# print the remainder of the original files
exec 0<&3
exec 1>&6
echo "$ids_in"
while read -r ids_in
do
echo "$ids_in"
done
exec 0>&4
exec 1>&7
echo "$table_in"
while read -r table_in
do
echo "$table_in"
done
break
done <&5
exec 3<&-
exec 4<&-
exec 5<&-
exec 6>&-
exec 7>&-
END
mv -f %{_docdir}/%{name}-%{version}/pci.ids.new %{pciids}
mv -f %{_docdir}/%{name}-%{version}/pcitable.new %{pcitable}
fi
uname -r | grep BOOT || /sbin/depmod -a > /dev/null 2>&1 || true
%preun
# If doing RPM un-install
if [ $1 -eq 0 ] ; then
FL="%{_docdir}/%{name}-%{version}/file.list
%{_docdir}/%{name}/file.list"
FL=$(for d in $FL ; do if [ -e $d ]; then echo $d; break; fi; done)
# Remove driver link
for f in $(sed 's/\.new$//' $FL) ; do
rm -f $f
done
# Restore old drivers
if [ -d /usr/local/lib/%{name} ]; then
cd /usr/local/lib/%{name}; find . -name '%{name}.*o*' -exec cp --parents {} /lib/modules/ \;
cd /usr/local/lib/%{name}; find . -name '%{name}_*.*o*' -exec cp --parents {} /lib/modules/ \;
rm -rf /usr/local/lib/%{name}
fi
fi
%postun
uname -r | grep BOOT || /sbin/depmod -a > /dev/null 2>&1 || true
Using Intel(R) Network Adapters with Linux* --
Information for Specific Linux* Distributions
==============================================
OCTOBER 5, 2004
Contents
========
- SuSE* LINUX Enterprise Server 8 IA64 cause unresolved symbols
- SuSE LINUX Enterprise Server 9 warning message during driver build
- Red Hat* Linux 7.1 - Creating an RPM from tar / zipped File
- ACPI enable may cause Dual Port Pro/1000 adapters to fail
- Linux SNMP: Set operation fails on Red Hat Enterprise Linux 3
- Red Hat Enterprise Linux 2.1 Distribution
- Loading and unloading modules with the Linux 2.6 Kernel
- Support
SuSE LINUX Enterprise Server 8 IA64 cause unresolved symbols
============================================================
If you get unresolved symbol errors when loading the e1000 driver, perform
the following:
1. cd /usr/src/linux
2. make cloneconfig
3. make dep
Then rebuild the driver.
SuSE LINUX Enterprise Server 9 warning message during driver build
==================================================================
While building the driver on SuSE LINUX Enterprise Server 9 installations,
the following warning or something similar may be displayed. It is safe to
ignore this message. The driver will load and function normally.
Symbol version dump /usr/src/<kernel-version>-obj/<arch>/<kernel flavor>/
Module.symvers is missing, modules will have CONFIG_MODVERSIONS disabled.
While loading the driver, ignore the warnings in the syslog:
linux kernel: <driver name>: no version for "struct_module" found: kernel
tainted.
linux kernel: <driver name>: unsupported module, tainting kernel.
Red Hat Linux 7.1 - Creating an RPM from tar / zipped File
==========================================================
When trying to generate an RPM from the .tar.gz file, a segmentation fault
(core dump) occurs. This failure occurs because Red Hat Linux 7.1 uses
version 4.0.2 of the RPM utility. This version does not have the ability to
handle parameterized macros, which are used within the e100 and e1000 spec
files to generate an RPM. Updating the RPM utility to a more current version
resolves the issue. The utility can be obtained from http://www.rpm.org.
ACPI enable may cause Dual Port PRO/1000 Adapters to fail
=========================================================
If ACPI is turned on in the kernel, dual port adapters may not work.
This is due to a limitation in ACPI. Currently, this affects all new
versions of SuSE.
Linux SNMP: Set operation fails on Red Hat Enterprise Linux 3
================================================================
Running the set operation using Red Hat Enterprise Linux 3 fails when
using the net-snmp-5.0.8 package. This issue has been fixed in
net-snmp-5.0.9 package.
Red Hat Enterprise Linux 2.1 Distribution
=========================================
If there are errors while compiling the driver, do the following:
1. Change to the kernel source directory.
2. Perform all the required steps to build the kernel up to and including
make dep.
3. Modify EXTRAVERSION in the Makefile in Red Hat kernel source directory
to match the version of the running kernel.
3. Build the driver, using instructions located in the README file.
While building the driver, ignore the warning:
/lib/modules/2.4.9-e.34/build/include/linux/rhconfig.h:31:60:
operator '(' has no left operand
NOTE: For Red Hat's procedure for building a Linux kernel we recommend
visiting their web site at www.redhat.com.
NOTE: This problem is resolved in Red Hat Enterprise Linux 2.1 Update 4.
Loading and unloading modules with the Linux 2.6 Kernel
=======================================================
A new kernel API has been implemented within the Linux 2.6 kernel regarding
the module reference count. This results in the e100, e1000 and ixgb drivers
being used with a module reference count of zero. Consequently, our driver
module can be removed from the system while still being used by other modules.
Until the other modules within the Linux stack use the new API, unintended
consequences may occur with module removal. This may result in system hangs
and/or panics.
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.
Copyright and Legal Disclaimers
===============================
Copyright(c) 2003 Intel Corporation. All rights reserved.
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
Intel Corporation assumes no responsibility for errors or omissions in this
document. Nor does Intel make any commitment to update the information
contained herein.
Intel, Itanium, and Pentium are trademarks or registered trademarks of Intel
Corporation or its subsidiaries in the United States and other countries.
*Other names and brands may be claimed as the property of others.
################################################################################
#
#
# Copyright(c) 1999 - 2004 Intel Corporation. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2 of the License, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
#
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc., 59
# Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# The full GNU General Public License is included in this distribution in the
# file called LICENSE.
#
# Contact Information:
# Linux NICS <linux.nics@intel.com>
# Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
#
################################################################################
###########################################################################
# Driver files
# core driver files
CFILES = e1000_main.c e1000_hw.c e1000_param.c \
e1000_ethtool.c kcompat.c
HFILES = e1000.h e1000_hw.h e1000_osdep.h kcompat.h
ifeq (,$(BUILD_KERNEL))
BUILD_KERNEL=$(shell uname -r)
endif
###########################################################################
# Environment tests
# Kernel Search Path
# All the places we look for kernel source
KSP := /lib/modules/$(BUILD_KERNEL)/source \
/lib/modules/$(BUILD_KERNEL)/build \
/usr/src/linux-$(BUILD_KERNEL) \
/usr/src/linux-$($(BUILD_KERNEL) | sed 's/-.*//') \
/usr/src/kernel-headers-$(BUILD_KERNEL) \
/usr/src/kernel-source-$(BUILD_KERNEL) \
/usr/src/linux-$($(BUILD_KERNEL) | sed 's/\([0-9]*\.[0-9]*\)\..*/\1/') \
/usr/src/linux
# prune the list down to only values that exist
# and have an include/linux sub-directory
test_dir = $(shell [ -e $(dir)/include/linux ] && echo $(dir))
KSP := $(foreach dir, $(KSP), $(test_dir))
# we will use this first valid entry in the search path
ifeq (,$(KSRC))
KSRC := $(firstword $(KSP))
endif
ifeq (,$(KSRC))
$(error Linux kernel source not found)
else
ifeq (/lib/modules/$(shell uname -r)/source, $(KSRC))
KOBJ := /lib/modules/$(shell uname -r)/build
else
KOBJ := $(KSRC)
endif
endif
# check for version.h and autoconf.h for running kernel in /boot (SUSE)
ifneq (,$(wildcard /boot/vmlinuz.version.h))
VERSION_FILE := /boot/vmlinuz.version.h
CONFIG_FILE := /boot/vmlinuz.autoconf.h
KVER := $(shell $(CC) $(CFLAGS) -E -dM $(VERSION_FILE) | \
grep UTS_RELEASE | awk '{ print $$3 }' | sed 's/\"//g')
ifeq ($(KVER),$(shell uname -r))
# set up include path to override headers from kernel source
x:=$(shell rm -rf include)
x:=$(shell mkdir -p include/linux)
x:=$(shell cp /boot/vmlinuz.version.h include/linux/version.h)
x:=$(shell cp /boot/vmlinuz.autoconf.h include/linux/autoconf.h)
CFLAGS += -I./include
else
VERSION_FILE := $(KOBJ)/include/linux/version.h
CONFIG_FILE := $(KSRC)/include/linux/config.h
endif
else
VERSION_FILE := $(KOBJ)/include/linux/version.h
CONFIG_FILE := $(KSRC)/include/linux/config.h
endif
ifeq (,$(wildcard $(VERSION_FILE)))
$(error Linux kernel source not configured - missing version.h)
endif
ifeq (,$(wildcard $(CONFIG_FILE)))
$(error Linux kernel source not configured - missing config.h)
endif
# pick a compiler
ifneq (,$(findstring egcs-2.91.66, $(shell cat /proc/version)))
CC := kgcc gcc cc
else
CC := gcc cc
endif
test_cc = $(shell which $(cc) > /dev/null 2>&1 && echo $(cc))
CC := $(foreach cc, $(CC), $(test_cc))
CC := $(firstword $(CC))
ifeq (,$(CC))
$(error Compiler not found)
endif
# we need to know what platform the driver is being built on
# some additional features are only built on Intel platforms
ARCH := $(shell uname -m | sed 's/i.86/i386/')
ifeq ($(ARCH),alpha)
CFLAGS += -ffixed-8 -mno-fp-regs
endif
ifeq ($(ARCH),x86_64)
CFLAGS += -mcmodel=kernel -mno-red-zone
endif
ifeq ($(ARCH),ppc)
CFLAGS += -msoft-float
endif
ifeq ($(ARCH),ppc64)
CFLAGS += -m64 -msoft-float
LDFLAGS += -melf64ppc
endif
# standard flags for module builds
CFLAGS += -DLINUX -D__KERNEL__ -DMODULE -O2 -pipe -Wall
CFLAGS += -I$(KSRC)/include -I.
CFLAGS += $(shell [ -f $(KSRC)/include/linux/modversions.h ] && \
echo "-DMODVERSIONS -DEXPORT_SYMTAB \
-include $(KSRC)/include/linux/modversions.h")
CFLAGS += $(CFLAGS_EXTRA)
#ifeq (,$(shell echo $(CFLAGS_EXTRA) | grep NAPI))
#CFLAGS += -DE1000_NO_NAPI
#CFLAGS_EXTRA += -DE1000_NO_NAPI
#endif
RHC := $(KSRC)/include/linux/rhconfig.h
ifneq (,$(wildcard $(RHC)))
# 7.3 typo in rhconfig.h
ifneq (,$(shell $(CC) $(CFLAGS) -E -dM $(RHC) | grep __module__bigmem))
CFLAGS += -D__module_bigmem
endif
endif
# get the kernel version - we use this to find the correct install path
KVER := $(shell $(CC) $(CFLAGS) -E -dM $(VERSION_FILE) | grep UTS_RELEASE | \
awk '{ print $$3 }' | sed 's/\"//g')
KKVER := $(shell echo $(KVER) | \
awk '{ if ($$0 ~ /2\.[4-9]\./) print "1"; else print "0"}')
ifeq ($(KKVER), 0)
$(error *** Aborting the build. \
*** This driver is not supported on kernel versions older than 2.4.0)
endif
# set the install path
INSTDIR := /lib/modules/$(KVER)/kernel/drivers/net/e1000
# look for SMP in config.h
SMP := $(shell $(CC) $(CFLAGS) -E -dM $(CONFIG_FILE) | \
grep CONFIG_SMP | awk '{ print $$3 }')
ifneq ($(SMP),1)
SMP := 0
endif
ifneq ($(SMP),$(shell uname -a | grep SMP > /dev/null 2>&1 && echo 1 || echo 0))
$(warning ***)
ifeq ($(SMP),1)
$(warning *** Warning: kernel source configuration (SMP))
$(warning *** does not match running kernel (UP))
else
$(warning *** Warning: kernel source configuration (UP))
$(warning *** does not match running kernel (SMP))
endif
$(warning *** Continuing with build,)
$(warning *** resulting driver may not be what you want)
$(warning ***)
endif
ifeq ($(SMP),1)
CFLAGS += -D__SMP__
endif
###########################################################################
# 2.4.x & 2.6.x Specific rules
K_VERSION:=$(shell uname -r | cut -c1-3 | sed 's/2\.[56]/2\.6/')
ifeq ($(K_VERSION), 2.6)
# Makefile for 2.6.x kernel
TARGET = e1000.ko
# man page
MANSECTION = 7
MANFILE = $(TARGET:.ko=.$(MANSECTION))
ifneq ($(KERNELRELEASE),)
EXTRA_CFLAGS += $(CFLAGS_EXTRA)
obj-m += e1000.o
e1000-objs := $(CFILES:.c=.o)
else
default:
ifeq ($(KOBJ),$(KSRC))
make -C $(KSRC) SUBDIRS=$(shell pwd) modules
else
make -C $(KSRC) O=$(KOBJ) SUBDIRS=$(shell pwd) modules
endif
endif
else # ifeq ($(K_VERSION),2.6)
# Makefile for 2.4.x kernel
TARGET = e1000.o
# man page
MANSECTION = 7
MANFILE = $(TARGET:.o=.$(MANSECTION))
# Get rid of compile warnings in kernel header files from SuSE
ifneq (,$(wildcard /etc/SuSE-release))
CFLAGS += -Wno-sign-compare -fno-strict-aliasing
endif
# Get rid of compile warnings in kernel header files from fedora
ifneq (,$(wildcard /etc/fedora-release))
CFLAGS += -fno-strict-aliasing
endif
.SILENT: $(TARGET)
$(TARGET): $(filter-out $(TARGET), $(CFILES:.c=.o))
$(LD) $(LDFLAGS) -r $^ -o $@
echo; echo
echo "**************************************************"
echo "** $(TARGET) built for $(KVER)"
echo -n "** SMP "
if [ "$(SMP)" = "1" ]; \
then echo "Enabled"; else echo "Disabled"; fi
echo "**************************************************"
echo
$(CFILES:.c=.o): $(HFILES) Makefile
default:
make
endif # ifeq ($(K_VERSION),2.6)
ifeq (,$(MANDIR))
# find the best place to install the man page
MANPATH := $(shell (manpath 2>/dev/null || echo $MANPATH) | sed 's/:/ /g')
ifneq (,$(MANPATH))
# test based on inclusion in MANPATH
test_dir = $(findstring $(dir), $(MANPATH))
else
# no MANPATH, test based on directory existence
test_dir = $(shell [ -e $(dir) ] && echo $(dir))
endif
# our preferred install path
# should /usr/local/man be in here ?
MANDIR := /usr/share/man /usr/man
MANDIR := $(foreach dir, $(MANDIR), $(test_dir))
MANDIR := $(firstword $(MANDIR))
endif
ifeq (,$(MANDIR))
# fallback to /usr/man
MANDIR := /usr/man
endif
# depmod version for rpm builds
DEPVER := $(shell /sbin/depmod -V 2>/dev/null | \
awk 'BEGIN {FS="."} NR==1 {print $$2}')
###########################################################################
# Build rules
$(MANFILE).gz: ../$(MANFILE)
gzip -c $< > $@
install: default $(MANFILE).gz
# remove all old versions of the driver
find $(INSTALL_MOD_PATH)/lib/modules/$(KVER) -name $(TARGET) -exec rm -f {} \; || true
find $(INSTALL_MOD_PATH)/lib/modules/$(KVER) -name $(TARGET).gz -exec rm -f {} \; || true
install -D -m 644 $(TARGET) $(INSTALL_MOD_PATH)$(INSTDIR)/$(TARGET)
ifeq (,$(INSTALL_MOD_PATH))
/sbin/depmod -a || true
else
ifeq ($(DEPVER),1 )
/sbin/depmod -r $(INSTALL_MOD_PATH) -a || true
else
/sbin/depmod -b $(INSTALL_MOD_PATH) -a -n > /dev/null || true
endif
endif
install -D -m 644 $(MANFILE).gz $(INSTALL_MOD_PATH)$(MANDIR)/man$(MANSECTION)/$(MANFILE).gz
man -c -P'cat > /dev/null' $(MANFILE:.$(MANSECTION)=) || true
uninstall:
if [ -e $(INSTDIR)/$(TARGET) ] ; then \
rm -f $(INSTDIR)/$(TARGET) ; \
fi
/sbin/depmod -a
if [ -e $(MANDIR)/man$(MANSECTION)/$(MANFILE).gz ] ; then \
rm -f $(MANDIR)/man$(MANSECTION)/$(MANFILE).gz ; \
fi
.PHONY: clean install
clean:
rm -rf $(TARGET) $(TARGET:.ko=.o) $(TARGET:.ko=.mod.o) $(CFILES:.c=.o) $(MANFILE).gz .*cmd
/*******************************************************************************
Copyright(c) 1999 - 2004 Intel Corporation. All rights reserved.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option)
any later version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc., 59
Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The full GNU General Public License is included in this distribution in the
file called LICENSE.
Contact Information:
Linux NICS <linux.nics@intel.com>
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*******************************************************************************/
/* Linux PRO/1000 Ethernet Driver main header file */
#ifndef _E1000_H_
#define _E1000_H_
#include <linux/stddef.h>
#include <linux/config.h>
#include <linux/module.h>
#include <linux/types.h>
#include <asm/byteorder.h>
#include <linux/init.h>
#include <linux/mm.h>
#include <linux/errno.h>
#include <linux/ioport.h>
#include <linux/pci.h>
#include <linux/kernel.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
#include <linux/delay.h>
#include <linux/timer.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
#include <linux/interrupt.h>
#include <linux/string.h>
#include <linux/pagemap.h>
#include <asm/bitops.h>
#include <asm/io.h>
#include <asm/irq.h>
#include <linux/capability.h>
#include <linux/in.h>
#include <linux/ip.h>
#include <linux/tcp.h>
#include <linux/udp.h>
#include <net/pkt_sched.h>
#include <linux/list.h>
#include <linux/reboot.h>
#ifdef NETIF_F_TSO
#include <net/checksum.h>
#endif
#ifdef SIOCGMIIPHY
#include <linux/mii.h>
#endif
#ifdef SIOCETHTOOL
#include <linux/ethtool.h>
#endif
#ifdef NETIF_F_HW_VLAN_TX
#include <linux/if_vlan.h>
#endif
#define BAR_0 0
#define BAR_1 1
#define BAR_5 5
#define PCI_DMA_64BIT 0xffffffffffffffffULL
#define PCI_DMA_32BIT 0x00000000ffffffffULL
#include "kcompat.h"
#define INTEL_E1000_ETHERNET_DEVICE(device_id) {\
PCI_DEVICE(PCI_VENDOR_ID_INTEL, device_id)}
struct e1000_adapter;
#include "e1000_hw.h"
#ifdef DBG
#define E1000_DBG(args...) printk(KERN_DEBUG "e1000: " args)
#else
#define E1000_DBG(args...)
#endif
#define E1000_ERR(args...) printk(KERN_ERR "e1000: " args)
#define PFX "e1000: "
#define DPRINTK(nlevel, klevel, fmt, args...) \
(void)((NETIF_MSG_##nlevel & adapter->msg_enable) && \
printk(KERN_##klevel PFX "%s: %s: " fmt, adapter->netdev->name, \
__FUNCTION__ , ## args))
#define E1000_MAX_INTR 10
/* TX/RX descriptor defines */
#define E1000_DEFAULT_TXD 256
#define E1000_MAX_TXD 256
#define E1000_MIN_TXD 80
#define E1000_MAX_82544_TXD 4096
#define E1000_DEFAULT_RXD 256
#define E1000_MAX_RXD 256
#define E1000_MIN_RXD 80
#define E1000_MAX_82544_RXD 4096
/* Supported Rx Buffer Sizes */
#define E1000_RXBUFFER_2048 2048
#define E1000_RXBUFFER_4096 4096
#define E1000_RXBUFFER_8192 8192
#define E1000_RXBUFFER_16384 16384
/* SmartSpeed delimiters */
#define E1000_SMARTSPEED_DOWNSHIFT 3
#define E1000_SMARTSPEED_MAX 15
/* Packet Buffer allocations */
#define E1000_PBA_BYTES_SHIFT 0xA
#define E1000_TX_HEAD_ADDR_SHIFT 7
#define E1000_PBA_TX_MASK 0xFFFF0000
/* Flow Control Watermarks */
#define E1000_FC_HIGH_DIFF 0x1638 /* High: 5688 bytes below Rx FIFO size */
#define E1000_FC_LOW_DIFF 0x1640 /* Low: 5696 bytes below Rx FIFO size */
#define E1000_FC_PAUSE_TIME 0x0680 /* 858 usec */
/* How many Tx Descriptors do we need to call netif_wake_queue ? */
#define E1000_TX_QUEUE_WAKE 16
/* How many Rx Buffers do we bundle into one write to the hardware ? */
#define E1000_RX_BUFFER_WRITE 16 /* Must be power of 2 */
#define AUTO_ALL_MODES 0
#define E1000_EEPROM_82544_APM 0x0004
#define E1000_EEPROM_APME 0x0400
#ifndef E1000_MASTER_SLAVE
/* Switch to override PHY master/slave setting */
#define E1000_MASTER_SLAVE e1000_ms_hw_default
#endif
/* only works for sizes that are powers of 2 */
#define E1000_ROUNDUP(i, size) ((i) = (((i) + (size) - 1) & ~((size) - 1)))
/* wrapper around a pointer to a socket buffer,
* so a DMA handle can be stored along with the buffer */
struct e1000_buffer {
struct sk_buff *skb;
uint64_t dma;
unsigned long time_stamp;
uint16_t length;
uint16_t next_to_watch;
};
struct e1000_desc_ring {
/* pointer to the descriptor ring memory */
void *desc;
/* physical address of the descriptor ring */
dma_addr_t dma;
/* length of descriptor ring in bytes */
unsigned int size;
/* number of descriptors in the ring */
unsigned int count;
/* next descriptor to associate a buffer with */
unsigned int next_to_use;
/* next descriptor to check for DD status bit */
unsigned int next_to_clean;
/* array of buffer information structs */
struct e1000_buffer *buffer_info;
};
#define E1000_DESC_UNUSED(R) \
((((R)->next_to_clean > (R)->next_to_use) ? 0 : (R)->count) + \
(R)->next_to_clean - (R)->next_to_use - 1)
#define E1000_GET_DESC(R, i, type) (&(((struct type *)((R).desc))[i]))
#define E1000_RX_DESC(R, i) E1000_GET_DESC(R, i, e1000_rx_desc)
#define E1000_TX_DESC(R, i) E1000_GET_DESC(R, i, e1000_tx_desc)
#define E1000_CONTEXT_DESC(R, i) E1000_GET_DESC(R, i, e1000_context_desc)
/* board specific private data structure */
struct e1000_adapter {
struct timer_list tx_fifo_stall_timer;
struct timer_list watchdog_timer;
struct timer_list phy_info_timer;
#ifdef NETIF_F_HW_VLAN_TX
struct vlan_group *vlgrp;
#endif
uint32_t bd_number;
uint32_t rx_buffer_len;
uint32_t part_num;
uint32_t wol;
uint32_t smartspeed;
uint32_t en_mng_pt;
uint16_t link_speed;
uint16_t link_duplex;
spinlock_t stats_lock;
atomic_t irq_sem;
struct work_struct tx_timeout_task;
uint8_t fc_autoneg;
#ifdef ETHTOOL_PHYS_ID
struct timer_list blink_timer;
unsigned long led_status;
#endif
/* TX */
struct e1000_desc_ring tx_ring;
struct e1000_buffer previous_buffer_info;
spinlock_t tx_lock;
uint32_t txd_cmd;
uint32_t tx_int_delay;
uint32_t tx_abs_int_delay;
uint32_t gotcl;
uint64_t gotcl_old;
uint64_t tpt_old;
uint64_t colc_old;
uint32_t tx_fifo_head;
uint32_t tx_head_addr;
uint32_t tx_fifo_size;
atomic_t tx_fifo_stall;
boolean_t pcix_82544;
boolean_t detect_tx_hung;
/* RX */
struct e1000_desc_ring rx_ring;
uint64_t hw_csum_err;
uint64_t hw_csum_good;
uint32_t rx_int_delay;
uint32_t rx_abs_int_delay;
boolean_t rx_csum;
uint32_t gorcl;
uint64_t gorcl_old;
/* Interrupt Throttle Rate */
uint32_t itr;
/* OS defined structs */
struct net_device *netdev;
struct pci_dev *pdev;
struct net_device_stats net_stats;
/* structs defined in e1000_hw.h */
struct e1000_hw hw;
struct e1000_hw_stats stats;
struct e1000_phy_info phy_info;
struct e1000_phy_stats phy_stats;
#ifdef ETHTOOL_TEST
uint32_t test_icr;
struct e1000_desc_ring test_tx_ring;
struct e1000_desc_ring test_rx_ring;
#endif
#ifdef E1000_COUNT_ICR
uint64_t icr_txdw;
uint64_t icr_txqe;
uint64_t icr_lsc;
uint64_t icr_rxseq;
uint64_t icr_rxdmt;
uint64_t icr_rxo;
uint64_t icr_rxt;
uint64_t icr_mdac;
uint64_t icr_rxcfg;
uint64_t icr_gpi;
#endif
uint32_t pci_state[16];
int msg_enable;
};
#endif /* _E1000_H_ */
Ce diff est replié.
Ce diff est replié.
Ce diff est replié.
Ce diff est replié.
/*******************************************************************************
Copyright(c) 1999 - 2004 Intel Corporation. All rights reserved.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option)
any later version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc., 59
Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The full GNU General Public License is included in this distribution in the
file called LICENSE.
Contact Information:
Linux NICS <linux.nics@intel.com>
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*******************************************************************************/
/* glue for the OS independent part of e1000
* includes register access macros
*/
#ifndef _E1000_OSDEP_H_
#define _E1000_OSDEP_H_
#include <linux/types.h>
#include <linux/pci.h>
#include <linux/delay.h>
#include <asm/io.h>
#include <linux/interrupt.h>
#include <linux/sched.h>
#include "kcompat.h"
#define usec_delay(x) udelay(x)
#ifndef msec_delay
#define msec_delay(x) msleep(x)
/* 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
#define CMD_MEM_WRT_INVALIDATE PCI_COMMAND_INVALIDATE
typedef enum {
#undef FALSE
FALSE = 0,
#undef TRUE
TRUE = 1
} boolean_t;
#define MSGOUT(S, A, B) printk(KERN_DEBUG S "\n", A, B)
#ifdef DBG
#define DEBUGOUT(S) printk(KERN_DEBUG S "\n")
#define DEBUGOUT1(S, A...) printk(KERN_DEBUG S "\n", A)
#else
#define DEBUGOUT(S)
#define DEBUGOUT1(S, A...)
#endif
#define DEBUGFUNC(F) DEBUGOUT(F)
#define DEBUGOUT2 DEBUGOUT1
#define DEBUGOUT3 DEBUGOUT2
#define DEBUGOUT7 DEBUGOUT3
#define E1000_WRITE_REG(a, reg, value) ( \
writel((value), ((a)->hw_addr + \
(((a)->mac_type >= e1000_82543) ? E1000_##reg : E1000_82542_##reg))))
#define E1000_READ_REG(a, reg) ( \
readl((a)->hw_addr + \
(((a)->mac_type >= e1000_82543) ? E1000_##reg : E1000_82542_##reg)))
#define E1000_WRITE_REG_ARRAY(a, reg, offset, value) ( \
writel((value), ((a)->hw_addr + \
(((a)->mac_type >= e1000_82543) ? E1000_##reg : E1000_82542_##reg) + \
((offset) << 2))))
#define E1000_READ_REG_ARRAY(a, reg, offset) ( \
readl((a)->hw_addr + \
(((a)->mac_type >= e1000_82543) ? E1000_##reg : E1000_82542_##reg) + \
((offset) << 2)))
#define E1000_WRITE_FLUSH(a) E1000_READ_REG(a, STATUS)
#endif /* _E1000_OSDEP_H_ */
Ce diff est replié.
Ce diff est replié.
Ce diff est replié.
Ce diff est replié.
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter