189 lines
6.1 KiB
C
189 lines
6.1 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 RF_HW_TONEMAP_H
|
||
|
#define RF_HW_TONEMAP_H
|
||
|
|
||
|
#include "os_types.h"
|
||
|
#include "hw_tonemap.h"
|
||
|
#include "phy_rf_chn.h"
|
||
|
|
||
|
#ifdef __cplusplus
|
||
|
extern "C" {
|
||
|
#endif
|
||
|
|
||
|
/* block size */
|
||
|
#define BLOCK_SIZE_0 0
|
||
|
#define BLOCK_SIZE_1 1
|
||
|
#define BLOCK_SIZE_2 2
|
||
|
#define BLOCK_SIZE_3 3
|
||
|
#define BLOCK_SIZE_4 4
|
||
|
#define BLOCK_SIZE_5 5
|
||
|
#define BLOCK_SIZE_MAX (BLOCK_SIZE_5 + 1)
|
||
|
|
||
|
/* MCS ID */
|
||
|
#define MCS_ID_0 0
|
||
|
#define MCS_ID_1 1
|
||
|
#define MCS_ID_2 2
|
||
|
#define MCS_ID_3 3
|
||
|
#define MCS_ID_4 4
|
||
|
#define MCS_ID_5 5
|
||
|
#define MCS_ID_6 6
|
||
|
#define MCS_ID_MAX (MCS_ID_6 + 1)
|
||
|
|
||
|
/* the length of a phr symbol -> 153.6us, unit ntb */
|
||
|
#define PHR_SYMBOL_LEN 3840
|
||
|
/* the length of a psdu symbol -> 153.6us, unit ntb */
|
||
|
#define PSDU_SYMBOL_LEN 3840
|
||
|
/* the length of stf and ltf on option 1 and option 2 -> 929.28us, unit ntb */
|
||
|
#define STF_LTF_OPTION1_2_LEN 23232
|
||
|
/* the length of stf and ltf on option 3 -> 936.96us, unit ntb */
|
||
|
#define STF_LTF_OPTION3_LEN 23424
|
||
|
/* the length of a sig -> 153.6us, unit ntb */
|
||
|
#define PER_SIG_LEN 3840
|
||
|
|
||
|
typedef struct _rf_option_info_entry {
|
||
|
/* option id */
|
||
|
uint32_t option : 8,
|
||
|
/* sig symbol num */
|
||
|
sig_symbol_num : 8,
|
||
|
/* vaild tone num */
|
||
|
vld_tone_num : 16;
|
||
|
} rf_option_info_entry_t;
|
||
|
|
||
|
/*
|
||
|
* rf tonemap table entry
|
||
|
*/
|
||
|
typedef struct _rf_tonemap_table_entry {
|
||
|
uint32_t robo_cnt : 4,
|
||
|
modulation : 3,
|
||
|
resv0 : 1,
|
||
|
coding_rate_idx : 2,
|
||
|
resv1 : 22;
|
||
|
} rf_tonemap_table_entry;
|
||
|
|
||
|
typedef struct _rf_robo_inter_entry {
|
||
|
uint8_t option;
|
||
|
robo_inter_table_entry robo_inter;
|
||
|
} rf_robo_inter_entry;
|
||
|
|
||
|
/*
|
||
|
* rf mcs table
|
||
|
*/
|
||
|
typedef struct _rf_mcs_table {
|
||
|
uint8_t phr_mcs;
|
||
|
uint8_t psdu_mcs;
|
||
|
} rf_mcs_table_t;
|
||
|
|
||
|
/* phy_rf_get_blkz - get rf block size.
|
||
|
* @pbsz (OUT) - pb size 16, 40, 72, 136, 264, 520.
|
||
|
* return block size, 0, 1, 3, 4, 5.
|
||
|
*/
|
||
|
uint8_t phy_rf_get_blkz(uint32_t pbsz);
|
||
|
|
||
|
/* phy_rf_get_pbsz - get rf pb size.
|
||
|
* @blkz (OUT) - 0, 1, 3, 4, 5.
|
||
|
* return block size, 16, 40, 72, 136, 264, 520.
|
||
|
*/
|
||
|
uint32_t phy_rf_get_pbsz(uint8_t blkz);
|
||
|
|
||
|
/* phy_rf_fl_init - phy rf fl init.
|
||
|
* @option - option. PHY_RF_OPTIONXXX.
|
||
|
* return.
|
||
|
*/
|
||
|
uint32_t phy_rf_fl_init(uint32_t option);
|
||
|
|
||
|
/* phy_rf_get_g_stf_ltf_fl - phy rf get gloab stf ltf fl.
|
||
|
* return uint32_t - stf ltf fl, uint us.
|
||
|
*/
|
||
|
uint32_t phy_rf_get_g_stf_ltf_fl();
|
||
|
|
||
|
/* phy_rf_get_g_sig_fl - phy rf get gloab sig fl.
|
||
|
* return uint32_t - sig fl, uint us.
|
||
|
*/
|
||
|
uint32_t phy_rf_get_g_sig_fl();
|
||
|
|
||
|
/* phy_rf_get_g_phr_fl - phy rf get gloab phr fl.
|
||
|
* @phr_mcs - MCS_ID_XXX.
|
||
|
* return uint32_t - phy header fl, uint us.
|
||
|
*/
|
||
|
uint32_t phy_rf_get_g_phr_fl(uint32_t phr_mcs);
|
||
|
|
||
|
/* phy_rf_get_g_psdu_fl - phy rf get gloab psdu fl.
|
||
|
* @psdu_mcs - MCS_ID_XXX.
|
||
|
* @pb_idx - BLOCK_SIZE_XXX.
|
||
|
* return uint32_t - psdu fl, uint us.
|
||
|
*/
|
||
|
uint32_t phy_rf_get_g_psdu_fl(uint32_t psdu_mcs, uint32_t pb_idx);
|
||
|
|
||
|
/* phy_rf_get_g_psdu_fl_ntb - phy rf get gloab psdu fl ntb.
|
||
|
* @psdu_mcs - MCS_ID_XXX.
|
||
|
* @pb_idx - BLOCK_SIZE_XXX.
|
||
|
* return uint32_t - psdu fl, uint ntb.
|
||
|
*/
|
||
|
uint32_t phy_rf_get_g_psdu_fl_ntb(uint32_t psdu_mcs, uint32_t pb_idx);
|
||
|
|
||
|
/* phy_rf_get_g_stf_ltf_sig_fl - phy rf get stf+ltf+sig fl, unit ntb.
|
||
|
* @option - option. PHY_RF_OPTIONXXX.
|
||
|
* return uint32_t - unit ntb.
|
||
|
*/
|
||
|
uint32_t phy_rf_get_g_stf_ltf_sig_fl(uint32_t option);
|
||
|
|
||
|
/* phy_rf_get_bcn_fix_mcs - phy rf get bcn fix mcs.
|
||
|
* @option - option. PHY_RF_OPTIONXXX.
|
||
|
* @pb_idx - BLOCK_SIZE_XXX.
|
||
|
* return - the ponit to rf_mcs_table_t.
|
||
|
*/
|
||
|
const rf_mcs_table_t *phy_rf_get_bcn_fix_mcs(uint32_t option,
|
||
|
uint32_t pb_sz_idx);
|
||
|
|
||
|
/* phy_rf_get_sof_fix_mcs - phy rf get spf fix mcs.
|
||
|
* @option - option. PHY_RF_OPTIONXXX.
|
||
|
* @pb_idx - BLOCK_SIZE_XXX.
|
||
|
* return - the ponit to rf_mcs_table_t.
|
||
|
*/
|
||
|
const rf_mcs_table_t *phy_rf_get_sof_fix_mcs(uint32_t option,
|
||
|
uint32_t pb_sz_idx);
|
||
|
|
||
|
/* phy_rf_get_ra_idx_range - get rf rate table index start/end range.
|
||
|
* @option - option. PHY_RF_OPTIONXXX.
|
||
|
* @start - return index start id.
|
||
|
* @end - return index end id.
|
||
|
* return - none.
|
||
|
*/
|
||
|
void phy_rf_get_ra_idx_range(uint8_t option, uint8_t *start, uint8_t *end);
|
||
|
|
||
|
/* phy_rf_get_ra_idx_mcs - get rf rate table mcs.
|
||
|
* @option - option. PHY_RF_OPTIONXXX.
|
||
|
* @idx - rate table index.
|
||
|
* @phr_mcs - return phr mcs.
|
||
|
* @psdu_mcs - return psdu mcs.
|
||
|
* return - error code, see ERR_XXX.
|
||
|
*/
|
||
|
uint32_t phy_rf_get_ra_idx_mcs(uint8_t option, uint8_t idx, uint8_t *phr_mcs,
|
||
|
uint8_t *psdu_mcs);
|
||
|
|
||
|
/* phy_rf_get_g_tx_sack_mcs - phy rf get g tx sack phr mcs.
|
||
|
* @option - void.
|
||
|
* return - txsack phr mcs.
|
||
|
*/
|
||
|
uint32_t phy_rf_get_g_tx_sack_mcs();
|
||
|
|
||
|
#ifdef __cplusplus
|
||
|
}
|
||
|
#endif
|
||
|
|
||
|
#endif // !HW_TONEMAP_H
|