Generic Buffer structure and associated helper functions. More...
#include <dma.h>#include <slist.h>#include <types.h>Go to the source code of this file.
Data Structures | |
| struct | buffer |
| A generic data buffer. More... | |
Defines | |
Buffer List Manipulation | |
| #define | buf_list_entry(slnode) slist_entry(slnode, struct buffer, node) |
| Convert a slist node to a buffer struct. | |
| #define | buf_list_peek_head(list) slist_peek_head(list, struct buffer, node) |
| Return the first buffer in list. | |
| #define | buf_list_peek_tail(list) slist_peek_tail(list, struct buffer, node) |
| Return the last buffer in list. | |
| #define | buf_list_peek_next(buf) slist_peek_next(&(buf)->node, struct buffer, node) |
| Return the buffer following buf in the list. | |
| #define | buf_list_pop_head(list) slist_pop_head(list, struct buffer, node) |
| Return the first buffer in list and remove it. | |
Functions | |
| static void | buffer_init_tx (struct buffer *buf, const void *data, size_t len) |
| Initialize a buffer for transmitting data. | |
| static void | buffer_init_tx_mapped (struct buffer *buf, dma_addr_t addr, size_t len) |
| Initialize an already-DMA-mapped buffer for transmitting data. | |
| static void | buffer_init_rx (struct buffer *buf, void *data, size_t len) |
| Initialize a buffer for receiving data. | |
| static void | buffer_init_rx_mapped (struct buffer *buf, dma_addr_t addr, size_t len) |
| Initialize an already-DMA-mapped buffer for receiving data. | |
| struct buffer * | buffer_alloc (void) |
| Allocate a buffer structure. | |
| void | buffer_free (struct buffer *buf) |
| Free the buffer structure buf. | |
| void | buffer_resize (struct buffer *buf, size_t new_size) |
| Resize the buffer pointed to by buf. The caller must make sure the new size fit into the allocated memory space. | |
| void | buffer_pool_init (void) |
| Initialize the buffer pool. | |
Generic Buffer structure and associated helper functions.
Copyright (C) 2009 Atmel Corporation. All rights reserved.
Definition in file buffer.h.
1.6.3