xref: /linux/Documentation/networking/device_drivers/ethernet/dlink/dl2k.rst (revision be7aa9facb20305891bc1dfa62c7b3d3e1f58323)
1.. SPDX-License-Identifier: GPL-2.0
2
3=========================================================
4D-Link DL2000-based Gigabit Ethernet Adapter Installation
5=========================================================
6
7May 23, 2002
8
9.. Contents
10
11 - Compatibility List
12 - Quick Install
13 - Compiling the Driver
14 - Installing the Driver
15 - Option parameter
16 - Configuration Script Sample
17 - Troubleshooting
18
19
20Compatibility List
21==================
22
23Adapter Support:
24
25- D-Link DGE-550T Gigabit Ethernet Adapter.
26- D-Link DGE-550SX Gigabit Ethernet Adapter.
27- D-Link DL2000-based Gigabit Ethernet Adapter.
28
29
30The driver support Linux kernel 2.4.7 later. We had tested it
31on the environments below.
32
33 . Red Hat v6.2 (update kernel to 2.4.7)
34 . Red Hat v7.0 (update kernel to 2.4.7)
35 . Red Hat v7.1 (kernel 2.4.7)
36 . Red Hat v7.2 (kernel 2.4.7-10)
37
38
39Quick Install
40=============
41Install linux driver as following command::
42
43    1. make all
44    2. insmod dl2k.ko
45    3. ifconfig eth0 up 10.xxx.xxx.xxx netmask 255.0.0.0
46			^^^^^^^^^^^^^^^\	    ^^^^^^^^\
47					IP		     NETMASK
48
49Now eth0 should active, you can test it by "ping" or get more information by
50"ifconfig". If tested ok, continue the next step.
51
524. ``cp dl2k.ko /lib/modules/`uname -r`/kernel/drivers/net``
535. Add the following line to /etc/modprobe.d/dl2k.conf::
54
55	alias eth0 dl2k
56
576. Run ``depmod`` to updated module indexes.
587. Run ``netconfig`` or ``netconf`` to create configuration script ifcfg-eth0
59   located at /etc/sysconfig/network-scripts or create it manually.
60
61   [see - Configuration Script Sample]
628. Driver will automatically load and configure at next boot time.
63
64Compiling the Driver
65====================
66In Linux, NIC drivers are most commonly configured as loadable modules.
67The approach of building a monolithic kernel has become obsolete. The driver
68can be compiled as part of a monolithic kernel, but is strongly discouraged.
69The remainder of this section assumes the driver is built as a loadable module.
70In the Linux environment, it is a good idea to rebuild the driver from the
71source instead of relying on a precompiled version. This approach provides
72better reliability since a precompiled driver might depend on libraries or
73kernel features that are not present in a given Linux installation.
74
75The 3 files necessary to build Linux device driver are dl2k.c, dl2k.h and
76Makefile. To compile, the Linux installation must include the gcc compiler,
77the kernel source, and the kernel headers. The Linux driver supports Linux
78Kernels 2.4.7. Copy the files to a directory and enter the following command
79to compile and link the driver:
80
81CD-ROM drive
82------------
83
84::
85
86    [root@XXX /] mkdir cdrom
87    [root@XXX /] mount -r -t iso9660 -o conv=auto /dev/cdrom /cdrom
88    [root@XXX /] cd root
89    [root@XXX /root] mkdir dl2k
90    [root@XXX /root] cd dl2k
91    [root@XXX dl2k] cp /cdrom/linux/dl2k.tgz /root/dl2k
92    [root@XXX dl2k] tar xfvz dl2k.tgz
93    [root@XXX dl2k] make all
94
95Floppy disc drive
96-----------------
97
98::
99
100    [root@XXX /] cd root
101    [root@XXX /root] mkdir dl2k
102    [root@XXX /root] cd dl2k
103    [root@XXX dl2k] mcopy a:/linux/dl2k.tgz /root/dl2k
104    [root@XXX dl2k] tar xfvz dl2k.tgz
105    [root@XXX dl2k] make all
106
107Installing the Driver
108=====================
109
110Manual Installation
111-------------------
112
113  Once the driver has been compiled, it must be loaded, enabled, and bound
114  to a protocol stack in order to establish network connectivity. To load a
115  module enter the command::
116
117    insmod dl2k.o
118
119  or::
120
121    insmod dl2k.o <optional parameter>	; add parameter
122
123---------------------------------------------------------
124
125  example::
126
127    insmod dl2k.o media=100mbps_hd
128
129   or::
130
131    insmod dl2k.o media=3
132
133   or::
134
135    insmod dl2k.o media=3,2	; for 2 cards
136
137---------------------------------------------------------
138
139  Please reference the list of the command line parameters supported by
140  the Linux device driver below.
141
142  The insmod command only loads the driver and gives it a name of the form
143  eth0, eth1, etc. To bring the NIC into an operational state,
144  it is necessary to issue the following command::
145
146    ifconfig eth0 up
147
148  Finally, to bind the driver to the active protocol (e.g., TCP/IP with
149  Linux), enter the following command::
150
151    ifup eth0
152
153  Note that this is meaningful only if the system can find a configuration
154  script that contains the necessary network information. A sample will be
155  given in the next paragraph.
156
157  The commands to unload a driver are as follows::
158
159    ifdown eth0
160    ifconfig eth0 down
161    rmmod dl2k.o
162
163  The following are the commands to list the currently loaded modules and
164  to see the current network configuration::
165
166    lsmod
167    ifconfig
168
169
170Automated Installation
171----------------------
172  This section describes how to install the driver such that it is
173  automatically loaded and configured at boot time. The following description
174  is based on a Red Hat 6.0/7.0 distribution, but it can easily be ported to
175  other distributions as well.
176
177Red Hat v6.x/v7.x
178-----------------
179  1. Copy dl2k.o to the network modules directory, typically
180     /lib/modules/2.x.x-xx/net or /lib/modules/2.x.x/kernel/drivers/net.
181  2. Locate the boot module configuration file, most commonly in the
182     /etc/modprobe.d/ directory. Add the following lines::
183
184	alias ethx dl2k
185	options dl2k <optional parameters>
186
187     where ethx will be eth0 if the NIC is the only ethernet adapter, eth1 if
188     one other ethernet adapter is installed, etc. Refer to the table in the
189     previous section for the list of optional parameters.
190  3. Locate the network configuration scripts, normally the
191     /etc/sysconfig/network-scripts directory, and create a configuration
192     script named ifcfg-ethx that contains network information.
193  4. Note that for most Linux distributions, Red Hat included, a configuration
194     utility with a graphical user interface is provided to perform steps 2
195     and 3 above.
196
197
198Parameter Description
199=====================
200You can install this driver without any additional parameter. However, if you
201are going to have extensive functions then it is necessary to set extra
202parameter. Below is a list of the command line parameters supported by the
203Linux device
204driver.
205
206
207===============================   ==============================================
208mtu=packet_size			  Specifies the maximum packet size. default
209				  is 1500.
210
211media=media_type		  Specifies the media type the NIC operates at.
212				  autosense	Autosensing active media.
213
214				  ===========	=========================
215				  10mbps_hd	10Mbps half duplex.
216				  10mbps_fd	10Mbps full duplex.
217				  100mbps_hd	100Mbps half duplex.
218				  100mbps_fd	100Mbps full duplex.
219				  1000mbps_fd	1000Mbps full duplex.
220				  1000mbps_hd	1000Mbps half duplex.
221				  0		Autosensing active media.
222				  1		10Mbps half duplex.
223				  2		10Mbps full duplex.
224				  3		100Mbps half duplex.
225				  4		100Mbps full duplex.
226				  5          	1000Mbps half duplex.
227				  6          	1000Mbps full duplex.
228				  ===========	=========================
229
230				  By default, the NIC operates at autosense.
231				  1000mbps_fd and 1000mbps_hd types are only
232				  available for fiber adapter.
233
234vlan=n				  Specifies the VLAN ID. If vlan=0, the
235				  Virtual Local Area Network (VLAN) function is
236				  disable.
237
238jumbo=[0|1]			  Specifies the jumbo frame support. If jumbo=1,
239				  the NIC accept jumbo frames. By default, this
240				  function is disabled.
241				  Jumbo frame usually improve the performance
242				  int gigabit.
243				  This feature need jumbo frame compatible
244				  remote.
245
246rx_coalesce=m			  Number of rx frame handled each interrupt.
247rx_timeout=n			  Rx DMA wait time for an interrupt.
248				  If set rx_coalesce > 0, hardware only assert
249				  an interrupt for m frames. Hardware won't
250				  assert rx interrupt until m frames received or
251				  reach timeout of n * 640 nano seconds.
252				  Set proper rx_coalesce and rx_timeout can
253				  reduce congestion collapse and overload which
254				  has been a bottleneck for high speed network.
255
256				  For example, rx_coalesce=10 rx_timeout=800.
257				  that is, hardware assert only 1 interrupt
258				  for 10 frames received or timeout of 512 us.
259
260tx_coalesce=n			  Number of tx frame handled each interrupt.
261				  Set n > 1 can reduce the interrupts
262				  congestion usually lower performance of
263				  high speed network card. Default is 16.
264
265tx_flow=[1|0]			  Specifies the Tx flow control. If tx_flow=0,
266				  the Tx flow control disable else driver
267				  autodetect.
268rx_flow=[1|0]			  Specifies the Rx flow control. If rx_flow=0,
269				  the Rx flow control enable else driver
270				  autodetect.
271===============================   ==============================================
272
273
274Configuration Script Sample
275===========================
276Here is a sample of a simple configuration script::
277
278    DEVICE=eth0
279    USERCTL=no
280    ONBOOT=yes
281    POOTPROTO=none
282    BROADCAST=207.200.5.255
283    NETWORK=207.200.5.0
284    NETMASK=255.255.255.0
285    IPADDR=207.200.5.2
286
287
288Troubleshooting
289===============
290Q1. Source files contain ^ M behind every line.
291
292    Make sure all files are Unix file format (no LF). Try the following
293    shell command to convert files::
294
295	cat dl2k.c | col -b > dl2k.tmp
296	mv dl2k.tmp dl2k.c
297
298    OR::
299
300	cat dl2k.c | tr -d "\r" > dl2k.tmp
301	mv dl2k.tmp dl2k.c
302
303Q2: Could not find header files (``*.h``)?
304
305    To compile the driver, you need kernel header files. After
306    installing the kernel source, the header files are usually located in
307    /usr/src/linux/include, which is the default include directory configured
308    in Makefile. For some distributions, there is a copy of header files in
309    /usr/src/include/linux and /usr/src/include/asm, that you can change the
310    INCLUDEDIR in Makefile to /usr/include without installing kernel source.
311
312    Note that RH 7.0 didn't provide correct header files in /usr/include,
313    including those files will make a wrong version driver.
314
315