add ecm and rndis thread delete for dynamic netif

This commit is contained in:
sakumisu
2023-11-21 20:20:21 +08:00
parent d6bd89f274
commit 03db11f4af
5 changed files with 82 additions and 51 deletions

View File

@@ -304,7 +304,12 @@ 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);
g_cdc_ecm_class.thread = usb_osal_thread_create("usbh_cdc_ecm_rx", 2048, CONFIG_USBHOST_PSC_PRIO + 1, usbh_cdc_ecm_rx_thread, netif);
}
void usbh_cdc_ecm_lwip_thread_deinit(void)
{
usb_osal_thread_delete(g_cdc_ecm_class.thread);
}
__WEAK void usbh_cdc_ecm_run(struct usbh_cdc_ecm *cdc_ecm_class)

View File

@@ -32,6 +32,8 @@ struct usbh_cdc_ecm {
ip_addr_t ipaddr;
ip_addr_t netmask;
ip_addr_t gateway;
usb_osal_thread_t thread;
};
#ifdef __cplusplus
@@ -43,6 +45,7 @@ void usbh_cdc_ecm_stop(struct usbh_cdc_ecm *cdc_ecm_class);
err_t usbh_cdc_ecm_linkoutput(struct netif *netif, struct pbuf *p);
void usbh_cdc_ecm_lwip_thread_init(struct netif *netif);
void usbh_cdc_ecm_lwip_thread_deinit(void);
#ifdef __cplusplus
}