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