The Linux Kernel Logo
  • Development process
  • Submitting patches
  • Code of conduct
  • Maintainer handbook
  • All development-process docs
  • Core API
  • Driver APIs
  • Subsystems
    • Core subsystems
    • Human interfaces
    • Networking interfaces
      • Networking
        • AF_XDP
        • Bare UDP Tunnelling Module Documentation
        • batman-adv
        • SocketCAN - Controller Area Network
        • The UCAN Protocol
        • Hardware Device Drivers
          • Asynchronous Transfer Mode (ATM) Device Drivers
          • Controller Area Network (CAN) Device Drivers
          • Cellular Modem Device Drivers
          • Ethernet Device Drivers
            • Linux and the 3Com EtherLink III Series Ethercards (driver v1.18c and higher)
            • 3Com Vortex device driver
            • Linux kernel driver for Elastic Network Adapter (ENA) family
            • Altera Triple-Speed Ethernet MAC driver
            • Linux Driver for the AMD/Pensando(R) DSC adapter family
            • PCI vDPA driver for the AMD/Pensando(R) DSC adapter family
            • PCI VFIO driver for the AMD/Pensando(R) DSC adapter family
            • Marvell(Aquantia) AQtion Driver
            • Chelsio N210 10Gb Ethernet Network Controller
            • Cirrus Logic LAN CS8900/CS8920 Ethernet Adapters
            • D-Link DL2000-based Gigabit Ethernet Adapter Installation
              • Compatibility List
              • Quick Install
              • Compiling the Driver
                • CD-ROM drive
                • Floppy disc drive
              • Installing the Driver
                • Manual Installation
                • Automated Installation
                • Red Hat v6.x/v7.x
              • Parameter Description
              • Configuration Script Sample
              • Troubleshooting
            • DM9000 Network driver
            • Davicom DM9102(A)/DM9132/DM9801 fast ethernet driver for Linux
            • The QorIQ DPAA Ethernet Driver
            • DPAA2 Documentation
            • The Gianfar Ethernet Driver
            • Linux kernel driver for Compute Engine Virtual Ethernet (gve):
            • Linux Kernel Driver for Huawei Intelligent NIC(HiNIC) family
            • Linux Base Driver for the Intel(R) PRO/100 Family of Adapters
            • Linux Base Driver for Intel(R) Ethernet Network Connection
            • Linux Driver for Intel(R) Ethernet Network Connection
            • Linux Base Driver for Intel(R) Ethernet Multi-host Controller
            • idpf Linux* Base Driver for the Intel(R) Infrastructure Data Path Function
            • Linux Base Driver for Intel(R) Ethernet Network Connection
            • Linux Base Virtual Function Driver for Intel(R) 1G Ethernet
            • Linux Base Driver for the Intel(R) Ethernet 10 Gigabit PCI Express Adapters
            • Linux Base Virtual Function Driver for Intel(R) 10G Ethernet
            • Linux Base Driver for the Intel(R) Ethernet Controller 700 Series
            • Linux Base Driver for Intel(R) Ethernet Adaptive Virtual Function
            • Linux Base Driver for the Intel(R) Ethernet Controller 800 Series
            • Marvell OcteonTx2 RVU Kernel Drivers
            • Linux kernel networking driver for Marvell’s Octeon PCI Endpoint NIC
            • Linux kernel networking driver for Marvell’s Octeon PCI Endpoint NIC VF
            • Mellanox ConnectX(R) mlx5 core VPI Network Driver
            • Meta Platforms Host Network Interface
            • Hyper-V network driver
            • Neterion’s (Formerly S2io) Xframe I/II PCI-X 10GbE driver
            • Network Flow Processor (NFP) Kernel Drivers
            • Linux Driver for the Pensando(R) Ethernet adapter family
            • SMC 9xxxx Driver
            • Linux Driver for the Synopsys(R) Ethernet Controllers “stmmac”
            • Texas Instruments CPSW ethernet driver
            • Texas Instruments CPSW switchdev based ethernet driver
            • Texas Instruments K3 AM65 CPSW NUSS switchdev based ethernet driver
            • TLAN driver for Linux
            • Linux Base Driver for WangXun(R) 10 Gigabit PCI Express Adapters
            • Linux Base Driver for WangXun(R) Gigabit PCI Express Adapters
          • Fiber Distributed Data Interface (FDDI) Device Drivers
          • Amateur Radio Device Drivers
          • Wi-Fi Device Drivers
          • WWAN Device Drivers
        • Networking Diagnostics
        • Distributed Switch Architecture
        • Linux Devlink Documentation
        • CAIF
        • Netlink interface for ethtool
        • IEEE 802.15.4 Developer’s Guide
        • ISO 15765-2 (ISO-TP)
        • J1939 Documentation
        • Linux Networking and Network Devices APIs
        • MSG_ZEROCOPY
        • FAILOVER
        • Net DIM - Generic Network Dynamic Interrupt Moderation
        • NET_FAILOVER
        • Page Pool API
        • PHY Abstraction Layer
        • phylink
        • IP-Aliasing
        • Ethernet Bridging
        • SNMP counter
        • Checksum Offloads
        • Segmentation Offloads
        • Scaling in the Linux Networking Stack
        • Kernel TLS
        • Kernel TLS offload
        • In-Kernel TLS Handshake
        • Linux NFC subsystem
        • Netdev private dataroom for 6lowpan interfaces
        • 6pack Protocol
        • ARCnet Hardware
        • ARCnet
        • ATM
        • AX.25
        • Linux Ethernet Bonding Driver HOWTO
        • cdc_mbim - Driver for CDC MBIM Mobile Broadband modems
        • DCCP protocol
        • DCTCP (DataCenter TCP)
        • Device Memory TCP
        • DNS Resolver Module
        • Softnet Driver Issues
        • EQL Driver: Serial IP Load Balancing HOWTO
        • LC-trie implementation notes
        • Linux Socket Filtering aka Berkeley Packet Filter (BPF)
        • Generic HDLC layer
        • Generic Netlink
        • Netlink Family Specifications
        • Generic networking statistics for netlink users
        • The Linux kernel GTP tunneling module
        • Identifier Locator Addressing (ILA)
        • IOAM6 Sysfs variables
        • io_uring zero copy Rx
        • IP dynamic address hack-port v0.03
        • IPsec
        • IP Sysctl
        • IPv6
        • IPVLAN Driver HOWTO
        • IPvs-sysctl
        • Kernel Connection Multiplexor
        • L2TP
        • The Linux LAPB Module Interface
        • How to use packet injection with mac80211
        • Management Component Transport Protocol (MCTP)
        • MPLS Sysfs variables
        • Multipath TCP (MPTCP)
        • MPTCP Sysfs variables
        • HOWTO for multiqueue network device support
        • Multi-PF Netdev
        • NAPI
        • Common Networking Struct Cachelines
        • Netconsole
        • Netdev features mess and how to get out from it alive
        • Network Devices, the Kernel, and You!
        • Netfilter Sysfs variables
        • NETIF Msg Level
        • Netmem Support for Network Drivers
        • Resilient Next-hop Groups
        • Netfilter Conntrack Sysfs variables
        • Netfilter’s flowtable infrastructure
        • OPEN Alliance 10BASE-T1x MAC-PHY Serial Interface (TC6) Framework Support
        • Open vSwitch datapath developer documentation
        • Operational States
        • Packet MMAP
        • Linux Phonet protocol family
        • PHY link topology
        • HOWTO for the linux packet generator
        • PLIP: The Parallel Line Internet Protocol Device
        • PPP Generic Driver and Channel Interface
        • The proc/net/tcp and proc/net/tcp6 variables
        • Power Sourcing Equipment (PSE) Documentation
        • How to use radiotap headers
        • RDS
        • Linux wireless regulatory documentation
        • Network Function Representors
        • RxRPC Network Protocol
        • SOCKET OPTIONS
        • SECURITY
        • EXAMPLE CLIENT USAGE
        • Linux Kernel SCTP
        • LSM/SeLinux secid
        • Seg6 Sysfs variables
        • struct sk_buff
        • SMC Sysctl
        • NIC SR-IOV APIs
        • Interface statistics
        • Stream Parser (strparser)
        • Ethernet switch device driver model (switchdev)
        • Sysfs tagging
        • TC Actions - Environmental Rules
        • TC queue based filtering
        • TCP Authentication Option Linux implementation (RFC5925)
        • Thin-streams and TCP
        • Team
        • Timestamping
        • Linux Kernel TIPC
        • Transparent proxy support
        • Universal TUN/TAP device driver
        • The UDP-Lite protocol (RFC 3828)
        • Virtual Routing and Forwarding (VRF)
        • Virtual eXtensible Local Area Networking documentation
        • Linux X.25 Project
        • X.25 Device Driver Interface
        • XFRM device - offloading the IPsec computations
        • XFRM proc - /proc/net/xfrm_* files
        • XFRM
        • XFRM Syscall
        • XDP RX Metadata
        • AF_XDP TX Metadata
      • NetLabel
      • InfiniBand
      • ISDN
      • MHI
    • Storage interfaces
    • Other subsystems
  • Locking
  • Licensing rules
  • Writing documentation
  • Development tools
  • Testing guide
  • Hacking guide
  • Tracing
  • Fault injection
  • Livepatching
  • Rust
  • Administration
  • Build system
  • Reporting issues
  • Userspace tools
  • Userspace API
  • Firmware
  • Firmware and Devicetree
  • CPU architectures
  • Unsorted documentation
  • Translations
The Linux Kernel
  • Kernel subsystem documentation
  • Networking
  • Hardware Device Drivers
  • Ethernet Device Drivers
  • D-Link DL2000-based Gigabit Ethernet Adapter Installation
  • View page source

D-Link DL2000-based Gigabit Ethernet Adapter Installation¶

May 23, 2002

Compatibility List¶

Adapter Support:

  • D-Link DGE-550T Gigabit Ethernet Adapter.

  • D-Link DGE-550SX Gigabit Ethernet Adapter.

  • D-Link DL2000-based Gigabit Ethernet Adapter.

The driver support Linux kernel 2.4.7 later. We had tested it on the environments below.

. Red Hat v6.2 (update kernel to 2.4.7) . Red Hat v7.0 (update kernel to 2.4.7) . Red Hat v7.1 (kernel 2.4.7) . Red Hat v7.2 (kernel 2.4.7-10)

Quick Install¶

Install linux driver as following command:

1. make all
2. insmod dl2k.ko
3. ifconfig eth0 up 10.xxx.xxx.xxx netmask 255.0.0.0
                    ^^^^^^^^^^^^^^^\            ^^^^^^^^\
                                    IP                   NETMASK

Now eth0 should active, you can test it by “ping” or get more information by “ifconfig”. If tested ok, continue the next step.

  1. cp dl2k.ko /lib/modules/`uname -r`/kernel/drivers/net

  2. Add the following line to /etc/modprobe.d/dl2k.conf:

    alias eth0 dl2k
    
  3. Run depmod to updated module indexes.

  4. Run netconfig or netconf to create configuration script ifcfg-eth0 located at /etc/sysconfig/network-scripts or create it manually.

    [see - Configuration Script Sample]

  5. Driver will automatically load and configure at next boot time.

Compiling the Driver¶

In Linux, NIC drivers are most commonly configured as loadable modules. 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. The remainder of this section assumes the driver is built as a loadable module. In the Linux environment, it is a good idea to rebuild the driver from the source instead of relying on a precompiled version. This approach provides better reliability since a precompiled driver might depend on libraries or kernel features that are not present in a given Linux installation.

The 3 files necessary to build Linux device driver are dl2k.c, dl2k.h and Makefile. To compile, the Linux installation must include the gcc compiler, the kernel source, and the kernel headers. The Linux driver supports Linux Kernels 2.4.7. Copy the files to a directory and enter the following command to compile and link the driver:

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 /root] mkdir dl2k
[root@XXX /root] cd dl2k
[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¶

[root@XXX /] cd root
[root@XXX /root] mkdir dl2k
[root@XXX /root] cd dl2k
[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¶

Manual Installation¶

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 module enter the command:

insmod dl2k.o

or:

insmod dl2k.o <optional parameter>  ; add parameter

example:

 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 the Linux device driver below.

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, it is necessary to issue the following command:

ifconfig eth0 up

Finally, to bind the driver to the active protocol (e.g., TCP/IP with Linux), enter the following command:

ifup eth0

Note that this is meaningful only if the system can find a configuration script that contains the necessary network information. A sample will be given in the next paragraph.

The commands to unload a driver are as follows:

ifdown eth0
ifconfig eth0 down
rmmod dl2k.o

The following are the commands to list the currently loaded modules and to see the current network configuration:

lsmod
ifconfig

Automated Installation¶

This section describes how to install the driver such that it is 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 other distributions as well.

Red Hat v6.x/v7.x¶

  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.

  2. Locate the boot module configuration file, most commonly in the /etc/modprobe.d/ directory. Add the following lines:

    alias ethx dl2k
    options dl2k <optional parameters>
    

    where ethx will be eth0 if the NIC is the only ethernet adapter, eth1 if one other ethernet adapter is installed, etc. Refer to the table in the previous section for the list of optional parameters.

  3. Locate the network configuration scripts, normally the /etc/sysconfig/network-scripts directory, and create a configuration script named ifcfg-ethx that contains network information.

  4. Note that for most Linux distributions, Red Hat included, a configuration utility with a graphical user interface is provided to perform steps 2 and 3 above.

Parameter Description¶

You can install this driver without any additional parameter. However, if you are going to have extensive functions then it is necessary to set extra parameter. Below is a list of the command line parameters supported by the Linux device driver.

mtu=packet_size

Specifies the maximum packet size. default is 1500.

media=media_type

Specifies the media type the NIC operates at. autosense Autosensing active media.

10mbps_hd

10Mbps half duplex.

10mbps_fd

10Mbps full duplex.

100mbps_hd

100Mbps half duplex.

100mbps_fd

100Mbps full duplex.

1000mbps_fd

1000Mbps full duplex.

1000mbps_hd

1000Mbps half duplex.

0

Autosensing active media.

1

10Mbps half duplex.

2

10Mbps full duplex.

3

100Mbps half duplex.

4

100Mbps full duplex.

5

1000Mbps half duplex.

6

1000Mbps full duplex.

By default, the NIC operates at autosense. 1000mbps_fd and 1000mbps_hd types are only available for fiber adapter.

vlan=n

Specifies the VLAN ID. If vlan=0, the Virtual Local Area Network (VLAN) function is disable.

jumbo=[0|1]

Specifies the jumbo frame support. If jumbo=1, the NIC accept jumbo frames. By default, this function is disabled. Jumbo frame usually improve the performance int gigabit. This feature need jumbo frame compatible remote.

rx_coalesce=m

Number of rx frame handled each interrupt.

rx_timeout=n

Rx DMA wait time for an interrupt. If set rx_coalesce > 0, hardware only assert an interrupt for m frames. Hardware won’t assert rx interrupt until m frames received or reach timeout of n * 640 nano seconds. Set proper rx_coalesce and rx_timeout can reduce congestion collapse and overload which has been a bottleneck for high speed network.

For example, rx_coalesce=10 rx_timeout=800. that is, hardware assert only 1 interrupt for 10 frames received or timeout of 512 us.

tx_coalesce=n

Number of tx frame handled each interrupt. Set n > 1 can reduce the interrupts congestion usually lower performance of high speed network card. Default is 16.

tx_flow=[1|0]

Specifies the Tx flow control. If tx_flow=0, the Tx flow control disable else driver autodetect.

rx_flow=[1|0]

Specifies the Rx flow control. If rx_flow=0, the Rx flow control enable else driver autodetect.

Configuration Script Sample¶

Here is a sample of a simple configuration script:

DEVICE=eth0
USERCTL=no
ONBOOT=yes
POOTPROTO=none
BROADCAST=207.200.5.255
NETWORK=207.200.5.0
NETMASK=255.255.255.0
IPADDR=207.200.5.2

Troubleshooting¶

Q1. Source files contain ^ M behind every line.

Make sure all files are Unix file format (no LF). Try the following shell command to convert files:

cat dl2k.c | col -b > dl2k.tmp
mv dl2k.tmp dl2k.c

OR:

cat dl2k.c | tr -d "\r" > dl2k.tmp
mv dl2k.tmp dl2k.c

Q2: Could not find header files (*.h)?

To compile the driver, you need kernel header files. After installing the kernel source, the header files are usually located in /usr/src/linux/include, which is the default include directory configured 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 INCLUDEDIR in Makefile to /usr/include without installing kernel source.

Note that RH 7.0 didn’t provide correct header files in /usr/include, including those files will make a wrong version driver.

Previous Next

© Copyright The kernel development community.

Built with Sphinx using a theme provided by Read the Docs.