Installing Your SMC NIC with Linux

Before you can use your SMC NIC, it will first be necessary to compile the driver to work with your version of Linux.  This page contains detailed instructions on how to compile the driver source file and install the compiled driver module.  These compiled driver modules are referred to as loadable kernel modules.

Linux has a facility for linking device drivers into the running kernel. This is called Modules support. With the vast variety of supported devices, pre-linking a kernel with all device drivers is impractical. Using loadable modules allow a commercial Linux distribution to use a small initial kernel and link in the device support needed after the machine has booted.

Compiling a Device Driver Module

In the instructions below, driver.c refers to the name of the driver source file for your device e.g. epic.c, and driver.o refers to the compiled driver module binary.

gcc -DMODVERSIONS -DMODULE -D__KERNEL__ -I/usr/src/linux/net/inet -O6 -c driver.c 
-DMODVERSIONS

from the compile command and try again.

   install -m 644 driver.o /lib/modules/`uname -r`/net/
   

Possible problems and solutions

If you get an "linux/version.h no such file or directory" message when compiling the driver, you either have not installed the kernel source code, or you haven't run

 
        cd /usr/src/linux; make include/linux/version.h

yet. Some distributions allow you to install just the essential header files of the kernel source code, including a pre-built "version.h", so this isn't always necessary.

If you get a "modversions.h not found" message when compiling the driver, delete '-DMODVERSIONS' from the command used to compile the driver module.

What if the card is detected with a ff:ff:ff:ff:ff:ff station address?

There are three known causes of this problem.

The "D3-cold" problem

Quick summary: restore operation by unplugging the machine after running an OS that disables the card. Merely using the "soft-off" pushbutton on a ATX case is not sufficient.

Many modern PCI chips have ACPI power management capability. Some include a mode known as "D3-cold", where the chip can power itself off. When in this mode the chip uses only the tiny amount of stand-by power always available when an ATX power supply is plugged in. In the D3-cold mode the chip can be turned on only by writing a PCI configuration space register. This works great if you have a ACPI-aware BIOS that knows how to re-enable the chip on a warm boot, but older BIOS don't know that the chip cannot retain configuration information. When the machine is warm booted the chip has only invalid configuration information.

The solution is to either update to the latest driver, (the drivers are being re-worked to enable the devices) or to disable the "PnP OS" setting in the machine's BIOS setup.

Testing the New Module

As 'root', load the module using "insmod driver.o" and execute the appropriate 'route add -net ...' for your local network.

If the networking works correctly, add the module to your system configuration. For Slackware and most other systems, add the insmod command to /etc/rc.d/rc.inet1 or /etc/rc.d/rc.local. RedHat users should add the insmod line to /etc/rc.d/rc.modules or copy driver.o to /lib/modules/`uname -r`/net/ and add the following line to /etc/conf.modules:

 
  alias eth0 driver
  

Modifying Driver Operation Through Options

Drivers are designed with the goal that no options should be needed in most environments. However not all cards and networks can be automatically configured, thus drivers allow operational parameters to be modified when they are loaded as a module. Typically the following variables may be set:

 
 name        type    description
 debug       int     The debug message level, 0 (no messages) to 6 (wordy).
 options     int[]   Per-card media type override and card operation
                     settings, typically the media type.
 full_duplex int[]   Set to '1' to force this interface to always be used in FD mode.

To test an option, load the module (as above) with a command such as "/sbin/insmod driver.o full_duplex=1,0,1". This command sets the full_duplex flag for the first and third cards of this type.

To set module parameters when the module is loaded automatically, add the following line to /etc/conf.modules

 
  alias eth0 driver
  options driver full_duplex=1,0,1 debug=0
  

Note that no spaces are permitted only between parameter names, not between the comma-separated numeric options.