Linux-USB Subsystem:-

Look at the Figure (given below) to understand the architecture of the Linux-USB subsystem. The constituent pieces of the subsystem are as follows:

1. The USB core. Like the core layers of driver subsystems that you saw in previous chapters, the USB core is a code base consisting of routines and structures available to HCDs and client drivers. The core also provides a level of indirection that renders client drivers independent of host controllers.

2. HCDs that drive different host controllers.

3. A hub driver for the root hub (and physical hubs) and a helper kernel thread khubd that monitors all ports connected to the hub. Detecting port status changes and configuring hot plugged devices is time consuming and is best accomplished using a helper thread for reasons. The khubd thread is asleep by default. The hub driver wakes khubd whenever it detects a status change on a USB port connected to it.

4. Device drivers for USB client devices.

5. The USB file system usbfs that lets you drive USB devices from user space.

For end-to-end operation, the USB subsystem calls on various other kernel layers for assistance. To support USB mass storage devices, for example, the USB subsystem works in tandem with SCSI drivers, as shown in the above Figure. To drive USB-Bluetooth keyboards, the stakeholders are fourfold: the USB subsystem, the Bluetooth layer, the input subsystem, and the tty layer.



(The Linux-USB subsystem.)