- 論壇徽章:
- 0
|
bus_type
相關(guān)數(shù)據(jù)結(jié)構(gòu):
struct bus_type {
char * name;
struct subsystem subsys;
struct kset drivers;
struct kset devices;
struct bus_attribute * bus_attrs;
struct device_attribute * dev_attrs;
struct driver_attribute * drv_attrs;
int (*match)(struct device * dev, struct device_driver * drv);
int (*hotplug) (struct device *dev, char **envp,
int num_envp, char *buffer, int buffer_size);
int (*suspend)(struct device * dev, pm_message_t state);
int (*resume)(struct device * dev);
};
內(nèi)核所支持的每一種總線類型都由一個bus_type對象表示。
bus_type中內(nèi)嵌了一個subsystem - subsys。
系統(tǒng)中的bus_subsys子系統(tǒng)將所有的bus_type中的subsys集合在一起。
bus_subsys對應(yīng)sysfs中的/sys/bus目錄.
另外,bus_type中有兩個內(nèi)嵌的kset對象:devices 和 drivers。分別表示該bus上的設(shè)備和驅(qū)動。
bus_type.gif (15.22 KB, 下載次數(shù): 25)
下載附件
2008-05-27 14:48 上傳
函數(shù)bus_for_each_dev() 和 bus_for_each_drv()分別用于遍歷bus上devices和drivers鏈表中的所有元素。 |
|