|
|
|
|
Learning Debian GNU/LinuxBy Bill McCarty1st Edition September 1999 1-56592-705-2, Order Number: 7052 360 pages, $34.95 , Includes CD-ROM |
D.6 Using Loadable Ethernet Drivers
Early versions of Linux used a so-called monolithic kernel. At that time, Linux distributions typically included several kernels, offering support for a variety of devices that might be needed to boot and install a Linux system. Devices not needed to boot and install a system - so-called special devices - had second-class status. To access special devices, users had to compile customized kernels that included support for those devices. When a user added a device to a system, it was often necessary to compile a new kernel, which was something of an inconvenience.
More recent versions of Linux feature a modular kernel, which allows drivers to be dynamically loaded on command. This makes it much easier than before to configure your Linux system to support Ethernet cards and other special devices. Debian GNU/Linux is generally able to configure your primary Ethernet card automatically, by probing for it during installation of Linux.
However, the autoprobe doesn't always succeed. Moreover, if you have more than one Ethernet card, the installation program sets up only the first card it finds. To set up additional cards, you need to know a bit about Linux's loadable modules.
D.6.1 Dynamically Loading a Modular Driver
To dynamically load a modular driver, you issue the following command:
insmod driverWhere
driverspecifies the module to be loaded. Table D.9 lists modular Ethernet drivers and the cards they support. As an example, the command:insmod ne2k-pciloads the modular driver for the PCI-based NE2000 Ethernet card.
Table D.9: Modular Ethernet Drivers and Supported Cards Driver
Cards
3c5013Com 3c501
3c5033Com EtherLink II
3c5053Com EtherLink Plus
3c5073Com EtnerLink 16
3c5093Com EtherLink III
3c5153Com EtherLink XL
8390National Semiconductor NS8390
a2065Commodore/Ameristar A2065
ac3200Ansel Communications AC3200 (EISA)
apricotApricot 82596
arcnetARCnet COM9026 and COM20020
ariadneVillage Tronic Ariadne
at1700Allied Telesis AT1700
atari_bionetAtari BIONET-100
atari_pamsnetAtari PAMsNet
atarilanceAtari VME Lance
copsLocalTalk PC
de4x5EtherWORKS DE425, DE434, DE435, DE450, DE500, DC21040, DC21041, DC21142, DC21143
de600D-Link DE-600
de620D-Link DE-620
depcaDEPCA/EtherWORKS DEPCA, DE100, DE101, DE200, DE201, DE202, DE210, DE422
dgrsDigi RightSwitch SE-X
e2100Cabletron E2100
eeproIntel EtherExpress Pro/10
eepro100Intel EtherExpress Pro/100
eexpressIntel EtherExpress
epic100SMC 83c170 EPIC/100
eth16iICL EtherTeam 16i, EtherTeam 32 (EISA)
ewrk3EtherWORKS DE203, DE204, DE205
hp-plusHP PCLAN/Plus
hpHP LAN
hp100HP J2585A, J2585B, J2970, J2973, J2573Compex ReadyLink ENET100-VG4Compex FreedomLine 100/VG
hydraHydra Amiganet
ibmtrIBM token ring
lanceAllied Telesis AT1500HP J2405ANE 2100, 2500
neNE1000, NE2000 (non-PCI)
ne2k-pciNE2000 (PCI)
ni52Rascal-Interlan NI5210
ni65Rascal-Interlan NI6510
pcnetAMD PCnet32- and PCnetPCI-based cards
rt18139Cards based on the RTL8129 and RTL8139 PCI Ethernet chips, such as:
ALFA GFC2206
Allied Telesyn AT2550
Genius GF100TXR (RTL8139)
NDC Communications NE100TX-E
SiS 900 (PCI)
SMC 1211TX (PCI)
smc-ultraSMC Ultra, UltraEZ, Ultra32
smc9194SMC 9000
tlanVarious Compaq and Olicom cards
tulipCards based on the DEC 21040/21041/21140/21142/21143, such as:
Accton EtherDuo PCI, EN1207
Adaptec ANA6901/C, ANA6911/TX
C-NET CNE-935
Cogent EM100, EM110, EM400, EM960, EM964 Quartet
Danpex EN-9400P3
D-Link DFE500-Tx, DE-530CT, DFE-540TX
Linksys EtherPCI
Kingston EtherX KNT40T, EtherX KNE100TX
Netgear FX310 TX 10/100
SMC EtherPower, 8432BT, EtherPower10/100, EtherPower10/100
Surecom EP-320X
tulip(cont.)Thomas Conrad TC5048
Znyx ZX312 EtherAction, ZX314, ZX315 EtherArray, ZX342, ZX344, ZX345, ZX346, ZX348, ZX351
wavelanAT&T/NCR GIS WaveLAN
wdWD8003, WD8013
yellowfinPacket Engines G-NIC
When a driver is loaded, it generally probes to locate the supported device. In case an autoprobe fails, most drivers let you specify the I/O port and IRQ by using a command like the following:
insmod ne2k=pci io=0x280 irq=11Some cards support additional options; these are documented in the file /usr/src/linux/Documentation/networking/net-modules.txt.
D.6.2 Loading Modular Drivers at Boot Time
The Linux kernel automatically loads modules specified in the module configuration file, /etc/conf.modules. So, once you've determined the proper module and options required by your Ethernet card, you can add a line or two to the module configuration file so that your card will be made ready to operate each time you boot your system.
The alias directive associates a logical module name with an actual module. Logical module names specify types of devices; for example,
eth0specifies the first Ethernet card in a system andeth1specifies the second Ethernet card in a system. Suppose your system includes two Ethernet cards: a non-PCI-based NE2000 and an SMC EtherPower, which is based on DEC's TULIP chip. You could use the following directives to automatically load these modules at boot time:alias eth0 ne alias eth1 tulipIf a driver requires options, you can specify them by using an
optionsdirective, which has the following form:options driver argument= value[, value,...] argument= value[, value,...] ...For example, you might specify the I/O port and IRQ used by the NE2000 card like this:
options ne io=0x280 irq=12Most ISA modules accept parameters like
io=0x340andirq=12on the insmod command line. You should supply these parameters to avoid probing for the card. Unlike PCI and EISA devices, ISA devices sometimes cannot be safely auto-probed.D.6.3 Administering Modular Drivers
The
lsmodcommand, which takes no arguments, lists the loaded modular drivers. To unload a modular driver, specify the driver as the argument of thermmodcommand. For example, to remove thenedriver, issue the command:rmmod neBy specifying the
-aargument, you can causermmodto unload every unused module; that is, every module not associated with an operational device:rmmod -aYou can't remove a module that's in use; therefore, you must shut down the device before removing it. To shut down an Ethernet device, you can use
linuxconfig. Or, you can issue the following command:ifconfig eth n downwhere
ethnspecifies the logical device (for example,eth0oreth1).
Back to: Learning Debian GNU/Linux
© 2001, O'Reilly & Associates, Inc.