Linux2.6.18中关于IDE接口初始化的疑惑
文件drivers\ide\ide.c中的IDE接口初始化函数/*
* This is gets invoked once during initialization, to set *everything* up
*/
static int __init ide_init(void)
{
printk(KERN_INFO "Uniform Multi-Platform E-IDE driver " REVISION "\n");
system_bus_speed = ide_system_bus_speed();
bus_register(&ide_bus_type);
init_ide_data();
#ifdef CONFIG_PROC_FS
proc_ide_root = proc_mkdir("ide", NULL);
#endif
#ifdef CONFIG_BLK_DEV_ALI14XX
if (probe_ali14xx)
(void)ali14xx_init();
#endif
#ifdef CONFIG_BLK_DEV_UMC8672
if (probe_umc8672)
(void)umc8672_init();
#endif
#ifdef CONFIG_BLK_DEV_DTC2278
if (probe_dtc2278)
(void)dtc2278_init();
#endif
#ifdef CONFIG_BLK_DEV_HT6560B
if (probe_ht6560b)
(void)ht6560b_init();
#endif
#ifdef CONFIG_BLK_DEV_QD65XX
if (probe_qd65xx)
(void)qd65xx_init();
#endif
initializing = 1;
/* Probe for special PCI and other "known" interface chipsets. */
probe_for_hwifs();
initializing = 0;
#ifdef CONFIG_PROC_FS
proc_ide_create();
#endif
return 0;
}
在调用probe_for_hwifs()之前设置了initializing = 1;如此就使得PCI and other "known" interface只是做了初始化,而不会调用probe_hwif_init_with_fixup()进行驱动设备的探测和注册;可是我找不到调用ide_generic_init()的地方,到底这些接口是通过什么方式注册的呢??? 文件drivers\ide\ide-generic.c中
static int __init ide_generic_init(void)
{
if (ide_hwifs.io_ports)
ide_get_lock(NULL, NULL); /* for atari only */
(void)ideprobe_init();
if (ide_hwifs.io_ports)
ide_release_lock(); /* for atari only */
create_proc_ide_interfaces();
return 0;
}
module_init(ide_generic_init);
在启动过程中进行了探测,HOHO
这个文件是在ide-core.o之后链接的,所以会排在后面调用!!!
页:
[1]