Open FFBoard
Open source force feedback firmware
net_device.h File Reference

Go to the source code of this file.

Enumerations

enum  ncm_data_interface_protocol_code_t { NCM_DATA_PROTOCOL_NETWORK_TRANSFER_BLOCK = 0x01 }
 

Functions

bool tud_network_can_xmit (uint16_t size)
 
void tud_network_xmit (void *ref, uint16_t arg)
 
bool tud_network_recv_cb (const uint8_t *src, uint16_t size)
 
uint16_t tud_network_xmit_cb (uint8_t *dst, void *ref, uint16_t arg)
 
void tud_network_init_cb (void)
 
void netd_init (void)
 
bool netd_deinit (void)
 
void netd_reset (uint8_t rhport)
 
uint16_t netd_open (uint8_t rhport, tusb_desc_interface_t const *itf_desc, uint16_t max_len)
 
bool netd_control_xfer_cb (uint8_t rhport, uint8_t stage, tusb_control_request_t const *request)
 
bool netd_xfer_cb (uint8_t rhport, uint8_t ep_addr, xfer_result_t result, uint32_t xferred_bytes)
 
void netd_report (uint8_t *buf, uint16_t len)
 

Variables

 C
 
uint8_t tud_network_mac_address [6]
 

Enumeration Type Documentation

◆ ncm_data_interface_protocol_code_t

Enumerator
NCM_DATA_PROTOCOL_NETWORK_TRANSFER_BLOCK 

Definition at line 48 of file net_device.h.

Function Documentation

◆ netd_control_xfer_cb()

bool netd_control_xfer_cb ( uint8_t  rhport,
uint8_t  stage,
tusb_control_request_t const *  request 
)

Respond to TinyUSB control requests. At startup transmission of notification packets are done here.

Definition at line 245 of file ecm_rndis_device.c.

◆ netd_deinit()

bool netd_deinit ( void  )

Deinit driver

Definition at line 139 of file ecm_rndis_device.c.

◆ netd_init()

void netd_init ( void  )

Initialize the driver data structures. Might be called several times.

Definition at line 135 of file ecm_rndis_device.c.

◆ netd_open()

uint16_t netd_open ( uint8_t  rhport,
tusb_desc_interface_t const *  itf_desc,
uint16_t  max_len 
)

Open the USB interface.

  • parse the USB descriptor TUD_CDC_NCM_DESCRIPTOR for itfnum and endpoints
  • a specific order of elements in the descriptor is tested.
Note
Actually all of the information could be read directly from itf_desc, because the structure and the values are well known. But we do it this way.
Postcondition
  • itf_num set
  • ep_notif, ep_in and ep_out are set
  • USB interface is open

Definition at line 150 of file ecm_rndis_device.c.

◆ netd_report()

void netd_report ( uint8_t *  buf,
uint16_t  len 
)

Definition at line 123 of file ecm_rndis_device.c.

◆ netd_reset()

void netd_reset ( uint8_t  rhport)

Resets the port. In this driver this is the same as netd_init()

Definition at line 143 of file ecm_rndis_device.c.

◆ netd_xfer_cb()

bool netd_xfer_cb ( uint8_t  rhport,
uint8_t  ep_addr,
xfer_result_t  result,
uint32_t  xferred_bytes 
)

Handle TinyUSB requests to process transfer events.

Definition at line 385 of file ecm_rndis_device.c.

◆ tud_network_can_xmit()

bool tud_network_can_xmit ( uint16_t  size)

Check if the glue logic is allowed to call tud_network_xmit(). This function also fetches a next buffer if required, so that tud_network_xmit() is ready for copy and transmission operation.

Definition at line 420 of file ecm_rndis_device.c.

◆ tud_network_init_cb()

void tud_network_init_cb ( void  )

◆ tud_network_recv_cb()

bool tud_network_recv_cb ( const uint8_t *  src,
uint16_t  size 
)

◆ tud_network_xmit()

void tud_network_xmit ( void *  ref,
uint16_t  arg 
)

Put a datagram into a waiting NTB. If currently no transmission is started, then initiate transmission.

Definition at line 427 of file ecm_rndis_device.c.

◆ tud_network_xmit_cb()

uint16_t tud_network_xmit_cb ( uint8_t *  dst,
void *  ref,
uint16_t  arg 
)

Variable Documentation

◆ C

C
extern
Initial value:
{
#endif
void tud_network_recv_renew(void)

◆ tud_network_mac_address

uint8_t tud_network_mac_address[6]
extern