Atmel Software Framework

mac_data_ind.c File Reference

Implements incoming frame handling in the MAC.

Copyright (c) 2013-2015 Atmel Corporation. All rights reserved.

#include <compiler.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 "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"

Macros

#define GET_PAN_COORDINATOR(spec)   (((spec) & 0x4000) >> 14)
 
#define GTS_DESCRIPTOR_COUNTER_MASK   (0x07)
 

Functions

void mac_process_tal_data_ind (uint8_t *msg)
 Depending on received frame the appropriate function is called. More...
 
static bool parse_mpdu (frame_info_t *frameptr)
 
static bool process_data_ind_not_transient (buffer_t *b_ptr, frame_info_t *f_ptr)
 Continues processing a data indication from the TAL for non-polling and non-scanning states of the MAC (mac_poll_state == MAC_POLL_IDLE, mac_scan_state == MAC_SCAN_IDLE). More...
 
void tal_rx_frame_cb (frame_info_t *frame)
 Callback function called by TAL on reception of any frame. More...
 

#define GET_PAN_COORDINATOR (   spec)    (((spec) & 0x4000) >> 14)
#define GTS_DESCRIPTOR_COUNTER_MASK   (0x07)

Referenced by parse_mpdu().

static bool parse_mpdu ( frame_info_t frameptr)
static

References aMaxMACPayloadSize, Assert, frame_payload_t::assoc_req_data, frame_payload_t::assoc_response_data, ASSOCIATIONREQUEST, ASSOCIATIONRESPONSE, frame_payload_t::beacon_data, beacon_payload, BEACONREQUEST, CLE16_TO_CPU_ENDIAN, mlme_comm_status_ind_tag::cmdcode, convert_byte_array_to_16_bit, frame_payload_t::coord_realign_data, mac_coord_realign_tag::coord_short_addr, COORDINATORREALIGNMENT, frame_payload_t::data, DATAREQUEST, parse_tag::dest_addr, parse_tag::dest_addr_mode, frame_payload_t::disassoc_req_data, DISASSOCIATIONNOTIFICATION, mlme_comm_status_ind_tag::DstAddr, mlme_comm_status_ind_tag::DstAddrMode, parse_tag::fcf, FCF_FRAME_VERSION_2006, FCF_FRAMETYPE_BEACON, FCF_FRAMETYPE_DATA, FCF_FRAMETYPE_MAC_CMD, FCF_GET_FRAMETYPE, FCF_SECURITY_ENABLED, parse_tag::frame_type, GTS_DESCRIPTOR_COUNTER_MASK, mac_beacon_payload_tag::gts_list, frame_payload_t::gts_req_data, mac_beacon_payload_tag::gts_spec, GTSREQUEST, address_field_t::long_address, parse_tag::mac_command, mac_extract_mhr_addr_info(), mac_nhle_q, mac_parse_data, parse_tag::mac_payload_data, parse_tag::mac_payload_length, MAC_SUCCESS, MLME_COMM_STATUS_INDICATION, frame_info_tag::mpdu, NUM_LONG_PEND_ADDR, NUM_SHORT_PEND_ADDR, ORPHANNOTIFICATION, mac_coord_realign_tag::pan_id, mlme_comm_status_ind_tag::PANId, PANIDCONFLICTNOTIFICAION, mac_data_payload_tag::payload, mac_beacon_payload_tag::pending_addr_spec, parse_tag::sequence_number, mac_assoc_response_tag::short_addr, mac_coord_realign_tag::short_addr, parse_tag::src_addr, parse_tag::src_addr_mode, mlme_comm_status_ind_tag::SrcAddr, mlme_comm_status_ind_tag::SrcAddrMode, status, mlme_comm_status_ind_tag::status, mac_beacon_payload_tag::superframe_spec, tal_pib, parse_tag::time_stamp, and frame_info_tag::time_stamp.

Referenced by mac_process_tal_data_ind().

static bool process_data_ind_not_transient ( buffer_t *  b_ptr,
frame_info_t f_ptr 
)
static

Continues processing a data indication from the TAL for non-polling and non-scanning states of the MAC (mac_poll_state == MAC_POLL_IDLE, mac_scan_state == MAC_SCAN_IDLE).

Parameters
b_ptrPointer to the buffer header.
f_ptrPointer to the frame_info_t structure.
Returns
bool True if frame has been processed, or false otherwise.

References Assert, ASSOCIATIONREQUEST, BEACONREQUEST, BO_USED_FOR_MAC_PERS_TIME, COORDINATORREALIGNMENT, DATAREQUEST, DISASSOCIATIONNOTIFICATION, FAILURE, FCF_FRAMETYPE_BEACON, FCF_FRAMETYPE_DATA, FCF_FRAMETYPE_MAC_CMD, FCF_LONG_ADDR, FCF_SHORT_ADDR, FINAL_CAP_SLOT_DEFAULT, parse_tag::frame_type, FUNC_PTR, GTSREQUEST, MAC_ACTIVE_CAP, MAC_ASSOCIATED, mac_bc_data_indicated, parse_tag::mac_command, mac_pib_tag::mac_CoordExtendedAddress, MAC_COORDINATOR, mac_pib_tag::mac_CoordShortAddress, mac_final_cap_slot, MAC_IDLE, mac_idle_trans(), MAC_PAN_COORD_STARTED, MAC_PAN_ID_CONFLICT, mac_parse_data, mac_pib, MAC_POLL_IDLE, mac_poll_state, mac_process_data_frame(), mac_process_gts_request(), MAC_SCAN_IDLE, mac_scan_state, mac_sleep_trans(), mac_state, MAC_SUCCESS, mac_superframe_state, MAC_SYNC_BEFORE_ASSOC, MAC_SYNC_NEVER, MAC_SYNC_ONCE, mac_sync_state, MAC_SYNC_TRACKING_BEACON, mac_t_gts_cb(), mac_trx_wakeup(), macBeaconTxTime, NON_BEACON_NWK, ORPHANNOTIFICATION, pal_is_timer_running(), pal_timer_start(), pal_timer_stop(), PANIDCONFLICTNOTIFICAION, PHY_RX_ON, set_tal_pib_internal(), parse_tag::src_addr, parse_tag::src_addr_mode, parse_tag::src_panid, T_Beacon_Tracking_Period, T_CAP, T_Superframe, tal_add_time_symbols(), TAL_CONVERT_SYMBOLS_TO_US, TAL_CONVERT_US_TO_SYMBOLS, TAL_GET_BEACON_INTERVAL_TIME, TAL_GET_SUPERFRAME_DURATION_TIME, tal_pib, TAL_RADIO_WAKEUP_TIME_SYM, tal_rx_enable(), tal_sub_time_symbols(), frame_info_tag::time_stamp, TIMEOUT_ABSOLUTE, and TIMEOUT_RELATIVE.

Referenced by mac_process_tal_data_ind().

void tal_rx_frame_cb ( frame_info_t frame)

Callback function called by TAL on reception of any frame.

User call back function for frame reception.

This function pushes an event into the TAL-MAC queue, indicating a frame reception.

Parameters
framePointer to recived frame

Referenced by process_incoming_frame().