update(platform): remove net class weak api, check CONFIG_USBHOST_PLATFORM_* macro is defined or not in usbh_lwip.c

Signed-off-by: sakumisu <1203593632@qq.com>
This commit is contained in:
sakumisu
2026-01-05 21:31:41 +08:00
parent d172c89eef
commit 44d92be013
7 changed files with 16 additions and 50 deletions

View File

@@ -306,16 +306,6 @@ int usbh_cdc_ecm_eth_output(uint32_t buflen)
return usbh_submit_urb(&g_cdc_ecm_class.bulkout_urb); return usbh_submit_urb(&g_cdc_ecm_class.bulkout_urb);
} }
__WEAK void usbh_cdc_ecm_run(struct usbh_cdc_ecm *cdc_ecm_class)
{
(void)cdc_ecm_class;
}
__WEAK void usbh_cdc_ecm_stop(struct usbh_cdc_ecm *cdc_ecm_class)
{
(void)cdc_ecm_class;
}
const struct usbh_class_driver cdc_ecm_class_driver = { const struct usbh_class_driver cdc_ecm_class_driver = {
.driver_name = "cdc_ecm", .driver_name = "cdc_ecm",
.connect = usbh_cdc_ecm_connect, .connect = usbh_cdc_ecm_connect,

View File

@@ -386,16 +386,6 @@ int usbh_cdc_ncm_eth_output(uint32_t buflen)
return usbh_submit_urb(&g_cdc_ncm_class.bulkout_urb); return usbh_submit_urb(&g_cdc_ncm_class.bulkout_urb);
} }
__WEAK void usbh_cdc_ncm_run(struct usbh_cdc_ncm *cdc_ncm_class)
{
(void)cdc_ncm_class;
}
__WEAK void usbh_cdc_ncm_stop(struct usbh_cdc_ncm *cdc_ncm_class)
{
(void)cdc_ncm_class;
}
const struct usbh_class_driver cdc_ncm_class_driver = { const struct usbh_class_driver cdc_ncm_class_driver = {
.driver_name = "cdc_ncm", .driver_name = "cdc_ncm",
.connect = usbh_cdc_ncm_connect, .connect = usbh_cdc_ncm_connect,

View File

@@ -795,16 +795,6 @@ int usbh_asix_eth_output(uint32_t buflen)
return usbh_submit_urb(&g_asix_class.bulkout_urb); return usbh_submit_urb(&g_asix_class.bulkout_urb);
} }
__WEAK void usbh_asix_run(struct usbh_asix *asix_class)
{
(void)asix_class;
}
__WEAK void usbh_asix_stop(struct usbh_asix *asix_class)
{
(void)asix_class;
}
static const uint16_t asix_id_table[][2] = { static const uint16_t asix_id_table[][2] = {
{ 0x0B95, 0x772B }, { 0x0B95, 0x772B },
{ 0x0B95, 0x7720 }, { 0x0B95, 0x7720 },

View File

@@ -2251,16 +2251,6 @@ int usbh_rtl8152_eth_output(uint32_t buflen)
return usbh_submit_urb(&g_rtl8152_class.bulkout_urb); return usbh_submit_urb(&g_rtl8152_class.bulkout_urb);
} }
__WEAK void usbh_rtl8152_run(struct usbh_rtl8152 *rtl8152_class)
{
(void)rtl8152_class;
}
__WEAK void usbh_rtl8152_stop(struct usbh_rtl8152 *rtl8152_class)
{
(void)rtl8152_class;
}
static const uint16_t rtl_id_table[][2] = { static const uint16_t rtl_id_table[][2] = {
{ 0x0BDA, 0x8152 }, { 0x0BDA, 0x8152 },
{ 0, 0 }, { 0, 0 },

View File

@@ -578,16 +578,6 @@ int usbh_rndis_eth_output(uint32_t buflen)
return usbh_submit_urb(&g_rndis_class.bulkout_urb); return usbh_submit_urb(&g_rndis_class.bulkout_urb);
} }
__WEAK void usbh_rndis_run(struct usbh_rndis *rndis_class)
{
(void)rndis_class;
}
__WEAK void usbh_rndis_stop(struct usbh_rndis *rndis_class)
{
(void)rndis_class;
}
static const struct usbh_class_driver rndis_class_driver = { static const struct usbh_class_driver rndis_class_driver = {
.driver_name = "rndis", .driver_name = "rndis",
.connect = usbh_rndis_connect, .connect = usbh_rndis_connect,

View File

@@ -30,6 +30,14 @@
#error TCPIP_THREAD_STACKSIZE must be >= 1024 #error TCPIP_THREAD_STACKSIZE must be >= 1024
#endif #endif
#if !defined(CONFIG_USBHOST_PLATFORM_CDC_ECM) && \
!defined(CONFIG_USBHOST_PLATFORM_CDC_RNDIS) && \
!defined(CONFIG_USBHOST_PLATFORM_CDC_NCM) && \
!defined(CONFIG_USBHOST_PLATFORM_ASIX) && \
!defined(CONFIG_USBHOST_PLATFORM_RTL8152)
#error "Please enable at least one USB Ethernet platform in usb_config.h or Kconfig"
#endif
// #define CONFIG_USBHOST_PLATFORM_CDC_ECM // #define CONFIG_USBHOST_PLATFORM_CDC_ECM
// #define CONFIG_USBHOST_PLATFORM_CDC_RNDIS // #define CONFIG_USBHOST_PLATFORM_CDC_RNDIS
// #define CONFIG_USBHOST_PLATFORM_CDC_NCM // #define CONFIG_USBHOST_PLATFORM_CDC_NCM

View File

@@ -48,6 +48,14 @@
#error RT_LWIP_TCPTHREAD_STACKSIZE must be >= 2048 #error RT_LWIP_TCPTHREAD_STACKSIZE must be >= 2048
#endif #endif
#if !defined(CONFIG_USBHOST_PLATFORM_CDC_ECM) && \
!defined(CONFIG_USBHOST_PLATFORM_CDC_RNDIS) && \
!defined(CONFIG_USBHOST_PLATFORM_CDC_NCM) && \
!defined(CONFIG_USBHOST_PLATFORM_ASIX) && \
!defined(CONFIG_USBHOST_PLATFORM_RTL8152)
#error "Please enable at least one USB Ethernet platform in usb_config.h or Kconfig"
#endif
// #define CONFIG_USBHOST_PLATFORM_CDC_ECM // #define CONFIG_USBHOST_PLATFORM_CDC_ECM
// #define CONFIG_USBHOST_PLATFORM_CDC_RNDIS // #define CONFIG_USBHOST_PLATFORM_CDC_RNDIS
// #define CONFIG_USBHOST_PLATFORM_CDC_NCM // #define CONFIG_USBHOST_PLATFORM_CDC_NCM