
              D-Link DGE-500SX Giga-Ether Adapter Installation
                     For Linux

Contents
========
 - Compatibility List
 - Compiling the Driver
 - Installing the Driver
   - Red Hat v6.0
   - Red Hat v5.2
   - Suse 6.1
   - Caldera 2.2
   - Turbo Linux 4.2 Pro
 - Parameter Description
 - Configuration Script Sample


Compatiblity List
=================
The driver support Linux kernal 2.0.x and 2.2.x. We had tested it on the
environments below.

 . red hat v5.2
 . red hat v6.0 (kernal 2.2.5-15)
 . Suse 6.1     (kernal 2.2.x)
 . Caldera 2.2  (kernal 2.2.x) 
 . Turbo Linux 4.2 Pro (kernal 2.2.9)


Compiling the Driver
====================
  In Linux, NIC drivers are most commonly configured as loadable modules.
The approach of building a monolithic kernel has become obsolete. The driver
can be compiled as part of a monolithic kernel, but is strongly discouraged.
The remainder of this section assumes the driver is built as a loadable module.
In the Linux environment, it is a good idea to rebuild the driver from the
source instead of relying on a precompiled version. This approach provides
better reliability since a precompiled driver might depend on libraries or
kernel features that are not present in a given Linux installation.

The two files necessary to build Linux device driver are DGELIN.C and
MAKEFILE. To compile, the Linux installation must include the gcc compiler,
the kernel source, and the kernel headers. The Linux driver supports Linux
Kernels 2.0.x and 2.2.x. Copy the files to a directory and enter the following
command to compile and link the driver:

; CD-ROM drive
[root@XXX /] mkdir cdrom
[root@XXX /] mount -t iso9660 -o conv=auto /dev/hdc /cdrom (if cdrom is on /dev/hdc)
[root@XXX /root] mkdir dgelin
[root@XXX /root] cd dgelin
[root@XXX /dgelin] cp /cdrom/linux/dgelin.c /root/dgelin
[root@XXX /dgelin] cp /cdrom/linux/makefile /root/dgelin
[root@XXX /dgelin] make

; Floppy disc drive
[root@XXX /root] mkdir dgelin
[root@XXX /root] cd dgelin
[root@XXX /dgelin] mcopy a:\linux\dgelin.c      ; use mcopy command
[root@XXX /dgelin] mcopy a:\linux\makefile
[root@XXX /dgelin] make

; If you aren't use mcopy command. Please reference following command.
; The dos2unix program should be prepare.

[root@XXX /root] make convert
[root@XXX /root] make

Be aware that the compiler cannot process source files in DOS/Windows file
format (i.e. ASCII files where each line is terminated with a carriage return
and line feed characters). If the source files have been edited in a DOS/
Windows environment, the source files must be converted to a Unix format
prior to compilation. A conversion target is included in the makefile for
this purpose. Note that this requires the dos2unix utility to be installed.

For Turbo Linux 4.2 Pro
-----------------------
mkdir floppy in root(/) path
mount -o conv=auto -t msdos /dev/fd0 /floppy
cp /floppy/linux/dgelin.c /root/dgelin
cp /floppy/linux/makefile /root/dgelin


Installing the Driver
=====================

  Manual Installation
  -------------------
  Once the driver has been compiled, it must be loaded, enabled, and bound
  to a protocol stack in order to establish network connectivity. To load a
  module enter the command:

  insmod dgelin.o

  or

  insmod dgelin.o <optional parameter>    ; add parameter

  (ex. insmod dgelin.o speed=1000 duplex=full mtu=9014 tx_threshold=700)


  Please reference the list of the command line parameters supported by
  the Linux device driver below.

  The insmod command only loads the driver and gives it a name of the form
  eth0, eth1, etc. To bring the NIC into an operational state,
  it is necessary to issue the following command:

  ifconfig eth1 up

  Finally, to bind the driver to the active protocol (e.g., TCP/IP with
  Linux), enter the following command:

  ifup eth1

  Note that this is meaningful only if the system can find a configuration
  script that contains the necessary network information. A sample will be
  given in the next paragraph.

  The commands to unload a driver are as follows:

  ifdown eth1
  ifconfig eth1 down
  rmmod dgelin.o

  The following are the commands to list the currently loaded modules and
  to see the current network configuration.

  lsmod
  ifconfig

  
  Suse 6.1
  --------
  1. insmod dgelin.o speed=1000 duplex=full    
  2. /etc/rc.d/init.d/./network restart
  3. (optional):route add default gw x.x.x.x (x.x.x.x is a gateway ip address)

  
  Caldera 2.2
  -----------
  1. insmod dgelin.o speed=1000 duplex=full    
  2. ifconfig eth0 ip-address broadcast ip-address netmask ip-address
  3. (optional):route add default gw x.x.x.x (x.x.x.x is a gateway ip address)

  
  Turbo Linux 4.2 Pro
  -------------------
  1. insmod dgelin.o speed=1000 duplex=full 
  2. ifconfig eth0 ip-address broadcast ip-address netmask ip-address
  3. (optional):route add default gw x.x.x.x (x.x.x.x is a gateway ip address)



  Automated Installation
  ----------------------
  This section describes how to install the driver such that it is
  automatically loaded and configured at boot time. The following description
  is based on a Red Hat 5.1/6.0 distribution, but it can easily be ported to
  other distributions as well.

  Red Hat v6.0
  ------------
  1. Copy dgelin.o to the network modules directory, typically
     /lib/modules/2.2.x-xx/net.
  2. Locate the boot module configuration file, most commonly conf.modules
     in the /etc directory. Add the following lines:

     alias ethx dgelin
     options dgelin <optional parameters>

     ( ex. force NIC to 1000M full duplex mode

       alias ethx dgelin
       options dgelin speed=1000 duplex=full
     )

     where ethx will be eth0 if the NIC is the only ethernet adapter, eth1 if
     one other ethernet adapter is installed, etc. Refer to the table in the
     previous section for the list of optional parameters.
  3. Locate the network configuration scripts, normally the
     /etc/sysconfig/network-scripts directory, and create a configuration
     script named ifcfg-ethx that contains network information.
  4. Note that for most Linux distributions, Red Hat included, a configuration
     utility with a graphical user interface is provided to perform steps 2
     and 3 above.


  Red Hat v5.2
  ------------
  1. Copy dgelin.o to the network modules directory, typically
     /lib/modules/2.0x/net.
  2. Locate the boot module configuration file, most commonly conf.modules
     in the /etc directory. Add the following line:

     alias ethx dgelin <optional parameters>

     where ethx will be eth0 if the NIC is the only ethernet adapter, eth1 if
     one other ethernet adapter is installed, etc. Refer to the table in the
     previous section for the list of optional parameters.
  3. Locate the network configuration scripts, normally the
     /etc/sysconfig/network-scripts directory, and create a configuration
     script named ifcfgethx that contains network information.
  4. Note that for most Linux distributions, Red Hat included, a configuration
     utility with a graphical user interface is provided to perform steps 2
     and 3 above.
  
  
  Suse 6.1
  --------
  1. Copy dgelin.o to the network modules directory, typically
     /lib/modules/2.2.x-xx/net.
  2. Run "yast" command first. After do this, a configuration menu will pop. Choose 
     "system administration"-->"Network configuration" selection. Then you can set host 
     name, ip address, network services here.
  
  3. Add the following lines in /etc/conf.modules:   
       (
        alias eth0 dgelin
        options dgelin speed=1000 duplex=full
       )
       
  4. Reboot computer       

  	
  Caldera 2.2
  -----------
  1. Copy dgelin.o to the network modules directory, typically
     /lib/modules/2.2.x-xx/net.
  2. Run "lisa" in console mode to set Network.
     (1). Choose "System Configuration"-->"System Configuration"-->
          "Kernel Module Administration"-->"Load kernel modules".
          In "Load Kernel Module" menu, choose "dgelin".
     (2). Choose "System Configuration"-->"Network Configuration" to set 
          ip address, gateway, DNS, host name... 
  3. Add the following lines in /etc/modules.conf: 
       (
        alias eth0 dgelin
        options dgelin speed=1000 duplex=full
       )
  4. Reboot computer
 
    
  Turbo Linux 4.2 Pro
  -------------------
  1. Copy dgelin.o to the network modules directory, typically
     /lib/modules/2.2.x-xx/net.
  2. Run "turbonetcfg" command to set Network.
  3. Add the following lines in /etc/conf.modules: 
     (
       alias eth0 dgelin
       options dgelin speed=1000 duplex=full
     ) 
  4. Reboot computer 



Configuration Script Sample
===========================
Here is a sample of a simple configuration script:

DEVICE=eth1
USERCTL=no
ONBOOT=yes
POOTPROTO=none
BROADCAST=207.200.5.255
NETWORK=207.200.5.0
NETMASK=255.255.255.0
IPADDR=207.200.5.2


Parameter Description
=====================

Below is a list of the command line parameters supported by the Linux device
driver.

mtu=packet_size                 - Specifies the maximum packet size. default
                                  is 1500.

tx_mode=transmission_method     - Specifies the I/O method use to transmit a
                                  packet. If transmission_method=1, the PIO
                                  method is used to transmit packets. If
                                  transmission_method=2, the PDL/PDC busmaster
                                  methods are used to transmit packets. By
                                  default, packets are transmitted using the
                                  PDL/PDC busmaster methods.

tx_threshold=threshold_value    - Specifies the threshold used on a per packet
                                  basis to determine whether the PDL busmaster
                                  or PDC busmaster method is used to transmit
                                  a packet. Packets with lengths less than the
                                  threshold use the PDC busmaster method.
                                  Packet with lengths greater than or equal to
                                  the threshold use the PDL busmaster method.
                                  The default threshold is 700.

rx_mode=receive_method          - Specifies the I/O method used to receive
                                  packets. If receive_method=1, the PIO method
                                  is used to receive packets. If receive_method
                                  =2, the PDL method is used receive packets.
                                  If receive_method=4, the PDC method is used
                                  to receive packets. By default, the packets
                                  are received using the PDL method.

speed=xxxx                      - Specifies the link speed the NIC operates at
                                  . If speed=0, the link speed is autonegoti-
                                  ated. If speed=1000, the link speed is forced
                                  to 1 gigabit. By default, the NIC autonegoti-
                                  ates the link speed.

duplex=duplex_mode              - Specifies the duplex mode for the NIC. If
                                  duplex=0, the duplex mode is autonegotiated.
                                  If duplex=full, the NIC operates in full
                                  duplex mode. By default, the NIC autonegoti-
                                  ates the duplex mode.

