Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xiphi1978
linux
提交
9ac59226
L
linux
项目概览
xiphi1978
/
linux
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
9ac59226
编写于
1月 26, 2008
作者:
B
Bartlomiej Zolnierkiewicz
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ide: move CONFIG_IDEPCI_PCIBUS_ORDER code to ide-scan-pci.c
Signed-off-by:
N
Bartlomiej Zolnierkiewicz
<
bzolnier@gmail.com
>
上级
c99c92c5
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
110 addition
and
103 deletion
+110
-103
drivers/ide/ide-scan-pci.c
drivers/ide/ide-scan-pci.c
+110
-0
drivers/ide/setup-pci.c
drivers/ide/setup-pci.c
+0
-103
未找到文件。
drivers/ide/ide-scan-pci.c
浏览文件 @
9ac59226
/*
* support for probing IDE PCI devices in the PCI bus order
*
* Copyright (c) 1998-2000 Andre Hedrick <andre@linux-ide.org>
* Copyright (c) 1995-1998 Mark Lord
*
* May be copied or modified under the terms of the GNU General Public License
*/
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/ide.h>
/*
* Module interfaces
*/
static
int
pre_init
=
1
;
/* Before first ordered IDE scan */
static
LIST_HEAD
(
ide_pci_drivers
);
/*
* __ide_pci_register_driver - attach IDE driver
* @driver: pci driver
* @module: owner module of the driver
*
* Registers a driver with the IDE layer. The IDE layer arranges that
* boot time setup is done in the expected device order and then
* hands the controllers off to the core PCI code to do the rest of
* the work.
*
* Returns are the same as for pci_register_driver
*/
int
__ide_pci_register_driver
(
struct
pci_driver
*
driver
,
struct
module
*
module
,
const
char
*
mod_name
)
{
if
(
!
pre_init
)
return
__pci_register_driver
(
driver
,
module
,
mod_name
);
driver
->
driver
.
owner
=
module
;
list_add_tail
(
&
driver
->
node
,
&
ide_pci_drivers
);
return
0
;
}
EXPORT_SYMBOL_GPL
(
__ide_pci_register_driver
);
/**
* ide_scan_pcidev - find an IDE driver for a device
* @dev: PCI device to check
*
* Look for an IDE driver to handle the device we are considering.
* This is only used during boot up to get the ordering correct. After
* boot up the pci layer takes over the job.
*/
static
int
__init
ide_scan_pcidev
(
struct
pci_dev
*
dev
)
{
struct
list_head
*
l
;
struct
pci_driver
*
d
;
list_for_each
(
l
,
&
ide_pci_drivers
)
{
d
=
list_entry
(
l
,
struct
pci_driver
,
node
);
if
(
d
->
id_table
)
{
const
struct
pci_device_id
*
id
=
pci_match_id
(
d
->
id_table
,
dev
);
if
(
id
!=
NULL
&&
d
->
probe
(
dev
,
id
)
>=
0
)
{
dev
->
driver
=
d
;
pci_dev_get
(
dev
);
return
1
;
}
}
}
return
0
;
}
/**
* ide_scan_pcibus - perform the initial IDE driver scan
*
* Perform the initial bus rather than driver ordered scan of the
* PCI drivers. After this all IDE pci handling becomes standard
* module ordering not traditionally ordered.
*/
int
__init
ide_scan_pcibus
(
void
)
{
struct
pci_dev
*
dev
=
NULL
;
struct
pci_driver
*
d
;
struct
list_head
*
l
,
*
n
;
pre_init
=
0
;
if
(
!
ide_scan_direction
)
while
((
dev
=
pci_get_device
(
PCI_ANY_ID
,
PCI_ANY_ID
,
dev
)))
ide_scan_pcidev
(
dev
);
else
while
((
dev
=
pci_get_device_reverse
(
PCI_ANY_ID
,
PCI_ANY_ID
,
dev
)))
ide_scan_pcidev
(
dev
);
/*
* Hand the drivers over to the PCI layer now we
* are post init.
*/
list_for_each_safe
(
l
,
n
,
&
ide_pci_drivers
)
{
list_del
(
l
);
d
=
list_entry
(
l
,
struct
pci_driver
,
node
);
if
(
__pci_register_driver
(
d
,
d
->
driver
.
owner
,
d
->
driver
.
mod_name
))
printk
(
KERN_ERR
"%s: failed to register %s driver
\n
"
,
__FUNCTION__
,
d
->
driver
.
mod_name
);
}
return
0
;
}
static
int
__init
ide_scan_pci
(
void
)
{
return
ide_scan_pcibus
();
...
...
drivers/ide/setup-pci.c
浏览文件 @
9ac59226
...
...
@@ -698,106 +698,3 @@ int ide_setup_pci_devices(struct pci_dev *dev1, struct pci_dev *dev2,
}
EXPORT_SYMBOL_GPL
(
ide_setup_pci_devices
);
#ifdef CONFIG_IDEPCI_PCIBUS_ORDER
/*
* Module interfaces
*/
static
int
pre_init
=
1
;
/* Before first ordered IDE scan */
static
LIST_HEAD
(
ide_pci_drivers
);
/*
* __ide_pci_register_driver - attach IDE driver
* @driver: pci driver
* @module: owner module of the driver
*
* Registers a driver with the IDE layer. The IDE layer arranges that
* boot time setup is done in the expected device order and then
* hands the controllers off to the core PCI code to do the rest of
* the work.
*
* Returns are the same as for pci_register_driver
*/
int
__ide_pci_register_driver
(
struct
pci_driver
*
driver
,
struct
module
*
module
,
const
char
*
mod_name
)
{
if
(
!
pre_init
)
return
__pci_register_driver
(
driver
,
module
,
mod_name
);
driver
->
driver
.
owner
=
module
;
list_add_tail
(
&
driver
->
node
,
&
ide_pci_drivers
);
return
0
;
}
EXPORT_SYMBOL_GPL
(
__ide_pci_register_driver
);
/**
* ide_scan_pcidev - find an IDE driver for a device
* @dev: PCI device to check
*
* Look for an IDE driver to handle the device we are considering.
* This is only used during boot up to get the ordering correct. After
* boot up the pci layer takes over the job.
*/
static
int
__init
ide_scan_pcidev
(
struct
pci_dev
*
dev
)
{
struct
list_head
*
l
;
struct
pci_driver
*
d
;
list_for_each
(
l
,
&
ide_pci_drivers
)
{
d
=
list_entry
(
l
,
struct
pci_driver
,
node
);
if
(
d
->
id_table
)
{
const
struct
pci_device_id
*
id
=
pci_match_id
(
d
->
id_table
,
dev
);
if
(
id
!=
NULL
&&
d
->
probe
(
dev
,
id
)
>=
0
)
{
dev
->
driver
=
d
;
pci_dev_get
(
dev
);
return
1
;
}
}
}
return
0
;
}
/**
* ide_scan_pcibus - perform the initial IDE driver scan
*
* Perform the initial bus rather than driver ordered scan of the
* PCI drivers. After this all IDE pci handling becomes standard
* module ordering not traditionally ordered.
*/
int
__init
ide_scan_pcibus
(
void
)
{
struct
pci_dev
*
dev
=
NULL
;
struct
pci_driver
*
d
;
struct
list_head
*
l
,
*
n
;
pre_init
=
0
;
if
(
!
ide_scan_direction
)
while
((
dev
=
pci_get_device
(
PCI_ANY_ID
,
PCI_ANY_ID
,
dev
)))
ide_scan_pcidev
(
dev
);
else
while
((
dev
=
pci_get_device_reverse
(
PCI_ANY_ID
,
PCI_ANY_ID
,
dev
)))
ide_scan_pcidev
(
dev
);
/*
* Hand the drivers over to the PCI layer now we
* are post init.
*/
list_for_each_safe
(
l
,
n
,
&
ide_pci_drivers
)
{
list_del
(
l
);
d
=
list_entry
(
l
,
struct
pci_driver
,
node
);
if
(
__pci_register_driver
(
d
,
d
->
driver
.
owner
,
d
->
driver
.
mod_name
))
printk
(
KERN_ERR
"%s: failed to register %s driver
\n
"
,
__FUNCTION__
,
d
->
driver
.
mod_name
);
}
return
0
;
}
#endif
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录