This file implements function to handle received frames.
Copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.
#include "tal_config.h"
#include <stdint.h>
#include <string.h>
#include <stdbool.h>
#include "pal.h"
#include "return_val.h"
#include "tal.h"
#include "ieee_const.h"
#include "stack_config.h"
#include "bmm.h"
#include "qmm.h"
#include "tal_pib.h"
#include "tal_internal.h"
Functions | |
void | complete_rx_transaction (trx_id_t trx_id) |
Completes Rx transaction. More... | |
static void | handle_incoming_frame (trx_id_t trx_id) |
Handles incoming frame from transceiver. More... | |
void | handle_rx_end_irq (trx_id_t trx_id) |
Handle received frame interrupt. More... | |
void | process_incoming_frame (trx_id_t trx_id, buffer_t *buf_ptr) |
Parses received frame and create the frame_info_t structure. More... | |
static bool | upload_frame (trx_id_t trx_id) |
Parses received frame and create the frame_info_t structure. More... | |
Variables | |
frame_info_t * | rx_frm_info [NUM_TRX] |
void complete_rx_transaction | ( | trx_id_t | trx_id | ) |
Completes Rx transaction.
trx_id | Transceiver identifier |
References frame_info_tag::mpdu, NULL, RF_BASE_ADDR_OFFSET, RG_RF09_EDV, tal_incoming_frame_queue, tal_pib, tal_rx_buffer, and trx_reg_read().
Referenced by ack_transmission_done(), handle_incoming_frame(), and handle_rx_end_irq().
|
static |
Handles incoming frame from transceiver.
trx_id | Transceiver identifier |
References ack_transmitting, complete_rx_transaction(), DEFAULT_FRAME_TYPES, FCF_ACK_REQUEST, FCF_FRAME_PENDING, FSK, is_ack_valid(), is_frame_an_ack(), MAC_SUCCESS, frame_info_tag::mpdu, PL_POS_FCF_1, RF_BASE_ADDR_OFFSET, RF_TX, RF_TXPREP, RG_BBC0_AFFTM, RG_BBC0_FSKPLL, SR_BBC0_AMCS_AACKFT, SR_BBC0_FSKC1_FSKPLH, status, stop_tal_timer(), switch_to_rx(), TAL_FRAME_PENDING, tal_pib, trx_bit_read(), trx_bit_write(), trx_reg_write(), trx_state, tx_done_handling(), tx_state, and TX_WAITING_FOR_ACK.
Referenced by handle_rx_end_irq().
void handle_rx_end_irq | ( | trx_id_t | trx_id | ) |
Handle received frame interrupt.
This function handles transceiver interrupts for received frames.
trx_id | Transceiver identifier |
References complete_rx_transaction(), FSK, handle_incoming_frame(), RF_BASE_ADDR_OFFSET, RF_RX, RG_RF09_CMD, SR_BBC0_AMCS_AACK, SR_BBC0_AMCS_AACKFT, SR_BBC0_FSKPHRRX_FCST, SR_BBC0_FSKPHRRX_MS, start_rpc(), stop_rpc(), stop_tal_timer(), switch_to_rx(), TAL_IDLE, tal_pib, tal_state, trx_bit_read(), trx_bit_write(), trx_reg_write(), trx_state, TX_BACKOFF, TX_DEFER, tx_state, and upload_frame().
Referenced by tal_task().
void process_incoming_frame | ( | trx_id_t | trx_id, |
buffer_t * | buf_ptr | ||
) |
Parses received frame and create the frame_info_t structure.
This function parses the received frame and creates the frame_info_t structure to be sent to the MAC as a parameter of tal_rx_frame_cb().
trx_id | Transceiver identifier |
buf_ptr | Pointer to the buffer containing the received frame |
References frame_info_tag::buffer_header, frame_info_tag::mpdu, scale_ed_value(), tal_pib, and tal_rx_frame_cb().
Parses received frame and create the frame_info_t structure.
This function parses the received frame and creates the frame_info_t structure to be sent to the MAC as a parameter of tal_rx_frame_cb().
trx_id | Transceiver identifier |
References Assert, BB_RX_FRM_BUF_OFFSET, ED_VAL_LEN, fs_tstamp, LQI_LEN, frame_info_tag::mpdu, NULL, RF_BASE_ADDR_OFFSET, RG_BBC0_FBRXS, RG_BBC0_RXFLL, tal_pib, tal_rx_buffer, and frame_info_tag::time_stamp.
Referenced by handle_rx_end_irq().
frame_info_t* rx_frm_info[NUM_TRX] |
Referenced by is_ack_valid(), and is_frame_an_ack().