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 ...
* it is an internal, virtual, "platform" bus. Buses can plug into each other. * 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...
每个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 - 指向与该结构体类型相关的bus_type类型的结构体 * @glue_dirs - 用来避免命名空间的冲突 * @class - 指向与该结构体类型相关的结构体 *这个结构体是实际kobject允许的安全静态分配的结构体。驱动核心意外的任何事物都不允许 触碰这个区域 */ struct subsys_private { struct kset subsys; struct ...
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[] = ...
* @bus: Type of bus device is on. * @driver: Which driver has allocated this * @platform_data: Platform data specific to the device. * Example: For devices on custom boards, as typical of embedded * and SOC based hardware, Linux often uses platform_data to point ...