struct class

来源:互联网 发布:java 协程 服务器框架 编辑:程序博客网 时间:2024/06/08 10:47
/** * struct class - 设备类 * @name:类名称 * @owner:模型拥有者 * @class_attrs:此类的默认属性 * @dev_attrs:属于此类的设备默认属性 * @dev_bin_attrs: 属于此类的设备默认二进制属性 * @dev_kobj:代表此类的kobj并且连接它到等级层次 * @dev_uevent:设备从此类添加或者移除,或者其他像添加添加环境变量此类事件的时候调用此函数 * @devnode:提供devtmpfs的时候调用. * @class_release: 释放此类. * @dev_release: 释放设备. * @suspend:让设备进入休眠模式,此模式常常是低功耗模式 * @resume:唤醒设备 * @ns_type:调用一边系统可是确定命名空间 * @namespace:属于此类设备的命名空间 * @pm:此类的默认电源管理操作 * @p:提供驱动核心私有数据,除了驱动,其他不能动用此参数 * A class is a higher-level view of a device that abstracts out low-level * implementation details. Drivers may see a SCSI disk or an ATA disk, but, * at the class level, they are all simply disks. Classes allow user space * to work with devices based on what they do, rather than how they are * connected or how they work. * 类是一种高等级视角看设备的,它能抽象出低等级的实施细节。驱动会查看SCSI硬盘 和ATA硬盘,但是在类级别看来,他们都是简单的硬盘。类能允许用户空间与设备恰当的 工作,而不是不是怎么样去工作。 */struct class {const char*name;struct module*owner;struct class_attribute*class_attrs;struct device_attribute*dev_attrs;struct bin_attribute*dev_bin_attrs;struct kobject*dev_kobj;int (*dev_uevent)(struct device *dev, struct kobj_uevent_env *env);char *(*devnode)(struct device *dev, umode_t *mode);void (*class_release)(struct class *class);void (*dev_release)(struct device *dev);int (*suspend)(struct device *dev, pm_message_t state);int (*resume)(struct device *dev);const struct kobj_ns_type_operations *ns_type;const void *(*namespace)(struct device *dev);const struct dev_pm_ops *pm;struct subsys_private *p;};

原创粉丝点击