include/buffer.h File Reference

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

The following macros are simple wrappers around the generic singly-linked-list functionality designed to make it easier to operate on singly linked lists of buffers (which is a very common thing to put on singly linked lists).

#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 bufferbuffer_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.

Detailed Description

Generic Buffer structure and associated helper functions.

Copyright (C) 2009 Atmel Corporation. All rights reserved.

Definition in file buffer.h.

Generated on Thu Apr 29 15:18:22 2010 for display-training by  doxygen 1.6.3