device结构体:设备驱动模型中的基础结构体之一

struct device {

  /*设备所依附的父设备

  大多数情况下,这样的设备是某种总线或主控制器

  如果该成员变量的值为NULL,表示当前设备是一个最顶端设备,通常这样的设备都不是你想得到的那个*/

  struct device *parent;

  struct device_private *p;

  struct kobject kobj;
  const char *init_name; /* initial name of the device */
  const struct device_type *type;

  struct mutex mutex; /* mutex to synchronize calls to  its driver.*/

  struct bus_type *bus; /* type of bus device is on */
  struct device_driver *driver; /* which driver has allocated this device */
  void *platform_data; /* Platform specific data, device core doesn't touch it */
   struct dev_pm_info power;
  struct dev_pm_domain *pm_domain;

#ifdef CONFIG_NUMA
  int numa_node; /* NUMA node this device is close to */
#endif
  u64 *dma_mask; /* dma mask (if dma'able device) */
  u64 coherent_dma_mask;/* Like dma_mask, but for alloc_coherent mappings as not all hardware supports
64 bit addresses for consistent  allocations such descriptors. */

  struct device_dma_parameters *dma_parms;

  struct list_head dma_pools; /* dma pools (if dma'ble) */

  struct dma_coherent_mem *dma_mem; /* internal for coherent mem override */
/* arch specific additions */
  struct dev_archdata archdata;

  struct device_node *of_node; /* associated device tree node */

  dev_t devt; /* dev_t, creates the sysfs "dev" */
  u32 id; /* device instance */

  spinlock_t devres_lock;
  struct list_head devres_head;

  struct klist_node knode_class;
  struct class *class;
  const struct attribute_group **groups; /* optional groups */

  void (*release)(struct device *dev);
};

浅析struct device结构体的更多相关文章

  1. Linux内核device结构体分析

    1.前言 Linux内核中的设备驱动模型,是建立在sysfs设备文件系统和kobject上的,由总线(bus).设备(device).驱动(driver)和类(class)所组成的关系结构,在底层,L ...

  2. struct ifreq结构体与ip,子网掩码,网关等信息

    总结一下,今天学习的关于通过socket,ioctl来获得ip,netmask等信息,其中很多内容参照了很多网上的信息,我会一一列出的 我用的这个函数,就是下面这个函数,其中的有一些全局变量,很好懂, ...

  3. Windows驱动开发-Device结构体

    每个驱动程序会创建一个或多个设备对象,每个设备对象都会有一个指针指向下一个设备对象 Device结构体源码 typedef struct DECLSPEC_ALIGN(MEMORY_ALLOCATIO ...

  4. Golang面向对象编程-struct(结构体)

    Golang面向对象编程-struct(结构体) 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.什么是面向对象编程 面向对象编程(Object Oriented Program ...

  5. struct timeval结构体 以及 gettimeofday()函数(转)

    struct timeval结构体 转载地址:http://blog.chinaunix.net/uid-20548989-id-2533161.html 该结构体是Linux系统中定义,struct ...

  6. struct in_addr 结构体

    struct in_addr 结构体: struct in_addr { in_addr_t s_addr; }; 表示一个32位的IPv4地址. in_addr_t一般为32位的unsigned i ...

  7. typedef struct与struct定义结构体

    今天在定义结构体的时候发现typedef struct与struct定义结构体有一些不同之处: 结构也是一种数据类型, 能够使用结构变量, 因此,  象其他 类型的变量一样, 在使用结构变量时要先对其 ...

  8. struct socket结构体详解

    原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 .作者信息和本声明.否则将追究法律责任.http://weiguozhihui.blog.51cto.com/3060615/15852 ...

  9. struct stat结构体简介

    在使用这个结构体和方法时,需要引入: <sys/types.h> <sys/stat.h> struct stat这个结构体是用来描述一个linux系统文件系统中的文件属性的结 ...

随机推荐

  1. zz阿里妈妈深度树检索技术(TDM)及应用框架的探索实践

    分享嘉宾:何杰 阿里妈妈 高级算法专家 编辑整理:孙锴 内容来源:DataFun AI Talk 出品社区:DataFun 注:欢迎转载,转载请注明出处 导读:阿里妈妈是阿里巴巴集团旗下数字营销的大中 ...

  2. UVA11464 Even Parity 搜索+递推

    问题描述 UVA11464 题解 第一直觉爆搜. 发现 \(N \le 15\) ,然后后面每行都可以通过第一行递推出来. 爆搜第一行,递推后面+check \(\mathrm{Code}\) #in ...

  3. bcftools

    beftools非常复杂,大概有20个命令,每个命令下面还有N多个参数 annotate .. edit VCF files, add or remove annotations call .. SN ...

  4. P2P中的NAT穿越(打洞)方案详解

    一.P2P(点对点技术) 点对点技术(peer-to-peer,简称P2P)又称对等互联网络技术,是一种网络新技术,依赖网络中参与者的计算能力和带宽,而不是把依赖都聚集在较少的几台服务器上. 点对点技 ...

  5. Metersploit系统参数说明

    Back参数 Back参数主要⽤用于返回.⽐比如你进⼊入了了某⼀一个漏漏洞洞模块的设置,但是你想再重新选择一个漏漏洞洞模块,那么就需要⽤用到back参数. 这张图说明,才开始我使用了ms08_067_ ...

  6. 剑指offer:二叉搜索树的第k个结点(中序遍历)

    1. 题目描述 /* 给定一棵二叉搜索树,请找出其中的第k小的结点. 例如, (5,3,7,2,4,6,8) 中,按结点数值大小顺序第三小结点的值为4. */ 2. 思路 中序遍历二叉搜索树,第K个就 ...

  7. 数据仓库001 - 复习Linux shell命令 - pwd mkdir mv tail -f xxx.log 和 ail -F xxx.log

    1.  [root@localhost ~]#  的含义 ?  [登录的用户  机器的名称 家目录] 2. 查看当前光标所在的目录   pwd [root@localhost ~]# pwd /roo ...

  8. Ubuntu中如何使得程序在后台运行

    Ubuntu中如何使得程序在后台运行 一.前言 在Ubuntu中有的程序启动需要执行改程序./bin目录下的文件,并且启动之后这个shell就不能使用和关闭了,非常的麻烦,因此就有了相应的命令来解决这 ...

  9. Oracle中如何创建数据库

    Oracle数据库的物理结构与MySQL以及SQLServer有着很大的不同.在使用MySQL或SQLServer时,我们不需要去关心它们的逻辑结构和物理结构. 但是在使用Oracle的时候,我们必须 ...

  10. multer 文件后缀名

    我的代码是这样写的. var storage = multer.diskStorage({ destination: function (req, file, cb) { cb(null, 'uplo ...