1 struct bus_type { 2 char * name; 3 4 struct subsystem subsys; 5 struct kset drivers; 6 struct kset devices; 7 8 struct bus_attribute * bus_attrs; 9 struct device_attribute * dev_attrs; 10 struct driver_attribute * drv_attrs; 11 12 int (*match)(struct device * dev, struct ...
上节中,除了简单的框架,我们还看到了一个和总线驱动相关的结构体bus_type 。这个结构体的定义在include/linux/device.h 中。本节先简单介绍结构体中的成员,再对每个成员作详细描述。[cpp]01.s t r u c t b u s _t y p e { 02.c o n s t c h a r *n a m e ; 03.s t ...
* A USB controller is usually a PCI device, for example. The device model * represents the actual connections between buses and the devices they control. * A bus is represented by the bus_type structure. It contains the name, the * default attributes, the bus' methods, PM operations, and...
每个phy 芯片会创建一个 struct phy_device 类型的设备,对应的有 struct phy_driver 类型的驱动,这两者实际上是挂载在 mdio_bus_type 总线上的,mac 会被注册成 struct net_device。 phy_devicestructphy_device{ structphy_driver*drv;// PHY设备驱动 structmii_bus*bus;// 对应的MII总线 structdevicedev;//...
ALSA: mark all struct bus_type as const Browse files Now that the driver core can properly handle constant struct bus_type, move all of the sound subsystem struct bus_type structures as const, placing them into read-only memory which can not be modified at runtime. Note, this fixes a...
struct bus_type结构体描述了linux中的各种bus,比如spi bus,i2c bus,platform bus等等,可以看到,在i2c_bus_type中,定义了match(),probe(),remove()和shutdown()函数,match()函数就是当有新的i2c_client或者i2c_driver添加进来时,试图寻找与新设备匹配的项,返回匹配的结果。
总线、设备、驱动,也就是bus、device、driver,在内核里都有对应的结构体,在include/linux/device.h 里定义。 Device.h (linux-3.4.2\include\linux) 1、总线、设备、驱动三者的关系 2、结构体 (1)总线结构体 [cpp] view plain copy struct bus_type {&...存储...
struct bus_type *bus; 确定设备位于哪种总线. struct device_driver *driver; 管理这个设备的驱动; 我们查看 struct device_driver 在下一节. void *driver_data; 一个可能被设备驱动使用的私有数据成员. void (*release)(struct device *dev); 当对这个设备的最后引用被去除时调用的方法; 它从被嵌入的 kobj...
EXPORT_SYMBOL_GPL(i2c_bus_type); struct device_type i2c_client_type = { const struct device_type i2c_client_type = { .groups = i2c_dev_groups, .uevent = i2c_device_uevent, .release = i2c_client_dev_release, @@ -1343,7 +1343,7 @@ static struct attribute *i2c_adapter_attrs[] = ...
该队列的输入时 IP 栈处理完毕的 packets。这些packets 要么是本机的应用产生的,要么是进入本机又要被路由出去的。被 IP 栈加入队列的 packets 会被网络设备驱动(hardware driver)取出并且通过一个数据通道(data bus)发到 NIC 硬件设备并传输出去。 在不使用 TSO/GSO 的情况下,IP 栈发到该队列的 packets 的长...