Commit ca705e47 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab Committed by David S. Miller

docs: networking: device drivers: convert dlink/dl2k.txt to ReST

- add SPDX header;
- mark code blocks and literals as such;
- mark lists as such;
- adjust identation, whitespaces and blank lines where needed;
- add to networking/index.rst.
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c981977d
.. SPDX-License-Identifier: GPL-2.0
D-Link DL2000-based Gigabit Ethernet Adapter Installation =========================================================
for Linux D-Link DL2000-based Gigabit Ethernet Adapter Installation
May 23, 2002 =========================================================
May 23, 2002
.. Contents
Contents
========
- Compatibility List - Compatibility List
- Quick Install - Quick Install
- Compiling the Driver - Compiling the Driver
...@@ -15,12 +18,13 @@ Contents ...@@ -15,12 +18,13 @@ Contents
Compatibility List Compatibility List
================= ==================
Adapter Support: Adapter Support:
D-Link DGE-550T Gigabit Ethernet Adapter. - D-Link DGE-550T Gigabit Ethernet Adapter.
D-Link DGE-550SX Gigabit Ethernet Adapter. - D-Link DGE-550SX Gigabit Ethernet Adapter.
D-Link DL2000-based Gigabit Ethernet Adapter. - D-Link DL2000-based Gigabit Ethernet Adapter.
The driver support Linux kernel 2.4.7 later. We had tested it The driver support Linux kernel 2.4.7 later. We had tested it
...@@ -34,28 +38,32 @@ on the environments below. ...@@ -34,28 +38,32 @@ on the environments below.
Quick Install Quick Install
============= =============
Install linux driver as following command: Install linux driver as following command::
1. make all 1. make all
2. insmod dl2k.ko 2. insmod dl2k.ko
3. ifconfig eth0 up 10.xxx.xxx.xxx netmask 255.0.0.0 3. ifconfig eth0 up 10.xxx.xxx.xxx netmask 255.0.0.0
^^^^^^^^^^^^^^^\ ^^^^^^^^\ ^^^^^^^^^^^^^^^\ ^^^^^^^^\
IP NETMASK IP NETMASK
Now eth0 should active, you can test it by "ping" or get more information by Now eth0 should active, you can test it by "ping" or get more information by
"ifconfig". If tested ok, continue the next step. "ifconfig". If tested ok, continue the next step.
4. cp dl2k.ko /lib/modules/`uname -r`/kernel/drivers/net 4. ``cp dl2k.ko /lib/modules/`uname -r`/kernel/drivers/net``
5. Add the following line to /etc/modprobe.d/dl2k.conf: 5. Add the following line to /etc/modprobe.d/dl2k.conf::
alias eth0 dl2k alias eth0 dl2k
6. Run depmod to updated module indexes.
7. Run "netconfig" or "netconf" to create configuration script ifcfg-eth0 6. Run ``depmod`` to updated module indexes.
7. Run ``netconfig`` or ``netconf`` to create configuration script ifcfg-eth0
located at /etc/sysconfig/network-scripts or create it manually. located at /etc/sysconfig/network-scripts or create it manually.
[see - Configuration Script Sample] [see - Configuration Script Sample]
8. Driver will automatically load and configure at next boot time. 8. Driver will automatically load and configure at next boot time.
Compiling the Driver Compiling the Driver
==================== ====================
In Linux, NIC drivers are most commonly configured as loadable modules. In Linux, NIC drivers are most commonly configured as loadable modules.
The approach of building a monolithic kernel has become obsolete. The driver 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. 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. The remainder of this section assumes the driver is built as a loadable module.
...@@ -73,57 +81,72 @@ to compile and link the driver: ...@@ -73,57 +81,72 @@ to compile and link the driver:
CD-ROM drive CD-ROM drive
------------ ------------
[root@XXX /] mkdir cdrom ::
[root@XXX /] mount -r -t iso9660 -o conv=auto /dev/cdrom /cdrom
[root@XXX /] cd root [root@XXX /] mkdir cdrom
[root@XXX /root] mkdir dl2k [root@XXX /] mount -r -t iso9660 -o conv=auto /dev/cdrom /cdrom
[root@XXX /root] cd dl2k [root@XXX /] cd root
[root@XXX dl2k] cp /cdrom/linux/dl2k.tgz /root/dl2k [root@XXX /root] mkdir dl2k
[root@XXX dl2k] tar xfvz dl2k.tgz [root@XXX /root] cd dl2k
[root@XXX dl2k] make all [root@XXX dl2k] cp /cdrom/linux/dl2k.tgz /root/dl2k
[root@XXX dl2k] tar xfvz dl2k.tgz
[root@XXX dl2k] make all
Floppy disc drive Floppy disc drive
----------------- -----------------
[root@XXX /] cd root ::
[root@XXX /root] mkdir dl2k
[root@XXX /root] cd dl2k [root@XXX /] cd root
[root@XXX dl2k] mcopy a:/linux/dl2k.tgz /root/dl2k [root@XXX /root] mkdir dl2k
[root@XXX dl2k] tar xfvz dl2k.tgz [root@XXX /root] cd dl2k
[root@XXX dl2k] make all [root@XXX dl2k] mcopy a:/linux/dl2k.tgz /root/dl2k
[root@XXX dl2k] tar xfvz dl2k.tgz
[root@XXX dl2k] make all
Installing the Driver Installing the Driver
===================== =====================
Manual Installation Manual Installation
------------------- -------------------
Once the driver has been compiled, it must be loaded, enabled, and bound 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 to a protocol stack in order to establish network connectivity. To load a
module enter the command: module enter the command::
insmod dl2k.o insmod dl2k.o
or or::
insmod dl2k.o <optional parameter> ; add parameter insmod dl2k.o <optional parameter> ; add parameter
=============================================================== ---------------------------------------------------------
example: insmod dl2k.o media=100mbps_hd
or insmod dl2k.o media=3 example::
or insmod dl2k.o media=3,2 ; for 2 cards
=============================================================== insmod dl2k.o media=100mbps_hd
or::
insmod dl2k.o media=3
or::
insmod dl2k.o media=3,2 ; for 2 cards
---------------------------------------------------------
Please reference the list of the command line parameters supported by Please reference the list of the command line parameters supported by
the Linux device driver below. the Linux device driver below.
The insmod command only loads the driver and gives it a name of the form 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, eth0, eth1, etc. To bring the NIC into an operational state,
it is necessary to issue the following command: it is necessary to issue the following command::
ifconfig eth0 up ifconfig eth0 up
Finally, to bind the driver to the active protocol (e.g., TCP/IP with Finally, to bind the driver to the active protocol (e.g., TCP/IP with
Linux), enter the following command: Linux), enter the following command::
ifup eth0 ifup eth0
...@@ -131,32 +154,32 @@ Installing the Driver ...@@ -131,32 +154,32 @@ Installing the Driver
script that contains the necessary network information. A sample will be script that contains the necessary network information. A sample will be
given in the next paragraph. given in the next paragraph.
The commands to unload a driver are as follows: The commands to unload a driver are as follows::
ifdown eth0 ifdown eth0
ifconfig eth0 down ifconfig eth0 down
rmmod dl2k.o rmmod dl2k.o
The following are the commands to list the currently loaded modules and The following are the commands to list the currently loaded modules and
to see the current network configuration. to see the current network configuration::
lsmod lsmod
ifconfig ifconfig
Automated Installation Automated Installation
---------------------- ----------------------
This section describes how to install the driver such that it is This section describes how to install the driver such that it is
automatically loaded and configured at boot time. The following description automatically loaded and configured at boot time. The following description
is based on a Red Hat 6.0/7.0 distribution, but it can easily be ported to is based on a Red Hat 6.0/7.0 distribution, but it can easily be ported to
other distributions as well. other distributions as well.
Red Hat v6.x/v7.x Red Hat v6.x/v7.x
----------------- -----------------
1. Copy dl2k.o to the network modules directory, typically 1. Copy dl2k.o to the network modules directory, typically
/lib/modules/2.x.x-xx/net or /lib/modules/2.x.x/kernel/drivers/net. /lib/modules/2.x.x-xx/net or /lib/modules/2.x.x/kernel/drivers/net.
2. Locate the boot module configuration file, most commonly in the 2. Locate the boot module configuration file, most commonly in the
/etc/modprobe.d/ directory. Add the following lines: /etc/modprobe.d/ directory. Add the following lines::
alias ethx dl2k alias ethx dl2k
options dl2k <optional parameters> options dl2k <optional parameters>
...@@ -180,11 +203,15 @@ parameter. Below is a list of the command line parameters supported by the ...@@ -180,11 +203,15 @@ parameter. Below is a list of the command line parameters supported by the
Linux device Linux device
driver. driver.
mtu=packet_size - Specifies the maximum packet size. default
=============================== ==============================================
mtu=packet_size Specifies the maximum packet size. default
is 1500. is 1500.
media=media_type - Specifies the media type the NIC operates at. media=media_type Specifies the media type the NIC operates at.
autosense Autosensing active media. autosense Autosensing active media.
=========== =========================
10mbps_hd 10Mbps half duplex. 10mbps_hd 10Mbps half duplex.
10mbps_fd 10Mbps full duplex. 10mbps_fd 10Mbps full duplex.
100mbps_hd 100Mbps half duplex. 100mbps_hd 100Mbps half duplex.
...@@ -198,16 +225,17 @@ media=media_type - Specifies the media type the NIC operates at. ...@@ -198,16 +225,17 @@ media=media_type - Specifies the media type the NIC operates at.
4 100Mbps full duplex. 4 100Mbps full duplex.
5 1000Mbps half duplex. 5 1000Mbps half duplex.
6 1000Mbps full duplex. 6 1000Mbps full duplex.
=========== =========================
By default, the NIC operates at autosense. By default, the NIC operates at autosense.
1000mbps_fd and 1000mbps_hd types are only 1000mbps_fd and 1000mbps_hd types are only
available for fiber adapter. available for fiber adapter.
vlan=n - Specifies the VLAN ID. If vlan=0, the vlan=n Specifies the VLAN ID. If vlan=0, the
Virtual Local Area Network (VLAN) function is Virtual Local Area Network (VLAN) function is
disable. disable.
jumbo=[0|1] - Specifies the jumbo frame support. If jumbo=1, jumbo=[0|1] Specifies the jumbo frame support. If jumbo=1,
the NIC accept jumbo frames. By default, this the NIC accept jumbo frames. By default, this
function is disabled. function is disabled.
Jumbo frame usually improve the performance Jumbo frame usually improve the performance
...@@ -215,8 +243,8 @@ jumbo=[0|1] - Specifies the jumbo frame support. If jumbo=1, ...@@ -215,8 +243,8 @@ jumbo=[0|1] - Specifies the jumbo frame support. If jumbo=1,
This feature need jumbo frame compatible This feature need jumbo frame compatible
remote. remote.
rx_coalesce=m - Number of rx frame handled each interrupt. rx_coalesce=m Number of rx frame handled each interrupt.
rx_timeout=n - Rx DMA wait time for an interrupt. rx_timeout=n Rx DMA wait time for an interrupt.
If set rx_coalesce > 0, hardware only assert If set rx_coalesce > 0, hardware only assert
an interrupt for m frames. Hardware won't an interrupt for m frames. Hardware won't
assert rx interrupt until m frames received or assert rx interrupt until m frames received or
...@@ -229,54 +257,58 @@ rx_timeout=n - Rx DMA wait time for an interrupt. ...@@ -229,54 +257,58 @@ rx_timeout=n - Rx DMA wait time for an interrupt.
that is, hardware assert only 1 interrupt that is, hardware assert only 1 interrupt
for 10 frames received or timeout of 512 us. for 10 frames received or timeout of 512 us.
tx_coalesce=n - Number of tx frame handled each interrupt. tx_coalesce=n Number of tx frame handled each interrupt.
Set n > 1 can reduce the interrupts Set n > 1 can reduce the interrupts
congestion usually lower performance of congestion usually lower performance of
high speed network card. Default is 16. high speed network card. Default is 16.
tx_flow=[1|0] - Specifies the Tx flow control. If tx_flow=0, tx_flow=[1|0] Specifies the Tx flow control. If tx_flow=0,
the Tx flow control disable else driver the Tx flow control disable else driver
autodetect. autodetect.
rx_flow=[1|0] - Specifies the Rx flow control. If rx_flow=0, rx_flow=[1|0] Specifies the Rx flow control. If rx_flow=0,
the Rx flow control enable else driver the Rx flow control enable else driver
autodetect. autodetect.
=============================== ==============================================
Configuration Script Sample Configuration Script Sample
=========================== ===========================
Here is a sample of a simple configuration script: Here is a sample of a simple configuration script::
DEVICE=eth0 DEVICE=eth0
USERCTL=no USERCTL=no
ONBOOT=yes ONBOOT=yes
POOTPROTO=none POOTPROTO=none
BROADCAST=207.200.5.255 BROADCAST=207.200.5.255
NETWORK=207.200.5.0 NETWORK=207.200.5.0
NETMASK=255.255.255.0 NETMASK=255.255.255.0
IPADDR=207.200.5.2 IPADDR=207.200.5.2
Troubleshooting Troubleshooting
=============== ===============
Q1. Source files contain ^ M behind every line. Q1. Source files contain ^ M behind every line.
Make sure all files are Unix file format (no LF). Try the following Make sure all files are Unix file format (no LF). Try the following
shell command to convert files. shell command to convert files::
cat dl2k.c | col -b > dl2k.tmp cat dl2k.c | col -b > dl2k.tmp
mv dl2k.tmp dl2k.c mv dl2k.tmp dl2k.c
OR OR::
cat dl2k.c | tr -d "\r" > dl2k.tmp cat dl2k.c | tr -d "\r" > dl2k.tmp
mv dl2k.tmp dl2k.c mv dl2k.tmp dl2k.c
Q2: Could not find header files (*.h) ? Q2: Could not find header files (``*.h``)?
To compile the driver, you need kernel header files. After To compile the driver, you need kernel header files. After
installing the kernel source, the header files are usually located in installing the kernel source, the header files are usually located in
/usr/src/linux/include, which is the default include directory configured /usr/src/linux/include, which is the default include directory configured
in Makefile. For some distributions, there is a copy of header files in in Makefile. For some distributions, there is a copy of header files in
/usr/src/include/linux and /usr/src/include/asm, that you can change the /usr/src/include/linux and /usr/src/include/asm, that you can change the
INCLUDEDIR in Makefile to /usr/include without installing kernel source. INCLUDEDIR in Makefile to /usr/include without installing kernel source.
Note that RH 7.0 didn't provide correct header files in /usr/include, Note that RH 7.0 didn't provide correct header files in /usr/include,
including those files will make a wrong version driver. including those files will make a wrong version driver.
...@@ -36,6 +36,7 @@ Contents: ...@@ -36,6 +36,7 @@ Contents:
davicom/dm9000 davicom/dm9000
dec/de4x5 dec/de4x5
dec/dmfe dec/dmfe
dlink/dl2k
.. only:: subproject and html .. only:: subproject and html
......
...@@ -1869,7 +1869,7 @@ Compile command: ...@@ -1869,7 +1869,7 @@ Compile command:
gcc -D__KERNEL__ -DMODULE -I/usr/src/linux/include -Wall -Wstrict-prototypes -O2 -c dl2k.c gcc -D__KERNEL__ -DMODULE -I/usr/src/linux/include -Wall -Wstrict-prototypes -O2 -c dl2k.c
Read Documentation/networking/device_drivers/dlink/dl2k.txt for details. Read Documentation/networking/device_drivers/dlink/dl2k.rst for details.
*/ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment