本文主要是介绍Linux Kernel设备驱动模型之struct kset,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
在设备驱动模型中,我们用kobject表示设备的基类,而一些相同的设备构成集合,即kset:
/*** struct kset - a set of kobjects of a specific type, belonging to a specific subsystem.** A kset defines a group of kobjects. They can be individually* different "types" but overall these kobjects all want to be grouped* together and operated on in the same manner. ksets are used to* define the attribute callbacks and other common events that happen to* a kobject.** @list: the list of all kobjects for this kset* @list_lock: a lock for iterating over the kobjects* @kobj: the embedded kobject for this kset (recursion, isn't it fun...)* @uevent_ops: the set of uevent operations for this kset. These are* called whenever a kobject has something happen to it so that the kset* can add new environment variables, or filter out the uevents if so* desired.*/ struct kset {struct list_head list;spinlock_t list_lock;struct kobject kobj;const struct kset_uevent_ops *uevent_ops; };
这篇关于Linux Kernel设备驱动模型之struct kset的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!