October 2017
Intermediate to advanced
586 pages
14h 8m
English
The bus controller is a device itself, and in 99% of cases buses are platform devices (even buses that offer enumeration). For example, the PCI controller is a platform device, and so is its respective driver. One must use the bus_register(struct *bus_type) function in order to register a bus with the kernel. The packt bus structure looks like this:
/*
* This is our bus structure
*/
struct bus_type packt_bus_type = {
.name = "packt",
.match = packt_device_match,
.probe = packt_device_probe,
.remove = packt_device_remove,
.shutdown = packt_device_shutdown,
};
The bus controller is a device itself; it has to be registered with the kernel, and will be used as a parent of the device siting on the bus. This is done in the bus ...
Read now
Unlock full access