Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
bcd8b54f
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
bcd8b54f
编写于
2月 02, 2007
作者:
L
Len Brown
浏览文件
操作
浏览文件
下载
差异文件
Pull hp-pci-root into test branch
上级
e47fddf2
d91a0078
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
13 addition
and
123 deletion
+13
-123
drivers/acpi/glue.c
drivers/acpi/glue.c
+0
-123
drivers/acpi/pci_root.c
drivers/acpi/pci_root.c
+13
-0
未找到文件。
drivers/acpi/glue.c
浏览文件 @
bcd8b54f
...
...
@@ -86,129 +86,6 @@ static int acpi_find_bridge_device(struct device *dev, acpi_handle * handle)
return
ret
;
}
/* Get PCI root bridge's handle from its segment and bus number */
struct
acpi_find_pci_root
{
unsigned
int
seg
;
unsigned
int
bus
;
acpi_handle
handle
;
};
static
acpi_status
do_root_bridge_busnr_callback
(
struct
acpi_resource
*
resource
,
void
*
data
)
{
unsigned
long
*
busnr
=
data
;
struct
acpi_resource_address64
address
;
if
(
resource
->
type
!=
ACPI_RESOURCE_TYPE_ADDRESS16
&&
resource
->
type
!=
ACPI_RESOURCE_TYPE_ADDRESS32
&&
resource
->
type
!=
ACPI_RESOURCE_TYPE_ADDRESS64
)
return
AE_OK
;
acpi_resource_to_address64
(
resource
,
&
address
);
if
((
address
.
address_length
>
0
)
&&
(
address
.
resource_type
==
ACPI_BUS_NUMBER_RANGE
))
*
busnr
=
address
.
minimum
;
return
AE_OK
;
}
static
int
get_root_bridge_busnr
(
acpi_handle
handle
)
{
acpi_status
status
;
unsigned
long
bus
,
bbn
;
struct
acpi_buffer
buffer
=
{
ACPI_ALLOCATE_BUFFER
,
NULL
};
acpi_get_name
(
handle
,
ACPI_FULL_PATHNAME
,
&
buffer
);
status
=
acpi_evaluate_integer
(
handle
,
METHOD_NAME__BBN
,
NULL
,
&
bbn
);
if
(
status
==
AE_NOT_FOUND
)
{
/* Assume bus = 0 */
printk
(
KERN_INFO
PREFIX
"Assume root bridge [%s] bus is 0
\n
"
,
(
char
*
)
buffer
.
pointer
);
status
=
AE_OK
;
bbn
=
0
;
}
if
(
ACPI_FAILURE
(
status
))
{
bbn
=
-
ENODEV
;
goto
exit
;
}
if
(
bbn
>
0
)
goto
exit
;
/* _BBN in some systems return 0 for all root bridges */
bus
=
-
1
;
status
=
acpi_walk_resources
(
handle
,
METHOD_NAME__CRS
,
do_root_bridge_busnr_callback
,
&
bus
);
/* If _CRS failed, we just use _BBN */
if
(
ACPI_FAILURE
(
status
)
||
(
bus
==
-
1
))
goto
exit
;
/* We select _CRS */
if
(
bbn
!=
bus
)
{
printk
(
KERN_INFO
PREFIX
"_BBN and _CRS returns different value for %s. Select _CRS
\n
"
,
(
char
*
)
buffer
.
pointer
);
bbn
=
bus
;
}
exit:
kfree
(
buffer
.
pointer
);
return
(
int
)
bbn
;
}
static
acpi_status
find_pci_rootbridge
(
acpi_handle
handle
,
u32
lvl
,
void
*
context
,
void
**
rv
)
{
struct
acpi_find_pci_root
*
find
=
(
struct
acpi_find_pci_root
*
)
context
;
unsigned
long
seg
,
bus
;
acpi_status
status
;
int
tmp
;
struct
acpi_buffer
buffer
=
{
ACPI_ALLOCATE_BUFFER
,
NULL
};
acpi_get_name
(
handle
,
ACPI_FULL_PATHNAME
,
&
buffer
);
status
=
acpi_evaluate_integer
(
handle
,
METHOD_NAME__SEG
,
NULL
,
&
seg
);
if
(
status
==
AE_NOT_FOUND
)
{
/* Assume seg = 0 */
status
=
AE_OK
;
seg
=
0
;
}
if
(
ACPI_FAILURE
(
status
))
{
status
=
AE_CTRL_DEPTH
;
goto
exit
;
}
tmp
=
get_root_bridge_busnr
(
handle
);
if
(
tmp
<
0
)
{
printk
(
KERN_ERR
PREFIX
"Find root bridge failed for %s
\n
"
,
(
char
*
)
buffer
.
pointer
);
status
=
AE_CTRL_DEPTH
;
goto
exit
;
}
bus
=
tmp
;
if
(
seg
==
find
->
seg
&&
bus
==
find
->
bus
)
{
find
->
handle
=
handle
;
status
=
AE_CTRL_TERMINATE
;
}
else
status
=
AE_OK
;
exit:
kfree
(
buffer
.
pointer
);
return
status
;
}
acpi_handle
acpi_get_pci_rootbridge_handle
(
unsigned
int
seg
,
unsigned
int
bus
)
{
struct
acpi_find_pci_root
find
=
{
seg
,
bus
,
NULL
};
acpi_get_devices
(
PCI_ROOT_HID_STRING
,
find_pci_rootbridge
,
&
find
,
NULL
);
return
find
.
handle
;
}
EXPORT_SYMBOL_GPL
(
acpi_get_pci_rootbridge_handle
);
/* Get device's handler per its address under its parent */
struct
acpi_find_child
{
acpi_handle
handle
;
...
...
drivers/acpi/pci_root.c
浏览文件 @
bcd8b54f
...
...
@@ -117,6 +117,19 @@ void acpi_pci_unregister_driver(struct acpi_pci_driver *driver)
EXPORT_SYMBOL
(
acpi_pci_unregister_driver
);
acpi_handle
acpi_get_pci_rootbridge_handle
(
unsigned
int
seg
,
unsigned
int
bus
)
{
struct
acpi_pci_root
*
tmp
;
list_for_each_entry
(
tmp
,
&
acpi_pci_roots
,
node
)
{
if
((
tmp
->
id
.
segment
==
(
u16
)
seg
)
&&
(
tmp
->
id
.
bus
==
(
u16
)
bus
))
return
tmp
->
device
->
handle
;
}
return
NULL
;
}
EXPORT_SYMBOL_GPL
(
acpi_get_pci_rootbridge_handle
);
static
acpi_status
get_root_bridge_busnr_callback
(
struct
acpi_resource
*
resource
,
void
*
data
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录