LAN91C111+Linux+2.4+Driver

所属分类:Linux/Unix编程
开发工具:Unix_Linux
文件大小:45KB
下载次数:34
上传日期:2005-03-14 17:44:31
上 传 者wwqq0121
说明:  lan91c111 Linux driver

文件列表:
copying (18835, 2001-10-12)
makefile (627, 2001-10-12)
smc91111.c (103049, 2001-10-12)
smc91111.h (20324, 2001-10-12)

SMSC LAN91C111 Driver Revision 2.0 9/24/01 Copyright (C) 2001 Standard Microsystems Corporation (SMSC) Copyright (C) 1996 by Erik Stahlman (ES) 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 This file contains the instructions, test methods, and caveats for the smc91111.c driver. You may not be using the driver without reading this file. Driver Description: =================== This driver has been modified to work on kernel 2.4. And it also contains the latest SMSC updates for the Odd Byte issue. Important thing to note about this is that, this driver might not compile on kernel version older than 2.4. Please visit the SMSC website (http://www.smsc.com) for latest updates on the drivers. Things to note about installation: ================================== 1. This is designed to be compiled and loaded as a module. While putting it into your kernel should be possible, it has not yet been tested. 2. The driver will only load on recent kernels because of changes to the network driver interface. I have compiled this under kernel 2.4. 3. To compile, run 'make' . 4. Loading the driver: use: insmod smc91111.o optional parameters: io=0x### : your base address irq=## : your irq nowait=x : 0 for standard I/O access (IOCHRDY wait states) 1 for fast access (no IOCHRDY wait states) 5. To allow automatic loading and intialization of the driver at boot-up add the following line to /etc/modules.conf (in RedHat 7.0): alias eth0 smc91111 options eth0 io=0x### irq=## See the man pages on module.conf. You must also be sure to copy the smc91111.o file to the modules directory: su cd /lib/modules/YOUR_CURRENT_KERNEL_VERSION/net cp 'directory where the file resides'/smc91111.o . chown root:root smc91111.o chmod a+r smc91111.o Then you must update the module dependencies (as root): /sbin/depmod Advanced Features: ================== If your Linux Kernel was compiled with the configuration options CONFIG_PROC_FS and CONFIG_SYSCTL enabled then the smc91111 driver provides several sysctl files for accessing extended features. These files can be found in /proc/sys/dev/ethX, where X is the interface number of the ethernet port. For example, if your SMC91C111 card is the only one in the system then your sysctl files will be located at /proc/sys/dev/eth0. The following lists the files supported by the driver. sysctl file Description ------------- -------------------------------------------------------------- info Prints a list of supported files along with a terse description of each one. swver Prints the software version information of the driver. autoneg When set to 1 enables auto negotiation mode. The LAN91C111 supports auto negotiation per IEEE 802.3 Clause 28. When auto negotiation is set the files "rspeed" and "rfduplx" (below) limit what capabilities are broadcast to the remote end. When "autoneg" is set to 0 the auto-negotiation feature is disabled, and the speed and duplex can be controlled directly and immediately with "rspeed" and "rfduplx". You can change the value of this file by issuing the command "echo 0 > autoneg", assuming that you are in the directory /proc/sys/dev/ethX. The default value of "autoneg" is 1. aspeed Reports the actual speed of the link. This file is read-only. afduplx Reports the actual duplex of the link. A value of 1 indicates the link is currently operating in full duplex. This file is read-only. rspeed Requested speed, controls the speed of the interface. The behavior invoked by this file depends on the value of the "autoneg" file. See the "autoneg" description above. A value of 100 indicates 100Mpbs, and a speed of 10 indicates 10Mbps. You cannot change the value of "rspeed" when "autoneg" is set to 1. You can issue the following commands to restrict the LAN91C111 to 10Mbps operation: cd /proc/sys/dev/eth0 echo 0 > autoneg echo 10 > speed echo 1 > autoneg The default value of "speed" is 100. rfduplx Requested duplex, controls the duplex operation of the interface. The behavior invoked by this file depends on the value of the "autoneg" file. See the "autoneg" description above. A value of 1 indicates full duplex, while a value of 0 indicates half duplex operation. You cannot change the value of "rfduplx" when "autoneg" is set to 1. The default value of "rfduplx" is 1. lnkfail When 1 indicates the PHY link is in a failure state (i.e. not connected to a valid LAN). A value of 0 indicates normal operation. miiop When set to 1 selects an external PHY. This feature has not yet been tested. The default value of "miiop" is 0. swfdup When set to 1 enables Switched Full Duplex Operation. This is to be used only when miiop is set to 1 (according to the LAN91C111 documentation). This feature has not yet been tested. The default value of "swfdup" is 0. ephloop When set to 1 enables a loopback in the EPH block. This feature has not yet been tested. The default value of "ephloop" is 0. forcol When set to 1 forces a collision. This feature has not yet been tested. The default value of "forcol" is 0. filtcar When set to 1 the LAN91C111 filters the leading edge of carrier sense for 12 bit times. This feature has not yet been tested. The default value of "filtcar" is 0. freemem Reports the amount of buffer memory currently free, in bytes. totmem Reports the total amount of buffer memory contained in the LAN91C111, in bytes. leda Reports and controls which line condition is reported on LEDA. I tested this feature with the SMSC EVB111-ISA board. LED A on this card is green and is labelled "100". This file accepts values from 0 thru 7. Value Line Condition Reported ----- ---------------------------------------------- 0 Logical OR of 100Mbps and 10Mbps link detected 1 Reserved 2 10Mpbs link detected 3 Full Duplex Mode Enabled 4 Transmit or Receive packet occurred 5 100Mbps Link Detected 6 Transmit packet occurred 7 Receive packet occurred The default value of "leda" is 5. ledb Reports and controls which line condition is reported on LEDB. I tested this feature with the SMSC EVB111-ISA board. LED B on this card is yellow and is labelled "FD". This file accepts values from 0 thru 7 (see above). The default value of "ledb" is 3. chiprev Reports the chip revision number of the LAN91C111. Testing Methodology and Report: =============================== I tested the smc91111.c driver using RedHat 7.1. The version I tested with came with kernel version 2.4.2. I updated the gcc tools because of known bugs in this version of the RedHat distribution. It should not have made a difference though, as the module is actually compiled using the "kgcc" compiler provided by RedHat 7.1 (you have to manually install the kgcc rpm from the CDROM). I used two machines to perform tests. The first is an AST Bravo MS-T PRO 6200, Model 2500C. It contains a PentiumPro w/integrated 256KB L2 cache, ***Mbytes of EDO DRAM, and a 2.5GB EIDE hard drive. The second machine is a generic Pentium II running at 360MHz. It contains ***Mbytes of SDRAM, and a 30GB hard drive. I used a NetGear FA311 PCI Ethernet card in this machine. I compiled and installed the fa311.c driver provided with the card. I tested in two configurations. The first was in isolation, where the two machines were connected to each other with a CAT5 crossover cable. The second configuration connected both machines to a local area network running at 10Mbps. This lan containes three Windows machines and an Efficient Networks SpeedStream router, connected to the Internet through an IDSL (today it is served by Northpoint, tomorrow it is serviced by ????) Test Scenerio #1 Testing in Isolated Network The PentiumPro machine with the EVB111-ISA card is named "LOCAL", with IP address 216.36.95.135, netmask 255.255.255.240. The PentiumII machine with the NetGear FA311 is named "REMOTE", with IP address of 216.36.95.134, netmask 255.255.255.240. 1. Bring the interface up. The insmod and ifconfig programs must be executed as root. LOCAL: /sbin/insmod smc91111.o Check /var/log/messages (at end) for results. You should see the I/O address and IRQ assigned to the card by the auto probe function. LOCAL: /sbin/ifconfig eth0 216.36.95.135 netmask 255.255.255.240 Verify that the interace is up by checking the results of ifconfig: LOCAL: /sbin/ifconfig Verify that the Ethernet MAC address reported by ifconfig looks reasonable. The card I tested with contained the address "00:80:0F:6A:00:00". Beware of addresses with all zeros, all ones, or repeating bytes. Test Result: Passed 2. Ping Remote Side LOCAL: ping -c5 216.36.95.134 Verify that 5 pings were returned. Test Result: Passed 3. Check sysctl variables LOCAL: cd /proc/sys/dev/eth0 LOCAL: ls Verify that the following files are shown: afduplx autoneg ephloop forcol info ledb miiop rspeed swver aspeed chiprev filtcar freemem leda lnkfail rfduplx swfdup totmem LOCAL: more autoneg Verify that the value printed is 1. LOCAL: more rspeed Verify that the value printed is 100. LOCAL: more rfduplx Verify that the value printed is 1. LOCAL: more aspeed Verify that the value printed is 100. LOCAL: more afduplx Verify that the value printed is 1. LOCAL: more lnkfail Verify that the value printed is 0. LOCAL: more totmem Verify that the value printed is 8192. LOCAL: more freemem Verify that the value printed is 8192. LOCAL: more leda Verify that the value printed is 5 LOCAL: more ledb Verify that the value printed is 3 Test Result: Passed 4. Check LEDs You may not be able to do this depending on the LEDs supported on your card. Verify that the "100" LED is on, indicating a 100Mbps connection. Verify that the "FD" LED is on, indicating Full-Duplex connection. Test Result: Passed 5. Check Transport - use ftp to transport a large file across the ethernet Obtain a large file, preferably several megabytes in size. I used the file XFree86-4.0.1-1.i386.rpm from Disk 1 of the RedHat 7.0 distribution because it was 15Mbytes in size. REMOTE: ftp 216.36.95.135 REMOTE: bin REMOTE: put large_file REMOTE: get large_file large_file_ftp REMOTE: quit REMOTE: diff large_file large_file_ftp Verify that the transfer occurred correctly, and that the file was not modified after transport. Test Result: Passed 6. Disable Auto-Negotiate, Force Half Duplex, 100Mbps The files in /proc/sys/dev/ethX can only be changed by root. LOCAL: echo 0 > autoneg Wait 5 seconds. LOCAL: echo 0 > rfduplx Wait 5 seconds. LOCAL: more rfduplx Verify that the result printed is 0. LOCAL: more afduplx Verify that the result printed is 0. Verify that the "100" LED is on, and the "FD" LED is off. Perform Test #2 (Ping Remote Side) to verify connection. Perform Test #5 (Check Transport). Test Result: Passed 7. Eanble Auto-Negotiate, Advertising Half Duplex, 100Mbps LOCAL: echo 1 > autoneg Wait 5 seconds. Verify that the "100" LED is on, and the "FD" LED is off. LOCAL: more autoneg Verify that the result printed is 1. LOCAL: more afduplx Verify that the result printed is 0. LOCAL: more aspeed Verify that the result printed is 100. Perform Test #2 (Ping Remote Side) to verify connection. LOCAL: more lnkfail Verify that the result printed is 0. Remove the ethernet cable from the RJ-45 connector. LOCAL: more lnkfail Verify that the result printed is 1. Reinsert the ethernet cable into the RJ-45 connector. LOCAL: more lnkfail Verify that the result printed is 0. LOCAL: more afduplx Verify that the result printed is 0. LOCAL: more aspeed Verify that the result printed is 100. Perform Test #2 (Ping Remote Side) to verify connection. Test Result: Passed 8. Force Half Duplex, 10Mbps LOCAL: echo 0 > autoneg Wait 5 seconds. LOCAL: echo 10 > rspeed Wait 5 seconds. LOCAL: more aspeed Verify that the result printed is 10. Verify that the "100" LED is off, and the "FD" LED is off. LOCAL: more afduplx Verify that the result printed is 0. Perform Test #2 (Ping Remote Side) to verify connection. Perform Test #5 (Check Transport). Test Result: Passed 9. Eanble Auto-Negotiate, Advertising Half Duplex, 10Mbps LOCAL: echo 1 > autoneg Wait 5 seconds. Verify that the "100" LED is off, and the "FD" LED is off. LOCAL: more autoneg Verify that the result printed is 1. LOCAL: more afduplx Verify that the result printed is 0. LOCAL: more aspeed Verify that the result printed is 10. Perform Test #2 (Ping Remote Side) to verify connection. LOCAL: more lnkfail Verify that the result printed is 0. Remove the ethernet cable from the RJ-45 connector. LOCAL: more lnkfail Verify that the result printed is 1. Reinsert the ethernet cable into the RJ-45 connector. LOCAL: more lnkfail Verify that the result printed is 0. LOCAL: more afduplx Verify that the result printed is 0. LOCAL: more aspeed Verify that the result printed is 10. Perform Test #2 (Ping Remote Side) to verify connection. Test Result: Passed 10. Force Full Duplex, 10Mbps LOCAL: echo 0 > autoneg Wait 5 seconds. LOCAL: echo 1 > rfduplx Wait 5 seconds. LOCAL: more afduplx Verify that the result printed is 1. Verify that the "100" LED is off, and the "FD" LED is on. LOCAL: more aspeed Verify that the result printed is 10. Perform Test #2 (Ping Remote Side) to verify connection. Perform Test #5 (Check Transport). Test Result: Passed 11. Eanble Auto-Negotiate, Advertising Full Duplex, 10Mbps LOCAL: echo 1 > autoneg Wait 5 seconds. Verify that the "100" LED is off, and the "FD" LED is on. LOCAL: more autoneg Verify that the result printed is 1. LOCAL: more afduplx Verify that the result printed is 1. LOCAL: more aspeed Verify that the result printed is 10. Perform Test #2 (Ping Remote Side) to verify connection. Test Result: Passed 12. Return to Full Duplex, 100Mbps LOCAL: echo 0 > autoneg Wait 5 seconds. LOCAL: echo 1 > rfduplx Wait 5 seconds. LOCAL: more afduplx Verify that the result printed is 1. LOCAL: echo 100 > rspeed Wait 5 seconds. LOCAL: more espeed Verify that the result printed is 100. Verify that the "100" LED is on, and the "FD" LED is on. Perform Test #2 (Ping Remote Side) to verify connection. LOCAL: echo 1 > autoneg Wait 5 seconds. Verify that the "100" LED is on, and the "FD" LED is on. LOCAL: more autoneg Verify that the result printed is 1. LOCAL: more afduplx Verify that the result printed is 1. LOCAL: more aspeed Verify that the result printed is 100. Perform Test #2 (Ping Remote Side) to verify connection. Test Result: Passed Test Scenerio #2 Testing in a Mixed-Mode 10Mbps LAN This section of testing was perform in a 10Mbps LAN with mixed 10Base2 and 10BaseT interfaces. The LAN was interconnected with a D-Link HUB, and a connection to the Internet was secured through an Efficient Networks SpeedStream router. The address of the router is 216.36.95.129. 13. Connect to LAN Connect both the LOCAL and REMOTE ethernet cards to the non-isolated LAN. Verify that the "100" LED is off, and the "FD" LED is off. LOCAL: more lnkfail Verify that the result printed is 0. LOCAL: more afduplx Verify that the result printed is 0. LOCAL: more aspeed Verify that the result printed is 10. Perform Test #2 (Ping Remote Side) to verify connection. Test Results: Passed 14. Test Promiscuous Mode LOCAL: /usr/sbin/tcpdump -p -i eth0 host 216.36.95.129 REMOTE: ping -c5 216.36.95.129 Verify that the LOCAL "tcpdump" program sees the pings to 216.36.95.129. Test Results: Passed 15. Test Multicast Mode The "route" command must be executed as root. LOCAL: route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0 REMOTE: route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0 LOCAL: /usr/sbin/tcpdump -p -i eth0 host 216.36.95.129 REMOTE: ping 224.0.0.1 Verify that the REMOTE machine gets at least one ICMP response from 216.36.95.135. You will probably also see ICMP responses from other Linux machines listening on the LAN. Also, by inspecting the output of the LOCAL "tcpdump" you can see which packets are Broadcast (B), Multicast (M), or Point-to-point (P). Test Results: Passed 16. Test LED Control LOCAL: echo 6 > leda LOCAL: echo 7 > ledb LOCAL: more leda Verify that the result printed is 6. LOCAL: more ledb Verify that the result printed is 7. Perform Test #2 (Ping Remote Side) to verify connection. Verify that the two LEDs toggle when packets are received and transmitted. ... ...

近期下载者

相关文件


收藏者