You are on page 1of 12

3/20/2020 Identify USB Driver.

Ubuntu, Debian, Mint, CentOS, Fedora & all Linux distro - blackMORE Ops

Identify USB Driver. Ubuntu, Debian, Mint, CentOS, Fedora & all Linux
distro
 August 25, 2014  Driver, How to, Linux, Networking, USB, Wireless LAN (Wi-Fi)

This guide shows how you can identify USB Driver Chipset(most commonly Wireless) Information on Linux.

Often users troll different forums and blogs to find out they can identify which driver their PCI or USB

device is using. This guide applies to all possible scenarios. After reading and following this guide you will
be able to identify the followings:

Examples of USB devices


1. USB Wireless Adapters

2. Mouses

3. Keyboards

4. External Hard drives

5. Card readers etc.

In short, any device drivers can be identified that is using plugged into a USB port. This guide will work for
any Linux distributions, namely –

1. Linux Mint

2. Ubuntu

3. Debian GNU/Linux

4. Mageia / Mandriva

5. Fedora

6. openSUSE / SUSE Linux Enterprise

7. Arch Linux

8. CentOS / Red Hat Enterprise Linux

9. PCLinuxOS

10. Slackware Linux


Privacy Policy on
11. Puppy Linux
Some
Cookies services
Usageused in
12. Kali Linux (my distro ;) ) this site uses cookies to ACCEPT  
tailor user experience or
https://www.blackmoreops.com/2014/08/25/identify-pci-usb-wired-wireless-driver-linux-identify-usb-driver/ 1/12
3/20/2020 Identify USB Driver. Ubuntu, Debian, Mint, CentOS, Fedora & all Linux distro - blackMORE Ops
tailor user experience or
As usual, I will start with basics first. nextads.
to show few paragraphs are slightly boring but if you really want to
understand, you might as well read them, otherwise just skip to the technical bits. Table of contents above.

So let’s start with the basics .. what is a an USB device…

What is Universal Serial Bus or USB?


Universal Serial Bus (USB) is an industry standard developed in the mid-1990s that defines the cables,
connectors and communications protocols used in a bus for connection, communication, and power
supply between computers and electronic devices.

USB was designed to standardize the connection of computer peripherals (including keyboards, pointing
devices, digital cameras, printers, portable media players, disk drives and network adapters) to personal
computers, both to communicate and to supply electric power. It has become commonplace on other
devices, such as smartphones, PDAs and video game consoles. USB has effectively replaced a variety of
earlier interfaces, such as serial and parallel ports, as well as separate power chargers for portable devices.

Source: Wikipedia

Question: How do I identify USB driver for anything in Linux?


This is a million dollar question, just how often you see a similar post in forums and blogs with vague and

unreliable answers? I will try my best to answer anything and everything in this post about all devices and

their drivers in here. So, stay tuned as this is going to a long a** post.

Identify USB Driver Chipset Information in Linux


lsusb which is a standard command in all Linux distribution will show you the PCI devices on your system.

LS = List

USB = Universal Serial Bus devices

Step 1: List all USB devices – Identify USB driver


root@kali:~# lsusb

This will give you a sample output like the following:

root@kali:~# lsusb
Bus 002 Device 003: ID 148f:2870 Ralink Technology, Corp. RT2870 Wireless Adapter
Bus 002 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 004: ID 046d:c016 Logitech, Inc. Optical Wheel Mouse
Bus 001 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
root@kali:~# Privacy Policy on
Some
Cookies services
Usageused in
this site uses cookies to ACCEPT  
tailor user experience or
https://www.blackmoreops.com/2014/08/25/identify-pci-usb-wired-wireless-driver-linux-identify-usb-driver/ 2/12
3/20/2020 Identify USB Driver. Ubuntu, Debian, Mint, CentOS, Fedora & all Linux distro - blackMORE Ops
tailor user experience or
to show ads.

Now you can see the device names, types etc. But unlike, lspci, it doesn’t give you that funky number at the

front.

Step 2: Dump the physical USB device hierarchy as a tree – Identify


USB driver
For some reason, USB devices were listed slight different. So similar commands like this was useless

root@kali:~# lsusb -vv -s 148f:2870

I could use the actual device serial to get lot’s of info

root@kali:~# lsusb -vv -s 003

But this again doesn’t have the ACTUAL driver info.

root@kali:~# lsusb -vv -s 003

Bus 002 Device 003: ID 148f:2870 Ralink Technology, Corp. RT2870 Wireless Adapter
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x148f Ralink Technology, Corp.
idProduct 0x2870 RT2870 Wireless Adapter
bcdDevice 1.01
iManufacturer 1 Ralink
iProduct 2 802.11 n WLAN
iSerial 3 1.0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 67
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 450mA
Interface Descriptor:

Privacy Policy on
bLength 9
bDescriptorType 4
bInterfaceNumber 0 Some
Cookies services
Usageused in
bAlternateSetting 0 this site uses cookies to ACCEPT  
tailor user experience or
https://www.blackmoreops.com/2014/08/25/identify-pci-usb-wired-wireless-driver-linux-identify-usb-driver/ 3/12
3/20/2020 Identify USB Driver. Ubuntu, Debian, Mint, CentOS, Fedora & all Linux distro - blackMORE Ops
bNumEndpoints 7
tailor user experience or
bInterfaceClass to show ads.
255 Vendor Specific Class
bInterfaceSubClass 255 Vendor Specific Subclass
bInterfaceProtocol 255 Vendor Specific Protocol
iInterface 5 1.0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x01 EP 1 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x02 EP 2 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x03 EP 3 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x04 EP 4 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x05 EP 5 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x06
Privacy Policy on
EP 6 OUT

Some services
Usageused in
bmAttributes 2
Transfer Type Bulk Cookies
Synch Type None this site uses cookies to ACCEPT  
tailor user experience or
https://www.blackmoreops.com/2014/08/25/identify-pci-usb-wired-wireless-driver-linux-identify-usb-driver/ 4/12
3/20/2020 Identify USB Driver. Ubuntu, Debian, Mint, CentOS, Fedora & all Linux distro - blackMORE Ops
Usage Type Data
tailor user experience or
wMaxPacketSize 0x0200 to show ads.
1x 512 bytes
bInterval 0
Device Qualifier (for other device speed):
bLength 10
bDescriptorType 6
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
bNumConfigurations 1
Device Status: 0x0000
(Bus Powered)

So I found a different way to list the driver. I used lsusb -t to dump the physical USB device hierarchy as a
tree.

root@kali:~# lsusb -t

This was actually great as most computers got just 3/4 USB devices plugged in at anytime. (i.e. Keyboard,
Mouse and USB Wireless Adapter etc.). In my case I had just 2 device plugged in.

So my lsusb -t output looks very small and shows me exactly what I wanted to see.

root@kali:~# lsusb -t
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/3p, 480M
|__ Port 1: Dev 2, If 0, Class=hub, Driver=hub/8p, 480M
|__ Port 5: Dev 3, If 0, Class=vend., Driver=rt2800usb, 480M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/3p, 480M
|__ Port 1: Dev 2, If 0, Class=hub, Driver=hub/6p, 480M
|__ Port 4: Dev 4, If 0, Class=HID, Driver=usbhid, 1.5M
root@kali:~#

And there you go.. My USB driver in use is rt2800usb.

That mean the Kernel is using a USB driver named rt2800usb.

Step 3: Get driver info for selected device – Identify USB driver
Now to get the full details of the driver you issue the following command:

Privacy Policy on
root@kali:~# modinfo rt2800usb

Some
Cookies services
Usageused in
This will list everything and anything
this site usesdriver
for that including
cookies to the driver file.
ACCEPT 
tailor user experience or
https://www.blackmoreops.com/2014/08/25/identify-pci-usb-wired-wireless-driver-linux-identify-usb-driver/ 5/12
3/20/2020 Identify USB Driver. Ubuntu, Debian, Mint, CentOS, Fedora & all Linux distro - blackMORE Ops
root@kali:~# modinfo rt2800usb
tailor user experience or
filename: to show ads.
/lib/modules/3.14-kali1-amd64/kernel/drivers/net/wireless/rt2x00/rt2800usb.ko
license: GPL
firmware: rt2870.bin
description: Ralink RT2800 USB Wireless LAN driver.
version: 2.3.0
author: http://rt2x00.serialmonkey.com
srcversion: 8D709655B6AD993F0D5ACC4
alias: usb:v20F4p724Ad*dc*dsc*dp*ic*isc*ip*in*
alias: usb:v148Fp5572d*dc*dsc*dp*ic*isc*ip*in*
depends: rt2x00lib,rt2800lib,rt2x00usb,usbcore
intree: Y
vermagic: 3.14-kali1-amd64 SMP mod_unload modversions
parm: nohwcrypt:Disable hardware encryption. (bool)
root@kali:~#

So the driver file used for this particular USB Wireless Adapter is:
filename: /lib/modules/3.14-kali1-amd64/kernel/drivers/net/wireless/rt2x00/rt2800usb.ko
Now we know the device name, driver used, driver filename, vendor, publisher, dependencies, license and
Author details for the selected USB device (USB Wireless Adapter).

Step 4: More ways to Identify USB driver details


We can use other tools to find USB driver used for a specific device..

Step 4.1: Identify USB driver using lshw command


lshw is another command that can be used to list hardware info.

ls = List

hw = Hardwares

First you need to install lshw in your Linux system. Install using the following command:

root@kali:~# apt-get install lshw

Privacy
Now list all hardware and detailed Policy
info using theon
following command
Some
Cookies Usageused in
services
root@kali:~# lshw this site uses cookies to ACCEPT  
tailor user experience or
https://www.blackmoreops.com/2014/08/25/identify-pci-usb-wired-wireless-driver-linux-identify-usb-driver/ 6/12
3/20/2020 Identify USB Driver. Ubuntu, Debian, Mint, CentOS, Fedora & all Linux distro - blackMORE Ops
tailor user experience or
lshw will give you anything and everything.
to show ads.If you want you can browse through the outputs and you will
find all the things you will ever need for a particular device.However, this is tedious job.

We can actually narrow it down using CLASS.

Some classes you can use are:

1. Display

2. Multimedia

3. Network etc.

For VGA/Display related output, you can use -C Display with lshw command.

root@kali:~# lshw -C Display

For Audio/Multimedia related output, you can use -C Multimedia with lshw command.

root@kali:~# lshw -C Multimedia

For Network related output, you can use -C Network with lshw command.

root@kali:~# lshw -C Network

So to find more info using lshw for this Ralink RT2800 USB Wireless adapter we will use the following
command:

root@kali:~# lshw -C Network

This will give you an output similar to below:

root@kali:~# lshw -C Network


*-network
description: Wireless interface
physical id: 1
bus info: usb@2:1.5
logical name: wlan0
serial: 00:60:64:37:4a:30
capabilities: ethernet physical wireless
configuration: broadcast=yes driver=rt2800usb driverversion=3.14-kali1-amd64 firmware=0.29 ip=10.0.0.4 link=yes multicast=yes wir

Privacy Policy on
Some
Cookies services
Usageused in
this site uses cookies to ACCEPT  
tailor user experience or
https://www.blackmoreops.com/2014/08/25/identify-pci-usb-wired-wireless-driver-linux-identify-usb-driver/ 7/12
3/20/2020 Identify USB Driver. Ubuntu, Debian, Mint, CentOS, Fedora & all Linux distro - blackMORE Ops
tailor user experience or
to show ads.

As you can see, it lists the driver name as well. We can get more details on that driver using modinfo now.

root@kali:~# modinfo rt2800usb

Step 4.2: Identify USB driver using GTK+ front-end for lshw
and finally last but not the least, lshw also got a GUI version (lshw-gtk). Install that if you don’t want to use

command line tools.

root@kali:~# apt-get install lshw-gtk

Launch GTK+ front-end for lshw using the following command on terminal

root@kali:~# lshw-gtk &

Refresh the window and you will see everything as per order. Double-click to expand each section.

Privacy Policy on
Some
Cookies services
Usageused in
this site uses cookies to ACCEPT  
tailor user experience or
https://www.blackmoreops.com/2014/08/25/identify-pci-usb-wired-wireless-driver-linux-identify-usb-driver/ 8/12
3/20/2020 Identify USB Driver. Ubuntu, Debian, Mint, CentOS, Fedora & all Linux distro - blackMORE Ops
tailor user experience or
to show ads.

Note: Once you’ve identified the driver name, you need to use modinfo <driver-name> to extract the

details.

root@kali:~# modinfo rt2800usb

Step 4.3: Identify USB driver using dmesg


Last but not the least, this is another way to identify which driver your Linux installation is using for a
particular USB pluggable device.

So I’ve got an ALFA AWUS036H USB 802.1b/g Long-Range Wireless USB Adapter. Following is how you use
dmesg

root@kali:~# dmesg

Now I will be using “dmesg | tail” command as we only want the last few lines from dmesg. BTW in case
you’re wondering, dmesg will print the Linux kernel ring buffer messages.

Privacy Policy on
root@kali:~# dmesg | tail
[85452.720179] usb 2-1.8: USB disconnect, device number 5
Some
Cookies services
Usageused in
[85514.996934] usb 1-1.4: USB disconnect, device number 5
[85526.132402] usb 1-1.4:
this site uses cookies to
new low-speed USB device number 6 using ehci-pci ACCEPT  
[85526.204445] usb 1-1.4: device descriptor read/64, error -32
tailor user experience or
https://www.blackmoreops.com/2014/08/25/identify-pci-usb-wired-wireless-driver-linux-identify-usb-driver/ 9/12
3/20/2020 Identify USB Driver. Ubuntu, Debian, Mint, CentOS, Fedora & all Linux distro - blackMORE Ops
tailor user experience or
[85526.405449] usb 1-1.4: New USB device found, idVendor=046d, idProduct=c016
to show ads.
[85526.405455] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[85526.405459] usb 1-1.4: Product: Optical USB Mouse
[85526.405462] usb 1-1.4: Manufacturer: Logitech
[85526.408538] input: Logitech Optical USB Mouse as /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.4/1-1.4:1.0/0003:046D:C016.0004/input/
[85526.409084] hid-generic 0003:046D:C016.0004: input,hidraw0: USB HID v1.10 Mouse [Logitech Optical USB Mouse] on usb-0000:00:1a.0-1.4/
root@kali:~#

As you can see the last USB device plugged in was my USB Mouse (which is using hid-generic driver.)

Now let’s plug in my ALFA AWUS036H USB 802.1b/g Long-Range Wireless USB Adapter and use this same
“dmesg | tail” command.

root@kali:~# dmesg | tail


[91238.551066] usb 2-1.8: New USB device found, idVendor=0bda, idProduct=8187
[91238.551073] usb 2-1.8: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[91238.551077] usb 2-1.8: Product: RTL8187_Wireless
[91238.551080] usb 2-1.8: Manufacturer: Manufacturer_Realtek_RTL8187_
[91238.551084] usb 2-1.8: SerialNumber: 00C0CA554C3E
[91238.849020] ieee80211 phy3: Selected rate control algorithm 'minstrel_ht'
[91238.849293] ieee80211 phy3: hwaddr 00:c0:ca:55:4c:3e, RTL8187vB (default) V1 + rtl8225z2, rfkill mask 2
[91238.870650] rtl8187: Customer ID is 0xFF
[91238.871388] rtl8187: wireless switch is on
[91241.316186] IPv6: ADDRCONF(NETDEV_UP): wlan1: link is not ready
root@kali:~#

Privacy Policy on
Some
Cookies services
Usageused in
this site uses cookies to ACCEPT  
tailor user experience or
https://www.blackmoreops.com/2014/08/25/identify-pci-usb-wired-wireless-driver-linux-identify-usb-driver/ 10/12
3/20/2020 Identify USB Driver. Ubuntu, Debian, Mint, CentOS, Fedora & all Linux distro - blackMORE Ops
tailor user experience or
So there you go, dmesg picked the
to newly plugged in ALFA AWUS036H USB 802.1b/g Long-Range Wireless
show ads.
USB Adapter and spewed some lines in there. So which one is the driver? In my case it is using rtl8187
driver.

We can double check it using both “lsusb -t” and “lshw -C Network” command

root@kali:~# lsusb -t
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/3p, 480M
|__ Port 1: Dev 2, If 0, Class=hub, Driver=hub/8p, 480M
|__ Port 5: Dev 3, If 0, Class=vend., Driver=rt2800usb, 480M
|__ Port 8: Dev 6, If 0, Class=>ifc, Driver=rtl8187, 480M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/3p, 480M
|__ Port 1: Dev 2, If 0, Class=hub, Driver=hub/6p, 480M
|__ Port 4: Dev 6, If 0, Class=HID, Driver=usbhid, 1.5M
root@kali:~#

and

root@kali:~# lshw -C Network


*-network:0
description: Wireless interface
physical id: 1
bus info: usb@2:1.8
logical name: wlan1
serial: 00:c0:ca:55:4c:3e
capabilities: ethernet physical wireless
configuration: broadcast=yes driver=rtl8187 driverversion=3.14-kali1-amd64 firmware=N/A link=no multicast=yes wireless=IEEE 802.1
root@kali:~#

See my list of supported Wifi Adapters that’s supported for injection and monitor mode — > 802.11 Recommended
USB Wireless Cards for Kali Linux

A modinfo will show more:

root@kali:~# modinfo rtl8187


filename: /lib/modules/3.14-kali1-amd64/kernel/drivers/net/wireless/rtl818x/rtl8187/rtl8187.ko
license: GPL
description: RTL8187/RTL8187B USB wireless driver
author: Larry Finger <Larry.Finger@lwfinger.net>
author: Hin-Tak Leung <htl10@users.sourceforge.net>
author: Herton Ronaldo Krzesinski <herton@mandriva.com.br>
author: Andrea Merello <andrea.merello@gmail.com>
author: Privacy Policy on
Michael Wu <flamingice@sourmilk.net>
alias:
depends:
Some services
Usageused in
usb:v1737p0073d*dc*dsc*dp*ic*isc*ip*in*
Cookies
mac80211,eeprom_93cx6,cfg80211,usbcore
intree: Y this site uses cookies to ACCEPT  
tailor user experience or
https://www.blackmoreops.com/2014/08/25/identify-pci-usb-wired-wireless-driver-linux-identify-usb-driver/ 11/12
3/20/2020 Identify USB Driver. Ubuntu, Debian, Mint, CentOS, Fedora & all Linux distro - blackMORE Ops
vermagic:
tailor user experience or
3.14-kali1-amd64 SMP mod_unload modversions
root@kali:~# to show ads.

USB Driver Installation


The obvious next question is how do I install USB driver? I’ve shown that in one of my previous post..

How to install Driver for TP-Link TL-WDN3200 N600 Wireless Dual Band USB Adapter in Linux

Any Linux driver can be installed similarly once you’ve identified the driver details. (or at least the files
from either vendors website or a 3rd party website).

Summary
I hope this article clears up the confusion on how to detect a driver for a particular USB device.

Those who care directly to this post, I was planning to write a single article on how to identify USB and PCI
driver but it seems that would be very very long post. So I’ve decided to divide the post into Two parts,

1. Identify PCI Driver on Linux

2. Identify USB Driver on Linux

Thanks for reading. If you’ve found this article useful, please share.

Privacy Policy on
Some
Cookies services
Usageused in
this site uses cookies to ACCEPT  
tailor user experience or
https://www.blackmoreops.com/2014/08/25/identify-pci-usb-wired-wireless-driver-linux-identify-usb-driver/ 12/12

You might also like