1 /* 2 * Copyright (c) 2022, sakumisu 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 #ifndef USBD_CDC_ECM_H 7 #define USBD_CDC_ECM_H 8 9 #include "usb_cdc.h" 10 11 #ifdef __cplusplus 12 extern "C" { 13 #endif 14 15 /* Ethernet Maximum Segment size, typically 1514 bytes */ 16 #define CONFIG_CDC_ECM_ETH_MAX_SEGSZE 1514U 17 #define CONFIG_USBDEV_CDC_ECM_USING_LWIP 18 19 /* Init cdc ecm interface driver */ 20 struct usbd_interface *usbd_cdc_ecm_init_intf(struct usbd_interface *intf, const uint8_t int_ep, const uint8_t out_ep, const uint8_t in_ep); 21 22 /* Setup request command callback api */ 23 void usbd_cdc_ecm_set_connect_speed(uint32_t speed[2]); 24 void usbd_cdc_ecm_data_recv_done(void); 25 26 #ifdef CONFIG_USBDEV_CDC_ECM_USING_LWIP 27 #include <lwip/pbuf.h> 28 struct pbuf *usbd_cdc_ecm_eth_rx(void); 29 int usbd_cdc_ecm_eth_tx(struct pbuf *p); 30 #endif 31 32 #ifdef __cplusplus 33 } 34 #endif 35 36 #endif /* USBD_CDC_ECM_H */ 37