move hub and hport variable into common ram to reduce nocache ram usage
This commit is contained in:
@@ -48,7 +48,7 @@ static void usbh_audio_devno_free(struct usbh_audio *audio_class)
|
|||||||
|
|
||||||
int usbh_audio_open(struct usbh_audio *audio_class, const char *name, uint32_t samp_freq)
|
int usbh_audio_open(struct usbh_audio *audio_class, const char *name, uint32_t samp_freq)
|
||||||
{
|
{
|
||||||
struct usb_setup_packet *setup = &audio_class->hport->setup;
|
struct usb_setup_packet *setup = audio_class->hport->setup;
|
||||||
struct usb_endpoint_descriptor *ep_desc;
|
struct usb_endpoint_descriptor *ep_desc;
|
||||||
uint8_t mult;
|
uint8_t mult;
|
||||||
uint16_t mps;
|
uint16_t mps;
|
||||||
@@ -120,7 +120,7 @@ freq_found:
|
|||||||
|
|
||||||
int usbh_audio_close(struct usbh_audio *audio_class, const char *name)
|
int usbh_audio_close(struct usbh_audio *audio_class, const char *name)
|
||||||
{
|
{
|
||||||
struct usb_setup_packet *setup = &audio_class->hport->setup;
|
struct usb_setup_packet *setup = audio_class->hport->setup;
|
||||||
struct usb_endpoint_descriptor *ep_desc;
|
struct usb_endpoint_descriptor *ep_desc;
|
||||||
int ret;
|
int ret;
|
||||||
uint8_t intf = 0xff;
|
uint8_t intf = 0xff;
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ static void usbh_cdc_acm_devno_free(struct usbh_cdc_acm *cdc_acm_class)
|
|||||||
|
|
||||||
int usbh_cdc_acm_set_line_coding(struct usbh_cdc_acm *cdc_acm_class, struct cdc_line_coding *line_coding)
|
int usbh_cdc_acm_set_line_coding(struct usbh_cdc_acm *cdc_acm_class, struct cdc_line_coding *line_coding)
|
||||||
{
|
{
|
||||||
struct usb_setup_packet *setup = &cdc_acm_class->hport->setup;
|
struct usb_setup_packet *setup = cdc_acm_class->hport->setup;
|
||||||
|
|
||||||
setup->bmRequestType = USB_REQUEST_DIR_OUT | USB_REQUEST_CLASS | USB_REQUEST_RECIPIENT_INTERFACE;
|
setup->bmRequestType = USB_REQUEST_DIR_OUT | USB_REQUEST_CLASS | USB_REQUEST_RECIPIENT_INTERFACE;
|
||||||
setup->bRequest = CDC_REQUEST_SET_LINE_CODING;
|
setup->bRequest = CDC_REQUEST_SET_LINE_CODING;
|
||||||
@@ -53,7 +53,7 @@ int usbh_cdc_acm_set_line_coding(struct usbh_cdc_acm *cdc_acm_class, struct cdc_
|
|||||||
|
|
||||||
int usbh_cdc_acm_get_line_coding(struct usbh_cdc_acm *cdc_acm_class, struct cdc_line_coding *line_coding)
|
int usbh_cdc_acm_get_line_coding(struct usbh_cdc_acm *cdc_acm_class, struct cdc_line_coding *line_coding)
|
||||||
{
|
{
|
||||||
struct usb_setup_packet *setup = &cdc_acm_class->hport->setup;
|
struct usb_setup_packet *setup = cdc_acm_class->hport->setup;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
setup->bmRequestType = USB_REQUEST_DIR_IN | USB_REQUEST_CLASS | USB_REQUEST_RECIPIENT_INTERFACE;
|
setup->bmRequestType = USB_REQUEST_DIR_IN | USB_REQUEST_CLASS | USB_REQUEST_RECIPIENT_INTERFACE;
|
||||||
@@ -72,7 +72,7 @@ int usbh_cdc_acm_get_line_coding(struct usbh_cdc_acm *cdc_acm_class, struct cdc_
|
|||||||
|
|
||||||
int usbh_cdc_acm_set_line_state(struct usbh_cdc_acm *cdc_acm_class, bool dtr, bool rts)
|
int usbh_cdc_acm_set_line_state(struct usbh_cdc_acm *cdc_acm_class, bool dtr, bool rts)
|
||||||
{
|
{
|
||||||
struct usb_setup_packet *setup = &cdc_acm_class->hport->setup;
|
struct usb_setup_packet *setup = cdc_acm_class->hport->setup;
|
||||||
|
|
||||||
setup->bmRequestType = USB_REQUEST_DIR_OUT | USB_REQUEST_CLASS | USB_REQUEST_RECIPIENT_INTERFACE;
|
setup->bmRequestType = USB_REQUEST_DIR_OUT | USB_REQUEST_CLASS | USB_REQUEST_RECIPIENT_INTERFACE;
|
||||||
setup->bRequest = CDC_REQUEST_SET_CONTROL_LINE_STATE;
|
setup->bRequest = CDC_REQUEST_SET_CONTROL_LINE_STATE;
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ static void usbh_hid_devno_free(struct usbh_hid *hid_class)
|
|||||||
|
|
||||||
static int usbh_hid_get_report_descriptor(struct usbh_hid *hid_class, uint8_t *buffer)
|
static int usbh_hid_get_report_descriptor(struct usbh_hid *hid_class, uint8_t *buffer)
|
||||||
{
|
{
|
||||||
struct usb_setup_packet *setup = &hid_class->hport->setup;
|
struct usb_setup_packet *setup = hid_class->hport->setup;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
setup->bmRequestType = USB_REQUEST_DIR_IN | USB_REQUEST_STANDARD | USB_REQUEST_RECIPIENT_INTERFACE;
|
setup->bmRequestType = USB_REQUEST_DIR_IN | USB_REQUEST_STANDARD | USB_REQUEST_RECIPIENT_INTERFACE;
|
||||||
@@ -58,7 +58,7 @@ static int usbh_hid_get_report_descriptor(struct usbh_hid *hid_class, uint8_t *b
|
|||||||
|
|
||||||
int usbh_hid_set_idle(struct usbh_hid *hid_class, uint8_t report_id, uint8_t duration)
|
int usbh_hid_set_idle(struct usbh_hid *hid_class, uint8_t report_id, uint8_t duration)
|
||||||
{
|
{
|
||||||
struct usb_setup_packet *setup = &hid_class->hport->setup;
|
struct usb_setup_packet *setup = hid_class->hport->setup;
|
||||||
|
|
||||||
setup->bmRequestType = USB_REQUEST_DIR_OUT | USB_REQUEST_CLASS | USB_REQUEST_RECIPIENT_INTERFACE;
|
setup->bmRequestType = USB_REQUEST_DIR_OUT | USB_REQUEST_CLASS | USB_REQUEST_RECIPIENT_INTERFACE;
|
||||||
setup->bRequest = HID_REQUEST_SET_IDLE;
|
setup->bRequest = HID_REQUEST_SET_IDLE;
|
||||||
@@ -71,7 +71,7 @@ int usbh_hid_set_idle(struct usbh_hid *hid_class, uint8_t report_id, uint8_t dur
|
|||||||
|
|
||||||
int usbh_hid_get_idle(struct usbh_hid *hid_class, uint8_t *buffer)
|
int usbh_hid_get_idle(struct usbh_hid *hid_class, uint8_t *buffer)
|
||||||
{
|
{
|
||||||
struct usb_setup_packet *setup = &hid_class->hport->setup;
|
struct usb_setup_packet *setup = hid_class->hport->setup;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
setup->bmRequestType = USB_REQUEST_DIR_IN | USB_REQUEST_CLASS | USB_REQUEST_RECIPIENT_INTERFACE;
|
setup->bmRequestType = USB_REQUEST_DIR_IN | USB_REQUEST_CLASS | USB_REQUEST_RECIPIENT_INTERFACE;
|
||||||
@@ -90,7 +90,7 @@ int usbh_hid_get_idle(struct usbh_hid *hid_class, uint8_t *buffer)
|
|||||||
|
|
||||||
int usbh_hid_set_protocol(struct usbh_hid *hid_class, uint8_t protocol)
|
int usbh_hid_set_protocol(struct usbh_hid *hid_class, uint8_t protocol)
|
||||||
{
|
{
|
||||||
struct usb_setup_packet *setup = &hid_class->hport->setup;
|
struct usb_setup_packet *setup = hid_class->hport->setup;
|
||||||
|
|
||||||
setup->bmRequestType = USB_REQUEST_DIR_OUT | USB_REQUEST_CLASS | USB_REQUEST_RECIPIENT_INTERFACE;
|
setup->bmRequestType = USB_REQUEST_DIR_OUT | USB_REQUEST_CLASS | USB_REQUEST_RECIPIENT_INTERFACE;
|
||||||
setup->bRequest = HID_REQUEST_SET_PROTOCOL;
|
setup->bRequest = HID_REQUEST_SET_PROTOCOL;
|
||||||
|
|||||||
@@ -17,16 +17,17 @@
|
|||||||
static uint32_t g_devinuse = 0;
|
static uint32_t g_devinuse = 0;
|
||||||
|
|
||||||
USB_NOCACHE_RAM_SECTION USB_MEM_ALIGNX uint8_t g_hub_buf[32];
|
USB_NOCACHE_RAM_SECTION USB_MEM_ALIGNX uint8_t g_hub_buf[32];
|
||||||
|
USB_NOCACHE_RAM_SECTION USB_MEM_ALIGNX uint8_t g_hub_intbuf[CONFIG_USBHOST_MAX_EXTHUBS + 1][1];
|
||||||
|
|
||||||
usb_slist_t hub_class_head = USB_SLIST_OBJECT_INIT(hub_class_head);
|
usb_slist_t hub_class_head = USB_SLIST_OBJECT_INIT(hub_class_head);
|
||||||
|
|
||||||
usb_osal_thread_t hub_thread;
|
usb_osal_thread_t hub_thread;
|
||||||
usb_osal_mq_t hub_mq;
|
usb_osal_mq_t hub_mq;
|
||||||
|
|
||||||
USB_NOCACHE_RAM_SECTION struct usbh_hub roothub;
|
struct usbh_hub roothub;
|
||||||
|
|
||||||
#if CONFIG_USBHOST_MAX_EXTHUBS > 0
|
#if CONFIG_USBHOST_MAX_EXTHUBS > 0
|
||||||
USB_NOCACHE_RAM_SECTION struct usbh_hub exthub[CONFIG_USBHOST_MAX_EXTHUBS];
|
struct usbh_hub exthub[CONFIG_USBHOST_MAX_EXTHUBS];
|
||||||
#endif
|
#endif
|
||||||
extern int usbh_hport_activate_ep0(struct usbh_hubport *hport);
|
extern int usbh_hport_activate_ep0(struct usbh_hubport *hport);
|
||||||
extern int usbh_hport_deactivate_ep0(struct usbh_hubport *hport);
|
extern int usbh_hport_deactivate_ep0(struct usbh_hubport *hport);
|
||||||
@@ -74,7 +75,7 @@ static int _usbh_hub_get_hub_descriptor(struct usbh_hub *hub, uint8_t *buffer)
|
|||||||
struct usb_setup_packet *setup;
|
struct usb_setup_packet *setup;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
setup = &hub->parent->setup;
|
setup = hub->parent->setup;
|
||||||
|
|
||||||
setup->bmRequestType = USB_REQUEST_DIR_IN | USB_REQUEST_CLASS | USB_REQUEST_RECIPIENT_DEVICE;
|
setup->bmRequestType = USB_REQUEST_DIR_IN | USB_REQUEST_CLASS | USB_REQUEST_RECIPIENT_DEVICE;
|
||||||
setup->bRequest = USB_REQUEST_GET_DESCRIPTOR;
|
setup->bRequest = USB_REQUEST_GET_DESCRIPTOR;
|
||||||
@@ -95,7 +96,7 @@ static int _usbh_hub_get_status(struct usbh_hub *hub, uint8_t *buffer)
|
|||||||
struct usb_setup_packet *setup;
|
struct usb_setup_packet *setup;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
setup = &hub->parent->setup;
|
setup = hub->parent->setup;
|
||||||
|
|
||||||
setup->bmRequestType = USB_REQUEST_DIR_IN | USB_REQUEST_CLASS | USB_REQUEST_RECIPIENT_DEVICE;
|
setup->bmRequestType = USB_REQUEST_DIR_IN | USB_REQUEST_CLASS | USB_REQUEST_RECIPIENT_DEVICE;
|
||||||
setup->bRequest = HUB_REQUEST_GET_STATUS;
|
setup->bRequest = HUB_REQUEST_GET_STATUS;
|
||||||
@@ -116,7 +117,7 @@ static int _usbh_hub_get_portstatus(struct usbh_hub *hub, uint8_t port, struct h
|
|||||||
struct usb_setup_packet *setup;
|
struct usb_setup_packet *setup;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
setup = &hub->parent->setup;
|
setup = hub->parent->setup;
|
||||||
|
|
||||||
setup->bmRequestType = USB_REQUEST_DIR_IN | USB_REQUEST_CLASS | USB_REQUEST_RECIPIENT_OTHER;
|
setup->bmRequestType = USB_REQUEST_DIR_IN | USB_REQUEST_CLASS | USB_REQUEST_RECIPIENT_OTHER;
|
||||||
setup->bRequest = HUB_REQUEST_GET_STATUS;
|
setup->bRequest = HUB_REQUEST_GET_STATUS;
|
||||||
@@ -136,7 +137,7 @@ static int _usbh_hub_set_feature(struct usbh_hub *hub, uint8_t port, uint8_t fea
|
|||||||
{
|
{
|
||||||
struct usb_setup_packet *setup;
|
struct usb_setup_packet *setup;
|
||||||
|
|
||||||
setup = &hub->parent->setup;
|
setup = hub->parent->setup;
|
||||||
|
|
||||||
setup->bmRequestType = USB_REQUEST_DIR_OUT | USB_REQUEST_CLASS | USB_REQUEST_RECIPIENT_OTHER;
|
setup->bmRequestType = USB_REQUEST_DIR_OUT | USB_REQUEST_CLASS | USB_REQUEST_RECIPIENT_OTHER;
|
||||||
setup->bRequest = HUB_REQUEST_SET_FEATURE;
|
setup->bRequest = HUB_REQUEST_SET_FEATURE;
|
||||||
@@ -151,7 +152,7 @@ static int _usbh_hub_clear_feature(struct usbh_hub *hub, uint8_t port, uint8_t f
|
|||||||
{
|
{
|
||||||
struct usb_setup_packet *setup;
|
struct usb_setup_packet *setup;
|
||||||
|
|
||||||
setup = &hub->parent->setup;
|
setup = hub->parent->setup;
|
||||||
|
|
||||||
setup->bmRequestType = USB_REQUEST_DIR_OUT | USB_REQUEST_CLASS | USB_REQUEST_RECIPIENT_OTHER;
|
setup->bmRequestType = USB_REQUEST_DIR_OUT | USB_REQUEST_CLASS | USB_REQUEST_RECIPIENT_OTHER;
|
||||||
setup->bRequest = HUB_REQUEST_CLEAR_FEATURE;
|
setup->bRequest = HUB_REQUEST_CLEAR_FEATURE;
|
||||||
@@ -310,6 +311,7 @@ static int usbh_hub_connect(struct usbh_hubport *hport, uint8_t intf)
|
|||||||
usbh_hub_register(hub);
|
usbh_hub_register(hub);
|
||||||
USB_LOG_INFO("Register HUB Class:%s\r\n", hport->config.intf[intf].devname);
|
USB_LOG_INFO("Register HUB Class:%s\r\n", hport->config.intf[intf].devname);
|
||||||
|
|
||||||
|
hub->int_buffer = g_hub_intbuf[hub->index - 1];
|
||||||
usbh_int_urb_fill(&hub->intin_urb, hub->intin, hub->int_buffer, 1, 0, hub_int_complete_callback, hub);
|
usbh_int_urb_fill(&hub->intin_urb, hub->intin, hub->int_buffer, 1, 0, hub_int_complete_callback, hub);
|
||||||
usbh_submit_urb(&hub->intin_urb);
|
usbh_submit_urb(&hub->intin_urb);
|
||||||
return 0;
|
return 0;
|
||||||
@@ -572,6 +574,7 @@ static void usbh_hub_thread_wakeup(struct usbh_hub *hub)
|
|||||||
|
|
||||||
void usbh_roothub_thread_wakeup(uint8_t port)
|
void usbh_roothub_thread_wakeup(uint8_t port)
|
||||||
{
|
{
|
||||||
|
roothub.int_buffer = g_hub_intbuf[roothub.index - 1];
|
||||||
roothub.int_buffer[0] |= (1 << port);
|
roothub.int_buffer[0] |= (1 << port);
|
||||||
usbh_hub_thread_wakeup(&roothub);
|
usbh_hub_thread_wakeup(&roothub);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ static void usbh_msc_devno_free(struct usbh_msc *msc_class)
|
|||||||
|
|
||||||
static int usbh_msc_get_maxlun(struct usbh_msc *msc_class, uint8_t *buffer)
|
static int usbh_msc_get_maxlun(struct usbh_msc *msc_class, uint8_t *buffer)
|
||||||
{
|
{
|
||||||
struct usb_setup_packet *setup = &msc_class->hport->setup;
|
struct usb_setup_packet *setup = msc_class->hport->setup;
|
||||||
|
|
||||||
setup->bmRequestType = USB_REQUEST_DIR_IN | USB_REQUEST_CLASS | USB_REQUEST_RECIPIENT_INTERFACE;
|
setup->bmRequestType = USB_REQUEST_DIR_IN | USB_REQUEST_CLASS | USB_REQUEST_RECIPIENT_INTERFACE;
|
||||||
setup->bRequest = MSC_REQUEST_GET_MAX_LUN;
|
setup->bRequest = MSC_REQUEST_GET_MAX_LUN;
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ static void usbh_video_devno_free(struct usbh_video *video_class)
|
|||||||
|
|
||||||
int usbh_video_get_cur(struct usbh_video *video_class, uint8_t intf, uint8_t entity_id, uint8_t cs, uint8_t *buf, uint16_t len)
|
int usbh_video_get_cur(struct usbh_video *video_class, uint8_t intf, uint8_t entity_id, uint8_t cs, uint8_t *buf, uint16_t len)
|
||||||
{
|
{
|
||||||
struct usb_setup_packet *setup = &video_class->hport->setup;
|
struct usb_setup_packet *setup = video_class->hport->setup;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
setup->bmRequestType = USB_REQUEST_DIR_IN | USB_REQUEST_CLASS | USB_REQUEST_RECIPIENT_INTERFACE;
|
setup->bmRequestType = USB_REQUEST_DIR_IN | USB_REQUEST_CLASS | USB_REQUEST_RECIPIENT_INTERFACE;
|
||||||
@@ -116,7 +116,7 @@ int usbh_video_get_cur(struct usbh_video *video_class, uint8_t intf, uint8_t ent
|
|||||||
|
|
||||||
int usbh_video_set_cur(struct usbh_video *video_class, uint8_t intf, uint8_t entity_id, uint8_t cs, uint8_t *buf, uint16_t len)
|
int usbh_video_set_cur(struct usbh_video *video_class, uint8_t intf, uint8_t entity_id, uint8_t cs, uint8_t *buf, uint16_t len)
|
||||||
{
|
{
|
||||||
struct usb_setup_packet *setup = &video_class->hport->setup;
|
struct usb_setup_packet *setup = video_class->hport->setup;
|
||||||
|
|
||||||
setup->bmRequestType = USB_REQUEST_DIR_OUT | USB_REQUEST_CLASS | USB_REQUEST_RECIPIENT_INTERFACE;
|
setup->bmRequestType = USB_REQUEST_DIR_OUT | USB_REQUEST_CLASS | USB_REQUEST_RECIPIENT_INTERFACE;
|
||||||
setup->bRequest = VIDEO_REQUEST_SET_CUR;
|
setup->bRequest = VIDEO_REQUEST_SET_CUR;
|
||||||
@@ -156,7 +156,7 @@ int usbh_video_open(struct usbh_video *video_class,
|
|||||||
uint16_t wHeight,
|
uint16_t wHeight,
|
||||||
uint8_t altsetting)
|
uint8_t altsetting)
|
||||||
{
|
{
|
||||||
struct usb_setup_packet *setup = &video_class->hport->setup;
|
struct usb_setup_packet *setup = video_class->hport->setup;
|
||||||
struct usb_endpoint_descriptor *ep_desc;
|
struct usb_endpoint_descriptor *ep_desc;
|
||||||
uint8_t mult;
|
uint8_t mult;
|
||||||
uint16_t mps;
|
uint16_t mps;
|
||||||
@@ -246,7 +246,7 @@ int usbh_video_open(struct usbh_video *video_class,
|
|||||||
|
|
||||||
int usbh_video_close(struct usbh_video *video_class)
|
int usbh_video_close(struct usbh_video *video_class)
|
||||||
{
|
{
|
||||||
struct usb_setup_packet *setup = &video_class->hport->setup;
|
struct usb_setup_packet *setup = video_class->hport->setup;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
USB_LOG_INFO("Close video device\r\n");
|
USB_LOG_INFO("Close video device\r\n");
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ USB_NOCACHE_RAM_SECTION USB_MEM_ALIGNX uint8_t g_rndis_buf[1024];
|
|||||||
|
|
||||||
static int usbh_rndis_init_msg_transfer(struct usbh_rndis *rndis_class)
|
static int usbh_rndis_init_msg_transfer(struct usbh_rndis *rndis_class)
|
||||||
{
|
{
|
||||||
struct usb_setup_packet *setup = &rndis_class->hport->setup;
|
struct usb_setup_packet *setup = rndis_class->hport->setup;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
rndis_initialize_msg_t *cmd;
|
rndis_initialize_msg_t *cmd;
|
||||||
rndis_initialize_cmplt_t *resp;
|
rndis_initialize_cmplt_t *resp;
|
||||||
@@ -60,7 +60,7 @@ static int usbh_rndis_init_msg_transfer(struct usbh_rndis *rndis_class)
|
|||||||
|
|
||||||
int usbh_rndis_query_msg_transfer(struct usbh_rndis *rndis_class, uint32_t oid, uint32_t query_len, uint8_t *info, uint32_t *info_len)
|
int usbh_rndis_query_msg_transfer(struct usbh_rndis *rndis_class, uint32_t oid, uint32_t query_len, uint8_t *info, uint32_t *info_len)
|
||||||
{
|
{
|
||||||
struct usb_setup_packet *setup = &rndis_class->hport->setup;
|
struct usb_setup_packet *setup = rndis_class->hport->setup;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
rndis_query_msg_t *cmd;
|
rndis_query_msg_t *cmd;
|
||||||
rndis_query_cmplt_t *resp;
|
rndis_query_cmplt_t *resp;
|
||||||
@@ -111,7 +111,7 @@ int usbh_rndis_query_msg_transfer(struct usbh_rndis *rndis_class, uint32_t oid,
|
|||||||
|
|
||||||
static int usbh_rndis_set_msg_transfer(struct usbh_rndis *rndis_class, uint32_t oid, uint8_t *info, uint32_t info_len)
|
static int usbh_rndis_set_msg_transfer(struct usbh_rndis *rndis_class, uint32_t oid, uint8_t *info, uint32_t info_len)
|
||||||
{
|
{
|
||||||
struct usb_setup_packet *setup = &rndis_class->hport->setup;
|
struct usb_setup_packet *setup = rndis_class->hport->setup;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
rndis_set_msg_t *cmd;
|
rndis_set_msg_t *cmd;
|
||||||
rndis_set_cmplt_t *resp;
|
rndis_set_cmplt_t *resp;
|
||||||
@@ -188,7 +188,7 @@ int usbh_rndis_bulk_in_transfer(struct usbh_rndis *rndis_class, uint8_t *buffer,
|
|||||||
|
|
||||||
int usbh_rndis_keepalive(struct usbh_rndis *rndis_class)
|
int usbh_rndis_keepalive(struct usbh_rndis *rndis_class)
|
||||||
{
|
{
|
||||||
struct usb_setup_packet *setup = &rndis_class->hport->setup;
|
struct usb_setup_packet *setup = rndis_class->hport->setup;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
rndis_keepalive_msg_t *cmd;
|
rndis_keepalive_msg_t *cmd;
|
||||||
rndis_keepalive_cmplt_t *resp;
|
rndis_keepalive_cmplt_t *resp;
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ struct usbh_class_info *usbh_class_info_table_begin = NULL;
|
|||||||
struct usbh_class_info *usbh_class_info_table_end = NULL;
|
struct usbh_class_info *usbh_class_info_table_end = NULL;
|
||||||
|
|
||||||
USB_NOCACHE_RAM_SECTION USB_MEM_ALIGNX uint8_t ep0_request_buffer[CONFIG_USBHOST_REQUEST_BUFFER_LEN];
|
USB_NOCACHE_RAM_SECTION USB_MEM_ALIGNX uint8_t ep0_request_buffer[CONFIG_USBHOST_REQUEST_BUFFER_LEN];
|
||||||
|
USB_NOCACHE_RAM_SECTION USB_MEM_ALIGNX struct usb_setup_packet g_setup[CONFIG_USBHOST_MAX_EXTHUBS + 1][CONFIG_USBHOST_MAX_EHPORTS];
|
||||||
|
|
||||||
/* general descriptor field offsets */
|
/* general descriptor field offsets */
|
||||||
#define DESC_bLength 0 /** Length offset */
|
#define DESC_bLength 0 /** Length offset */
|
||||||
@@ -415,8 +416,8 @@ int usbh_enumerate(struct usbh_hubport *hport)
|
|||||||
uint16_t ep_mps;
|
uint16_t ep_mps;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
#define USB_REQUEST_BUFFER_SIZE 256
|
hport->setup = &g_setup[hport->parent->index - 1][hport->port - 1];
|
||||||
setup = &hport->setup;
|
setup = hport->setup;
|
||||||
|
|
||||||
/* Configure EP0 with the default maximum packet size */
|
/* Configure EP0 with the default maximum packet size */
|
||||||
usbh_hport_activate_ep0(hport);
|
usbh_hport_activate_ep0(hport);
|
||||||
|
|||||||
@@ -123,11 +123,11 @@ struct usbh_interface_altsetting {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct usbh_interface {
|
struct usbh_interface {
|
||||||
struct usbh_interface_altsetting altsetting[CONFIG_USBHOST_MAX_INTF_ALTSETTINGS];
|
|
||||||
uint8_t altsetting_num;
|
|
||||||
char devname[CONFIG_USBHOST_DEV_NAMELEN];
|
char devname[CONFIG_USBHOST_DEV_NAMELEN];
|
||||||
struct usbh_class_driver *class_driver;
|
struct usbh_class_driver *class_driver;
|
||||||
void *priv;
|
void *priv;
|
||||||
|
struct usbh_interface_altsetting altsetting[CONFIG_USBHOST_MAX_INTF_ALTSETTINGS];
|
||||||
|
uint8_t altsetting_num;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct usbh_configuration {
|
struct usbh_configuration {
|
||||||
@@ -146,8 +146,8 @@ struct usbh_hubport {
|
|||||||
const char *iManufacturer;
|
const char *iManufacturer;
|
||||||
const char *iProduct;
|
const char *iProduct;
|
||||||
const char *iSerialNumber;
|
const char *iSerialNumber;
|
||||||
uint8_t* raw_config_desc;
|
uint8_t *raw_config_desc;
|
||||||
USB_MEM_ALIGNX struct usb_setup_packet setup;
|
struct usb_setup_packet *setup;
|
||||||
struct usbh_hub *parent;
|
struct usbh_hub *parent;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -158,7 +158,7 @@ struct usbh_hub {
|
|||||||
uint8_t index;
|
uint8_t index;
|
||||||
uint8_t hub_addr;
|
uint8_t hub_addr;
|
||||||
usbh_pipe_t intin;
|
usbh_pipe_t intin;
|
||||||
USB_MEM_ALIGNX uint8_t int_buffer[1];
|
uint8_t *int_buffer;
|
||||||
struct usbh_urb intin_urb;
|
struct usbh_urb intin_urb;
|
||||||
struct usb_hub_descriptor hub_desc;
|
struct usb_hub_descriptor hub_desc;
|
||||||
struct usbh_hubport child[CONFIG_USBHOST_MAX_EHPORTS];
|
struct usbh_hubport child[CONFIG_USBHOST_MAX_EHPORTS];
|
||||||
@@ -184,6 +184,7 @@ struct usbh_hubport *usbh_find_hubport(uint8_t dev_addr);
|
|||||||
void *usbh_find_class_instance(const char *devname);
|
void *usbh_find_class_instance(const char *devname);
|
||||||
|
|
||||||
int lsusb(int argc, char **argv);
|
int lsusb(int argc, char **argv);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user