Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Mauro Carvalho Chehab and committed by
David S. Miller
ca705e47 c981977d

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