![]() |
EVE 1.0
|
![]() |
Data Structures | |
struct | urb_t |
struct | ep_c_t |
struct | ep_t |
struct | ep_init_t |
struct | usbnet_rx_buf_t |
struct | usbnet_tx_buf_t |
struct | usbnet_tx_tiny_buf_t |
struct | net_buffers_t |
struct | usbnet_stat_h |
union | netspace_t |
Macros | |
#define | USBNET_ETH_FRAME_LEN (UIP_BUFSIZE + 58 - UIP_LLH_LEN) |
#define | USBNET_RX_BUF_SIZE USBNET_ETH_FRAME_LEN |
#define | USBNET_TX_BUF_SIZE USBNET_ETH_FRAME_LEN |
#define | USBNET_TX_TINY_BUF_SIZE (248) |
#define | USBNET_RX_POOL_SIZE (1) |
#define | USBNET_TX_POOL_SIZE (1) |
#define | USBNET_TX_TINY_POOL_SIZE (2) |
#define | USBNET_MANAGED_TX_POOL_SIZE (2) |
Typedefs | |
typedef ep_xfer_status_t(* | ep_if_xfer_cb_t) (ep_xfer_status_t status, uint32_t xferred, uint32_t remaining) |
typedef void(* | ep_xfer_cb_t) (struct ep_t *ep, struct urb_t *urb) |
typedef void(* | ep_complete_cb_t) (struct ep_t *ep, struct urb_t *urb, ep_xfer_status_t status) |
typedef ep_if_xfer_cb_t | ep_done_trap_t |
Enumerations |
Functions | |
void | ep_init (const struct ep_init_t *ep) |
int | ep_xfer_done (ep_xfer_status_t status, uint32_t xferred, uint32_t remaining, struct ep_t *ep) |
void | ep_xfer_in (struct ep_t *ep, struct urb_t *urb) |
void | ep_xfer_out (struct ep_t *ep, struct urb_t *urb) |
void | ep_kill_all_urbs (struct ep_t *ep, void *device) |
static struct urb_t * | ep_alloc_urb (struct ep_t *ep) |
static void | ep_free_urb (struct ep_t *ep, struct urb_t *urb) |
static bool | ep_is_empty (struct ep_t *ep) |
static void | ep_schedule_urb (struct ep_t *ep, struct urb_t *urb) |
void | usbnet_init () |
void | usbnet_start (struct process *module, uint8_t rx_backlog_len) |
void | usbnet_stop (struct process *module) |
struct urb_t * | usbnet_alloc_urb (struct process *module, uint32_t size, struct dlist_t *backlog) |
void | usbnet_schedule_tx (struct urb_t *urb) |
void | usbnet_schedule_rx (struct urb_t *urb) |
bool | usbnet_quote (void) |
static struct usbnet_tx_buf_t * | usbnet_tx_buf (struct urb_t *urb) |
static struct usbnet_rx_buf_t * | usbnet_rx_buf (struct urb_t *urb) |
Variables | |
struct usbnet_stat_h | usbnetStat |
union netspace_t | netspace |
#define USBNET_ETH_FRAME_LEN (UIP_BUFSIZE + 58 - UIP_LLH_LEN) |
#define USBNET_RX_BUF_SIZE USBNET_ETH_FRAME_LEN |
#define USBNET_TX_BUF_SIZE USBNET_ETH_FRAME_LEN |
#define USBNET_TX_TINY_BUF_SIZE (248) |
#define USBNET_RX_POOL_SIZE (1) |
#define USBNET_TX_POOL_SIZE (1) |
#define USBNET_TX_TINY_POOL_SIZE (2) |
#define USBNET_MANAGED_TX_POOL_SIZE (2) |
typedef ep_xfer_status_t(* ep_if_xfer_cb_t) (ep_xfer_status_t status, uint32_t xferred, uint32_t remaining) |
typedef void(* ep_complete_cb_t) (struct ep_t *ep, struct urb_t *urb, ep_xfer_status_t status) |
typedef ep_if_xfer_cb_t ep_done_trap_t |
USB complete callback for the EFM32 USB framework. The callback must call ep_xfer_done for the endpoint like below:
enum ep_xfer_status_t |
anonymous enum |
void ep_init | ( | const struct ep_init_t * | ep | ) |
Initialize an endpoint, allocate URBs and buffers
ep | The endpoint initialization description structure |
int ep_xfer_done | ( | ep_xfer_status_t | status, |
uint32_t | xferred, | ||
uint32_t | remaining, | ||
struct ep_t * | ep | ||
) |
Entry point for transfer done notifications See ep_done_trap_t for details how the function should be called.
status | Transfer status |
xferred | Number of bytes transferred |
remaining | Number of bytes remaining |
ep | The endpoint the function is called for |
Instantiation of ef ep_xfer_cb_t for receive endpoints
ep | The endpoint |
urb | The URB to be received |
Instantiation of ef ep_xfer_cb_t for transmit endpoints
ep | The endpoint |
urb | The URB to be send |
void ep_kill_all_urbs | ( | struct ep_t * | ep, |
void * | device | ||
) |
Cancel any ongoing transfer. The function internally called complete callback for the cancelled URBs.
ep | The endpoint |
device | Device instance |
Allocate a URB from the endpoint
ep | The endpoint |
Definition at line 189 of file ep.h.
References ep_t::c, dlist_del(), dlist_is_empty(), urb_t::link, dlist_t::next, ep_t::pool, and ep_c_t::size.
Free a URB
ep | The endpoint |
urb | The URB |
Definition at line 206 of file ep.h.
References dlist_append(), urb_t::link, and ep_t::pool.
|
inlinestatic |
Check if no more URBs can be allocated from the endpoint
ep | The endpoint |
Definition at line 217 of file ep.h.
References dlist_is_empty(), and ep_t::pool.
Schedule the URB for receiving or transmitting
ep | The endpoint |
urb | The URB |
Definition at line 227 of file ep.h.
References ep_t::c, dlist_append(), ep_t::head, urb_t::link, dlist_t::next, dlist_t::prev, and ep_c_t::xfer.
void usbnet_init | ( | ) |
Initialize the usbnet core.
void usbnet_start | ( | struct process * | module, |
uint8_t | rx_backlog_len | ||
) |
Start the interface; begin listening.
module | Usbnet client module |
rx_backlog_len | Amount of buffers in the RX backlog |
void usbnet_stop | ( | struct process * | module | ) |
Stop the interface; kill all URBs
module | Usbnet client module |
Allocate an URB for transmitting.
The URB is allocated from the appropriate pool, depending on requested size and backlog.
module | Usbnet client module |
size | Actual size of data to send |
backlog | The backlog the URB will belong to, or NULL for unmanaged allocation |
void usbnet_schedule_tx | ( | struct urb_t * | urb | ) |
Schedule the URB for transmission
urb | The URB to be sent over the interface |
void usbnet_schedule_rx | ( | struct urb_t * | urb | ) |
Schedule the URB for reception
urb | The URB to be received |
bool usbnet_quote | ( | void | ) |
Check if there is at least one URB available in the managed pool
Note that it the function returns false, the usbnet core will send USBNET_PROCESS_EVENT_TX_FLOW_ON signal to the usbnet_process when a new fresh URB appears in the managed pool.
|
static |
Convert an URB structure to the usbnet_tx_buf_t it actually points to
urb | The urb |
Definition at line 210 of file usbnet.h.
References urb_t::buf, and usbnet_rx_buf_t::data.
|
static |
Convert an URB structure to the usbnet_rx_buf_t it actually points to
urb | The urb |
Definition at line 221 of file usbnet.h.
References urb_t::buf, and usbnet_rx_buf_t::data.
struct usbnet_stat_h usbnetStat |
Usbnet statistics
union netspace_t netspace |
The physical USB buffers memory block.