Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OS
U-Boot.Mirror
提交
5f6aa03f
U
U-Boot.Mirror
项目概览
OS
/
U-Boot.Mirror
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
U-Boot.Mirror
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
5f6aa03f
编写于
10月 07, 2011
作者:
M
Marek Vasut
提交者:
Remy Bohmer
12月 11, 2011
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
USB: Fix complaints about strict aliasing in OHCI-HCD
Signed-off-by:
N
Marek Vasut
<
marek.vasut@gmail.com
>
上级
5a1219ef
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
43 addition
and
32 deletion
+43
-32
drivers/usb/host/ohci-hcd.c
drivers/usb/host/ohci-hcd.c
+43
-32
未找到文件。
drivers/usb/host/ohci-hcd.c
浏览文件 @
5f6aa03f
...
...
@@ -1262,12 +1262,19 @@ static int ohci_submit_rh_msg(struct usb_device *dev, unsigned long pipe,
int
len
=
0
;
int
stat
=
0
;
__u32
datab
[
4
];
__u8
*
data_buf
=
(
__u8
*
)
datab
;
union
{
void
*
ptr
;
__u8
*
u8
;
__u16
*
u16
;
__u32
*
u32
;
}
databuf
;
__u16
bmRType_bReq
;
__u16
wValue
;
__u16
wIndex
;
__u16
wLength
;
databuf
.
u32
=
(
__u32
*
)
datab
;
#ifdef DEBUG
pkt_print
(
NULL
,
dev
,
pipe
,
buffer
,
transfer_len
,
cmd
,
"SUB(rh)"
,
usb_pipein
(
pipe
));
...
...
@@ -1297,20 +1304,20 @@ pkt_print(NULL, dev, pipe, buffer, transfer_len,
*/
case
RH_GET_STATUS
:
*
(
__u16
*
)
data_buf
=
cpu_to_le16
(
1
);
databuf
.
u16
[
0
]
=
cpu_to_le16
(
1
);
OK
(
2
);
case
RH_GET_STATUS
|
RH_INTERFACE
:
*
(
__u16
*
)
data_buf
=
cpu_to_le16
(
0
);
databuf
.
u16
[
0
]
=
cpu_to_le16
(
0
);
OK
(
2
);
case
RH_GET_STATUS
|
RH_ENDPOINT
:
*
(
__u16
*
)
data_buf
=
cpu_to_le16
(
0
);
databuf
.
u16
[
0
]
=
cpu_to_le16
(
0
);
OK
(
2
);
case
RH_GET_STATUS
|
RH_CLASS
:
*
(
__u32
*
)
data_buf
=
cpu_to_le32
(
databuf
.
u32
[
0
]
=
cpu_to_le32
(
RD_RH_STAT
&
~
(
RH_HS_CRWE
|
RH_HS_DRWE
));
OK
(
4
);
case
RH_GET_STATUS
|
RH_OTHER
|
RH_CLASS
:
*
(
__u32
*
)
data_buf
=
cpu_to_le32
(
RD_RH_PORTSTAT
);
databuf
.
u32
[
0
]
=
cpu_to_le32
(
RD_RH_PORTSTAT
);
OK
(
4
);
case
RH_CLEAR_FEATURE
|
RH_ENDPOINT
:
...
...
@@ -1374,14 +1381,14 @@ pkt_print(NULL, dev, pipe, buffer, transfer_len,
min_t
(
unsigned
int
,
sizeof
(
root_hub_dev_des
),
wLength
));
data
_buf
=
root_hub_dev_des
;
OK
(
len
);
data
buf
.
ptr
=
root_hub_dev_des
;
OK
(
len
);
case
(
0x02
):
/* configuration descriptor */
len
=
min_t
(
unsigned
int
,
leni
,
min_t
(
unsigned
int
,
sizeof
(
root_hub_config_des
),
wLength
));
data
_buf
=
root_hub_config_des
;
OK
(
len
);
data
buf
.
ptr
=
root_hub_config_des
;
OK
(
len
);
case
(
0x03
):
/* string descriptors */
if
(
wValue
==
0x0300
)
{
len
=
min_t
(
unsigned
int
,
...
...
@@ -1389,7 +1396,7 @@ pkt_print(NULL, dev, pipe, buffer, transfer_len,
min_t
(
unsigned
int
,
sizeof
(
root_hub_str_index0
),
wLength
));
data
_buf
=
root_hub_str_index0
;
data
buf
.
ptr
=
root_hub_str_index0
;
OK
(
len
);
}
if
(
wValue
==
0x0301
)
{
...
...
@@ -1398,7 +1405,7 @@ pkt_print(NULL, dev, pipe, buffer, transfer_len,
min_t
(
unsigned
int
,
sizeof
(
root_hub_str_index1
),
wLength
));
data
_buf
=
root_hub_str_index1
;
data
buf
.
ptr
=
root_hub_str_index1
;
OK
(
len
);
}
default:
...
...
@@ -1410,41 +1417,45 @@ pkt_print(NULL, dev, pipe, buffer, transfer_len,
{
__u32
temp
=
roothub_a
(
&
gohci
);
data
_buf
[
0
]
=
9
;
/* min length; */
data
_buf
[
1
]
=
0x29
;
data
_buf
[
2
]
=
temp
&
RH_A_NDP
;
data
buf
.
u8
[
0
]
=
9
;
/* min length; */
data
buf
.
u8
[
1
]
=
0x29
;
data
buf
.
u8
[
2
]
=
temp
&
RH_A_NDP
;
#ifdef CONFIG_AT91C_PQFP_UHPBUG
data
_buf
[
2
]
=
(
data_buf
[
2
]
==
2
)
?
1
:
0
;
data
buf
.
u8
[
2
]
=
(
databuf
.
u8
[
2
]
==
2
)
?
1
:
0
;
#endif
data
_buf
[
3
]
=
0
;
data
buf
.
u8
[
3
]
=
0
;
if
(
temp
&
RH_A_PSM
)
/* per-port power switching? */
data
_buf
[
3
]
|=
0x1
;
data
buf
.
u8
[
3
]
|=
0x1
;
if
(
temp
&
RH_A_NOCP
)
/* no overcurrent reporting? */
data
_buf
[
3
]
|=
0x10
;
data
buf
.
u8
[
3
]
|=
0x10
;
else
if
(
temp
&
RH_A_OCPM
)
/* per-port overcurrent reporting? */
data
_buf
[
3
]
|=
0x8
;
data
buf
.
u8
[
3
]
|=
0x8
;
/* corresponds to data
_buf
[4-7] */
datab
[
1
]
=
0
;
data
_buf
[
5
]
=
(
temp
&
RH_A_POTPGT
)
>>
24
;
/* corresponds to data
buf.u8
[4-7] */
datab
uf
.
u8
[
1
]
=
0
;
data
buf
.
u8
[
5
]
=
(
temp
&
RH_A_POTPGT
)
>>
24
;
temp
=
roothub_b
(
&
gohci
);
data
_buf
[
7
]
=
temp
&
RH_B_DR
;
if
(
data
_buf
[
2
]
<
7
)
{
data
_buf
[
8
]
=
0xff
;
data
buf
.
u8
[
7
]
=
temp
&
RH_B_DR
;
if
(
data
buf
.
u8
[
2
]
<
7
)
{
data
buf
.
u8
[
8
]
=
0xff
;
}
else
{
data
_buf
[
0
]
+=
2
;
data
_buf
[
8
]
=
(
temp
&
RH_B_DR
)
>>
8
;
data
_buf
[
10
]
=
data_buf
[
9
]
=
0xff
;
data
buf
.
u8
[
0
]
+=
2
;
data
buf
.
u8
[
8
]
=
(
temp
&
RH_B_DR
)
>>
8
;
data
buf
.
u8
[
10
]
=
databuf
.
u8
[
9
]
=
0xff
;
}
len
=
min_t
(
unsigned
int
,
leni
,
min_t
(
unsigned
int
,
data
_buf
[
0
],
wLength
));
min_t
(
unsigned
int
,
data
buf
.
u8
[
0
],
wLength
));
OK
(
len
);
}
case
RH_GET_CONFIGURATION
:
*
(
__u8
*
)
data_buf
=
0x01
;
OK
(
1
);
case
RH_GET_CONFIGURATION
:
databuf
.
u8
[
0
]
=
0x01
;
OK
(
1
);
case
RH_SET_CONFIGURATION
:
WR_RH_STAT
(
0x10000
);
OK
(
0
);
case
RH_SET_CONFIGURATION
:
WR_RH_STAT
(
0x10000
);
OK
(
0
);
default:
dbg
(
"unsupported root hub command"
);
...
...
@@ -1458,8 +1469,8 @@ pkt_print(NULL, dev, pipe, buffer, transfer_len,
#endif
len
=
min_t
(
int
,
len
,
leni
);
if
(
data
!=
data
_buf
)
memcpy
(
data
,
data_buf
,
len
);
if
(
data
!=
data
buf
.
ptr
)
memcpy
(
data
,
databuf
.
ptr
,
len
);
dev
->
act_len
=
len
;
dev
->
status
=
stat
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录