/**
* struct device_driver - The basic device driver structure
* @name: Name of the device driver.
驱动名称
* @bus: The bus which the device of this driver belongs to.
设备的驱动属于哪种总线
* @owner: The module owner.
模型拥有者
* @mod_name: Used for built-in modules.
为了built-in模型使用
* @suppress_bind_attrs: Disables bind/unbind via sysfs.
禁止使能绑定文件系统
* @of_match_table: The open firmware table.
开放固件条目
* @probe: Called to query the existence of a specific device,
* whether this driver can work with it, and bind the driver
* to a specific device.
用于查询确定的设备,进而确定驱动是否能工作,并且绑定设备
* @remove: Called when the device is removed from the system to
* unbind a device from this driver.
当设备移除的时候,解绑设备和驱动
* @shutdown: Called at shut-down time to quiesce the device.
关闭的时候静止设备
* @suspend: Called to put the device to sleep mode. Usually to a
* low power state.
让设备进入休眠模式,常常是进入低功耗模式
* @resume: Called to bring a device from sleep mode.
从休眠模式唤醒
* @groups: Default attributes that get created by the driver core
* automatically.
驱动核心创建的默认属性
* @pm: Power management operations of the device which matched
* this driver.
符合这个驱动的电源管理操作
* @p: Driver core's private data, no one other than the driver
* core can touch this.
*驱动核心私有数据,除了驱动核心其他任何资源不能操作此数据
* The device driver-model tracks all of the drivers known to the system.
* The main reason for this tracking is to enable the driver core to match
* up drivers with new devices. Once drivers are known objects within the
* system, however, a number of other things become possible. Device drivers
* can export information and configuration variables that are independent
* of any specific device.
*/
//设备驱动模型遍历所有系统已知的驱动,这样做的主要目的是让驱动和兴匹配新设备
//一旦驱动被系统获取到,一系列的事情都变得可能,设备驱动能输出信息和配置变量
//而这一切都不依赖于特定的设备
struct device_driver {
const char *name;
struct bus_type *bus;
struct module *owner;
const char *mod_name; /* used for built-in modules */
bool suppress_bind_attrs; /* disables bind/unbind via sysfs */
const struct of_device_id *of_match_table;
int (*probe) (struct device *dev);
int (*remove) (struct device *dev);
void (*shutdown) (struct device *dev);
int (*suspend) (struct device *dev, pm_message_t state);
int (*resume) (struct device *dev);
const struct attribute_group **groups;
const struct dev_pm_ops *pm;
struct driver_private *p;
};
struct device_driver
最新推荐文章于 2024-10-05 15:08:02 发布