LinuxÄÚºËÉ豸ģÐÍ(3)
ÒëÕߣº¹ùÉÙ±¯
2009/12/01
ÔÎÄ£ºlinux-2.6/Documentation/driver-model/bus.txt
×ÜÏßÀàÐÍ
¶¨Òå
~~~~
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);
};
int bus_register(struct bus_type * bus);
ÉùÃ÷
~~~~
ÄÚºËÀïµÄÿһ¸ö×ÜÏßÀàÐÍ£¨PCI£¬USB£¬µÈ£©Ó¦µ±ÉùÃ÷Ò»¸ö¾²Ì¬µÄ¶ÔÏó¡£ËüÃDZØÐë³õʼ
»¯nameÓò£¬ÓÐʱҲ³õʼ»¯match()»Øµ÷º¯Êý¡£
struct bus_type pci_bus_type = {
.name = "pci",
.match = pci_bus_match,
};
¸ÃÊý¾Ý½á¹¹Ó¦µ±±»°üº¬ÔÚÒ»¸öÍ·ÎļþÀÏòÏà¹ØµÄÇý¶¯µ¼³ö:
extern struct bus_type pci_bus_type;
×¢²á
~~~~~
×ÜÏßÇý¶¯ÔÚ³õʼ»¯µÄʱºò£¬»áµ÷ÓÃbus_register()¡£Ëü³õʼ»¯×ÜÏ߶ÔÏóµÄÆäÓàµÄÓò£¬
²¢½«×ÜÏ߶ÔÏó²åÈëµ½×ÜÏßÀàÐ͵ÄÈ«¾ÖÁ´±íÀï¡£Ò»µ©×ÜÏ߶ÔÏó±»×¢²á£¬
ËüµÄÿ¸öÓò¶ÔÓÚ×ÜÏßÇý¶¯¶¼ÊÇ¿ÉÓõġ£
»Øµ÷º¯Êý
~~~~~~~~
match():¹ØÁªÇý¶¯µ½É豸
~~~~~~~~~~~~~~~~~~~~~~
É豸µÄIDÊý¾Ý½á¹¹µÄ¸ñʽºÍ±È½ÏÓï·¨ÓÉÆä×ÜÏß×Ô¼º¹æ¶¨¡£Çý¶
Ïà¹ØÎĵµ£º
VimºÍËùÓеÄÁ÷ÐÐÎı¾±à¼Æ÷Ò»Ñù£¬¿ÉÒԺܺõı༸÷ÖÖ×Ö·û±àÂëµÄÎļþ£¬Õ⵱Ȼ°üÀ¨ UCS-2¡¢UTF-8 µÈÁ÷ÐÐµÄ Unicode ±àÂ뷽ʽ¡£¶øÇҺͺܶàÀ´×Ô Linux ÊÀ½çµÄÈí¼þÒ»Ñù£¬ÕâÐèÒªÄã×Ô¼º¶¯ÊÖÉèÖá£
Vim ÓÐËĸö¸ú×Ö·û±àÂ뷽ʽÓйصÄÑ¡Ïencoding ¡¢fileencoding ¡¢fileencodings ¡¢termencoding (ÕâЩѡÏî¿ÉÄܵÄÈ¡ÖµÇë²Î¿¼ Vim ÔÚ ......
LinuxÄÚºËÉ豸ģÐÍ
·ÒëÕߣº¹ùÉÙ±¯
2009/12/01
ÔÎÄ£ºlinux/Documentation/driver-model/overview.txt
¸ÅÊö
~~~~
LinuxÄÚºËÇý¶¯Ä£ÐÍÊÇÕë¶ÔÄÚºË֮ǰËùÓв»Í¬µÄÇý¶¯Ä£Ð͵Äͳһ³éÏóÄ£ÐÍ¡£ËüµÄÄ¿µÄÊÇ,ͨ
¹ý½áºÏÒ»Ì×Êý¾ÝºÍ²Ù×÷¼¯µ½Ò»¸öÈ«¾Ö¿É·ÃÎʵÄÊý¾Ý½á¹¹À´Ó¶øÌí¼Ó»ùÓÚijÖÖÖ¸¶¨×ÜÏßµÄÉè
±¸ºÍÇŽÓÇý¶¯¡£
´«Í³µÄÇý¶¯ ......
·ÒëÕߣº¹ùÉÙ±¯
2009/12/01
ÔÎÄ£ºlinux/Documentation/driver-model/binding.txt
Çý¶¯°ó¶¨
Çý¶¯°ó¶¨¾ÍÊǽ«Ò»¸öÉ豸ºÍ¿ØÖƸÃÉ豸µÄÇý¶¯¹ØÁªÔÚÒ»ÇеĹý³Ì¡£
µäÐ͵ÄÇé¿öÏ£¬×ÜÏßÇý¶¯À´´¦ÀíÇý¶¯°ó¶¨£¬ÒòΪÿ¸ö×ÜÏßÇý¶¯¶¼ÓÐ×ÜÏßÏà¹ØµÄÊý¾Ý
½á¹¹À´±íʾÉ豸ºÍÉ豸Çý¶¯¡£ÓÐÁ˱íʾÉ豸ºÍÉ豸Çý¶¯µÄͨÓÃÊý¾Ý½á¹¹£¬¾ø´ó¶àÊýµÄ°ó ......