Files
kunlun/plc/halmac/inc/mac_rf_rx_hw.h
2024-09-28 14:24:04 +08:00

133 lines
4.4 KiB
C

/****************************************************************************
Copyright(c) 2019 by Aerospace C.Power (Chongqing) Microelectronics. ALL RIGHTS RESERVED.
This Information is proprietary to Aerospace C.Power (Chongqing) Microelectronics and MAY NOT
be copied by any method or incorporated into another program without
the express written consent of Aerospace C.Power. This Information or any portion
thereof remains the property of Aerospace C.Power. The Information contained herein
is believed to be accurate and Aerospace C.Power assumes no responsibility or
liability for its use in any way and conveys no license or title under
any patent or copyright and makes no representation or warranty that this
Information is free from patent or copyright infringement.
****************************************************************************/
#ifndef MAC_RF_RX_HW_H
#define MAC_RF_RX_HW_H
#include "os_types.h"
#include "iot_config.h"
#ifdef __cplusplus
extern "C" {
#endif
#include "mpdu_header.h"
#if HPLC_RF_DEV_SUPPORT
#include "rf_rx_desc_reg_api.h"
#include "rf_rx_mpdu_desc.h"
/**
*@brief mac_rf_rx_hw_init mac rf rx hw init.
*@param void [void]
*@exception [none.]
*@return [void]
*/
void mac_rf_rx_hw_init();
/**
*@brief mac_rf_rx_hw_mpdu mac rf rx hw mpdu.
*@param ring_id [ring id]
*@param quota_ms [quota ms]
*@exception [none.]
*@return [0]
*/
uint32_t mac_rf_rx_hw_mpdu(void *pdev, uint32_t ring_id, uint32_t quota_ms);
/**
*@brief mac_rf_rx_debug_log_exception output debug infomation for exception.
*@param pkt [pkt]
*@exception [none.]
*@return [0]
*/
uint32_t mac_rf_rx_debug_log_exception(iot_pkt_t *pkt);
/**
*@brief mac_rf_rx_debug_log_sof_unicast_info
* output debug infomation for unicast sof
*@param rx_fc_msg rx fc information pointer
*@param mpdu_st rx mpdu start desc pointer
*@param mpdu_ed rx mpdu end desc pointer
*@param pb_st rx pb start desc pointer
*@param pb_ed rx pb end desc pointer
*@param att att desc pointer
*@return none
*/
void mac_rf_rx_debug_log_sof_info(rx_fc_msg_t rx_fc_msg,
rf_rx_mpdu_start *mpdu_st, rf_rx_mpdu_end *mpdu_ed,
rf_rx_pb_start *pb_st, rf_rx_pb_end *pb_ed, rf_rx_attention *att);
/**
*@brief mac_rf_rx_debug_log_bcn_info output debug infomation for beacon
*@param rx_fc_msg rx fc information pointer
*@param mpdu_st rx mpdu start desc pointer
*@param mpdu_ed rx mpdu end desc pointer
*@param pb_ed rx pb end desc pointer
*@exception none
*@return none
*/
void mac_rf_rx_debug_log_bcn_info(rx_fc_msg_t *rx_fc_msg,
rf_rx_mpdu_start *mpdu_st, rf_rx_mpdu_end *mpdu_ed, rf_rx_pb_end *pb_ed);
#else //HPLC_RF_DEV_SUPPORT
#define mac_rf_rx_hw_mpdu(pdev, ring_id, quota_ms) (0); \
do { \
(void)pdev; (void)ring_id; (void)quota_ms; \
} while(0)
#define mac_rf_rx_debug_log_exception(pkt) \
do { \
(void)pkt; \
} while (0)
#define mac_rf_rx_debug_log_sof_info(rx_fc_msg, mpdu_st, mpdu_ed, \
pb_st, pb_de, att) \
do { \
(void)rx_fc_msg; \
(void)mpdu_st; \
(void)mpdu_ed; \
(void)pb_st; \
(void)pb_de; \
(void)att; \
} while (0)
#define mac_rf_rx_debug_log_bcn_info(rx_fc_msg, mpdu_st, mpdu_ed, pb_ed) \
do { \
(void)rx_fc_msg; \
(void)mpdu_st; \
(void)mpdu_ed; \
(void)pb_ed; \
} while(0)
#endif //HPLC_RF_DEV_SUPPORT
/**
*@brief mac_rf_rx_hw_mpdu_internal mac rf rx hw mpdu internal.
*@param pdev_in [pdev]
*@param ring_id [ring id]
*@param quota_ms [quota ms]
*@exception [none.]
*@return [0]
*/
uint32_t mac_rf_rx_hw_mpdu_internal(void *pdev_in, uint32_t ring_id,
uint32_t quota_ms);
#ifdef __cplusplus
}
#endif
#endif // !MAC_RF_RX_HW_H