This file implements GTS feature for MAC.
Copyright (c) 2013-2018 Microchip Technology Inc. and its subsidiaries.
#include <compiler.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include <stdbool.h>
#include "return_val.h"
#include "pal.h"
#include "bmm.h"
#include "qmm.h"
#include "tal.h"
#include "tal_slotted_csma.h"
#include "ieee_const.h"
#include "mac_msg_const.h"
#include "mac_api.h"
#include "mac_msg_types.h"
#include "mac_data_structures.h"
#include "stack_config.h"
#include "mac_internal.h"
#include "mac.h"
#include "mac_config.h"
#include "mac_build_config.h"
Functions | |
void | flush_gts_queues (void) |
void | handle_gts_data_req (mcps_data_req_t *data_req, uint8_t *msg) |
void | handle_gts_data_tx_end (void) |
void | handle_gts_sync_loss (void) |
void | init_gts_queues (void) |
uint8_t | mac_add_gts_info (uint8_t *frame_ptr) |
void | mac_gen_mlme_gts_conf (buffer_t *buf_ptr, uint8_t status, gts_char_t gts_char) |
static bool | mac_gts_allocate (gts_char_t GtsCharacteristics, uint16_t DevAddress) |
static bool | mac_gts_deallocate (gts_char_t GtsCharacteristics, uint16_t DevAddress, bool persist) |
void | mac_gts_table_update (void) |
void | mac_parse_bcn_gts_info (uint8_t gts_count, uint8_t gts_dir, mac_gts_list_t *gts_list_ptr) |
void | mac_process_gts_request (buffer_t *gts_req) |
static void | mac_send_gts_ind (gts_char_t GtsChar, uint16_t dev_addr) |
void | mac_t_gts_cb (void *callback_parameter) |
void | mac_tx_gts_data (queue_t *gts_data) |
void | mlme_gts_request (uint8_t *m) |
static void | process_deallocate_data_q (queue_t *q_ptr) |
void | reset_gts_expiry (mac_pan_gts_mgmt_t *mac_pan_gts_entry) |
void | reset_gts_globals (void) |
Variables | |
static queue_t | dev_tx_gts_q |
static queue_t | gts_q [MAX_GTS_ON_PANC] |
mac_dev_gts_mgmt_t | mac_dev_gts_table [MAX_GTS_ON_DEV] |
uint8_t | mac_dev_gts_table_len = 0 |
mac_pan_gts_mgmt_t | mac_pan_gts_table [MAX_GTS_ON_PANC] |
PANC table for GTS maintenance. More... | |
uint8_t | mac_pan_gts_table_len = 0 |
Length of active GTS in PANC table. More... | |
const uint8_t | minCAPLength [4] = { 9, 4, 2, 1} |
Reference for maintaining minCAPLength. More... | |
|
static |
References aGTSDescPersistenceTime, mac_pan_gts_mgmt_tag::DevShortAddr, ENTER_CRITICAL_REGION, mac_pan_gts_mgmt_tag::ExpiryCount, GTS_EXPIRY_BO_0_TO_8, GTS_EXPIRY_BO_9_TO_14, mac_pan_gts_mgmt_tag::GtsDesc, mac_gts_desc_tag::GtsDirection, gts_char_tag::GtsDirection, mac_gts_desc_tag::GtsLength, gts_char_tag::GtsLength, mac_gts_desc_tag::GtsStartingSlot, LEAVE_CRITICAL_REGION, mac_final_cap_slot, mac_pan_gts_table_len, MAX_GTS_ON_PANC, minCAPLength, mac_pan_gts_mgmt_tag::PersistenceCount, and tal_pib.
Referenced by mac_process_gts_request(), and mlme_gts_request().
|
static |
References aGTSDescPersistenceTime, mac_pan_gts_mgmt_tag::DevShortAddr, ENTER_CRITICAL_REGION, mac_pan_gts_mgmt_tag::ExpiryCount, FINAL_CAP_SLOT_DEFAULT, mac_pan_gts_mgmt_tag::gts_data_q, mac_pan_gts_mgmt_tag::GtsDesc, mac_gts_desc_tag::GtsDirection, gts_char_tag::GtsDirection, mac_gts_desc_tag::GtsLength, gts_char_tag::GtsLength, mac_gts_desc_tag::GtsStartingSlot, LEAVE_CRITICAL_REGION, mac_final_cap_slot, mac_pan_gts_table_len, MAX_GTS_ON_PANC, mac_pan_gts_mgmt_tag::PersistenceCount, and process_deallocate_data_q().
Referenced by mac_gts_table_update(), mac_process_gts_request(), and mlme_gts_request().
|
static |
References Assert, bmm_buffer_alloc(), BMM_BUFFER_POINTER, mlme_gts_ind_tag::cmdcode, mlme_gts_ind_tag::DeviceAddr, mlme_gts_ind_tag::GtsChar, LARGE_BUFFER_SIZE, mac_nhle_q, MLME_GTS_INDICATION, qmm_queue_append(), and gts_char_tag::Reserved.
Referenced by handle_gts_sync_loss(), and mac_parse_bcn_gts_info().
void mlme_gts_request | ( | uint8_t * | m | ) |
References aGTSDescPersistenceTime, BMM_BUFFER_POINTER, frame_info_tag::buffer_header, convert_16_bit_to_byte_array(), convert_spec_16_bit_to_byte_array(), CSMA_SLOTTED, mlme_gts_req_tag::DeviceShortAddr, FCF_ACK_REQUEST, FCF_FRAMETYPE_MAC_CMD, FCF_PAN_ID_COMPRESSION, FCF_SET_DEST_ADDR_MODE, FCF_SET_FRAMETYPE, FCF_SET_SOURCE_ADDR_MODE, FCF_SHORT_ADDR, GTS_ALLOCATE, GTS_DEALLOCATE, GTS_REQ_PAYLOAD_LEN, GTS_STATE_IDLE, GTS_STATE_REQ_SENT, mlme_gts_req_tag::GtsChar, gts_char_tag::GtsCharType, gts_char_tag::GtsDirection, gts_char_tag::GtsLength, GTSREQUEST, LARGE_BUFFER_SIZE, MAC_ASSOCIATED, mac_pib_tag::mac_CoordShortAddress, mac_dev_gts_table, mac_pib_tag::mac_DSN, mac_gen_mlme_gts_conf(), mac_gts_allocate(), mac_gts_deallocate(), mac_pib_tag::mac_GTSPermit, MAC_INVALID_PARAMETER, MAC_NO_DATA, MAC_NO_SHORT_ADDR_VALUE, MAC_NO_SHORT_ADDRESS, MAC_PAN_COORD_STARTED, mac_pib, mac_state, MAC_SUCCESS, mac_sync_state, MAC_SYNC_TRACKING_BEACON, mac_trx_wakeup(), MAKE_MAC_BUSY, frame_info_tag::mpdu, frame_info_tag::msg_type, tal_pib, and tal_tx_frame().
|
static |
References BMM_BUFFER_POINTER, mac_gen_mcps_data_conf(), MAC_INVALID_GTS, frame_info_tag::msduHandle, qmm_queue_remove(), and queue_tag::size.
Referenced by mac_gts_deallocate(), and mac_parse_bcn_gts_info().
|
static |
Referenced by handle_gts_data_req().
|
static |
const uint8_t minCAPLength[4] = { 9, 4, 2, 1} |
Reference for maintaining minCAPLength.
Referenced by mac_gts_allocate().