home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  



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  driver

Where driver specifies the module to be loaded. Table D.9 lists modular Ethernet drivers and the cards they support. As an example, the command:

 insmod ne2k-pci

loads the modular driver for the PCI-based NE2000 Ethernet card.


Table D.9: Modular Ethernet Drivers and Supported Cards

Driver

Cards

3c501

3Com 3c501

3c503

3Com EtherLink II

3c505

3Com EtherLink Plus

3c507

3Com EtnerLink 16

3c509

3Com EtherLink III

3c515

3Com EtherLink XL

8390

National Semiconductor NS8390

a2065

Commodore/Ameristar A2065

ac3200

Ansel Communications AC3200 (EISA)

apricot

Apricot 82596

arcnet

ARCnet COM9026 and COM20020

ariadne

Village Tronic Ariadne

at1700

Allied Telesis AT1700

atari_bionet

Atari BIONET-100

atari_pamsnet

Atari PAMsNet

atarilance

Atari VME Lance

cops

LocalTalk PC

de4x5

EtherWORKS DE425, DE434, DE435, DE450, DE500, DC21040, DC21041, DC21142, DC21143

de600

D-Link DE-600

de620

D-Link DE-620

depca

DEPCA/EtherWORKS DEPCA, DE100, DE101, DE200, DE201, DE202, DE210, DE422

dgrs

Digi RightSwitch SE-X

e2100

Cabletron E2100

eepro

Intel EtherExpress Pro/10

eepro100

Intel EtherExpress Pro/100

eexpress

Intel EtherExpress

epic100

SMC 83c170 EPIC/100

eth16i

ICL EtherTeam 16i, EtherTeam 32 (EISA)

ewrk3

EtherWORKS DE203, DE204, DE205

hp-plus

HP PCLAN/Plus

hp

HP LAN

hp100

HP J2585A, J2585B, J2970, J2973, J2573Compex ReadyLink ENET100-VG4Compex FreedomLine 100/VG

hydra

Hydra Amiganet

ibmtr

IBM token ring

lance

Allied Telesis AT1500HP J2405ANE 2100, 2500

ne

NE1000, NE2000 (non-PCI)

ne2k-pci

NE2000 (PCI)

ni52

Rascal-Interlan NI5210

ni65

Rascal-Interlan NI6510

pcnet

AMD PCnet32- and PCnetPCI-based cards

rt18139

Cards 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-ultra

SMC Ultra, UltraEZ, Ultra32

smc9194

SMC 9000

tlan

Various Compaq and Olicom cards

tulip

Cards 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

wavelan

AT&T/NCR GIS WaveLAN

wd

WD8003, WD8013

yellowfin

Packet 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=11

Some 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, eth0 specifies the first Ethernet card in a system and eth1 specifies 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 tulip

If a driver requires options, you can specify them by using an options directive, 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=12

Most ISA modules accept parameters like io=0x340 and irq=12 on 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 lsmod command, which takes no arguments, lists the loaded modular drivers. To unload a modular driver, specify the driver as the argument of the rmmod command. For example, to remove the ne driver, issue the command:

 rmmod ne

By specifying the -a argument, you can cause rmmod to unload every unused module; that is, every module not associated with an operational device:

 rmmod -a

You 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 down

where eth n specifies the logical device (for example, eth0 or eth1).


Previous: D.5 Boot Parameters Learning Debian GNU/Linux Next: E. Linux Command Quick Reference
D.5 Boot Parameters Book Index E. Linux Command Quick Reference