struct bus_type, struct device, struct device_driver

 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 device_driver * drv);
13     int     (*hotplug) (struct device *dev, char **envp,
14                     int num_envp, char *buffer, int buffer_size);
15     int     (*suspend)(struct device * dev, u32 state);
16     int     (*resume)(struct device * dev);
17 };
 1 struct device {
 2     struct list_head node;      /* node in sibling list */
 3     struct list_head bus_list;  /* node in bus's list */
 4     struct list_head driver_list;
 5     struct list_head children;
 6     struct device   * parent;
 7 
 8     struct kobject kobj;
 9     char    bus_id[BUS_ID_SIZE];    /* position on parent bus */
10 
11     struct bus_type * bus;      /* type of bus device is on */
12     struct device_driver *driver;   /* which driver has allocated this
13                        device */
14     void        *driver_data;   /* data private to the driver */
15     void        *platform_data; /* Platform specific data (e.g. ACPI,
16                        BIOS data relevant to device) */
17     struct dev_pm_info  power;
18 
19     u32     detach_state;   /* State to enter when device is
20                        detached from its driver. */
21 
22     u64     *dma_mask;  /* dma mask (if dma'able device) */
23     u64     coherent_dma_mask;/* Like dma_mask, but for
24                          alloc_coherent mappings as
25                          not all hardware supports
26                          64 bit addresses for consistent
27                          allocations such descriptors. */
28 
29     struct list_head    dma_pools;  /* dma pools (if dma'ble) */
30 
31     struct dma_coherent_mem *dma_mem; /* internal for coherent mem
32                          override */
33 
34     void    (*release)(struct device * dev);
35 };
 1 struct device_driver {
 2     char            * name;
 3     struct bus_type     * bus;
 4 
 5     struct semaphore    unload_sem;
 6     struct kobject      kobj;
 7     struct list_head    devices;
 8 
 9     struct module       * owner;
10 
11     int (*probe)    (struct device * dev);
12     int     (*remove)   (struct device * dev);
13     void    (*shutdown) (struct device * dev);
14     int (*suspend)  (struct device * dev, u32 state, u32 level);
15     int (*resume)   (struct device * dev, u32 level);
16 };
1 struct list_head {
2      struct list_head *next, *prev;
3 };

 

转载于:https://www.cnblogs.com/sunsweet/archive/2013/04/25/3042434.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值