253 lines
		
	
	
		
			7.0 KiB
		
	
	
	
		
			C
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			253 lines
		
	
	
		
			7.0 KiB
		
	
	
	
		
			C
		
	
	
		
			Executable File
		
	
	
	
	
#ifndef __TX_ENTRY_H
 | 
						|
#define __TX_ENTRY_H
 | 
						|
 | 
						|
#include "phy_bb.h"
 | 
						|
#include "phy_phase.h"
 | 
						|
#include "tx_mpdu_start.h"
 | 
						|
#include "iot_irq.h"
 | 
						|
 | 
						|
#define MAC_TX_BEACON                   0
 | 
						|
#define MAC_TX_SOF                      1
 | 
						|
#define MAC_TX_SACK                     2
 | 
						|
#define MAC_TX_CTS                      3
 | 
						|
#define MAC_TX_SOUND                    4
 | 
						|
#define MAC_TX_RSOF                     5
 | 
						|
#define MAC_TX_TMI                      10
 | 
						|
#define MAC_TX_MIX_MODE                 11
 | 
						|
#define MAC_TX_GP_EXT                   12
 | 
						|
#define MAC_TX_GP_TONE_MASK             13
 | 
						|
#define MAC_TX_BURN                     14
 | 
						|
#define MAC_TX_BAND_SWITCH              15
 | 
						|
#define MAC_TX_GP_HYBRID                16
 | 
						|
#define PHY_BURST_MODE                  17
 | 
						|
#define MAC_TX_INTR_BCN_ALT             100
 | 
						|
#define MAC_TX_INTR_MPDU_COMPLETE       101
 | 
						|
#define MAC_TX_SCHED_BCN_AHEAD_ALERT    102
 | 
						|
#define MAC_TX_PHY_TD_START             103
 | 
						|
#define MAC_TX_EMC_SCAN                 104
 | 
						|
#define MAC_PHY_RST_FLOW                105
 | 
						|
#define MAC_SOUND_TMAP                  106
 | 
						|
#define MAC_TX_TEST_ID                  MAC_TX_BEACON
 | 
						|
 | 
						|
#define MAC_TMI_0                       0
 | 
						|
#define MAC_TMI_1                       1
 | 
						|
#define MAC_TMI_2                       2
 | 
						|
#define MAC_TMI_3                       3
 | 
						|
#define MAC_TMI_4                       4
 | 
						|
#define MAC_TMI_5                       5
 | 
						|
#define MAC_TMI_6                       6
 | 
						|
#define MAC_TMI_7                       7
 | 
						|
#define MAC_TMI_8                       8
 | 
						|
#define MAC_TMI_9                       9
 | 
						|
#define MAC_TMI_10                      10
 | 
						|
#define MAC_TMI_11                      11
 | 
						|
#define MAC_TMI_12                      12
 | 
						|
#define MAC_TMI_13                      13
 | 
						|
#define MAC_TMI_14                      14
 | 
						|
#define MAC_EXT_TMI_0                   15
 | 
						|
#define MAC_EXT_TMI_1                   16
 | 
						|
#define MAC_EXT_TMI_2                   17
 | 
						|
#define MAC_EXT_TMI_3                   18
 | 
						|
#define MAC_EXT_TMI_4                   19
 | 
						|
#define MAC_EXT_TMI_5                   20
 | 
						|
#define MAC_EXT_TMI_6                   21
 | 
						|
#define MAC_EXT_TMI_7                   22
 | 
						|
#define MAC_EXT_TMI_8                   23
 | 
						|
#define MAC_EXT_TMI_9                   24
 | 
						|
#define MAC_EXT_TMI_10                  25
 | 
						|
#define MAC_EXT_TMI_11                  26
 | 
						|
#define MAC_EXT_TMI_12                  27
 | 
						|
#define MAC_EXT_TMI_13                  28
 | 
						|
#define MAC_EXT_TMI_14                  29
 | 
						|
#define MAC_EXT_TMI_MAX                 30
 | 
						|
#define MAC_TMI_ID                      MAC_TMI_4
 | 
						|
 | 
						|
#define MAC_PB_NUM_0                    0
 | 
						|
#define MAC_PB_NUM_1                    1
 | 
						|
#define MAC_PB_NUM_2                    2
 | 
						|
#define MAC_PB_NUM_3                    3
 | 
						|
#define MAC_PB_NUM_4                    4
 | 
						|
#define MAC_PB_NUM_ID                   MAC_PB_NUM_1
 | 
						|
 | 
						|
#define MAC_PB_SIZE_MAX                 PB_SIZE_520
 | 
						|
#define TX_PKT_SEND_INTERVAL            100
 | 
						|
 | 
						|
/* multi rate support */
 | 
						|
#define MAC_RATE_RANDOM_SUPPORT         0
 | 
						|
 | 
						|
/* multi band support */
 | 
						|
#define MAC_MULTI_BAND_SUPPORT          0
 | 
						|
 | 
						|
/* tx always enable */
 | 
						|
#define PHY_TX_ALWAYS_EN                0
 | 
						|
 | 
						|
/* compatible with nid bit width of all protocols */
 | 
						|
#define PHY_TXRX_NID_VAL                (0xb)
 | 
						|
 | 
						|
/* tx glb cfg */
 | 
						|
typedef struct _iot_tx_cfg_info {
 | 
						|
    /* phase */
 | 
						|
    PHY_PHASE_OVR_ID phase;
 | 
						|
        /* mac type */
 | 
						|
    uint32_t m_type :3,
 | 
						|
        /* current packet type */
 | 
						|
        p_type  :3,
 | 
						|
        /* current test type */
 | 
						|
        t_type  :7,
 | 
						|
        /* TMI */
 | 
						|
        tmi     :5,
 | 
						|
        /* pb num */
 | 
						|
        pb_num  :4,
 | 
						|
        /* band mode */
 | 
						|
        band_id :8,
 | 
						|
        /* gi */
 | 
						|
        gi :2;
 | 
						|
        /* source tei */
 | 
						|
    uint32_t src_tei : 12,
 | 
						|
        /* destination tei */
 | 
						|
        dst_tei : 12,
 | 
						|
        /* hwq num */
 | 
						|
        hwq_num :2,
 | 
						|
        /* ppdu mode */
 | 
						|
        ppdu_mode :2,
 | 
						|
        /* mpdu cnt */
 | 
						|
        mpdu_cnt :2,
 | 
						|
        /* turbo rate */
 | 
						|
        turbo_rate:2;
 | 
						|
        /* modulation */
 | 
						|
    uint16_t modu :3,
 | 
						|
        /* nid */
 | 
						|
        nid :8,
 | 
						|
        /* rate mode */
 | 
						|
        rate_mode :4,
 | 
						|
        /* sof ack en */
 | 
						|
        ack_en  :1;
 | 
						|
} iot_tx_cfg_info_t;
 | 
						|
 | 
						|
/* register tx intr */
 | 
						|
typedef struct _iot_mac_intr_info {
 | 
						|
    uint32_t       int_num;
 | 
						|
    iot_irq_t      handle;
 | 
						|
} iot_mac_intr_info_t;
 | 
						|
 | 
						|
extern volatile tx_mpdu_start *mpdu_start;
 | 
						|
extern iot_tx_cfg_info_t glb_cfg;
 | 
						|
extern uint32_t bcn_period_ms;
 | 
						|
extern uint32_t print_tx_period_ms;
 | 
						|
extern volatile bool_t mac_tx_complete_flag;
 | 
						|
extern volatile bool_t mac_beacon_alert_flag;
 | 
						|
extern iot_mac_intr_info_t mac_info;
 | 
						|
#if IOT_DTEST_ONLY_SUPPORT == 1
 | 
						|
extern uint16_t band_cnt[MAC_BB_MAX_RATE][MAX_HW_BAND];
 | 
						|
#else
 | 
						|
extern uint16_t *band_cnt[MAC_BB_MAX_RATE];
 | 
						|
#endif
 | 
						|
 | 
						|
/**
 | 
						|
 *@brief tx_common_init.
 | 
						|
 *  The common API function is designed for external calling by MP
 | 
						|
 *  or the other compositive scenario.
 | 
						|
 *
 | 
						|
 *@param band_idx           [band index.]
 | 
						|
 *@param enable             [bool type, true or false.]
 | 
						|
 *@exception                [none.]
 | 
						|
 *@return                   [none.]
 | 
						|
*/
 | 
						|
void tx_common_init(uint32_t band_idx);
 | 
						|
 | 
						|
/**
 | 
						|
 *@brief phy_tx_gain_rms_set.
 | 
						|
 *  config tx td rms value to fix power.
 | 
						|
 *
 | 
						|
 *@param para_int           [int parameter.]
 | 
						|
 *@exception                [none.]
 | 
						|
 *@return                   [none.]
 | 
						|
*/
 | 
						|
void phy_tx_gain_rms_set(uint8_t para_int);
 | 
						|
 | 
						|
/**
 | 
						|
 *@brief mac_tx_handle.
 | 
						|
 *  mac tx APIs to send specail pkt. such as phase,
 | 
						|
 *  mac prototype, packet type, number and if wait
 | 
						|
 *  rx or not.
 | 
						|
 *
 | 
						|
 *@param phase              [tx phase.]
 | 
						|
 *@param mac_type           [mac prototype.]
 | 
						|
 *@param pkt_type           [packet type.]
 | 
						|
 *@param num                [number.]
 | 
						|
 *@param wait_rx            [true or false.]
 | 
						|
 *@exception                [none.]
 | 
						|
 *@return                   [none.]
 | 
						|
*/
 | 
						|
void mac_tx_handle(PHY_PHASE_OVR_ID phase, \
 | 
						|
    uint32_t mac_type, \
 | 
						|
    uint32_t pkt_type, \
 | 
						|
    uint32_t num, \
 | 
						|
    bool_t wait_rx);
 | 
						|
 | 
						|
/**
 | 
						|
 *@brief mac_glb_map.
 | 
						|
 *  update the newest global mac info.
 | 
						|
 *
 | 
						|
 *@param mac_type           [mac prototype.]
 | 
						|
 *@param pkt_type           [packet type.]
 | 
						|
 *@param test_type          [test id.]
 | 
						|
 *@exception                [none.]
 | 
						|
 *@return                   [none.]
 | 
						|
*/
 | 
						|
void mac_glb_map(uint32_t mac_type, uint32_t pkt_type, uint32_t test_type);
 | 
						|
 | 
						|
/**
 | 
						|
 *@brief phy_interrupt_init.
 | 
						|
 *  phy interrupt initialize.
 | 
						|
 *
 | 
						|
 *@param none               [none.]
 | 
						|
 *@exception                [none.]
 | 
						|
 *@return                   [none.]
 | 
						|
*/
 | 
						|
void phy_interrupt_init();
 | 
						|
 | 
						|
/**
 | 
						|
 *@brief tx_send_packet_interval.
 | 
						|
 *  use for tx sending packet at interval.
 | 
						|
 *
 | 
						|
 *@param interval           [time interval.]
 | 
						|
 *@exception                [none.]
 | 
						|
 *@return                   [none.]
 | 
						|
 */
 | 
						|
void tx_send_packet_interval(uint32_t interval);
 | 
						|
 | 
						|
/**
 | 
						|
 *@brief phy_tmap_common_init.
 | 
						|
 *  phy sound tone map common init.
 | 
						|
 *
 | 
						|
 *@param none               [none.]
 | 
						|
 *@exception                [none.]
 | 
						|
 *@return                   [none.]
 | 
						|
 */
 | 
						|
void phy_tmap_common_init();
 | 
						|
 | 
						|
/**
 | 
						|
 *@brief phy_tmap_init.
 | 
						|
 *
 | 
						|
 *  sound tone map initilze.
 | 
						|
 *
 | 
						|
 *@param none               [none.]
 | 
						|
 *@exception                [none.]
 | 
						|
 *@return                   [none.]
 | 
						|
 */
 | 
						|
void phy_tmap_init();
 | 
						|
 | 
						|
/**
 | 
						|
 *@brief phy_tmap_self_tmi_set.
 | 
						|
 *
 | 
						|
 *  phy tone map tx and rx tmi set.
 | 
						|
 *
 | 
						|
 *@param tmi                [which tmi to set.]
 | 
						|
 *@exception                [none.]
 | 
						|
 *@return                   [none.]
 | 
						|
 */
 | 
						|
void phy_tmap_self_tmi_set(uint8_t tmi);
 | 
						|
 | 
						|
#endif
 |