Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
99fc1d91
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
99fc1d91
编写于
9月 23, 2013
作者:
B
Benjamin Herrenschmidt
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
powerpc/hvsi: Fix endian issues in HVSI driver
Signed-off-by:
N
Benjamin Herrenschmidt
<
benh@kernel.crashing.org
>
上级
5e4da530
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
20 addition
and
21 deletion
+20
-21
arch/powerpc/include/asm/hvsi.h
arch/powerpc/include/asm/hvsi.h
+8
-8
drivers/tty/hvc/hvsi_lib.c
drivers/tty/hvc/hvsi_lib.c
+12
-13
未找到文件。
arch/powerpc/include/asm/hvsi.h
浏览文件 @
99fc1d91
...
...
@@ -25,7 +25,7 @@
struct
hvsi_header
{
uint8_t
type
;
uint8_t
len
;
uint16_t
seqno
;
__be16
seqno
;
}
__attribute__
((
packed
));
struct
hvsi_data
{
...
...
@@ -35,24 +35,24 @@ struct hvsi_data {
struct
hvsi_control
{
struct
hvsi_header
hdr
;
uint16_t
verb
;
__be16
verb
;
/* optional depending on verb: */
uint32_t
word
;
uint32_t
mask
;
__be32
word
;
__be32
mask
;
}
__attribute__
((
packed
));
struct
hvsi_query
{
struct
hvsi_header
hdr
;
uint16_t
verb
;
__be16
verb
;
}
__attribute__
((
packed
));
struct
hvsi_query_response
{
struct
hvsi_header
hdr
;
uint16_t
verb
;
uint16_t
query_seqno
;
__be16
verb
;
__be16
query_seqno
;
union
{
uint8_t
version
;
uint32_t
mctrl_word
;
__be32
mctrl_word
;
}
u
;
}
__attribute__
((
packed
));
...
...
drivers/tty/hvc/hvsi_lib.c
浏览文件 @
99fc1d91
...
...
@@ -9,7 +9,7 @@
static
int
hvsi_send_packet
(
struct
hvsi_priv
*
pv
,
struct
hvsi_header
*
packet
)
{
packet
->
seqno
=
atomic_inc_return
(
&
pv
->
seqno
);
packet
->
seqno
=
cpu_to_be16
(
atomic_inc_return
(
&
pv
->
seqno
)
);
/* Assumes that always succeeds, works in practice */
return
pv
->
put_chars
(
pv
->
termno
,
(
char
*
)
packet
,
packet
->
len
);
...
...
@@ -28,7 +28,7 @@ static void hvsi_start_handshake(struct hvsi_priv *pv)
/* Send version query */
q
.
hdr
.
type
=
VS_QUERY_PACKET_HEADER
;
q
.
hdr
.
len
=
sizeof
(
struct
hvsi_query
);
q
.
verb
=
VSV_SEND_VERSION_NUMBER
;
q
.
verb
=
cpu_to_be16
(
VSV_SEND_VERSION_NUMBER
)
;
hvsi_send_packet
(
pv
,
&
q
.
hdr
);
}
...
...
@@ -40,7 +40,7 @@ static int hvsi_send_close(struct hvsi_priv *pv)
ctrl
.
hdr
.
type
=
VS_CONTROL_PACKET_HEADER
;
ctrl
.
hdr
.
len
=
sizeof
(
struct
hvsi_control
);
ctrl
.
verb
=
VSV_CLOSE_PROTOCOL
;
ctrl
.
verb
=
cpu_to_be16
(
VSV_CLOSE_PROTOCOL
)
;
return
hvsi_send_packet
(
pv
,
&
ctrl
.
hdr
);
}
...
...
@@ -69,14 +69,14 @@ static void hvsi_got_control(struct hvsi_priv *pv)
{
struct
hvsi_control
*
pkt
=
(
struct
hvsi_control
*
)
pv
->
inbuf
;
switch
(
pkt
->
verb
)
{
switch
(
be16_to_cpu
(
pkt
->
verb
)
)
{
case
VSV_CLOSE_PROTOCOL
:
/* We restart the handshaking */
hvsi_start_handshake
(
pv
);
break
;
case
VSV_MODEM_CTL_UPDATE
:
/* Transition of carrier detect */
hvsi_cd_change
(
pv
,
pkt
->
word
&
HVSI_TSCD
);
hvsi_cd_change
(
pv
,
be32_to_cpu
(
pkt
->
word
)
&
HVSI_TSCD
);
break
;
}
}
...
...
@@ -87,7 +87,7 @@ static void hvsi_got_query(struct hvsi_priv *pv)
struct
hvsi_query_response
r
;
/* We only handle version queries */
if
(
pkt
->
verb
!=
VSV_SEND_VERSION_NUMBER
)
if
(
be16_to_cpu
(
pkt
->
verb
)
!=
VSV_SEND_VERSION_NUMBER
)
return
;
pr_devel
(
"HVSI@%x: Got version query, sending response...
\n
"
,
...
...
@@ -96,7 +96,7 @@ static void hvsi_got_query(struct hvsi_priv *pv)
/* Send version response */
r
.
hdr
.
type
=
VS_QUERY_RESPONSE_PACKET_HEADER
;
r
.
hdr
.
len
=
sizeof
(
struct
hvsi_query_response
);
r
.
verb
=
VSV_SEND_VERSION_NUMBER
;
r
.
verb
=
cpu_to_be16
(
VSV_SEND_VERSION_NUMBER
)
;
r
.
u
.
version
=
HVSI_VERSION
;
r
.
query_seqno
=
pkt
->
hdr
.
seqno
;
hvsi_send_packet
(
pv
,
&
r
.
hdr
);
...
...
@@ -112,7 +112,7 @@ static void hvsi_got_response(struct hvsi_priv *pv)
switch
(
r
->
verb
)
{
case
VSV_SEND_MODEM_CTL_STATUS
:
hvsi_cd_change
(
pv
,
r
->
u
.
mctrl_word
&
HVSI_TSCD
);
hvsi_cd_change
(
pv
,
be32_to_cpu
(
r
->
u
.
mctrl_word
)
&
HVSI_TSCD
);
pv
->
mctrl_update
=
1
;
break
;
}
...
...
@@ -265,8 +265,7 @@ int hvsilib_read_mctrl(struct hvsi_priv *pv)
pv
->
mctrl_update
=
0
;
q
.
hdr
.
type
=
VS_QUERY_PACKET_HEADER
;
q
.
hdr
.
len
=
sizeof
(
struct
hvsi_query
);
q
.
hdr
.
seqno
=
atomic_inc_return
(
&
pv
->
seqno
);
q
.
verb
=
VSV_SEND_MODEM_CTL_STATUS
;
q
.
verb
=
cpu_to_be16
(
VSV_SEND_MODEM_CTL_STATUS
);
rc
=
hvsi_send_packet
(
pv
,
&
q
.
hdr
);
if
(
rc
<=
0
)
{
pr_devel
(
"HVSI@%x: Error %d...
\n
"
,
pv
->
termno
,
rc
);
...
...
@@ -304,9 +303,9 @@ int hvsilib_write_mctrl(struct hvsi_priv *pv, int dtr)
ctrl
.
hdr
.
type
=
VS_CONTROL_PACKET_HEADER
,
ctrl
.
hdr
.
len
=
sizeof
(
struct
hvsi_control
);
ctrl
.
verb
=
VSV_SET_MODEM_CTL
;
ctrl
.
mask
=
HVSI_TSDTR
;
ctrl
.
word
=
dtr
?
HVSI_TSDTR
:
0
;
ctrl
.
verb
=
cpu_to_be16
(
VSV_SET_MODEM_CTL
)
;
ctrl
.
mask
=
cpu_to_be32
(
HVSI_TSDTR
)
;
ctrl
.
word
=
cpu_to_be32
(
dtr
?
HVSI_TSDTR
:
0
)
;
return
hvsi_send_packet
(
pv
,
&
ctrl
.
hdr
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录