0001 .. SPDX-License-Identifier: GPL-2.0
0002
0003 =========================================================
0004 D-Link DL2000-based Gigabit Ethernet Adapter Installation
0005 =========================================================
0006
0007 May 23, 2002
0008
0009 .. Contents
0010
0011 - Compatibility List
0012 - Quick Install
0013 - Compiling the Driver
0014 - Installing the Driver
0015 - Option parameter
0016 - Configuration Script Sample
0017 - Troubleshooting
0018
0019
0020 Compatibility List
0021 ==================
0022
0023 Adapter Support:
0024
0025 - D-Link DGE-550T Gigabit Ethernet Adapter.
0026 - D-Link DGE-550SX Gigabit Ethernet Adapter.
0027 - D-Link DL2000-based Gigabit Ethernet Adapter.
0028
0029
0030 The driver support Linux kernel 2.4.7 later. We had tested it
0031 on the environments below.
0032
0033 . Red Hat v6.2 (update kernel to 2.4.7)
0034 . Red Hat v7.0 (update kernel to 2.4.7)
0035 . Red Hat v7.1 (kernel 2.4.7)
0036 . Red Hat v7.2 (kernel 2.4.7-10)
0037
0038
0039 Quick Install
0040 =============
0041 Install linux driver as following command::
0042
0043 1. make all
0044 2. insmod dl2k.ko
0045 3. ifconfig eth0 up 10.xxx.xxx.xxx netmask 255.0.0.0
0046 ^^^^^^^^^^^^^^^\ ^^^^^^^^\
0047 IP NETMASK
0048
0049 Now eth0 should active, you can test it by "ping" or get more information by
0050 "ifconfig". If tested ok, continue the next step.
0051
0052 4. ``cp dl2k.ko /lib/modules/`uname -r`/kernel/drivers/net``
0053 5. Add the following line to /etc/modprobe.d/dl2k.conf::
0054
0055 alias eth0 dl2k
0056
0057 6. Run ``depmod`` to updated module indexes.
0058 7. Run ``netconfig`` or ``netconf`` to create configuration script ifcfg-eth0
0059 located at /etc/sysconfig/network-scripts or create it manually.
0060
0061 [see - Configuration Script Sample]
0062 8. Driver will automatically load and configure at next boot time.
0063
0064 Compiling the Driver
0065 ====================
0066 In Linux, NIC drivers are most commonly configured as loadable modules.
0067 The approach of building a monolithic kernel has become obsolete. The driver
0068 can be compiled as part of a monolithic kernel, but is strongly discouraged.
0069 The remainder of this section assumes the driver is built as a loadable module.
0070 In the Linux environment, it is a good idea to rebuild the driver from the
0071 source instead of relying on a precompiled version. This approach provides
0072 better reliability since a precompiled driver might depend on libraries or
0073 kernel features that are not present in a given Linux installation.
0074
0075 The 3 files necessary to build Linux device driver are dl2k.c, dl2k.h and
0076 Makefile. To compile, the Linux installation must include the gcc compiler,
0077 the kernel source, and the kernel headers. The Linux driver supports Linux
0078 Kernels 2.4.7. Copy the files to a directory and enter the following command
0079 to compile and link the driver:
0080
0081 CD-ROM drive
0082 ------------
0083
0084 ::
0085
0086 [root@XXX /] mkdir cdrom
0087 [root@XXX /] mount -r -t iso9660 -o conv=auto /dev/cdrom /cdrom
0088 [root@XXX /] cd root
0089 [root@XXX /root] mkdir dl2k
0090 [root@XXX /root] cd dl2k
0091 [root@XXX dl2k] cp /cdrom/linux/dl2k.tgz /root/dl2k
0092 [root@XXX dl2k] tar xfvz dl2k.tgz
0093 [root@XXX dl2k] make all
0094
0095 Floppy disc drive
0096 -----------------
0097
0098 ::
0099
0100 [root@XXX /] cd root
0101 [root@XXX /root] mkdir dl2k
0102 [root@XXX /root] cd dl2k
0103 [root@XXX dl2k] mcopy a:/linux/dl2k.tgz /root/dl2k
0104 [root@XXX dl2k] tar xfvz dl2k.tgz
0105 [root@XXX dl2k] make all
0106
0107 Installing the Driver
0108 =====================
0109
0110 Manual Installation
0111 -------------------
0112
0113 Once the driver has been compiled, it must be loaded, enabled, and bound
0114 to a protocol stack in order to establish network connectivity. To load a
0115 module enter the command::
0116
0117 insmod dl2k.o
0118
0119 or::
0120
0121 insmod dl2k.o <optional parameter> ; add parameter
0122
0123 ---------------------------------------------------------
0124
0125 example::
0126
0127 insmod dl2k.o media=100mbps_hd
0128
0129 or::
0130
0131 insmod dl2k.o media=3
0132
0133 or::
0134
0135 insmod dl2k.o media=3,2 ; for 2 cards
0136
0137 ---------------------------------------------------------
0138
0139 Please reference the list of the command line parameters supported by
0140 the Linux device driver below.
0141
0142 The insmod command only loads the driver and gives it a name of the form
0143 eth0, eth1, etc. To bring the NIC into an operational state,
0144 it is necessary to issue the following command::
0145
0146 ifconfig eth0 up
0147
0148 Finally, to bind the driver to the active protocol (e.g., TCP/IP with
0149 Linux), enter the following command::
0150
0151 ifup eth0
0152
0153 Note that this is meaningful only if the system can find a configuration
0154 script that contains the necessary network information. A sample will be
0155 given in the next paragraph.
0156
0157 The commands to unload a driver are as follows::
0158
0159 ifdown eth0
0160 ifconfig eth0 down
0161 rmmod dl2k.o
0162
0163 The following are the commands to list the currently loaded modules and
0164 to see the current network configuration::
0165
0166 lsmod
0167 ifconfig
0168
0169
0170 Automated Installation
0171 ----------------------
0172 This section describes how to install the driver such that it is
0173 automatically loaded and configured at boot time. The following description
0174 is based on a Red Hat 6.0/7.0 distribution, but it can easily be ported to
0175 other distributions as well.
0176
0177 Red Hat v6.x/v7.x
0178 -----------------
0179 1. Copy dl2k.o to the network modules directory, typically
0180 /lib/modules/2.x.x-xx/net or /lib/modules/2.x.x/kernel/drivers/net.
0181 2. Locate the boot module configuration file, most commonly in the
0182 /etc/modprobe.d/ directory. Add the following lines::
0183
0184 alias ethx dl2k
0185 options dl2k <optional parameters>
0186
0187 where ethx will be eth0 if the NIC is the only ethernet adapter, eth1 if
0188 one other ethernet adapter is installed, etc. Refer to the table in the
0189 previous section for the list of optional parameters.
0190 3. Locate the network configuration scripts, normally the
0191 /etc/sysconfig/network-scripts directory, and create a configuration
0192 script named ifcfg-ethx that contains network information.
0193 4. Note that for most Linux distributions, Red Hat included, a configuration
0194 utility with a graphical user interface is provided to perform steps 2
0195 and 3 above.
0196
0197
0198 Parameter Description
0199 =====================
0200 You can install this driver without any additional parameter. However, if you
0201 are going to have extensive functions then it is necessary to set extra
0202 parameter. Below is a list of the command line parameters supported by the
0203 Linux device
0204 driver.
0205
0206
0207 =============================== ==============================================
0208 mtu=packet_size Specifies the maximum packet size. default
0209 is 1500.
0210
0211 media=media_type Specifies the media type the NIC operates at.
0212 autosense Autosensing active media.
0213
0214 =========== =========================
0215 10mbps_hd 10Mbps half duplex.
0216 10mbps_fd 10Mbps full duplex.
0217 100mbps_hd 100Mbps half duplex.
0218 100mbps_fd 100Mbps full duplex.
0219 1000mbps_fd 1000Mbps full duplex.
0220 1000mbps_hd 1000Mbps half duplex.
0221 0 Autosensing active media.
0222 1 10Mbps half duplex.
0223 2 10Mbps full duplex.
0224 3 100Mbps half duplex.
0225 4 100Mbps full duplex.
0226 5 1000Mbps half duplex.
0227 6 1000Mbps full duplex.
0228 =========== =========================
0229
0230 By default, the NIC operates at autosense.
0231 1000mbps_fd and 1000mbps_hd types are only
0232 available for fiber adapter.
0233
0234 vlan=n Specifies the VLAN ID. If vlan=0, the
0235 Virtual Local Area Network (VLAN) function is
0236 disable.
0237
0238 jumbo=[0|1] Specifies the jumbo frame support. If jumbo=1,
0239 the NIC accept jumbo frames. By default, this
0240 function is disabled.
0241 Jumbo frame usually improve the performance
0242 int gigabit.
0243 This feature need jumbo frame compatible
0244 remote.
0245
0246 rx_coalesce=m Number of rx frame handled each interrupt.
0247 rx_timeout=n Rx DMA wait time for an interrupt.
0248 If set rx_coalesce > 0, hardware only assert
0249 an interrupt for m frames. Hardware won't
0250 assert rx interrupt until m frames received or
0251 reach timeout of n * 640 nano seconds.
0252 Set proper rx_coalesce and rx_timeout can
0253 reduce congestion collapse and overload which
0254 has been a bottleneck for high speed network.
0255
0256 For example, rx_coalesce=10 rx_timeout=800.
0257 that is, hardware assert only 1 interrupt
0258 for 10 frames received or timeout of 512 us.
0259
0260 tx_coalesce=n Number of tx frame handled each interrupt.
0261 Set n > 1 can reduce the interrupts
0262 congestion usually lower performance of
0263 high speed network card. Default is 16.
0264
0265 tx_flow=[1|0] Specifies the Tx flow control. If tx_flow=0,
0266 the Tx flow control disable else driver
0267 autodetect.
0268 rx_flow=[1|0] Specifies the Rx flow control. If rx_flow=0,
0269 the Rx flow control enable else driver
0270 autodetect.
0271 =============================== ==============================================
0272
0273
0274 Configuration Script Sample
0275 ===========================
0276 Here is a sample of a simple configuration script::
0277
0278 DEVICE=eth0
0279 USERCTL=no
0280 ONBOOT=yes
0281 POOTPROTO=none
0282 BROADCAST=207.200.5.255
0283 NETWORK=207.200.5.0
0284 NETMASK=255.255.255.0
0285 IPADDR=207.200.5.2
0286
0287
0288 Troubleshooting
0289 ===============
0290 Q1. Source files contain ^ M behind every line.
0291
0292 Make sure all files are Unix file format (no LF). Try the following
0293 shell command to convert files::
0294
0295 cat dl2k.c | col -b > dl2k.tmp
0296 mv dl2k.tmp dl2k.c
0297
0298 OR::
0299
0300 cat dl2k.c | tr -d "\r" > dl2k.tmp
0301 mv dl2k.tmp dl2k.c
0302
0303 Q2: Could not find header files (``*.h``)?
0304
0305 To compile the driver, you need kernel header files. After
0306 installing the kernel source, the header files are usually located in
0307 /usr/src/linux/include, which is the default include directory configured
0308 in Makefile. For some distributions, there is a copy of header files in
0309 /usr/src/include/linux and /usr/src/include/asm, that you can change the
0310 INCLUDEDIR in Makefile to /usr/include without installing kernel source.
0311
0312 Note that RH 7.0 didn't provide correct header files in /usr/include,
0313 including those files will make a wrong version driver.
0314