![]() |
Open FFBoard
Open source force feedback firmware
|
Go to the source code of this file.
Classes | |
struct | ncm_interface_t |
Functions | |
static void | notification_xmit (uint8_t rhport, bool force_next) |
static void | xmit_put_ntb_into_free_list (xmit_ntb_t *free_ntb) |
static xmit_ntb_t * | xmit_get_free_ntb (void) |
static void | xmit_put_ntb_into_ready_list (xmit_ntb_t *ready_ntb) |
static xmit_ntb_t * | xmit_get_next_ready_ntb (void) |
static bool | xmit_insert_required_zlp (uint8_t rhport, uint32_t xferred_bytes) |
static void | xmit_start_if_possible (uint8_t rhport) |
static bool | xmit_requested_datagram_fits_into_current_ntb (uint16_t datagram_size) |
static bool | xmit_setup_next_glue_ntb (void) |
static recv_ntb_t * | recv_get_free_ntb (void) |
static recv_ntb_t * | recv_get_next_ready_ntb (void) |
static void | recv_put_ntb_into_free_list (recv_ntb_t *free_ntb) |
static void | recv_put_ntb_into_ready_list (recv_ntb_t *ready_ntb) |
static void | recv_try_to_start_new_reception (uint8_t rhport) |
static bool | recv_validate_datagram (const recv_ntb_t *ntb, uint32_t len) |
static void | recv_transfer_datagram_to_glue_logic (void) |
bool | tud_network_can_xmit (uint16_t size) |
void | tud_network_xmit (void *ref, uint16_t arg) |
void | tud_network_recv_renew (void) |
void | tud_network_recv_renew_r (uint8_t rhport) |
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_xfer_cb (uint8_t rhport, uint8_t ep_addr, xfer_result_t result, uint32_t xferred_bytes) |
bool | netd_control_xfer_cb (uint8_t rhport, uint8_t stage, tusb_control_request_t const *request) |
Variables | |
CFG_TUD_MEM_SECTION CFG_TUD_MEM_ALIGN tu_static ncm_interface_t | ncm_interface |
CFG_TUD_MEM_SECTION CFG_TUD_MEM_ALIGN tu_static const ntb_parameters_t | ntb_parameters |
tu_static struct ncm_notify_t | ncm_notify_connected |
tu_static struct ncm_notify_t | ncm_notify_speed_change |
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 863 of file ncm_device.c.
bool netd_deinit | ( | void | ) |
Deinit driver
Definition at line 756 of file ncm_device.c.
void netd_init | ( | void | ) |
Initialize the driver data structures. Might be called several times.
Definition at line 740 of file ncm_device.c.
uint16_t netd_open | ( | uint8_t | rhport, |
tusb_desc_interface_t const * | itf_desc, | ||
uint16_t | max_len | ||
) |
Open the USB interface.
Definition at line 784 of file ncm_device.c.
void netd_reset | ( | uint8_t | rhport | ) |
Resets the port. In this driver this is the same as netd_init()
Definition at line 764 of file ncm_device.c.
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 824 of file ncm_device.c.
|
static |
Transmit next notification to the host (if appropriate). Notifications are transferred to the host once during connection setup.
Definition at line 188 of file ncm_device.c.
|
static |
Return pointer to an available receive buffer or NULL. Returned buffer (if any) has the size CFG_TUD_NCM_OUT_NTB_MAX_SIZE.
Definition at line 419 of file ncm_device.c.
|
static |
Get the next NTB from the ready list (and remove it from the list). If the ready list is empty, return NULL.
Definition at line 436 of file ncm_device.c.
|
static |
Put NTB into the receiver free list.
Definition at line 450 of file ncm_device.c.
|
static |
ready_ntb holds a validated NTB, put this buffer into the waiting list.
Definition at line 466 of file ncm_device.c.
|
static |
Transfer the next (pending) datagram to the glue logic and return receive buffer if empty.
Definition at line 598 of file ncm_device.c.
|
static |
If possible, start a new reception TinyUSB -> driver.
Definition at line 481 of file ncm_device.c.
|
static |
Validate incoming datagram.
Definition at line 515 of file ncm_device.c.
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 648 of file ncm_device.c.
void tud_network_recv_renew | ( | void | ) |
Keep the receive logic busy and transfer pending packets to the glue logic. Avoid recursive calls due to wrong expectations of the net glue logic, see https://github.com/hathach/tinyusb/issues/2711
Definition at line 699 of file ncm_device.c.
void tud_network_recv_renew_r | ( | uint8_t | rhport | ) |
Same as tud_network_recv_renew() but knows rhport
Definition at line 725 of file ncm_device.c.
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 666 of file ncm_device.c.
|
static |
Get an NTB from the free list
Definition at line 239 of file ncm_device.c.
|
static |
Get the next NTB from the ready list (and remove it from the list). If the ready list is empty, return NULL.
Definition at line 271 of file ncm_device.c.
|
static |
Transmit a ZLP if required
Definition at line 293 of file ncm_device.c.
|
static |
Put NTB into the transmitter free list.
Definition at line 220 of file ncm_device.c.
|
static |
Put a filled NTB into the ready list
Definition at line 255 of file ncm_device.c.
|
static |
check if a new datagram fits into the current NTB
Definition at line 358 of file ncm_device.c.
|
static |
Setup an NTB for the glue logic
Definition at line 376 of file ncm_device.c.
|
static |
Start transmission if it there is a waiting packet and if can be done from interface side.
Definition at line 314 of file ncm_device.c.
CFG_TUD_MEM_SECTION CFG_TUD_MEM_ALIGN tu_static ncm_interface_t ncm_interface |
Definition at line 121 of file ncm_device.c.
tu_static struct ncm_notify_t ncm_notify_connected |
Definition at line 159 of file ncm_device.c.
tu_static struct ncm_notify_t ncm_notify_speed_change |
Definition at line 171 of file ncm_device.c.
CFG_TUD_MEM_SECTION CFG_TUD_MEM_ALIGN tu_static const ntb_parameters_t ntb_parameters |
This is the NTB parameter structure
Definition at line 129 of file ncm_device.c.