总线模型

来源:互联网 发布:windows 10和windows7 编辑:程序博客网 时间:2024/05/17 09:37

总线描述

struct busy_type

{ struct bus_attribute,

   match,

   uevent,....

总线属性

struct busy_attribute

{ struct attribute attr;

    show

    store  

初始化做两件事:

    总线注册

    bus_register(&my_bus_type)

    创建属性文件

    bus_create_file(struct bus_type *bus, struct bus_arrtibute *attr)

     创建属性文件前需要定义bus_type 和 bus_arrtibute 结构

 

/sys/bus下看到创建的总线文件