|
@@ -58,9 +58,9 @@ struct rt_rndis_eth
|
|
#endif /* RNDIS_DELAY_LINK_UP */
|
|
#endif /* RNDIS_DELAY_LINK_UP */
|
|
|
|
|
|
ALIGN(4)
|
|
ALIGN(4)
|
|
- rt_uint8_t rx_pool[64];
|
|
|
|
|
|
+ rt_uint8_t rx_pool[512];
|
|
ALIGN(4)
|
|
ALIGN(4)
|
|
- rt_uint8_t tx_pool[64];
|
|
|
|
|
|
+ rt_uint8_t tx_pool[512];
|
|
|
|
|
|
rt_uint32_t cmd_pool[2];
|
|
rt_uint32_t cmd_pool[2];
|
|
ALIGN(4)
|
|
ALIGN(4)
|
|
@@ -175,14 +175,14 @@ const static struct ucdc_data_descriptor _data_desc =
|
|
USB_DESC_TYPE_ENDPOINT,
|
|
USB_DESC_TYPE_ENDPOINT,
|
|
USB_DIR_OUT | USB_DYNAMIC,
|
|
USB_DIR_OUT | USB_DYNAMIC,
|
|
USB_EP_ATTR_BULK,
|
|
USB_EP_ATTR_BULK,
|
|
- USB_CDC_BUFSIZE,
|
|
|
|
|
|
+ USB_DYNAMIC,
|
|
0x00,
|
|
0x00,
|
|
/* endpoint, bulk in */
|
|
/* endpoint, bulk in */
|
|
USB_DESC_LENGTH_ENDPOINT,
|
|
USB_DESC_LENGTH_ENDPOINT,
|
|
USB_DESC_TYPE_ENDPOINT,
|
|
USB_DESC_TYPE_ENDPOINT,
|
|
USB_DYNAMIC | USB_DIR_IN,
|
|
USB_DYNAMIC | USB_DIR_IN,
|
|
USB_EP_ATTR_BULK,
|
|
USB_EP_ATTR_BULK,
|
|
- USB_CDC_BUFSIZE,
|
|
|
|
|
|
+ USB_DYNAMIC,
|
|
0x00,
|
|
0x00,
|
|
};
|
|
};
|
|
|
|
|
|
@@ -206,16 +206,17 @@ struct usb_os_function_comp_id_descriptor rndis_func_comp_id_desc =
|
|
.subCompatibleID = {'5', '1', '6', '2', '0', '0', '1', 0x00},
|
|
.subCompatibleID = {'5', '1', '6', '2', '0', '0', '1', 0x00},
|
|
.reserved2 = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
|
|
.reserved2 = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
|
|
};
|
|
};
|
|
-ALIGN(4)
|
|
|
|
|
|
+//FS and HS needed
|
|
static struct usb_qualifier_descriptor dev_qualifier =
|
|
static struct usb_qualifier_descriptor dev_qualifier =
|
|
{
|
|
{
|
|
- sizeof(dev_qualifier),
|
|
|
|
- USB_DESC_TYPE_DEVICEQUALIFIER,
|
|
|
|
- 0x0200,
|
|
|
|
- USB_CLASS_CDC,
|
|
|
|
- 0x00,
|
|
|
|
- 64,
|
|
|
|
- 0x01,
|
|
|
|
|
|
+ sizeof(dev_qualifier), //bLength
|
|
|
|
+ USB_DESC_TYPE_DEVICEQUALIFIER, //bDescriptorType
|
|
|
|
+ 0x0200, //bcdUSB
|
|
|
|
+ USB_CLASS_CDC, //bDeviceClass
|
|
|
|
+ USB_CDC_SUBCLASS_ACM, //bDeviceSubClass
|
|
|
|
+ USB_CDC_PROTOCOL_VENDOR, //bDeviceProtocol
|
|
|
|
+ 64, //bMaxPacketSize0
|
|
|
|
+ 0x01, //bNumConfigurations
|
|
0,
|
|
0,
|
|
};
|
|
};
|
|
|
|
|
|
@@ -401,7 +402,7 @@ static rt_err_t _rndis_query_response(ufunction_t func,rndis_query_msg_t msg)
|
|
case OID_GEN_LINK_SPEED:
|
|
case OID_GEN_LINK_SPEED:
|
|
resp = _create_resp(4);
|
|
resp = _create_resp(4);
|
|
if(resp == RT_NULL) break;
|
|
if(resp == RT_NULL) break;
|
|
- _set_resp(resp, (10UL * 1000 * 1000) / 100);
|
|
|
|
|
|
+ _set_resp(resp, func->device->dcd->device_is_hs ? (480UL * 1000 *1000) : (12UL * 1000 * 1000) / 100);
|
|
break;
|
|
break;
|
|
|
|
|
|
case OID_GEN_MEDIA_CONNECT_STATUS:
|
|
case OID_GEN_MEDIA_CONNECT_STATUS:
|
|
@@ -1008,7 +1009,7 @@ static struct ufunction_ops ops =
|
|
*
|
|
*
|
|
* @return RT_EOK on successful.
|
|
* @return RT_EOK on successful.
|
|
*/
|
|
*/
|
|
-static rt_err_t _cdc_descriptor_config(ucdc_comm_desc_t comm, rt_uint8_t cintf_nr, ucdc_data_desc_t data, rt_uint8_t dintf_nr)
|
|
|
|
|
|
+static rt_err_t _cdc_descriptor_config(ucdc_comm_desc_t comm, rt_uint8_t cintf_nr, ucdc_data_desc_t data, rt_uint8_t dintf_nr, rt_uint8_t device_is_hs)
|
|
{
|
|
{
|
|
comm->call_mgmt_desc.data_interface = dintf_nr;
|
|
comm->call_mgmt_desc.data_interface = dintf_nr;
|
|
comm->union_desc.master_interface = cintf_nr;
|
|
comm->union_desc.master_interface = cintf_nr;
|
|
@@ -1016,7 +1017,8 @@ static rt_err_t _cdc_descriptor_config(ucdc_comm_desc_t comm, rt_uint8_t cintf_n
|
|
#ifdef RT_USB_DEVICE_COMPOSITE
|
|
#ifdef RT_USB_DEVICE_COMPOSITE
|
|
comm->iad_desc.bFirstInterface = cintf_nr;
|
|
comm->iad_desc.bFirstInterface = cintf_nr;
|
|
#endif
|
|
#endif
|
|
-
|
|
|
|
|
|
+ data->ep_out_desc.wMaxPacketSize = device_is_hs ? 512 : 64;
|
|
|
|
+ data->ep_in_desc.wMaxPacketSize = device_is_hs ? 512 : 64;
|
|
return RT_EOK;
|
|
return RT_EOK;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1237,7 +1239,7 @@ ufunction_t rt_usbd_function_rndis_create(udevice_t device)
|
|
(rt_off_t)&((ucdc_comm_desc_t)0)->intf_desc);
|
|
(rt_off_t)&((ucdc_comm_desc_t)0)->intf_desc);
|
|
rt_usbd_altsetting_config_descriptor(data_setting, &_data_desc, 0);
|
|
rt_usbd_altsetting_config_descriptor(data_setting, &_data_desc, 0);
|
|
/* configure the cdc interface descriptor */
|
|
/* configure the cdc interface descriptor */
|
|
- _cdc_descriptor_config(comm_setting->desc, intf_comm->intf_num, data_setting->desc, intf_data->intf_num);
|
|
|
|
|
|
+ _cdc_descriptor_config(comm_setting->desc, intf_comm->intf_num, data_setting->desc, intf_data->intf_num, device->dcd->device_is_hs);
|
|
|
|
|
|
/* create a command endpoint */
|
|
/* create a command endpoint */
|
|
comm_desc = (ucdc_comm_desc_t)comm_setting->desc;
|
|
comm_desc = (ucdc_comm_desc_t)comm_setting->desc;
|