Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Buffer Management

Buffer Management (large and small buffers): provides services for dynamically allocating and freeing memory buffers.

Data Structures

struct  buffer_t
 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...
 

Functions

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

Variables

uint8_t * buffer_t::body
 Pointer to the buffer body. More...
 
struct buffer_tag * buffer_t::next
 Pointer to next free buffer. More...
 

#define BMM_BUFFER_POINTER (   buf)    ((buf)->body)

This macro provides the pointer to the corresponding body of the supplied buffer header.

Referenced by dispatch_event(), find_buffer_cb(), gen_mlme_poll_conf(), gen_mlme_start_conf(), gen_rx_enable_conf(), handle_gts_data_req(), handle_received_frame_irq(), mac_awake_disassociate(), mac_awake_scan(), mac_build_and_tx_data_req(), mac_gen_mcps_data_conf(), mac_gen_mlme_associate_conf(), mac_gen_mlme_disassociate_conf(), mac_gen_mlme_gts_conf(), mac_prep_disassoc_conf(), mac_process_beacon_frame(), mac_process_data_frame(), mac_process_disassociate_notification(), mac_process_orphan_realign(), mac_process_tal_data_ind(), mac_process_tal_tx_status(), mac_send_gts_ind(), mac_t_scan_duration_cb(), mac_tx_gts_data(), mcps_data_conf(), mcps_data_ind(), mcps_data_request(), mlme_associate_conf(), mlme_associate_request(), mlme_beacon_notify_ind(), mlme_disassociate_conf(), mlme_disassociate_ind(), mlme_disassociate_request(), mlme_get_conf(), mlme_get_request(), mlme_gts_conf(), mlme_gts_ind(), mlme_gts_request(), mlme_poll_conf(), mlme_poll_request(), mlme_reset_conf(), mlme_reset_request(), mlme_rx_enable_conf(), mlme_rx_enable_request(), mlme_scan_conf(), mlme_scan_request(), mlme_set_conf(), mlme_set_request(), mlme_start_request(), mlme_sync_loss_ind(), mlme_sync_request(), parse_mpdu(), process_deallocate_data_q(), process_incoming_frame(), scan_proceed(), send_reset_conf(), send_scan_cmd(), tx_pan_id_conf_notif(), wpan_mcps_data_req(), wpan_mlme_associate_req(), wpan_mlme_disassociate_req(), wpan_mlme_get_req(), wpan_mlme_gts_req(), wpan_mlme_poll_req(), wpan_mlme_reset_req(), wpan_mlme_rx_enable_req(), wpan_mlme_scan_req(), wpan_mlme_set_req(), and wpan_mlme_sync_req().

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.

References LARGE_BUFFER_SIZE, qmm_queue_remove(), and SMALL_BUFFER_SIZE.

Referenced by handle_received_frame_irq(), mac_awake_scan(), mac_build_and_tx_data_req(), mac_send_gts_ind(), parse_mpdu(), tal_init(), tal_task(), tx_pan_id_conf_notif(), wpan_mcps_data_req(), wpan_mlme_associate_req(), wpan_mlme_disassociate_req(), wpan_mlme_get_req(), wpan_mlme_gts_req(), wpan_mlme_poll_req(), wpan_mlme_reset_req(), wpan_mlme_rx_enable_req(), wpan_mlme_scan_req(), wpan_mlme_set_req(), and wpan_mlme_sync_req().

__PACK__RST_DATA__ 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.

References buffer_t::body, buf_pool, LARGE_BUFFER_SIZE, qmm_queue_append(), qmm_queue_init(), SMALL_BUFFER_SIZE, TOTAL_NUMBER_OF_LARGE_BUFS, and TOTAL_NUMBER_OF_SMALL_BUFS.

Referenced by tal_init().

uint8_t* buffer_t::body

Pointer to the buffer body.

Referenced by bmm_buffer_init(), mac_sync_loss(), and queue_read_or_remove().

struct buffer_tag* buffer_t::next

Pointer to next free buffer.

Referenced by qmm_queue_append(), and queue_read_or_remove().