Getting Linux Connected, using Ethernet and TCP/IP

Configuring Linux to talk to your network card


Ethernet and Kernel HOWTOs

The best sources of information for getting Linux to see your network ethernet network card are the :

On most Linux distributions, these documents are also kept in the /usr/doc directory.

A Module or in the Kernel ?

To support a network card under Linux you need to compile a corresponding network card driver. This will be used by the kernel to talk to your network card.

Usually, the drivers for network cards under Linux are supplied in source code form with the Linux kernel source code.

Occasionally, for some of the more obscure network cards, or newer drivers for cards such as PCI network cards, the driver source code is not available in the kernel source. In this case, you need to obtain the source code, and follow the directions on how to get the network card driver going.

The question which needs to be considered is "Do I build the network card driver into the kernel or do I create a module for it ?"

In the Kernel

Building the network card driver into the kernel is probably the best option for a few reasons :

As a Module

Occasionally you may need to use a module for you network card driver.

This usually occurs when you are using a network card whose driver is not supplied within the kernel source code. Using modules is a convenient way for a network card device driver author to develop and distribute a network card driver.

Autoprobe vs. Manual Configuration

Another issue is whether the kernel will be able to autodetect the network card or whether you will have to tell the kernel what the hardware settings of the network card are. Some network cards / drivers are able to automatically find the network card, while some can't (eg. NE2000).

Autoprobe

Autoprobing works by "probing" various well known IO port addresses that the network card could reside at. Probing involves reading and possibly writing bytes to these IO ports, to see if the selected network card responds. If the selected network card responds, Linux can then use the network card for networking.

One problem with autoprobing is that the probes may cause other devices to stop working. As some of the well known IO ports can also be used by other devices, probing these addresses may cause the other devices to cease up, preventing them from working properly. In this occurs, you may want to manually configure the network card driver to use a specific IO port, IRQ and memory address, corresponding to the settings you used when you installed the network card.

Also, be aware that autoprobing is not only used by network card drivers. Other device drivers, which are loaded before the network card driver, may also autoprobe the network card, ceasing it up, when may then cause it to not be recognised, when its driver is loaded.

Manual Configuration

Manual configuration involves telling either the Linux kernel or the module what the hardware settings of the network card are. These settings are typically the IO port, the Interrupt Request Line (IRQ) and possibly the shared memory address of the card.

Kernel Command Line

In the case of a network card driver built into the kernel, you usually add a parameter to the kernel command line such as ether=5,0x300. This tells the kernel to look for a network card at IRQ 5, IO port 0x300 (hexidecimal). See both the Kernel-HOWTO and the Ethernet-HOWTO for more details on using kernel command line parameters.

Module parameters

Module parameters are supplied when the module is loaded.

If you are loading the module manually, using the insmod(8) command, you supply the parameters on the end of the insmod command eg. insmod ne2000 io=0x300 irq=5. This command would tell the ne2000 module that the ne2000 card is located at IO port 0x300 (hexidecimal) and IRQ 5.

Alternatively, if you are using dynamic, on demand module loading (via kerneld), you add parameters in the module.conf file, which specifies what the module parameters are for each module. These parameters are the same format as those used with the insmod(8) command. See the depmod(1) man page for more details on dynamic module loading.

For more details on modules in general, see the Modules mini-howto, and the file modules.txt in the Documentation subdirectory in the Linux kernel source.


[Previous Page] | [Next Page] | [Start of Current Topic] | [Previous Topic] | [Next Topic]

LinuxSA - http://www.linuxsa.org.au

Prepared by Mark Smith
marks@senet.com.au

Fri Feb 20 13:28:03 CST 1998