QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 2518|回复: 1

Linux2.6.18中关于IDE接口初始化的疑惑

[复制链接]
发表于 2006-12-7 12:54:21 | 显示全部楼层 |阅读模式
文件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_dtc227
                (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()的地方,到底这些接口是通过什么方式注册的呢???
 楼主| 发表于 2006-12-11 11:17:02 | 显示全部楼层
文件drivers\ide\ide-generic.c中
static int __init ide_generic_init(void)
{
        if (ide_hwifs[0].io_ports[IDE_DATA_OFFSET])
                ide_get_lock(NULL, NULL); /* for atari only */

        (void)ideprobe_init();

        if (ide_hwifs[0].io_ports[IDE_DATA_OFFSET])
                ide_release_lock();        /* for atari only */

        create_proc_ide_interfaces();

        return 0;
}

module_init(ide_generic_init);

在启动过程中进行了探测,HOHO
这个文件是在ide-core.o之后链接的,所以会排在后面调用!!!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-4-24 12:06 , Processed in 0.076731 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表