Go to the documentation of this file.
22 #ifndef USB_USBUS_CDC_ECM_H
23 #define USB_USBUS_CDC_ECM_H
46 #ifndef CONFIG_USBUS_CDC_ECM_CONFIG_SPEED
47 #define CONFIG_USBUS_CDC_ECM_CONFIG_SPEED 1000000
53 #ifndef CONFIG_USBUS_CDC_ECM_CONFIG_SPEED_DOWNSTREAM
54 #define CONFIG_USBUS_CDC_ECM_CONFIG_SPEED_DOWNSTREAM CONFIG_USBUS_CDC_ECM_CONFIG_SPEED
60 #ifndef CONFIG_USBUS_CDC_ECM_CONFIG_SPEED_UPSTREAM
61 #define CONFIG_USBUS_CDC_ECM_CONFIG_SPEED_UPSTREAM CONFIG_USBUS_CDC_ECM_CONFIG_SPEED
71 #define USBUS_CDCECM_EP_CTRL_SIZE 16
78 #define USBUS_CDCECM_EP_DATA_SIZE 64
usbus_cdcecm_notif_t notif
Startup message notification tracker.
struct usbus_cdcecm_device usbus_cdcecm_device_t
USBUS CDC ECM device interface context.
USBUS control endpoint module.
usbus_interface_t iface_data
Data interface.
usbus_t * usbus
Ptr to the USBUS context.
USBUS interface alternative setting.
unsigned active_iface
Current active data interface.
char mac_host[13]
host side's MAC address as string
Definitions for Ethernet.
usbus_interface_t iface_ctrl
Control interface.
netdev_t netdev
Netdev context struct.
Ethernet header definitions.
Definitions low-level network driver interface.
#define ETHERNET_ADDR_LEN
Length of an Ethernet address.
@ USBUS_CDCECM_NOTIF_LINK_UP
Link status is notified.
void usbus_cdcecm_init(usbus_t *usbus, usbus_cdcecm_device_t *handler)
CDC ECM initialization function.
size_t len
Length of the current rx frame.
usbus_cdcecm_notif_t
notification state, used to track which information must be send to the host
event_t tx_xmit
Transmit ready event.
mutex_t out_lock
mutex used for locking netif/USBUS send
size_t tx_len
Length of the current tx frame.
Structure to hold driver state.
usbus_endpoint_t * ep_ctrl
Control endpoint.
USBUS CDC ECM device interface context.
@ USBUS_CDCECM_NOTIF_NONE
Nothing notified so far.
USBUS descriptor generator.
event_t rx_flush
Receive flush event.
Mutex for thread synchronization.
uint8_t mac_netdev[ETHERNET_ADDR_LEN]
this device's MAC address
usbus_descr_gen_t ecm_descr
ECM descriptor generator.
usbus_endpoint_t * ep_in
Data endpoint in.
uint8_t in_buf[ETHERNET_FRAME_LEN]
Buffer for the received frames.
#define ETHERNET_FRAME_LEN
maximum number of bytes in an ethernet frame (without FCS)
usbus_string_t mac_str
String context for the host side mac address.
usbus_interface_alt_t iface_data_alt
Data alternative (active) interface.
usbus_endpoint_t * ep_out
Data endpoint out.
@ USBUS_CDCECM_NOTIF_SPEED
Link speed is notified.
usbus_handler_t handler_ctrl
Control interface handler.
Definitions for USB protocol messages.