Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
ihbai
rt-thread
提交
c2539db3
R
rt-thread
项目概览
ihbai
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c2539db3
编写于
10月 22, 2018
作者:
lymzzyh
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[Components][drivers][usb]修复非对齐访问异常
上级
1ddde279
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
27 addition
and
5 deletion
+27
-5
components/drivers/usb/usbdevice/class/cdc_vcom.c
components/drivers/usb/usbdevice/class/cdc_vcom.c
+6
-2
components/drivers/usb/usbdevice/class/hid.c
components/drivers/usb/usbdevice/class/hid.c
+5
-1
components/drivers/usb/usbdevice/class/mstorage.c
components/drivers/usb/usbdevice/class/mstorage.c
+5
-1
components/drivers/usb/usbdevice/class/rndis.c
components/drivers/usb/usbdevice/class/rndis.c
+3
-0
components/drivers/usb/usbdevice/class/winusb.c
components/drivers/usb/usbdevice/class/winusb.c
+8
-1
未找到文件。
components/drivers/usb/usbdevice/class/cdc_vcom.c
浏览文件 @
c2539db3
...
...
@@ -82,6 +82,7 @@ struct vcom_tx_msg
rt_size_t
size
;
};
ALIGN
(
4
)
static
struct
udevice_descriptor
dev_desc
=
{
USB_DESC_LENGTH_DEVICE
,
//bLength;
...
...
@@ -101,6 +102,7 @@ static struct udevice_descriptor dev_desc =
};
//FS and HS needed
ALIGN
(
4
)
static
struct
usb_qualifier_descriptor
dev_qualifier
=
{
sizeof
(
dev_qualifier
),
//bLength
...
...
@@ -115,6 +117,7 @@ static struct usb_qualifier_descriptor dev_qualifier =
};
/* communcation interface descriptor */
ALIGN
(
4
)
const
static
struct
ucdc_comm_descriptor
_comm_desc
=
{
#ifdef RT_USB_DEVICE_COMPOSITE
...
...
@@ -184,6 +187,7 @@ const static struct ucdc_comm_descriptor _comm_desc =
};
/* data interface descriptor */
ALIGN
(
4
)
const
static
struct
ucdc_data_descriptor
_data_desc
=
{
/* interface descriptor */
...
...
@@ -217,7 +221,7 @@ const static struct ucdc_data_descriptor _data_desc =
0x00
,
},
};
ALIGN
(
4
)
static
char
serno
[
_SER_NO_LEN
+
1
]
=
{
'\0'
};
RT_WEAK
rt_err_t
vcom_get_stored_serno
(
char
*
serno
,
int
size
);
...
...
@@ -225,7 +229,7 @@ rt_err_t vcom_get_stored_serno(char *serno, int size)
{
return
RT_ERROR
;
}
ALIGN
(
4
)
const
static
char
*
_ustring
[]
=
{
"Language"
,
...
...
components/drivers/usb/usbdevice/class/hid.c
浏览文件 @
c2539db3
...
...
@@ -35,6 +35,7 @@ struct hid_s
};
/* CustomHID_ConfigDescriptor */
ALIGN
(
4
)
const
rt_uint8_t
_report_desc
[]
=
{
#ifdef RT_USB_DEVICE_HID_KEYBOARD
...
...
@@ -239,6 +240,7 @@ const rt_uint8_t _report_desc[]=
#endif
};
/* CustomHID_ReportDescriptor */
ALIGN
(
4
)
static
struct
udevice_descriptor
_dev_desc
=
{
USB_DESC_LENGTH_DEVICE
,
//bLength;
...
...
@@ -258,6 +260,7 @@ static struct udevice_descriptor _dev_desc =
};
//FS and HS needed
ALIGN
(
4
)
static
struct
usb_qualifier_descriptor
dev_qualifier
=
{
sizeof
(
dev_qualifier
),
//bLength
...
...
@@ -273,6 +276,7 @@ static struct usb_qualifier_descriptor dev_qualifier =
/* hid interface descriptor */
ALIGN
(
4
)
const
static
struct
uhid_comm_descriptor
_hid_comm_desc
=
{
#ifdef RT_USB_DEVICE_COMPOSITE
...
...
@@ -357,7 +361,7 @@ const static struct uhid_comm_descriptor _hid_comm_desc =
},
};
ALIGN
(
4
)
const
static
char
*
_ustring
[]
=
{
"Language"
,
...
...
components/drivers/usb/usbdevice/class/mstorage.c
浏览文件 @
c2539db3
...
...
@@ -68,6 +68,7 @@ struct mstorage
struct
rt_device_blk_geometry
geometry
;
};
ALIGN
(
4
)
static
struct
udevice_descriptor
dev_desc
=
{
USB_DESC_LENGTH_DEVICE
,
//bLength;
...
...
@@ -87,6 +88,7 @@ static struct udevice_descriptor dev_desc =
};
//FS and HS needed
ALIGN
(
4
)
static
struct
usb_qualifier_descriptor
dev_qualifier
=
{
sizeof
(
dev_qualifier
),
//bLength
...
...
@@ -101,7 +103,7 @@ static struct usb_qualifier_descriptor dev_qualifier =
};
ALIGN
(
4
)
const
static
struct
umass_descriptor
_mass_desc
=
{
#ifdef RT_USB_DEVICE_COMPOSITE
...
...
@@ -148,6 +150,7 @@ const static struct umass_descriptor _mass_desc =
},
};
ALIGN
(
4
)
const
static
char
*
_ustring
[]
=
{
"Language"
,
...
...
@@ -170,6 +173,7 @@ static rt_size_t _read_10(ufunction_t func, ustorage_cbw_t cbw);
static
rt_size_t
_write_10
(
ufunction_t
func
,
ustorage_cbw_t
cbw
);
static
rt_size_t
_verify_10
(
ufunction_t
func
,
ustorage_cbw_t
cbw
);
ALIGN
(
4
)
static
struct
scsi_cmd
cmd_data
[]
=
{
{
SCSI_TEST_UNIT_READY
,
_test_unit_ready
,
6
,
FIXED
,
0
,
DIR_NONE
},
...
...
components/drivers/usb/usbdevice/class/rndis.c
浏览文件 @
c2539db3
...
...
@@ -214,6 +214,7 @@ const static char* _ustring[] =
USB_STRING_OS
};
ALIGN
(
4
)
struct
usb_os_function_comp_id_descriptor
rndis_func_comp_id_desc
=
{
.
bFirstInterfaceNumber
=
USB_DYNAMIC
,
...
...
@@ -222,7 +223,9 @@ struct usb_os_function_comp_id_descriptor rndis_func_comp_id_desc =
.
subCompatibleID
=
{
'5'
,
'1'
,
'6'
,
'2'
,
'0'
,
'0'
,
'1'
,
0x00
},
.
reserved2
=
{
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
}
};
//FS and HS needed
ALIGN
(
4
)
static
struct
usb_qualifier_descriptor
dev_qualifier
=
{
sizeof
(
dev_qualifier
),
//bLength
...
...
components/drivers/usb/usbdevice/class/winusb.c
浏览文件 @
c2539db3
...
...
@@ -24,6 +24,7 @@ struct winusb_device
typedef
struct
winusb_device
*
winusb_device_t
;
ALIGN
(
4
)
static
struct
udevice_descriptor
dev_desc
=
{
USB_DESC_LENGTH_DEVICE
,
//bLength;
...
...
@@ -41,7 +42,9 @@ static struct udevice_descriptor dev_desc =
USB_STRING_SERIAL_INDEX
,
//iSerialNumber;
USB_DYNAMIC
,
//bNumConfigurations;
};
//FS and HS needed
ALIGN
(
4
)
static
struct
usb_qualifier_descriptor
dev_qualifier
=
{
sizeof
(
dev_qualifier
),
//bLength
...
...
@@ -55,6 +58,7 @@ static struct usb_qualifier_descriptor dev_qualifier =
0
,
};
ALIGN
(
4
)
struct
winusb_descriptor
_winusb_desc
=
{
#ifdef RT_USB_DEVICE_COMPOSITE
...
...
@@ -102,7 +106,7 @@ struct winusb_descriptor _winusb_desc =
},
};
ALIGN
(
4
)
const
static
char
*
_ustring
[]
=
{
"Language"
,
...
...
@@ -113,11 +117,14 @@ const static char* _ustring[] =
"Interface"
,
USB_STRING_OS
//must be
};
ALIGN
(
4
)
struct
usb_os_proerty
winusb_proerty
[]
=
{
USB_OS_PROERTY_DESC
(
USB_OS_PROERTY_TYPE_REG_SZ
,
"DeviceInterfaceGUID"
,
RT_WINUSB_GUID
),
};
ALIGN
(
4
)
struct
usb_os_function_comp_id_descriptor
winusb_func_comp_id_desc
=
{
.
bFirstInterfaceNumber
=
USB_DYNAMIC
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录