Learn more about USB driver bus drivers

The bus driver is not changed, the kernel is all done for us. In order to understand the whole USB driver system, let's analyze the bus driver.

A bus block diagram

Learn more about USB driver bus drivers

The picture of the bus is very clear. This blog analyzes the program on the left. In the next section, we want to explain the actual example of the USB keyboard.

Second, the program is implemented

1. Because the code is too much and the relationship is complicated, only the called function (no write parameters) is listed here. From inserting a USB device to calling a USB device driver, this process.

2. What did the bus driver do?

a. Identify USB devices

Assign address

2. And tell the USB device (set address)

3. Issue the command to get the descriptor (descriptor information can be seen in include\linux\usb\Ch9.h)

Learn more about USB driver bus drivers

b. Find and install the corresponding device driver

c. Provide USB read and write functions

Although the structure of the device driver of the USB itself is exactly the same as when it is not attached to the USB bus, there has been a big change in the access method. For example, for character device drivers, although they are still write(), read(), ioctl() functions, in these functions, communication with USB devices is no longer I/O memory and I/O ports. Access, and throughout is a USB request block called URB, these request blocks operate through interfaces such as read and write provided by the USB bus driver.

Portable Inverter Generator

Wuxi Doton Power , http://www.dotonpower.com

Posted on