Don't understand german? Read or subscribe to my english-only feed.

Linux kernel driver <-> device mapping (Update)

Update: thanks for mentioning ethtool, Robert Fischer

A common sysadmin task is to locate a specific device and identify which driver is responsible for it. Usage examples to identify a WLAN device on Linux:

Not so well known yet – pciutils >=2.2.9. provides switch ‘-k’ for lspci:

% lspci -k
[...]
03:00.0 Network controller: Intel Corporation PRO/Wireless 3945ABG Network Connection (rev 02)
        Kernel driver in use: ipw3945
        Kernel modules: ipw3945
[...]

Using hwinfo:

% hwinfo --netcard
  Model: "Intel PRO/Wireless 3945ABG Network Connection"
[...]
  Driver: "ipw3945"
  Driver Modules: "ipw3945"
  Device File: ipw
  Features: WLAN

Via ethtool:

% ethtool -i ipw
driver: ipw3945
version: 1.2.1dmpr
firmware-version: 14.2 1:0 ()
bus-info: 0000:03:00.0

Or using the manual approach via sysfs (being /sys/class/net/$DEVICE_NAME/device/driver/module) – recommended for scripting:

% basename $(readlink /sys/class/net/ipw/device/driver)
ipw3945

One Response to “Linux kernel driver <-> device mapping (Update)”

  1. trispace Says:

    There is also
    $ ethtool -i eth1
    driver: 8139too
    version: 0.9.28
    firmware-version:
    bus-info: 0000:05:06.0