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. cookiecutter

    1.安装cookiecutter pip3 install cookiecutter 2.设置模板 https://github.com/cookiecutter/cookiecutter   搜索需 ...

  2. 【简单的spfa+优先队列】

    题目是给出只有x和y构成的图,相同元素走路不花费,不同元素间花费1,给出起点终点,最少花费是 #include<cstdio>#include<algorithm>#inclu ...

  3. 水平划分table

    大概10年前,接到的任务是要解决一个AuditTrail表的写入性能. performance test的时候,一晚上这个表可以长1百万行,在SQLServer归档到本地文件以后再去删除这1百万条记录 ...

  4. 基于Django的Rest Framework框架的频率组件

    0|1一.频率组件的作用 在我们平常浏览网站的时候会发现,一个功能你点击很多次后,系统会让你休息会在点击,这其实就是频率控制,主要作用是限制你在一定时间内提交请求的次数,减少服务器的压力. modle ...

  5. influxdb安装和学习

    安装 https://docs.docker.com/samples/library/influxdb/ 先启动,创建admin用户 docker run -d --name influxdb -p ...

  6. 分布式应用的未来 — Distributionless

    作者丨阿里云高级技术专家 至简(李云) 在技术变革推动社会发展这一时代背景下,大量支撑规模化分布式应用的技术创新.创造与创业应用而生,Could Native.Service Mesh.Serverl ...

  7. F#周报2019年第22期

    新闻 2019年实用F#挑战结果 FSharp.Formatting正在确定维护者 实用F#挑战的赢家们 使用F#在分布式系统中进行故障检测与共识 F#里的Cloudflare Worker Juni ...

  8. 使用SolrJ客户端管理SolrCloud(Solr集群)

    1.使用SolrJ客户端管理SolrCloud(Solr集群). package com.taotao.search.service; import java.io.IOException; impo ...

  9. Python - 元组 - 第九天

    Python 元组 Python 的元组与列表类似,不同之处在于元组的元素不能修改. 元组使用小括号,列表使用方括号. 元组创建很简单,只需要在括号中添加元素,并使用逗号隔开即可.例如: >&g ...

  10. Java学习——反射

    Java学习——反射 摘要:本文主要讲述了什么是反射,使用反射有什么好处,以及如何使用反射. 部分内容来自以下博客: https://www.cnblogs.com/tech-bird/p/35253 ...