Files
CherryUSB/class/cdc/usbh_cdc_ecm.h

54 lines
1.3 KiB
C
Raw Normal View History

2023-11-04 17:16:24 +08:00
/*
* Copyright (c) 2022, sakumisu
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef USBH_CDC_ECM_H
#define USBH_CDC_ECM_H
#include "usb_cdc.h"
2023-11-11 13:59:59 +08:00
#include "lwip/netif.h"
#include "lwip/pbuf.h"
2023-11-04 17:16:24 +08:00
struct usbh_cdc_ecm {
struct usbh_hubport *hport;
struct usb_endpoint_descriptor *bulkin; /* Bulk IN endpoint */
struct usb_endpoint_descriptor *bulkout; /* Bulk OUT endpoint */
struct usb_endpoint_descriptor *intin; /* Interrupt IN endpoint */
struct usbh_urb bulkout_urb; /* Bulk out endpoint */
struct usbh_urb bulkin_urb; /* Bulk IN endpoint */
struct usbh_urb intin_urb; /* Interrupt IN endpoint */
2023-11-04 17:16:24 +08:00
uint8_t ctrl_intf; /* Control interface number */
uint8_t data_intf; /* Data interface number */
uint8_t minor;
2023-11-04 17:16:24 +08:00
uint8_t mac[6];
bool connect_status;
uint16_t max_segment_size;
2023-11-11 13:59:59 +08:00
uint32_t speed[2];
ip_addr_t ipaddr;
ip_addr_t netmask;
ip_addr_t gateway;
2023-11-04 17:16:24 +08:00
};
#ifdef __cplusplus
extern "C" {
#endif
int usbh_cdc_ecm_get_connect_status(struct usbh_cdc_ecm *cdc_ecm_class);
2023-11-04 17:16:24 +08:00
void usbh_cdc_ecm_run(struct usbh_cdc_ecm *cdc_ecm_class);
void usbh_cdc_ecm_stop(struct usbh_cdc_ecm *cdc_ecm_class);
2023-11-11 13:59:59 +08:00
err_t usbh_cdc_ecm_linkoutput(struct netif *netif, struct pbuf *p);
2023-12-19 21:38:55 +08:00
void usbh_cdc_ecm_rx_thread(void *argument);
2023-11-11 13:59:59 +08:00
2023-11-04 17:16:24 +08:00
#ifdef __cplusplus
}
#endif
#endif /* USBH_CDC_ACM_H */