Microchip® Advanced Software Framework

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

Queue Management: provides services for creating and maintaining the queues.

Data Structures

struct  queue_tag
 Queue structure. More...
 
struct  search_t
 Structure to search for a buffer to be removed from a queue. More...
 

Typedefs

typedef struct queue_tag queue_t
 Queue structure. More...
 

Functions

void qmm_queue_append (queue_t *q, buffer_t *buf)
 Appends a buffer into the queue. More...
 
void qmm_queue_flush (queue_t *q)
 Internal function for flushing a specific queue. More...
 
__PACK__RST_DATA__ void qmm_queue_init (queue_t *q)
 Initializes the queue. More...
 
buffer_tqmm_queue_read (queue_t *q, search_t *search)
 Reads a buffer from queue. More...
 
buffer_tqmm_queue_remove (queue_t *q, search_t *search)
 Removes a buffer from queue. More...
 

Variables

uint8_t(* search_t::criteria_func )(void *buf, void *handle)
 Pointer to search criteria function. More...
 
void * search_t::handle
 Handle to callbck parameter. More...
 
buffer_tqueue_tag::head
 Pointer to head of queue. More...
 
uint8_t queue_tag::size
 Number of buffers present in the current queue. More...
 
buffer_tqueue_tag::tail
 Pointer to tail of queue. More...
 

typedef struct queue_tag queue_t

Queue structure.

This structur defines the queue structure. The application should declare the queue of type queue_t and call qmm_queue_init before invoking any other functionality of qmm.

void qmm_queue_append ( queue_t q,
buffer_t buf 
)

Appends a buffer into the queue.

This function appends a buffer into the queue.

Parameters
qQueue into which buffer should be appended
bufPointer to the buffer that should be appended into the queue. Note that this pointer should be same as the pointer returned by bmm_buffer_alloc.

References Assert, ENTER_CRITICAL_REGION, queue_tag::head, LEAVE_CRITICAL_REGION, MAC_SUCCESS, buffer_t::next, QUEUE_FULL, queue_tag::size, and queue_tag::tail.

Referenced by bmm_buffer_free(), bmm_buffer_init(), gen_mlme_poll_conf(), gen_mlme_start_conf(), gen_rx_enable_conf(), handle_received_frame_irq(), mac_awake_scan(), mac_gen_mcps_data_conf(), mac_gen_mlme_associate_conf(), mac_gen_mlme_disassociate_conf(), mac_mlme_comm_status(), mac_process_associate_request(), mac_process_beacon_frame(), mac_process_data_frame(), mac_process_disassociate_notification(), mac_process_orphan_notification(), mac_process_orphan_realign(), mac_process_tal_data_ind(), mac_process_tal_tx_status(), mac_sync_loss(), mac_tx_coord_realignment_command(), mcps_data_request(), mcps_purge_request(), mlme_associate_response(), mlme_disassociate_request(), mlme_get_request(), mlme_scan_request(), mlme_set_request(), parse_mpdu(), scan_clean_up(), scan_proceed(), send_reset_conf(), tal_rx_frame_cb(), wpan_mcps_data_req(), wpan_mcps_purge_req(), wpan_mlme_associate_req(), wpan_mlme_associate_resp(), wpan_mlme_disassociate_req(), wpan_mlme_get_req(), wpan_mlme_orphan_resp(), wpan_mlme_poll_req(), wpan_mlme_reset_req(), wpan_mlme_rx_enable_req(), wpan_mlme_scan_req(), wpan_mlme_set_req(), and wpan_mlme_start_req().

void qmm_queue_flush ( queue_t q)

Internal function for flushing a specific queue.

Parameters
qQueue to be flushed

References bmm_buffer_free(), qmm_queue_remove(), and queue_tag::size.

Referenced by flush_queues().

__PACK__RST_DATA__ void qmm_queue_init ( queue_t q)

Initializes the queue.

This function initializes the queue. Note that this function should be called before invoking any other functionality of QMM.

Parameters
qThe queue which should be initialized.

References queue_tag::head, queue_tag::size, and queue_tag::tail.

Referenced by bmm_buffer_init(), mac_init(), tal_init(), and wpan_init().

buffer_t* qmm_queue_read ( queue_t q,
search_t search 
)

Reads a buffer from queue.

This function reads either the first buffer if search is NULL or buffer matching the given criteria from queue.

Parameters
qThe queue from which buffer should be read.
searchIf this parameter is NULL first buffer in the queue will be read. Otherwise buffer matching the criteria will be read
Returns
Pointer to the buffer header which is to be read, NULL if the buffer is not available

References queue_read_or_remove(), and READ_MODE.

Referenced by handle_persistence_time_decrement(), mac_buffer_add_pending(), and mac_process_data_request().

buffer_t* qmm_queue_remove ( queue_t q,
search_t search 
)

Removes a buffer from queue.

This function removes a buffer from queue

Parameters
qQueue from which buffer should be removed
searchSearch criteria. If this parameter is NULL, first buffer in the queue will be removed. Otherwise buffer matching the criteria will be removed.
Returns
Pointer to the buffer header, if the buffer is successfully removed, NULL otherwise.

References queue_read_or_remove(), and REMOVE_MODE.

Referenced by bmm_buffer_alloc(), handle_persistence_time_decrement(), mac_buffer_purge(), mac_task(), qmm_queue_flush(), remove_frame_from_indirect_q(), tal_reset(), tal_task(), and wpan_task().

uint8_t(* search_t::criteria_func)(void *buf, void *handle)
void* search_t::handle
buffer_t* queue_tag::head

Pointer to head of queue.

Referenced by qmm_queue_append(), qmm_queue_init(), and queue_read_or_remove().

buffer_t* queue_tag::tail

Pointer to tail of queue.

Referenced by qmm_queue_append(), qmm_queue_init(), and queue_read_or_remove().