Microchip® Advanced Software Framework

bmm.h File Reference

This file contains the Buffer Management Module definitions.

Id:
bmm.h 19562 2009-12-15 17:18:44Z sschneid
Author
Microchip Technology Inc: http://www.microchip.com
Support: https://www.microchip.com/support/
#include <stdint.h>
#include <stdbool.h>

Data Structures

struct  buffer_tag
 Buffer structure holding information of each buffer. More...
 

Macros

#define BMM_BUFFER_POINTER(buf)   ((buf)->body)
 This macro provides the pointer to the corresponding body of the supplied buffer header. More...
 

Typedefs

typedef struct buffer_tag buffer_t
 Buffer structure holding information of each buffer. More...
 

Functions

buffer_tbmm_buffer_alloc (uint8_t size)
 Allocates a buffer. More...
 
void bmm_buffer_free (buffer_t *pbuffer)
 Frees up a buffer. More...
 
void bmm_buffer_init (void)
 Initializes the buffer module. More...
 

typedef struct buffer_tag buffer_t

Buffer structure holding information of each buffer.

buffer_t* bmm_buffer_alloc ( uint8_t  size)

Allocates a buffer.

This function allocates a buffer and returns a pointer to the buffer. The same pointer should be used while freeing the buffer.User should call BMM_BUFFER_POINTER(buf) to get the pointer to buffer user area.

Parameters
sizesize of buffer to be allocated.
Returns
pointer to the buffer allocated, NULL if buffer not available.

Referenced by handle_received_frame_irq(), mac_gts_table_update(), mac_send_gts_ind(), parse_mpdu(), tal_init(), tal_task(), wpan_mcps_data_req(), wpan_mlme_reset_req(), and wpan_mlme_set_req().

void bmm_buffer_free ( buffer_t pbuffer)

Frees up a buffer.

This function frees up a buffer. The pointer passed to this function should be the pointer returned during buffer allocation. The result is unpredictable if an incorrect pointer is passed.

Parameters
pbufferPointer to buffer that has to be freed.

Referenced by dispatch_event(), mac_process_data_frame(), mac_process_gts_request(), mac_process_tal_data_ind(), mac_process_tal_tx_status(), mcps_data_conf(), mcps_data_ind(), mlme_gts_conf(), mlme_gts_ind(), mlme_reset_conf(), mlme_set_conf(), process_data_ind_not_transient(), tal_reset(), tal_rx_frame_cb(), wpan_mcps_data_req(), wpan_mlme_reset_req(), and wpan_mlme_set_req().

void bmm_buffer_init ( void  )

Initializes the buffer module.

This function initializes the buffer module. This function should be called before using any other functionality of buffer module.

Referenced by tal_init().