Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
41d0ab2a
cloud-kernel
项目概览
openanolis
/
cloud-kernel
大约 1 年 前同步成功
通知
153
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
41d0ab2a
编写于
9月 09, 2005
作者:
L
Linus Torvalds
浏览文件
操作
浏览文件
下载
差异文件
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/pci-2.6
上级
a4531edd
cdb9b9f7
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
77 addition
and
64 deletion
+77
-64
drivers/pci/hotplug.c
drivers/pci/hotplug.c
+21
-32
drivers/pci/hotplug/pciehprm_acpi.c
drivers/pci/hotplug/pciehprm_acpi.c
+4
-4
drivers/pci/pci.h
drivers/pci/pci.h
+0
-1
drivers/pci/probe.c
drivers/pci/probe.c
+33
-17
drivers/pci/quirks.c
drivers/pci/quirks.c
+6
-0
include/linux/pci.h
include/linux/pci.h
+13
-10
未找到文件。
drivers/pci/hotplug.c
浏览文件 @
41d0ab2a
...
...
@@ -20,46 +20,35 @@ int pci_hotplug (struct device *dev, char **envp, int num_envp,
scratch
=
buffer
;
/* stuff we want to pass to /sbin/hotplug */
envp
[
i
++
]
=
scratch
;
length
+=
scnprintf
(
scratch
,
buffer_size
-
length
,
"PCI_CLASS=%04X"
,
pdev
->
class
);
if
((
buffer_size
-
length
<=
0
)
||
(
i
>=
num_envp
))
if
(
add_hotplug_env_var
(
envp
,
num_envp
,
&
i
,
buffer
,
buffer_size
,
&
length
,
"PCI_CLASS=%04X"
,
pdev
->
class
))
return
-
ENOMEM
;
++
length
;
scratch
+=
length
;
envp
[
i
++
]
=
scratch
;
length
+=
scnprintf
(
scratch
,
buffer_size
-
length
,
"PCI_ID=%04X:%04X"
,
pdev
->
vendor
,
pdev
->
device
);
if
((
buffer_size
-
length
<=
0
)
||
(
i
>=
num_envp
))
if
(
add_hotplug_env_var
(
envp
,
num_envp
,
&
i
,
buffer
,
buffer_size
,
&
length
,
"PCI_ID=%04X:%04X"
,
pdev
->
vendor
,
pdev
->
device
))
return
-
ENOMEM
;
++
length
;
scratch
+=
length
;
envp
[
i
++
]
=
scratch
;
length
+=
scnprintf
(
scratch
,
buffer_size
-
length
,
"PCI_SUBSYS_ID=%04X:%04X"
,
pdev
->
subsystem_vendor
,
pdev
->
subsystem_device
);
if
((
buffer_size
-
length
<=
0
)
||
(
i
>=
num_envp
))
if
(
add_hotplug_env_var
(
envp
,
num_envp
,
&
i
,
buffer
,
buffer_size
,
&
length
,
"PCI_SUBSYS_ID=%04X:%04X"
,
pdev
->
subsystem_vendor
,
pdev
->
subsystem_device
))
return
-
ENOMEM
;
++
length
;
scratch
+=
length
;
envp
[
i
++
]
=
scratch
;
length
+=
scnprintf
(
scratch
,
buffer_size
-
length
,
"PCI_SLOT_NAME=%s"
,
pci_name
(
pdev
));
if
((
buffer_size
-
length
<=
0
)
||
(
i
>=
num_envp
))
if
(
add_hotplug_env_var
(
envp
,
num_envp
,
&
i
,
buffer
,
buffer_size
,
&
length
,
"PCI_SLOT_NAME=%s"
,
pci_name
(
pdev
)))
return
-
ENOMEM
;
envp
[
i
++
]
=
scratch
;
length
+=
scnprintf
(
scratch
,
buffer_size
-
length
,
"MODALIAS=pci:v%08Xd%08Xsv%08Xsd%08Xbc%02Xsc%02Xi%02x"
,
pdev
->
vendor
,
pdev
->
device
,
pdev
->
subsystem_vendor
,
pdev
->
subsystem_device
,
(
u8
)(
pdev
->
class
>>
16
),
(
u8
)(
pdev
->
class
>>
8
),
(
u8
)(
pdev
->
class
));
if
((
buffer_size
-
length
<=
0
)
||
(
i
>=
num_envp
))
if
(
add_hotplug_env_var
(
envp
,
num_envp
,
&
i
,
buffer
,
buffer_size
,
&
length
,
"MODALIAS=pci:v%08Xd%08Xsv%08Xsd%08Xbc%02Xsc%02Xi%02x"
,
pdev
->
vendor
,
pdev
->
device
,
pdev
->
subsystem_vendor
,
pdev
->
subsystem_device
,
(
u8
)(
pdev
->
class
>>
16
),
(
u8
)(
pdev
->
class
>>
8
),
(
u8
)(
pdev
->
class
)))
return
-
ENOMEM
;
envp
[
i
]
=
NULL
;
...
...
drivers/pci/hotplug/pciehprm_acpi.c
浏览文件 @
41d0ab2a
...
...
@@ -1696,15 +1696,15 @@ void pciehprm_enable_card(
pci_bus
->
number
=
func
->
bus
;
devfn
=
PCI_DEVFN
(
func
->
device
,
func
->
function
);
rc
=
pci_bus_read_config_word
(
pci_bus
,
devfn
,
PCI_COMMAND
,
&
c
omman
d
);
rc
=
pci_bus_read_config_word
(
pci_bus
,
devfn
,
PCI_COMMAND
,
&
c
m
d
);
if
(
card_type
==
PCI_HEADER_TYPE_BRIDGE
)
{
rc
=
pci_bus_read_config_word
(
pci_bus
,
devfn
,
PCI_BRIDGE_CONTROL
,
&
bc
omman
d
);
rc
=
pci_bus_read_config_word
(
pci_bus
,
devfn
,
PCI_BRIDGE_CONTROL
,
&
bc
m
d
);
}
c
md
=
command
=
comman
d
|
PCI_COMMAND_MASTER
|
PCI_COMMAND_INVALIDATE
c
ommand
=
cm
d
|
PCI_COMMAND_MASTER
|
PCI_COMMAND_INVALIDATE
|
PCI_COMMAND_IO
|
PCI_COMMAND_MEMORY
;
bc
md
=
bcommand
=
bcomman
d
|
PCI_BRIDGE_CTL_NO_ISA
;
bc
ommand
=
bcm
d
|
PCI_BRIDGE_CTL_NO_ISA
;
ab
=
find_acpi_bridge_by_bus
(
acpi_bridges_head
,
ctrl
->
seg
,
ctrl
->
bus
);
if
(
ab
)
{
...
...
drivers/pci/pci.h
浏览文件 @
41d0ab2a
...
...
@@ -29,7 +29,6 @@ static inline int pci_proc_detach_bus(struct pci_bus *bus) { return 0; }
#endif
/* Functions for PCI Hotplug drivers to use */
extern
struct
pci_bus
*
pci_add_new_bus
(
struct
pci_bus
*
parent
,
struct
pci_dev
*
dev
,
int
busnr
);
extern
unsigned
int
pci_do_scan_bus
(
struct
pci_bus
*
bus
);
extern
int
pci_remove_device_safe
(
struct
pci_dev
*
dev
);
extern
unsigned
char
pci_max_busnr
(
void
);
...
...
drivers/pci/probe.c
浏览文件 @
41d0ab2a
...
...
@@ -753,27 +753,19 @@ pci_scan_device(struct pci_bus *bus, int devfn)
kfree
(
dev
);
return
NULL
;
}
device_initialize
(
&
dev
->
dev
);
dev
->
dev
.
release
=
pci_release_dev
;
pci_dev_get
(
dev
);
dev
->
dev
.
dma_mask
=
&
dev
->
dma_mask
;
dev
->
dev
.
coherent_dma_mask
=
0xffffffffull
;
return
dev
;
}
struct
pci_dev
*
__devinit
pci_scan_single_device
(
struct
pci_bus
*
bus
,
int
devfn
)
void
__devinit
pci_device_add
(
struct
pci_dev
*
dev
,
struct
pci_bus
*
bus
)
{
struct
pci_dev
*
dev
;
device_initialize
(
&
dev
->
dev
);
dev
->
dev
.
release
=
pci_release_dev
;
pci_dev_get
(
dev
);
dev
=
pci_scan_device
(
bus
,
devfn
)
;
pci_scan_msi_device
(
dev
)
;
dev
->
dev
.
dma_mask
=
&
dev
->
dma_mask
;
dev
->
dev
.
coherent_dma_mask
=
0xffffffffull
;
if
(
!
dev
)
return
NULL
;
/* Fix up broken headers */
pci_fixup_device
(
pci_fixup_header
,
dev
);
...
...
@@ -785,6 +777,19 @@ pci_scan_single_device(struct pci_bus *bus, int devfn)
spin_lock
(
&
pci_bus_lock
);
list_add_tail
(
&
dev
->
bus_list
,
&
bus
->
devices
);
spin_unlock
(
&
pci_bus_lock
);
}
struct
pci_dev
*
__devinit
pci_scan_single_device
(
struct
pci_bus
*
bus
,
int
devfn
)
{
struct
pci_dev
*
dev
;
dev
=
pci_scan_device
(
bus
,
devfn
);
if
(
!
dev
)
return
NULL
;
pci_device_add
(
dev
,
bus
);
pci_scan_msi_device
(
dev
);
return
dev
;
}
...
...
@@ -881,7 +886,8 @@ unsigned int __devinit pci_do_scan_bus(struct pci_bus *bus)
return
max
;
}
struct
pci_bus
*
__devinit
pci_scan_bus_parented
(
struct
device
*
parent
,
int
bus
,
struct
pci_ops
*
ops
,
void
*
sysdata
)
struct
pci_bus
*
__devinit
pci_create_bus
(
struct
device
*
parent
,
int
bus
,
struct
pci_ops
*
ops
,
void
*
sysdata
)
{
int
error
;
struct
pci_bus
*
b
;
...
...
@@ -938,8 +944,6 @@ struct pci_bus * __devinit pci_scan_bus_parented(struct device *parent, int bus,
b
->
resource
[
0
]
=
&
ioport_resource
;
b
->
resource
[
1
]
=
&
iomem_resource
;
b
->
subordinate
=
pci_scan_child_bus
(
b
);
return
b
;
sys_create_link_err:
...
...
@@ -957,6 +961,18 @@ struct pci_bus * __devinit pci_scan_bus_parented(struct device *parent, int bus,
kfree
(
b
);
return
NULL
;
}
EXPORT_SYMBOL_GPL
(
pci_create_bus
);
struct
pci_bus
*
__devinit
pci_scan_bus_parented
(
struct
device
*
parent
,
int
bus
,
struct
pci_ops
*
ops
,
void
*
sysdata
)
{
struct
pci_bus
*
b
;
b
=
pci_create_bus
(
parent
,
bus
,
ops
,
sysdata
);
if
(
b
)
b
->
subordinate
=
pci_scan_child_bus
(
b
);
return
b
;
}
EXPORT_SYMBOL
(
pci_scan_bus_parented
);
#ifdef CONFIG_HOTPLUG
...
...
drivers/pci/quirks.c
浏览文件 @
41d0ab2a
...
...
@@ -876,6 +876,12 @@ static void __init asus_hides_smbus_hostbridge(struct pci_dev *dev)
case
0xC00C
:
/* Samsung P35 notebook */
asus_hides_smbus
=
1
;
}
}
else
if
(
unlikely
(
dev
->
subsystem_vendor
==
PCI_VENDOR_ID_COMPAQ
))
{
if
(
dev
->
device
==
PCI_DEVICE_ID_INTEL_82855PM_HB
)
switch
(
dev
->
subsystem_device
)
{
case
0x0058
:
/* Compaq Evo N620c */
asus_hides_smbus
=
1
;
}
}
}
DECLARE_PCI_FIXUP_HEADER
(
PCI_VENDOR_ID_INTEL
,
PCI_DEVICE_ID_INTEL_82845_HB
,
asus_hides_smbus_hostbridge
);
...
...
include/linux/pci.h
浏览文件 @
41d0ab2a
...
...
@@ -315,8 +315,11 @@ static inline struct pci_bus *pci_scan_bus(int bus, struct pci_ops *ops, void *s
pci_bus_add_devices
(
root_bus
);
return
root_bus
;
}
struct
pci_bus
*
pci_create_bus
(
struct
device
*
parent
,
int
bus
,
struct
pci_ops
*
ops
,
void
*
sysdata
);
struct
pci_bus
*
pci_add_new_bus
(
struct
pci_bus
*
parent
,
struct
pci_dev
*
dev
,
int
busnr
);
int
pci_scan_slot
(
struct
pci_bus
*
bus
,
int
devfn
);
struct
pci_dev
*
pci_scan_single_device
(
struct
pci_bus
*
bus
,
int
devfn
);
void
pci_device_add
(
struct
pci_dev
*
dev
,
struct
pci_bus
*
bus
);
unsigned
int
pci_scan_child_bus
(
struct
pci_bus
*
bus
);
void
pci_bus_add_device
(
struct
pci_dev
*
dev
);
void
pci_read_bridge_bases
(
struct
pci_bus
*
child
);
...
...
@@ -377,32 +380,32 @@ static inline int pci_write_config_dword(struct pci_dev *dev, int where, u32 val
return
pci_bus_write_config_dword
(
dev
->
bus
,
dev
->
devfn
,
where
,
val
);
}
int
pci_enable_device
(
struct
pci_dev
*
dev
);
int
pci_enable_device_bars
(
struct
pci_dev
*
dev
,
int
mask
);
int
__must_check
pci_enable_device
(
struct
pci_dev
*
dev
);
int
__must_check
pci_enable_device_bars
(
struct
pci_dev
*
dev
,
int
mask
);
void
pci_disable_device
(
struct
pci_dev
*
dev
);
void
pci_set_master
(
struct
pci_dev
*
dev
);
#define HAVE_PCI_SET_MWI
int
pci_set_mwi
(
struct
pci_dev
*
dev
);
int
__must_check
pci_set_mwi
(
struct
pci_dev
*
dev
);
void
pci_clear_mwi
(
struct
pci_dev
*
dev
);
void
pci_intx
(
struct
pci_dev
*
dev
,
int
enable
);
int
pci_set_dma_mask
(
struct
pci_dev
*
dev
,
u64
mask
);
int
pci_set_consistent_dma_mask
(
struct
pci_dev
*
dev
,
u64
mask
);
int
__must_check
pci_set_dma_mask
(
struct
pci_dev
*
dev
,
u64
mask
);
int
__must_check
pci_set_consistent_dma_mask
(
struct
pci_dev
*
dev
,
u64
mask
);
void
pci_update_resource
(
struct
pci_dev
*
dev
,
struct
resource
*
res
,
int
resno
);
int
pci_assign_resource
(
struct
pci_dev
*
dev
,
int
i
);
void
pci_restore_bars
(
struct
pci_dev
*
dev
);
/* ROM control related routines */
void
__iomem
*
pci_map_rom
(
struct
pci_dev
*
pdev
,
size_t
*
size
);
void
__iomem
*
pci_map_rom_copy
(
struct
pci_dev
*
pdev
,
size_t
*
size
);
void
__iomem
__must_check
*
pci_map_rom
(
struct
pci_dev
*
pdev
,
size_t
*
size
);
void
__iomem
__must_check
*
pci_map_rom_copy
(
struct
pci_dev
*
pdev
,
size_t
*
size
);
void
pci_unmap_rom
(
struct
pci_dev
*
pdev
,
void
__iomem
*
rom
);
void
pci_remove_rom
(
struct
pci_dev
*
pdev
);
/* Power management related routines */
int
pci_save_state
(
struct
pci_dev
*
dev
);
int
pci_restore_state
(
struct
pci_dev
*
dev
);
int
pci_set_power_state
(
struct
pci_dev
*
dev
,
pci_power_t
state
);
pci_power_t
pci_choose_state
(
struct
pci_dev
*
dev
,
pm_message_t
state
);
int
pci_enable_wake
(
struct
pci_dev
*
dev
,
pci_power_t
state
,
int
enable
);
int
__must_check
pci_set_power_state
(
struct
pci_dev
*
dev
,
pci_power_t
state
);
pci_power_t
__must_check
pci_choose_state
(
struct
pci_dev
*
dev
,
pm_message_t
state
);
int
__must_check
pci_enable_wake
(
struct
pci_dev
*
dev
,
pci_power_t
state
,
int
enable
);
/* Helper functions for low-level code (drivers/pci/setup-[bus,res].c) */
void
pci_bus_assign_resources
(
struct
pci_bus
*
bus
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录