![]() As such, Linux supports only one configuration per device - the default one. A configuration of a USB device is like a profile, where the default one is the commonly used one. All valid USB devices contain one or more configurations. To further decode these sections, a valid USB device needs to be understood first. Figure 3: USB's proc window snippet Decoding a USB device section The listing basically contains one such section for each valid USB device detected on the system. Figure 3 shows a typical snippet of the same, clipped around the pen drive-specific section. This enables the detected USB device details to be viewed in a more techno-friendly way through the /proc window, using cat /proc/bus/usb/devices. In many Linux distributions like Mandriva, Fedora,… the usbfs driver is loaded as part of the default configuration. A -v option to lsusbprovides detailed information. Figure 2 shows this, with and without the pen drive plugged in. Figure 1: USB subsystem in LinuxĪ basic listing of all detected USB devices can be obtained using the lsusb command, as root. Figure 1 shows a top-to-bottom view of the USB subsystem in Linux. The USB protocol formatted information about the USB device is then populated into the generic USB core layer (the usbcore driver) in kernel-space, thus enabling the detection of a USB device in kernel-space, even without having its specific driver.Īfter this, it is up to various drivers, interfaces, and applications (which are dependent on the various Linux distributions), to have the user-space view of the detected devices. The corresponding host controller driver would pick and translate the low-level physical layer information into higher-level USB protocol-specific information. ![]() Hardware-space detection is done by the USB host controller - typically a native bus device, like a PCI device on x86 systems. Whether a driver for a USB device is there or not on a Linux system, a valid USB device will always be detected at the hardware and kernel spaces of a USB-enabled Linux system, since it is designed (and detected) as per the USB protocol specifications. USB stick) that was at hand - a JetFlash from Transcend, with vendor ID 0x058f and product ID 0圆387. The fastest way to get the hang of it, and Pugs’ usual way, was to pick up a USB device, and write a driver for it, to experiment with. Pugs’ pen drive was the device Shweta was playing with, when both of them sat down to explore the world of USB drivers in Linux. This article, which is part of the series on Linux device drivers, gets you started with writing your first USB driver in Linux. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |