From d414fd21d84082ec4bebd1e593cefabddbc40fe5 Mon Sep 17 00:00:00 2001 From: sakumisu <1203593632@qq.com> Date: Fri, 1 Dec 2023 20:43:13 +0800 Subject: add config for rndis & ecm thread --- class/cdc/usbh_cdc_ecm.c | 2 +- class/wireless/usbh_rndis.c | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'class') diff --git a/class/cdc/usbh_cdc_ecm.c b/class/cdc/usbh_cdc_ecm.c index cc016491..28451485 100644 --- a/class/cdc/usbh_cdc_ecm.c +++ b/class/cdc/usbh_cdc_ecm.c @@ -309,7 +309,7 @@ err_t usbh_cdc_ecm_linkoutput(struct netif *netif, struct pbuf *p) void usbh_cdc_ecm_lwip_thread_init(struct netif *netif) { - usb_osal_thread_create("usbh_cdc_ecm_rx", 2048, CONFIG_USBHOST_PSC_PRIO + 1, usbh_cdc_ecm_rx_thread, netif); + usb_osal_thread_create("usbh_cdc_ecm_rx", CONFIG_USBHOST_RNDIS_STACKSIZE, CONFIG_USBHOST_CDC_ECM_PRIO, usbh_cdc_ecm_rx_thread, netif); } __WEAK void usbh_cdc_ecm_run(struct usbh_cdc_ecm *cdc_ecm_class) diff --git a/class/wireless/usbh_rndis.c b/class/wireless/usbh_rndis.c index c1c308a1..bfe6b594 100644 --- a/class/wireless/usbh_rndis.c +++ b/class/wireless/usbh_rndis.c @@ -492,12 +492,18 @@ find_class: g_rndis_rx_length = 0; USB_LOG_ERR("No memory to alloc pbuf for rndis rx\r\n"); } + } else { + g_rndis_rx_length = 0; + USB_LOG_ERR("Error rndis packet message\r\n"); } } } + + // clang-format off delete: USB_LOG_INFO("Delete rndis rx thread\r\n"); usb_osal_thread_delete(NULL); + // clang-format on } err_t usbh_rndis_linkoutput(struct netif *netif, struct pbuf *p) @@ -543,7 +549,7 @@ err_t usbh_rndis_linkoutput(struct netif *netif, struct pbuf *p) void usbh_rndis_lwip_thread_init(struct netif *netif) { - usb_osal_thread_create("usbh_rndis_rx", 2560, CONFIG_USBHOST_PSC_PRIO + 1, usbh_rndis_rx_thread, netif); + usb_osal_thread_create("usbh_rndis_rx", CONFIG_USBHOST_RNDIS_STACKSIZE, CONFIG_USBHOST_RNDIS_PRIO, usbh_rndis_rx_thread, netif); } __WEAK void usbh_rndis_run(struct usbh_rndis *rndis_class) -- cgit v1.3.1