Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xiphi1978
linux
提交
23cb3ada
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,发现更多精彩内容 >>
提交
23cb3ada
编写于
12月 18, 2005
作者:
L
Linus Torvalds
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/scjody/ieee1394
上级
27f4e083
16e842a6
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
58 addition
and
10 deletion
+58
-10
drivers/ieee1394/hosts.h
drivers/ieee1394/hosts.h
+1
-0
drivers/ieee1394/nodemgr.c
drivers/ieee1394/nodemgr.c
+57
-10
未找到文件。
drivers/ieee1394/hosts.h
浏览文件 @
23cb3ada
...
...
@@ -41,6 +41,7 @@ struct hpsb_host {
/* this nodes state */
unsigned
in_bus_reset
:
1
;
unsigned
is_shutdown
:
1
;
unsigned
resume_packet_sent
:
1
;
/* this nodes' duties on the bus */
unsigned
is_root
:
1
;
...
...
drivers/ieee1394/nodemgr.c
浏览文件 @
23cb3ada
...
...
@@ -1349,6 +1349,33 @@ static void nodemgr_update_pdrv(struct node_entry *ne)
}
/* Write the BROADCAST_CHANNEL as per IEEE1394a 8.3.2.3.11 and 8.4.2.3. This
* seems like an optional service but in the end it is practically mandatory
* as a consequence of these clauses.
*
* Note that we cannot do a broadcast write to all nodes at once because some
* pre-1394a devices would hang. */
static
void
nodemgr_irm_write_bc
(
struct
node_entry
*
ne
,
int
generation
)
{
const
u64
bc_addr
=
(
CSR_REGISTER_BASE
|
CSR_BROADCAST_CHANNEL
);
quadlet_t
bc_remote
,
bc_local
;
int
ret
;
if
(
!
ne
->
host
->
is_irm
||
ne
->
generation
!=
generation
||
ne
->
nodeid
==
ne
->
host
->
node_id
)
return
;
bc_local
=
cpu_to_be32
(
ne
->
host
->
csr
.
broadcast_channel
);
/* Check if the register is implemented and 1394a compliant. */
ret
=
hpsb_read
(
ne
->
host
,
ne
->
nodeid
,
generation
,
bc_addr
,
&
bc_remote
,
sizeof
(
bc_remote
));
if
(
!
ret
&&
bc_remote
&
cpu_to_be32
(
0x80000000
)
&&
bc_remote
!=
bc_local
)
hpsb_node_write
(
ne
,
bc_addr
,
&
bc_local
,
sizeof
(
bc_local
));
}
static
void
nodemgr_probe_ne
(
struct
host_info
*
hi
,
struct
node_entry
*
ne
,
int
generation
)
{
struct
device
*
dev
;
...
...
@@ -1360,6 +1387,8 @@ static void nodemgr_probe_ne(struct host_info *hi, struct node_entry *ne, int ge
if
(
!
dev
)
return
;
nodemgr_irm_write_bc
(
ne
,
generation
);
/* If "needs_probe", then this is either a new or changed node we
* rescan totally. If the generation matches for an existing node
* (one that existed prior to the bus reset) we send update calls
...
...
@@ -1413,9 +1442,25 @@ static void nodemgr_node_probe(struct host_info *hi, int generation)
return
;
}
/* Because we are a 1394a-2000 compliant IRM, we need to inform all the other
* nodes of the broadcast channel. (Really we're only setting the validity
* bit). Other IRM responsibilities go in here as well. */
static
int
nodemgr_send_resume_packet
(
struct
hpsb_host
*
host
)
{
struct
hpsb_packet
*
packet
;
int
ret
=
1
;
packet
=
hpsb_make_phypacket
(
host
,
0x003c0000
|
NODEID_TO_NODE
(
host
->
node_id
)
<<
24
);
if
(
packet
)
{
packet
->
no_waiter
=
1
;
packet
->
generation
=
get_hpsb_generation
(
host
);
ret
=
hpsb_send_packet
(
packet
);
}
if
(
ret
)
HPSB_WARN
(
"fw-host%d: Failed to broadcast resume packet"
,
host
->
id
);
return
ret
;
}
/* Perform a few high-level IRM responsibilities. */
static
int
nodemgr_do_irm_duties
(
struct
hpsb_host
*
host
,
int
cycles
)
{
quadlet_t
bc
;
...
...
@@ -1424,13 +1469,8 @@ static int nodemgr_do_irm_duties(struct hpsb_host *host, int cycles)
if
(
!
host
->
is_irm
||
host
->
irm_id
==
(
nodeid_t
)
-
1
)
return
1
;
host
->
csr
.
broadcast_channel
|=
0x40000000
;
/* set validity bit */
bc
=
cpu_to_be32
(
host
->
csr
.
broadcast_channel
);
hpsb_write
(
host
,
LOCAL_BUS
|
ALL_NODES
,
get_hpsb_generation
(
host
),
(
CSR_REGISTER_BASE
|
CSR_BROADCAST_CHANNEL
),
&
bc
,
sizeof
(
quadlet_t
));
/* We are a 1394a-2000 compliant IRM. Set the validity bit. */
host
->
csr
.
broadcast_channel
|=
0x40000000
;
/* If there is no bus manager then we should set the root node's
* force_root bit to promote bus stability per the 1394
...
...
@@ -1463,6 +1503,13 @@ static int nodemgr_do_irm_duties(struct hpsb_host *host, int cycles)
}
}
/* Some devices suspend their ports while being connected to an inactive
* host adapter, i.e. if connected before the low-level driver is
* loaded. They become visible either when physically unplugged and
* replugged, or when receiving a resume packet. Send one once. */
if
(
!
host
->
resume_packet_sent
&&
!
nodemgr_send_resume_packet
(
host
))
host
->
resume_packet_sent
=
1
;
return
1
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录