Path: blob/master/ALFA-W1F1/RTL8814AU/hal/phydm/phydm.h
1307 views
/******************************************************************************1*2* Copyright(c) 2007 - 2017 Realtek Corporation.3*4* This program is free software; you can redistribute it and/or modify it5* under the terms of version 2 of the GNU General Public License as6* published by the Free Software Foundation.7*8* This program is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for11* more details.12*13* The full GNU General Public License is included in this distribution in the14* file called LICENSE.15*16* Contact Information:17* wlanfae <[email protected]>18* Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park,19* Hsinchu 300, Taiwan.20*21* Larry Finger <[email protected]>22*23*****************************************************************************/2425#ifndef __HALDMOUTSRC_H__26#define __HALDMOUTSRC_H__2728/*@============================================================*/29/*@include files*/30/*@============================================================*/31/*PHYDM header*/32#include "phydm_pre_define.h"33#include "phydm_features.h"34#include "phydm_dig.h"35#ifdef CONFIG_PATH_DIVERSITY36#include "phydm_pathdiv.h"37#endif38#ifdef CONFIG_PHYDM_ANTENNA_DIVERSITY39#include "phydm_antdiv.h"40#endif4142#include "phydm_soml.h"4344#ifdef CONFIG_SMART_ANTENNA45#include "phydm_smt_ant.h"46#endif47#ifdef CONFIG_ANT_DETECTION48#include "phydm_antdect.h"49#endif50#include "phydm_rainfo.h"51#ifdef CONFIG_DYNAMIC_TX_TWR52#include "phydm_dynamictxpower.h"53#endif54#include "phydm_cfotracking.h"55#include "phydm_adaptivity.h"56#include "phydm_dfs.h"57#include "phydm_ccx.h"58#include "txbf/phydm_hal_txbf_api.h"59#if (PHYDM_LA_MODE_SUPPORT)60#include "phydm_adc_sampling.h"61#endif62#ifdef CONFIG_PSD_TOOL63#include "phydm_psd.h"64#endif65#ifdef PHYDM_PRIMARY_CCA66#include "phydm_primary_cca.h"67#endif68#include "phydm_cck_pd.h"69#include "phydm_rssi_monitor.h"70#ifdef PHYDM_AUTO_DEGBUG71#include "phydm_auto_dbg.h"72#endif73#include "phydm_math_lib.h"74#include "phydm_noisemonitor.h"75#include "phydm_api.h"76#ifdef PHYDM_POWER_TRAINING_SUPPORT77#include "phydm_pow_train.h"78#endif79#ifdef PHYDM_LNA_SAT_CHK_SUPPORT80#include "phydm_lna_sat.h"81#endif82#ifdef PHYDM_PMAC_TX_SETTING_SUPPORT83#include "phydm_pmac_tx_setting.h"84#endif85#ifdef PHYDM_MP_SUPPORT86#include "phydm_mp.h"87#endif8889#ifdef PHYDM_CCK_RX_PATHDIV_SUPPORT90#include "phydm_cck_rx_pathdiv.h"91#endif9293#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN | ODM_CE))94#include "phydm_beamforming.h"95#endif9697#ifdef CONFIG_DIRECTIONAL_BF98#include "phydm_direct_bf.h"99#endif100101#include "phydm_regtable.h"102103/*@HALRF header*/104#include "halrf/halrf_iqk.h"105#include "halrf/halrf_dpk.h"106#include "halrf/halrf.h"107#include "halrf/halrf_powertracking.h"108#if (DM_ODM_SUPPORT_TYPE & (ODM_AP))109#include "halrf/halphyrf_ap.h"110#elif(DM_ODM_SUPPORT_TYPE & (ODM_CE))111#include "halrf/halphyrf_ce.h"112#elif (DM_ODM_SUPPORT_TYPE & (ODM_WIN))113#include "halrf/halphyrf_win.h"114#elif(DM_ODM_SUPPORT_TYPE & (ODM_IOT))115#include "halrf/halphyrf_iot.h"116#endif117118extern const u16 phy_rate_table[84];119120/*@============================================================*/121/*@Definition */122/*@============================================================*/123124/* Traffic load decision */125#define TRAFFIC_NO_TP 0126#define TRAFFIC_ULTRA_LOW 1127#define TRAFFIC_LOW 2128#define TRAFFIC_MID 3129#define TRAFFIC_HIGH 4130131#define NONE 0132133#if defined(DM_ODM_CE_MAC80211)134#define MAX_2(x, y) \135__max2(typeof(x), typeof(y), \136x, y)137#define __max2(t1, t2, x, y) ({ \138t1 m80211_max1 = (x); \139t2 m80211_max2 = (y); \140m80211_max1 > m80211_max2 ? m80211_max1 : m80211_max2; })141142#define MIN_2(x, y) \143__min2(typeof(x), typeof(y), \144x, y)145#define __min2(t1, t2, x, y) ({ \146t1 m80211_min1 = (x); \147t2 m80211_min2 = (y); \148m80211_min1 < m80211_min2 ? m80211_min1 : m80211_min2; })149150#define DIFF_2(x, y) \151__diff2(typeof(x), typeof(y), \152x, y)153#define __diff2(t1, t2, x, y) ({ \154t1 __d1 = (x); \155t2 __d2 = (y); \156(__d1 >= __d2) ? (__d1 - __d2) : (__d2 - __d1); })157#else158#define MAX_2(_x_, _y_) (((_x_) > (_y_)) ? (_x_) : (_y_))159#define MIN_2(_x_, _y_) (((_x_) < (_y_)) ? (_x_) : (_y_))160#define DIFF_2(_x_, _y_) ((_x_ >= _y_) ? (_x_ - _y_) : (_y_ - _x_))161#endif162163#define IS_GREATER(_x_, _y_) (((_x_) >= (_y_)) ? true : false)164#define IS_LESS(_x_, _y_) (((_x_) < (_y_)) ? true : false)165166#if defined(DM_ODM_CE_MAC80211)167#define BYTE_DUPLICATE_2_DWORD(B0) ({ \168u32 __b_dup = (B0);\169(((__b_dup) << 24) | ((__b_dup) << 16) | ((__b_dup) << 8) | (__b_dup));\170})171#else172#define BYTE_DUPLICATE_2_DWORD(B0) \173(((B0) << 24) | ((B0) << 16) | ((B0) << 8) | (B0))174#endif175#define BYTE_2_DWORD(B3, B2, B1, B0) \176(((B3) << 24) | ((B2) << 16) | ((B1) << 8) | (B0))177#define BIT_2_BYTE(B3, B2, B1, B0) \178(((B3) << 3) | ((B2) << 2) | ((B1) << 1) | (B0))179180/*@For cmn sta info*/181#if defined(DM_ODM_CE_MAC80211)182#define is_sta_active(sta) ({ \183struct cmn_sta_info *__sta = (sta); \184((__sta) && (__sta->dm_ctrl & STA_DM_CTRL_ACTIVE)); \185})186187#define IS_FUNC_EN(name) ({ \188u8 *__is_func_name = (name); \189(__is_func_name) && (*__is_func_name); \190})191#else192#define is_sta_active(sta) ((sta) && (sta->dm_ctrl & STA_DM_CTRL_ACTIVE))193194#define IS_FUNC_EN(name) ((name) && (*name))195#endif196197#if (DM_ODM_SUPPORT_TYPE == ODM_AP)198#define PHYDM_WATCH_DOG_PERIOD 1 /*second*/199#else200#define PHYDM_WATCH_DOG_PERIOD 2 /*second*/201#endif202203#define PHY_HIST_SIZE 12204#define PHY_HIST_TH_SIZE (PHY_HIST_SIZE - 1)205206/*@============================================================*/207/*structure and define*/208/*@============================================================*/209210#define dm_type_by_fw 0211#define dm_type_by_driver 1212213#ifdef BB_RAM_SUPPORT214215struct phydm_bb_ram_per_sta {216/* @Reg0x1E84 for RAM I/O*/217boolean hw_igi_en;218boolean tx_pwr_offset0_en;219boolean tx_pwr_offset1_en;220/* @ macid from 0 to 63, above 63 => mapping to 63*/221u8 macid_addr;222/* @hw_igi value for paths after packet Tx in a period of time*/223u8 hw_igi;224/* @tx_pwr_offset0 offset for Tx power index*/225s8 tx_pwr_offset0;226s8 tx_pwr_offset1;227228};229230struct phydm_bb_ram_ctrl {231/*@ For 98F/14B/22C/12F, each tx_pwr_ofst step will be 1dB*/232struct phydm_bb_ram_per_sta pram_sta_ctrl[ODM_ASSOCIATE_ENTRY_NUM];233/*------------ For table2 do not set power offset by macid --------*/234/* For type == 2'b10, 0x1e70[22:16] = tx_pwr_offset_reg0, 0x1e70[23] = enable */235boolean tx_pwr_ofst_reg0_en;236u8 tx_pwr_ofst_reg0;237/* For type == 2'b11, 0x1e70[30:24] = tx_pwr_offset_reg1, 0x1e70[31] = enable */238boolean tx_pwr_ofst_reg1_en;239u8 tx_pwr_ofst_reg1;240};241242#endif243244struct phydm_phystatus_statistic {245/*@[CCK]*/246u32 rssi_cck_sum;247u32 rssi_cck_cnt;248u32 rssi_beacon_sum[RF_PATH_MEM_SIZE];249u32 rssi_beacon_cnt;250#ifdef PHYSTS_3RD_TYPE_SUPPORT251#if (defined(PHYDM_COMPILE_ABOVE_2SS))252u32 rssi_cck_sum_abv_2ss[RF_PATH_MEM_SIZE - 1];253#endif254#endif255/*@[OFDM]*/256u32 rssi_ofdm_sum[RF_PATH_MEM_SIZE];257u32 rssi_ofdm_cnt;258u32 evm_ofdm_sum;259u32 snr_ofdm_sum[RF_PATH_MEM_SIZE];260u16 evm_ofdm_hist[PHY_HIST_SIZE];261u16 snr_ofdm_hist[PHY_HIST_SIZE];262/*@[1SS]*/263u32 rssi_1ss_cnt;264u32 rssi_1ss_sum[RF_PATH_MEM_SIZE];265u32 evm_1ss_sum;266u32 snr_1ss_sum[RF_PATH_MEM_SIZE];267u16 evm_1ss_hist[PHY_HIST_SIZE];268u16 snr_1ss_hist[PHY_HIST_SIZE];269/*@[2SS]*/270#if (defined(PHYDM_COMPILE_ABOVE_2SS))271u32 rssi_2ss_cnt;272u32 rssi_2ss_sum[RF_PATH_MEM_SIZE];273u32 evm_2ss_sum[2];274u32 snr_2ss_sum[RF_PATH_MEM_SIZE];275u16 evm_2ss_hist[2][PHY_HIST_SIZE];276u16 snr_2ss_hist[2][PHY_HIST_SIZE];277#endif278/*@[3SS]*/279#if (defined(PHYDM_COMPILE_ABOVE_3SS))280u32 rssi_3ss_cnt;281u32 rssi_3ss_sum[RF_PATH_MEM_SIZE];282u32 evm_3ss_sum[3];283u32 snr_3ss_sum[RF_PATH_MEM_SIZE];284u16 evm_3ss_hist[3][PHY_HIST_SIZE];285u16 snr_3ss_hist[3][PHY_HIST_SIZE];286#endif287/*@[4SS]*/288#if (defined(PHYDM_COMPILE_ABOVE_4SS))289u32 rssi_4ss_cnt;290u32 rssi_4ss_sum[RF_PATH_MEM_SIZE];291u32 evm_4ss_sum[4];292u32 snr_4ss_sum[RF_PATH_MEM_SIZE];293u16 evm_4ss_hist[4][PHY_HIST_SIZE];294u16 snr_4ss_hist[4][PHY_HIST_SIZE];295#endif296#ifdef PHYDM_PHYSTAUS_AUTO_SWITCH297u16 p4_cnt[RF_PATH_MEM_SIZE]; /*phy-sts page4 cnt*/298u16 cn_sum[RF_PATH_MEM_SIZE]; /*condition number*/299u16 cn_hist[RF_PATH_MEM_SIZE][PHY_HIST_SIZE];300#endif301};302303struct phydm_phystatus_avg {304/*@[CCK]*/305u8 rssi_cck_avg;306u8 rssi_beacon_avg[RF_PATH_MEM_SIZE];307#ifdef PHYSTS_3RD_TYPE_SUPPORT308#if (defined(PHYDM_COMPILE_ABOVE_2SS))309u8 rssi_cck_avg_abv_2ss[RF_PATH_MEM_SIZE - 1];310#endif311#endif312/*@[OFDM]*/313u8 rssi_ofdm_avg[RF_PATH_MEM_SIZE];314u8 evm_ofdm_avg;315u8 snr_ofdm_avg[RF_PATH_MEM_SIZE];316/*@[1SS]*/317u8 rssi_1ss_avg[RF_PATH_MEM_SIZE];318u8 evm_1ss_avg;319u8 snr_1ss_avg[RF_PATH_MEM_SIZE];320/*@[2SS]*/321#if (defined(PHYDM_COMPILE_ABOVE_2SS))322u8 rssi_2ss_avg[RF_PATH_MEM_SIZE];323u8 evm_2ss_avg[2];324u8 snr_2ss_avg[RF_PATH_MEM_SIZE];325#endif326/*@[3SS]*/327#if (defined(PHYDM_COMPILE_ABOVE_3SS))328u8 rssi_3ss_avg[RF_PATH_MEM_SIZE];329u8 evm_3ss_avg[3];330u8 snr_3ss_avg[RF_PATH_MEM_SIZE];331#endif332/*@[4SS]*/333#if (defined(PHYDM_COMPILE_ABOVE_4SS))334u8 rssi_4ss_avg[RF_PATH_MEM_SIZE];335u8 evm_4ss_avg[4];336u8 snr_4ss_avg[RF_PATH_MEM_SIZE];337#endif338};339340struct odm_phy_dbg_info {341/*@ODM Write,debug info*/342u32 num_qry_phy_status_cck;343u32 num_qry_phy_status_ofdm;344#if (ODM_PHY_STATUS_NEW_TYPE_SUPPORT) || (defined(PHYSTS_3RD_TYPE_SUPPORT))345u32 num_qry_mu_pkt;346u32 num_qry_bf_pkt;347u16 num_mu_vht_pkt[VHT_RATE_NUM];348boolean is_ldpc_pkt;349boolean is_stbc_pkt;350u8 num_of_ppdu[4];351u8 gid_num[4];352#endif353u32 condi_num; /*@condition number U(18,4)*/354u8 condi_num_cdf[CN_CNT_MAX];355u8 num_qry_beacon_pkt;356u8 beacon_cnt_in_period; /*@beacon cnt within watchdog period*/357u8 beacon_phy_rate;358u8 show_phy_sts_all_pkt; /*@Show phy status witch not match BSSID*/359u16 show_phy_sts_max_cnt; /*@show number of phy-status row data per PHYDM watchdog*/360u16 show_phy_sts_cnt;361u16 num_qry_legacy_pkt[LEGACY_RATE_NUM];362u16 num_qry_ht_pkt[HT_RATE_NUM];363u16 num_qry_pkt_sc_20m[LOW_BW_RATE_NUM]; /*@20M SC*/364boolean ht_pkt_not_zero;365boolean low_bw_20_occur;366#if ODM_IC_11AC_SERIES_SUPPORT || defined(PHYDM_IC_JGR3_SERIES_SUPPORT)367u16 num_qry_vht_pkt[VHT_RATE_NUM];368u16 num_qry_pkt_sc_40m[LOW_BW_RATE_NUM]; /*@40M SC*/369boolean vht_pkt_not_zero;370boolean low_bw_40_occur;371#endif372u16 snr_hist_th[PHY_HIST_TH_SIZE];373u16 evm_hist_th[PHY_HIST_TH_SIZE];374#ifdef PHYDM_PHYSTAUS_AUTO_SWITCH375u16 cn_hist_th[PHY_HIST_TH_SIZE]; /*U(16,1)*/376#endif377#ifdef PHYDM_IC_JGR3_SERIES_SUPPORT378s16 cfo_tail[4]; /* per-path's cfo_tail */379#endif380struct phydm_phystatus_statistic physts_statistic_info;381struct phydm_phystatus_avg phystatus_statistic_avg;382};383384enum odm_cmninfo {385/*@Fixed value*/386/*@-----------HOOK BEFORE REG INIT-----------*/387ODM_CMNINFO_PLATFORM = 0,388ODM_CMNINFO_ABILITY,389ODM_CMNINFO_INTERFACE,390ODM_CMNINFO_MP_TEST_CHIP,391ODM_CMNINFO_IC_TYPE,392ODM_CMNINFO_CUT_VER,393ODM_CMNINFO_FAB_VER,394ODM_CMNINFO_FW_VER,395ODM_CMNINFO_FW_SUB_VER,396ODM_CMNINFO_RF_TYPE,397ODM_CMNINFO_RFE_TYPE,398ODM_CMNINFO_DPK_EN,399ODM_CMNINFO_BOARD_TYPE,400ODM_CMNINFO_PACKAGE_TYPE,401ODM_CMNINFO_EXT_LNA,402ODM_CMNINFO_5G_EXT_LNA,403ODM_CMNINFO_EXT_PA,404ODM_CMNINFO_5G_EXT_PA,405ODM_CMNINFO_GPA,406ODM_CMNINFO_APA,407ODM_CMNINFO_GLNA,408ODM_CMNINFO_ALNA,409ODM_CMNINFO_TDMA,410ODM_CMNINFO_EXT_TRSW,411ODM_CMNINFO_EXT_LNA_GAIN,412ODM_CMNINFO_PATCH_ID,413ODM_CMNINFO_BINHCT_TEST,414ODM_CMNINFO_BWIFI_TEST,415ODM_CMNINFO_SMART_CONCURRENT,416ODM_CMNINFO_CONFIG_BB_RF,417ODM_CMNINFO_IQKPAOFF,418ODM_CMNINFO_HUBUSBMODE,419ODM_CMNINFO_FWDWRSVDPAGEINPROGRESS,420ODM_CMNINFO_TX_TP,421ODM_CMNINFO_RX_TP,422ODM_CMNINFO_SOUNDING_SEQ,423ODM_CMNINFO_REGRFKFREEENABLE,424ODM_CMNINFO_RFKFREEENABLE,425ODM_CMNINFO_NORMAL_RX_PATH_CHANGE,426ODM_CMNINFO_VALID_PATH_SET,427ODM_CMNINFO_EFUSE0X3D8,428ODM_CMNINFO_EFUSE0X3D7,429ODM_CMNINFO_SOFT_AP_SPECIAL_SETTING,430ODM_CMNINFO_X_CAP_SETTING,431ODM_CMNINFO_ADVANCE_OTA,432ODM_CMNINFO_HP_HWID,433ODM_CMNINFO_TSSI_ENABLE,434ODM_CMNINFO_DIS_DPD,435ODM_CMNINFO_POWER_VOLTAGE,436/*@-----------HOOK BEFORE REG INIT-----------*/437438/*@Dynamic value:*/439440/*@--------- POINTER REFERENCE-----------*/441ODM_CMNINFO_TX_UNI,442ODM_CMNINFO_RX_UNI,443ODM_CMNINFO_BAND,444ODM_CMNINFO_SEC_CHNL_OFFSET,445ODM_CMNINFO_SEC_MODE,446ODM_CMNINFO_BW,447ODM_CMNINFO_CHNL,448ODM_CMNINFO_FORCED_RATE,449ODM_CMNINFO_ANT_DIV,450ODM_CMNINFO_PATH_DIV,451ODM_CMNINFO_ADAPTIVE_SOML,452ODM_CMNINFO_ADAPTIVITY,453ODM_CMNINFO_SCAN,454ODM_CMNINFO_POWER_SAVING,455ODM_CMNINFO_ONE_PATH_CCA,456ODM_CMNINFO_DRV_STOP,457ODM_CMNINFO_PNP_IN,458ODM_CMNINFO_INIT_ON,459ODM_CMNINFO_ANT_TEST,460ODM_CMNINFO_NET_CLOSED,461ODM_CMNINFO_P2P_LINK,462ODM_CMNINFO_FCS_MODE,463ODM_CMNINFO_IS1ANTENNA,464ODM_CMNINFO_RFDEFAULTPATH,465ODM_CMNINFO_DFS_MASTER_ENABLE,466ODM_CMNINFO_FORCE_TX_ANT_BY_TXDESC,467ODM_CMNINFO_SET_S0S1_DEFAULT_ANTENNA,468ODM_CMNINFO_SOFT_AP_MODE,469ODM_CMNINFO_MP_MODE,470ODM_CMNINFO_INTERRUPT_MASK,471ODM_CMNINFO_BB_OPERATION_MODE,472ODM_CMNINFO_BF_ANTDIV_DECISION,473ODM_CMNINFO_MANUAL_SUPPORTABILITY,474/*@--------- POINTER REFERENCE-----------*/475476/*@------------CALL BY VALUE-------------*/477ODM_CMNINFO_WIFI_DIRECT,478ODM_CMNINFO_WIFI_DISPLAY,479ODM_CMNINFO_LINK_IN_PROGRESS,480ODM_CMNINFO_LINK,481ODM_CMNINFO_CMW500LINK,482ODM_CMNINFO_STATION_STATE,483ODM_CMNINFO_RSSI_MIN,484ODM_CMNINFO_RSSI_MIN_BY_PATH,485ODM_CMNINFO_DBG_COMP,486ODM_CMNINFO_RA_THRESHOLD_HIGH, /*to be removed*/487ODM_CMNINFO_RA_THRESHOLD_LOW, /*to be removed*/488ODM_CMNINFO_RF_ANTENNA_TYPE,489ODM_CMNINFO_WITH_EXT_ANTENNA_SWITCH,490ODM_CMNINFO_BE_FIX_TX_ANT,491ODM_CMNINFO_BT_ENABLED,492ODM_CMNINFO_BT_HS_CONNECT_PROCESS,493ODM_CMNINFO_BT_HS_RSSI,494ODM_CMNINFO_BT_OPERATION,495ODM_CMNINFO_BT_LIMITED_DIG,496ODM_CMNINFO_AP_TOTAL_NUM,497ODM_CMNINFO_POWER_TRAINING,498ODM_CMNINFO_DFS_REGION_DOMAIN,499ODM_CMNINFO_BT_CONTINUOUS_TURN,500ODM_CMNINFO_IS_DOWNLOAD_FW,501ODM_CMNINFO_PHYDM_PATCH_ID,502ODM_CMNINFO_RRSR_VAL,503ODM_CMNINFO_LINKED_BF_SUPPORT,504/*@------------CALL BY VALUE-------------*/505506/*@Dynamic ptr array hook itms.*/507ODM_CMNINFO_STA_STATUS,508ODM_CMNINFO_MAX,509510};511512enum phydm_rfe_bb_source_sel {513PAPE_2G = 0,514PAPE_5G = 1,515LNA0N_2G = 2,516LNAON_5G = 3,517TRSW = 4,518TRSW_B = 5,519GNT_BT = 6,520ZERO = 7,521ANTSEL_0 = 8,522ANTSEL_1 = 9,523ANTSEL_2 = 0xa,524ANTSEL_3 = 0xb,525ANTSEL_4 = 0xc,526ANTSEL_5 = 0xd,527ANTSEL_6 = 0xe,528ANTSEL_7 = 0xf529};530531enum phydm_info_query {532PHYDM_INFO_FA_OFDM,533PHYDM_INFO_FA_CCK,534PHYDM_INFO_FA_TOTAL,535PHYDM_INFO_CCA_OFDM,536PHYDM_INFO_CCA_CCK,537PHYDM_INFO_CCA_ALL,538PHYDM_INFO_CRC32_OK_VHT,539PHYDM_INFO_CRC32_OK_HT,540PHYDM_INFO_CRC32_OK_LEGACY,541PHYDM_INFO_CRC32_OK_CCK,542PHYDM_INFO_CRC32_ERROR_VHT,543PHYDM_INFO_CRC32_ERROR_HT,544PHYDM_INFO_CRC32_ERROR_LEGACY,545PHYDM_INFO_CRC32_ERROR_CCK,546PHYDM_INFO_EDCCA_FLAG,547PHYDM_INFO_OFDM_ENABLE,548PHYDM_INFO_CCK_ENABLE,549PHYDM_INFO_CRC32_OK_HT_AGG,550PHYDM_INFO_CRC32_ERROR_HT_AGG,551PHYDM_INFO_DBG_PORT_0,552PHYDM_INFO_CURR_IGI,553PHYDM_INFO_RSSI_MIN,554PHYDM_INFO_RSSI_MAX,555PHYDM_INFO_CLM_RATIO,556PHYDM_INFO_NHM_RATIO,557PHYDM_INFO_NHM_NOISE_PWR,558};559560enum phydm_api {561PHYDM_API_NBI = 1,562PHYDM_API_CSI_MASK = 2,563};564565enum phydm_func_idx { /*@F_XXX = PHYDM XXX function*/566567F00_DIG = 0,568F01_RA_MASK = 1,569F02_DYN_TXPWR = 2,570F03_FA_CNT = 3,571F04_RSSI_MNTR = 4,572F05_CCK_PD = 5,573F06_ANT_DIV = 6,574F07_SMT_ANT = 7,575F08_PWR_TRAIN = 8,576F09_RA = 9,577F10_PATH_DIV = 10,578F11_DFS = 11,579F12_DYN_ARFR = 12,580F13_ADPTVTY = 13,581F14_CFO_TRK = 14,582F15_ENV_MNTR = 15,583F16_PRI_CCA = 16,584F17_ADPTV_SOML = 17,585F18_LNA_SAT_CHK = 18,586};587588/*@=[PHYDM supportability]==========================================*/589enum odm_ability {590ODM_BB_DIG = BIT(F00_DIG),591ODM_BB_RA_MASK = BIT(F01_RA_MASK),592ODM_BB_DYNAMIC_TXPWR = BIT(F02_DYN_TXPWR),593ODM_BB_FA_CNT = BIT(F03_FA_CNT),594ODM_BB_RSSI_MONITOR = BIT(F04_RSSI_MNTR),595ODM_BB_CCK_PD = BIT(F05_CCK_PD),596ODM_BB_ANT_DIV = BIT(F06_ANT_DIV),597ODM_BB_SMT_ANT = BIT(F07_SMT_ANT),598ODM_BB_PWR_TRAIN = BIT(F08_PWR_TRAIN),599ODM_BB_RATE_ADAPTIVE = BIT(F09_RA),600ODM_BB_PATH_DIV = BIT(F10_PATH_DIV),601ODM_BB_DFS = BIT(F11_DFS),602ODM_BB_DYNAMIC_ARFR = BIT(F12_DYN_ARFR),603ODM_BB_ADAPTIVITY = BIT(F13_ADPTVTY),604ODM_BB_CFO_TRACKING = BIT(F14_CFO_TRK),605ODM_BB_ENV_MONITOR = BIT(F15_ENV_MNTR),606ODM_BB_PRIMARY_CCA = BIT(F16_PRI_CCA),607ODM_BB_ADAPTIVE_SOML = BIT(F17_ADPTV_SOML),608ODM_BB_LNA_SAT_CHK = BIT(F18_LNA_SAT_CHK),609};610611/*@=[PHYDM Debug Component]=====================================*/612enum phydm_dbg_comp {613/*@BB Driver Functions*/614DBG_DIG = BIT(F00_DIG),615DBG_RA_MASK = BIT(F01_RA_MASK),616DBG_DYN_TXPWR = BIT(F02_DYN_TXPWR),617DBG_FA_CNT = BIT(F03_FA_CNT),618DBG_RSSI_MNTR = BIT(F04_RSSI_MNTR),619DBG_CCKPD = BIT(F05_CCK_PD),620DBG_ANT_DIV = BIT(F06_ANT_DIV),621DBG_SMT_ANT = BIT(F07_SMT_ANT),622DBG_PWR_TRAIN = BIT(F08_PWR_TRAIN),623DBG_RA = BIT(F09_RA),624DBG_PATH_DIV = BIT(F10_PATH_DIV),625DBG_DFS = BIT(F11_DFS),626DBG_DYN_ARFR = BIT(F12_DYN_ARFR),627DBG_ADPTVTY = BIT(F13_ADPTVTY),628DBG_CFO_TRK = BIT(F14_CFO_TRK),629DBG_ENV_MNTR = BIT(F15_ENV_MNTR),630DBG_PRI_CCA = BIT(F16_PRI_CCA),631DBG_ADPTV_SOML = BIT(F17_ADPTV_SOML),632DBG_LNA_SAT_CHK = BIT(F18_LNA_SAT_CHK),633/*BIT(19)*/634/*Neet to re-arrange*/635DBG_PHY_STATUS = BIT(20),636DBG_TMP = BIT(21),637DBG_FW_TRACE = BIT(22),638DBG_TXBF = BIT(23),639DBG_COMMON_FLOW = BIT(24),640DBG_COMP_MCC = BIT(25),641/*BIT(26)*/642DBG_DM_SUMMARY = BIT(27),643ODM_PHY_CONFIG = BIT(28),644ODM_COMP_INIT = BIT(29),645DBG_CMN = BIT(30),/*@common*/646ODM_COMP_API = BIT(31)647};648649/*@=========================================================*/650651/*@ODM_CMNINFO_ONE_PATH_CCA*/652enum odm_cca_path {653ODM_CCA_2R = 0,654ODM_CCA_1R_A = 1,655ODM_CCA_1R_B = 2,656};657658enum phy_reg_pg_type {659PHY_REG_PG_RELATIVE_VALUE = 0,660PHY_REG_PG_EXACT_VALUE = 1661};662663enum phydm_offload_ability {664PHYDM_PHY_PARAM_OFFLOAD = BIT(0),665PHYDM_RF_IQK_OFFLOAD = BIT(1),666PHYDM_RF_DPK_OFFLOAD = BIT(2),667};668669struct phydm_pause_lv {670s8 lv_dig;671s8 lv_cckpd;672s8 lv_antdiv;673s8 lv_adapt;674s8 lv_adsl;675};676677struct phydm_func_poiner {678void (*pause_phydm_handler)(void *dm_void, u32 *val_buf, u8 val_len);679};680681struct pkt_process_info {682#ifdef PHYDM_PHYSTAUS_AUTO_SWITCH683/*@send phystatus in each sampling time*/684boolean physts_auto_swch_en;685u8 mac_ppdu_cnt;686u8 phy_ppdu_cnt; /*change with phy cca cnt*/687u8 page_bitmap_target;688u8 page_bitmap_record;689#endif690u8 lna_idx;691u8 vga_idx;692};693694#ifdef ODM_CONFIG_BT_COEXIST695struct phydm_bt_info {696boolean is_bt_enabled; /*@BT is enabled*/697boolean is_bt_connect_process; /*@BT HS is under connection progress.*/698u8 bt_hs_rssi; /*@BT HS mode wifi rssi value.*/699boolean is_bt_hs_operation; /*@BT HS mode is under progress*/700boolean is_bt_limited_dig; /*@BT is busy.*/701};702#endif703704struct phydm_iot_center {705boolean is_linked_cmw500;706u8 win_patch_id; /*@Customer ID*/707u32 phydm_patch_id;708709};710711#if (RTL8822B_SUPPORT)712struct drp_rtl8822b_struct {713enum bb_path path_judge;714u16 path_a_cck_fa;715u16 path_b_cck_fa;716};717#endif718719#ifdef CONFIG_MCC_DM720#define MCC_DM_REG_NUM 32721struct _phydm_mcc_dm_ {722u8 mcc_pre_status;723u8 mcc_reg_id[MCC_DM_REG_NUM];724u16 mcc_dm_reg[MCC_DM_REG_NUM];725u8 mcc_dm_val[MCC_DM_REG_NUM][2];726/*mcc DIG*/727u8 mcc_rssi[2];728/*u8 mcc_igi[2];*/729730/* need to be config by driver*/731u8 mcc_status;732u8 sta_macid[2][NUM_STA];733u16 mcc_rf_ch[2];734735};736#endif737738#if (RTL8822C_SUPPORT || RTL8812F_SUPPORT || RTL8197G_SUPPORT)739struct phydm_physts {740u8 cck_gi_u_bnd;741u8 cck_gi_l_bnd;742};743#endif744745#if (DM_ODM_SUPPORT_TYPE & ODM_WIN)746#if (RT_PLATFORM != PLATFORM_LINUX)747typedef748#endif749750struct dm_struct {751#else/*for AP, CE Team*/752struct dm_struct {753#endif754/*@Add for different team use temporarily*/755void *adapter; /*@For CE/NIC team*/756struct rtl8192cd_priv *priv; /*@For AP team*/757boolean odm_ready;758enum phy_reg_pg_type phy_reg_pg_value_type;759u8 phy_reg_pg_version;760u64 support_ability; /*@PHYDM function Supportability*/761u64 pause_ability; /*@PHYDM function pause Supportability*/762u64 debug_components;763u8 cmn_dbg_msg_period;764u8 cmn_dbg_msg_cnt;765u32 fw_debug_components;766u32 num_qry_phy_status_all; /*@CCK + OFDM*/767u32 last_num_qry_phy_status_all;768u32 rx_pwdb_ave;769boolean is_init_hw_info_by_rfe;770771//TSSI772u8 en_tssi_mode;773774/*@------ ODM HANDLE, DRIVER NEEDS NOT TO HOOK------*/775boolean is_cck_high_power;776u8 rf_path_rx_enable;777/*@------ ODM HANDLE, DRIVER NEEDS NOT TO HOOK------*/778779/* @COMMON INFORMATION */780781/*@Init value*/782/*@-----------HOOK BEFORE REG INIT-----------*/783784u8 support_platform; /*@PHYDM Platform info WIN/AP/CE = 1/2/3 */785u8 normal_rx_path;786u8 valid_path_set; /*@use for single rx path only*/787boolean brxagcswitch; /* @for rx AGC table switch in Microsoft case */788u8 support_interface; /*@PHYDM PCIE/USB/SDIO = 1/2/3*/789u32 support_ic_type; /*@PHYDM supported IC*/790enum phydm_api_host run_in_drv_fw; /*@PHYDM API is using in FW or Driver*/791u8 ic_ip_series; /*N/AC/JGR3*/792enum phydm_phy_sts_type ic_phy_sts_type; /*@Type1/type2/type3*/793u8 cut_version; /*@cut version TestChip/A-cut/B-cut... = 0/1/2/3/...*/794u8 fab_version; /*@Fab version TSMC/UMC = 0/1*/795u8 fw_version;796u8 fw_sub_version;797u8 rf_type; /*@RF type 4T4R/3T3R/2T2R/1T2R/1T1R/...*/798u8 rfe_type;799u8 board_type;800u8 package_type;801u16 type_glna;802u16 type_gpa;803u16 type_alna;804u16 type_apa;805u8 ext_lna; /*@with 2G external LNA NO/Yes = 0/1*/806u8 ext_lna_5g; /*@with 5G external LNA NO/Yes = 0/1*/807u8 ext_pa; /*@with 2G external PNA NO/Yes = 0/1*/808u8 ext_pa_5g; /*@with 5G external PNA NO/Yes = 0/1*/809u8 efuse0x3d7; /*@with Efuse number*/810u8 efuse0x3d8;811u8 ext_trsw; /*@with external TRSW NO/Yes = 0/1*/812u8 ext_lna_gain; /*@gain of external lna*/813boolean is_in_hct_test;814u8 wifi_test;815boolean is_dual_mac_smart_concurrent;816u32 bk_support_ability; /*SD4 only*/817u8 with_extenal_ant_switch;818/*@cck agc relative*/819boolean cck_new_agc;820s8 cck_lna_gain_table[8];821u8 cck_sat_cnt_th_init;822/*@-------------------------------------*/823u32 phydm_sys_up_time;824u8 num_rf_path; /*@ex: 8821C=1, 8192E=2, 8814B=4*/825u32 soft_ap_special_setting;826boolean boolean_dummy;827s8 s8_dummy;828u8 u8_dummy;829u16 u16_dummy;830u32 u32_dummy;831u8 rfe_hwsetting_band;832u8 p_advance_ota;833boolean hp_hw_id;834boolean BOOLEAN_temp;835boolean is_dfs_band;836u8 is_rx_blocking_en;837u16 fw_offload_ability;838boolean is_download_fw;839boolean en_dis_dpd;840u16 dis_dpd_rate;841#if (RTL8822C_SUPPORT || RTL8814B_SUPPORT || RTL8197G_SUPPORT)842u8 txagc_buff[RF_PATH_MEM_SIZE][PHY_NUM_RATE_IDX];843u32 bp_0x9b0;844#endif845/*@-----------HOOK BEFORE REG INIT-----------*/846/*@===========================================================*/847/*@====[ CALL BY Reference ]=========================================*/848/*@===========================================================*/849850u64 *num_tx_bytes_unicast; /*@TX Unicast byte cnt*/851u64 *num_rx_bytes_unicast; /*@RX Unicast byte cnt*/852u8 *band_type; /*@2.4G/5G = 0/1*/853u8 *sec_ch_offset; /*@Secondary channel offset don't_care/below/above = 0/1/2*/854u8 *security; /*@security mode Open/WEP/AES/TKIP = 0/1/2/3*/855u8 *band_width; /*@20M/40M/80M = 0/1/2*/856u8 *channel; /*@central CH number*/857boolean *is_scan_in_process;858boolean *is_power_saving;859boolean *is_tdma;860u8 *one_path_cca; /*@CCA path 2-path/path-A/path-B = 0/1/2; using enum odm_cca_path.*/861u8 *antenna_test;862boolean *is_net_closed;863boolean *is_fcs_mode_enable; /*@fast channel switch (= MCC mode)*/864/*@--------- For 8723B IQK-------------------------------------*/865boolean *is_1_antenna;866u8 *rf_default_path; /* @0:S1, 1:S0 */867/*@-----------------------------------------------------------*/868869u16 *forced_data_rate;870u8 *enable_antdiv;871u8 *enable_pathdiv;872u8 *en_adap_soml;873u8 *edcca_mode;874u8 *hub_usb_mode; /*@1:USB2.0, 2:USB3.0*/875boolean *is_fw_dw_rsvd_page_in_progress;876u32 *current_tx_tp;877u32 *current_rx_tp;878u8 *sounding_seq;879u32 *soft_ap_mode;880u8 *mp_mode;881u32 *interrupt_mask;882u8 *bb_op_mode;883u32 *manual_supportability;884/*@===========================================================*/885/*@====[ CALL BY VALUE ]===========================================*/886/*@===========================================================*/887888u8 disable_phydm_watchdog;889boolean is_link_in_process;890boolean is_wifi_direct;891boolean is_wifi_display;892boolean is_linked;893boolean pre_is_linked;894boolean first_connect;895boolean first_disconnect;896boolean bsta_state;897u8 rssi_min;898u8 rssi_min_macid;899u8 pre_rssi_min;900u8 rssi_max;901u8 rssi_max_macid;902u8 rssi_min_by_path;903boolean is_mp_chip;904boolean is_one_entry_only;905u32 one_entry_macid;906u32 one_entry_tp;907u32 pre_one_entry_tp;908u8 pre_number_linked_client;909u8 number_linked_client;910u8 pre_number_active_client;911u8 number_active_client;912boolean is_disable_phy_api;913u8 rssi_a;914u8 rssi_b;915u8 rssi_c;916u8 rssi_d;917s8 rxsc_80;918s8 rxsc_40;919s8 rxsc_20;920s8 rxsc_l;921u64 rssi_trsw;922u64 rssi_trsw_h;923u64 rssi_trsw_l;924u64 rssi_trsw_iso;925u8 tx_ant_status; /*TX path enable*/926u8 rx_ant_status; /*RX path enable*/927#ifdef PHYDM_COMPILE_ABOVE_4SS928enum bb_path tx_4ss_status; /*@Use N-X for 4STS rate*/929#endif930#ifdef PHYDM_COMPILE_ABOVE_3SS931enum bb_path tx_3ss_status; /*@Use N-X for 3STS rate*/932#endif933#ifdef PHYDM_COMPILE_ABOVE_2SS934enum bb_path tx_2ss_status; /*@Use N-X for 2STS rate*/935#endif936enum bb_path tx_1ss_status; /*@Use N-X for 1STS rate*/937u8 cck_lna_idx;938u8 cck_vga_idx;939u8 curr_station_id;940u8 ofdm_agc_idx[4];941u8 rx_rate;942u8 rate_ss;943u8 tx_rate;944u8 linked_interval;945u8 pre_channel;946u32 txagc_offset_value_a;947boolean is_txagc_offset_positive_a;948u32 txagc_offset_value_b;949boolean is_txagc_offset_positive_b;950u8 ap_total_num;951/*@[traffic]*/952u8 traffic_load;953u8 pre_traffic_load;954u32 tx_tp; /*@Mbps*/955u32 rx_tp; /*@Mbps*/956u32 total_tp; /*@Mbps*/957u8 txrx_state_all; /*@0:tx, 1:rx, 2:bi-dir*/958u64 cur_tx_ok_cnt;959u64 cur_rx_ok_cnt;960u64 last_tx_ok_cnt;961u64 last_rx_ok_cnt;962u16 consecutive_idlel_time; /*@unit: second*/963/*@---------------------------*/964boolean is_bb_swing_offset_positive_a;965boolean is_bb_swing_offset_positive_b;966967/*@[DIG]*/968boolean MPDIG_2G; /*off MPDIG*/969u8 times_2g; /*@for MP DIG*/970u8 force_igi; /*@for debug*/971972/*@[TDMA-DIG]*/973u16 tdma_dig_timer_ms;974u8 tdma_dig_state_number;975u8 tdma_dig_low_upper_bond;976u8 force_tdma_low_igi;977u8 force_tdma_high_igi;978u8 fix_expire_to_zero;979boolean original_dig_restore;980/*@---------------------------*/981982/*@[AntDiv]*/983u8 ant_div_type;984u8 antdiv_rssi;985u8 fat_comb_a;986u8 fat_comb_b;987u8 antdiv_intvl;988u8 antdiv_delay;989u8 ant_type;990u8 ant_type2;991u8 pre_ant_type;992u8 pre_ant_type2;993u8 antdiv_period;994u8 evm_antdiv_period;995u8 antdiv_select;996u8 antdiv_train_num; /*@training time for each antenna in EVM method*/997u8 stop_antdiv_rssi_th;998u16 stop_antdiv_tp_diff_th;999u16 stop_antdiv_tp_th;1000u8 antdiv_tp_period;1001u16 tp_active_th;1002u8 tp_active_occur;1003u8 path_select;1004u8 antdiv_evm_en;1005u8 bdc_holdstate;1006u8 antdiv_counter;1007/*@---------------------------*/10081009u8 ndpa_period;1010boolean h2c_rarpt_connect;1011boolean cck_agc_report_type; /*@1:4bit LNA, 0:3bit LNA */1012u8 print_agc;1013u8 la_mode;1014/*@---8821C Antenna and RF Set BTG/WLG/WLA Select---------------*/1015u8 current_rf_set_8821c;1016u8 default_rf_set_8821c;1017u8 current_ant_num_8821c;1018u8 default_ant_num_8821c;1019u8 rfe_type_expand;1020/*@-----------------------------------------------------------*/1021/*@---For Adaptivtiy---------------------------------------------*/1022s8 TH_L2H_default;1023s8 th_edcca_hl_diff_default;1024s8 th_l2h_ini;1025s8 th_edcca_hl_diff;1026boolean carrier_sense_enable;1027/*@-----------------------------------------------------------*/1028u8 pre_dbg_priority;1029u8 nbi_set_result;1030u8 c2h_cmd_start;1031u8 fw_debug_trace[60];1032u8 pre_c2h_seq;1033boolean fw_buff_is_enpty;1034u32 data_frame_num;1035/*@--- for spur detection ---------------------------------------*/1036boolean en_reg_mntr_bb;1037boolean en_reg_mntr_rf;1038boolean en_reg_mntr_mac;1039boolean en_reg_mntr_byte;1040/*@--------------------------------------------------------------*/1041#if (RTL8814B_SUPPORT)1042/*@--- for spur detection ---------------------------------------*/1043u8 dsde_sel;1044u8 nbi_path_sel;1045u8 csi_wgt;1046/*@------------------------------------------*/1047#endif1048/*@--- for noise detection ---------------------------------------*/1049boolean is_noisy_state;1050boolean noisy_decision; /*@b_noisy*/1051boolean pre_b_noisy;1052u32 noisy_decision_smooth;1053/*@-----------------------------------------------------------*/10541055/*@--- for MCC ant weighting ------------------------------------*/1056boolean is_stop_dym_ant_weighting;1057/*@-----------------------------------------------------------*/10581059boolean is_disable_dym_ecs;1060boolean is_disable_dym_ant_weighting;1061struct cmn_sta_info *phydm_sta_info[ODM_ASSOCIATE_ENTRY_NUM];1062u8 phydm_macid_table[ODM_ASSOCIATE_ENTRY_NUM];/*@sta_idx = phydm_macid_table[HW_macid]*/10631064#if (RATE_ADAPTIVE_SUPPORT)1065u16 currmin_rpt_time;1066struct _phydm_txstatistic_ hw_stats;1067struct _odm_ra_info_ ra_info[ODM_ASSOCIATE_ENTRY_NUM];1068/*Use mac_id as array index. STA mac_id=0*/1069/*VWiFi Client mac_id={1, ODM_ASSOCIATE_ENTRY_NUM-1} //YJ,add,120119*/1070#endif1071/*@2012/02/14 MH Add to share 88E ra with other SW team*/1072/*We need to colelct all support abilit to a proper area.*/1073boolean ra_support88e;1074boolean *is_driver_stopped;1075boolean *is_driver_is_going_to_pnp_set_power_sleep;1076boolean *pinit_adpt_in_progress;1077boolean is_user_assign_level;1078u8 RSSI_BT; /*@come from BT*/10791080/*@---PSD Relative ---------------------------------------------*/1081boolean is_psd_in_process;1082boolean is_psd_active;1083/*@-----------------------------------------------------------*/10841085boolean bsomlenabled; /* @D-SoML control */1086u8 linked_bf_support;1087boolean bhtstfdisabled; /* @dynamic HTSTF gain control*/1088u32 n_iqk_cnt;1089u32 n_iqk_ok_cnt;1090u32 n_iqk_fail_cnt;10911092#if (DM_ODM_SUPPORT_TYPE & ODM_AP)1093boolean config_bbrf;1094#endif1095boolean is_disable_power_training;1096boolean is_bt_continuous_turn;1097u8 enhance_pwr_th[3];1098u8 set_pwr_th[3];1099/*@----------Dyn Tx Pwr ---------------------------------------*/1100#ifdef BB_RAM_SUPPORT1101struct phydm_bb_ram_ctrl p_bb_ram_ctrl;1102#endif1103u8 dynamic_tx_high_power_lvl;1104void (*fill_desc_dyntxpwr)(void *dm, u8 *desc, u8 dyn_tx_power);1105u8 last_dtp_lvl;1106u8 min_power_index;1107u32 tx_agc_ofdm_18_6;1108/*-------------------------------------------------------------*/1109u8 rx_pkt_type;11101111#ifdef CONFIG_PHYDM_DFS_MASTER1112u8 dfs_region_domain;1113u8 *dfs_master_enabled;1114/*@---phydm_radar_detect_with_dbg_parm start --------------------*/1115u8 radar_detect_dbg_parm_en;1116u32 radar_detect_reg_918;1117u32 radar_detect_reg_91c;1118u32 radar_detect_reg_920;1119u32 radar_detect_reg_924;11201121u32 radar_detect_reg_a40;1122u32 radar_detect_reg_a44;1123u32 radar_detect_reg_a48;1124u32 radar_detect_reg_a4c;1125u32 radar_detect_reg_a50;1126u32 radar_detect_reg_a54;11271128u32 radar_detect_reg_f54;1129u32 radar_detect_reg_f58;1130u32 radar_detect_reg_f5c;1131u32 radar_detect_reg_f70;1132u32 radar_detect_reg_f74;1133/*@---For zero-wait DFS---------------------------------------*/1134boolean seg1_dfs_flag;1135/*@-----------------------------------------------------------*/1136/*@-----------------------------------------------------------*/1137#endif11381139/*@=== RTL8721D ===*/1140#if (RTL8721D_SUPPORT)1141boolean cbw20_adc80;1142boolean invalid_mode;1143u8 power_voltage;1144u8 cca_cbw20_lev;1145u8 cca_cbw40_lev;1146#endif11471148/*@=== PHYDM Timer ========================================== (start)*/11491150struct phydm_timer_list mpt_dig_timer;1151struct phydm_timer_list fast_ant_training_timer;1152#ifdef ODM_EVM_ENHANCE_ANTDIV1153struct phydm_timer_list evm_fast_ant_training_timer;1154#endif1155#ifdef PHYDM_TDMA_DIG_SUPPORT1156struct phydm_timer_list tdma_dig_timer;1157#endif1158struct phydm_timer_list sbdcnt_timer;11591160/*@=== PHYDM Workitem ======================================= (start)*/11611162#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)1163#if USE_WORKITEM1164RT_WORK_ITEM fast_ant_training_workitem;1165RT_WORK_ITEM ra_rpt_workitem;1166RT_WORK_ITEM sbdcnt_workitem;1167RT_WORK_ITEM phydm_evm_antdiv_workitem;1168#ifdef PHYDM_TDMA_DIG_SUPPORT1169RT_WORK_ITEM phydm_tdma_dig_workitem;1170#endif1171#endif1172#endif11731174/*@=== PHYDM Structure ======================================== (start)*/1175struct phydm_func_poiner phydm_func_handler;1176struct phydm_iot_center iot_table;11771178#ifdef ODM_CONFIG_BT_COEXIST1179struct phydm_bt_info bt_info_table;1180#endif11811182struct pkt_process_info pkt_proc_struct;1183struct phydm_adaptivity_struct adaptivity;1184struct _DFS_STATISTICS dfs;1185struct odm_noise_monitor noise_level;1186struct odm_phy_dbg_info phy_dbg_info;11871188#ifdef PHYDM_IC_JGR3_SERIES_SUPPORT1189struct phydm_bf_rate_info_jgr3 bf_rate_info_jgr3;1190#endif11911192#ifdef CONFIG_ADAPTIVE_SOML1193struct adaptive_soml dm_soml_table;1194#endif11951196#if (defined(CONFIG_PHYDM_ANTENNA_DIVERSITY))1197#if (DM_ODM_SUPPORT_TYPE & (ODM_AP))1198struct _BF_DIV_COEX_ dm_bdc_table;1199#endif12001201#if (defined(CONFIG_HL_SMART_ANTENNA))1202struct smt_ant_honbo dm_sat_table;1203#endif1204#endif12051206#if (defined(CONFIG_SMART_ANTENNA))1207struct smt_ant smtant_table;1208#endif12091210struct _hal_rf_ rf_table; /*@for HALRF function*/1211struct dm_rf_calibration_struct rf_calibrate_info;1212struct dm_iqk_info IQK_info;1213struct dm_dpk_info dpk_info;1214struct dm_dack_info dack_info;12151216#ifdef CONFIG_PHYDM_ANTENNA_DIVERSITY1217struct phydm_fat_struct dm_fat_table;1218struct sw_antenna_switch dm_swat_table;1219#endif1220struct phydm_dig_struct dm_dig_table;1221#ifdef PHYDM_LNA_SAT_CHK_SUPPORT1222struct phydm_lna_sat_t dm_lna_sat_info;1223#endif12241225#ifdef CONFIG_MCC_DM1226struct _phydm_mcc_dm_ mcc_dm;1227#endif12281229#ifdef PHYDM_SUPPORT_CCKPD1230struct phydm_cckpd_struct dm_cckpd_table;1231#endif12321233#ifdef PHYDM_PRIMARY_CCA1234struct phydm_pricca_struct dm_pri_cca;1235#endif12361237struct ra_table dm_ra_table;1238struct phydm_fa_struct false_alm_cnt;1239#ifdef PHYDM_TDMA_DIG_SUPPORT1240struct phydm_fa_acc_struct false_alm_cnt_acc;1241#ifdef IS_USE_NEW_TDMA1242struct phydm_fa_acc_struct false_alm_cnt_acc_low;1243#endif1244#endif1245struct phydm_cfo_track_struct dm_cfo_track;1246struct ccx_info dm_ccx_info;12471248struct odm_power_trim_data power_trim_data;1249#if (RTL8822B_SUPPORT)1250struct drp_rtl8822b_struct phydm_rtl8822b;1251#endif12521253#ifdef CONFIG_PSD_TOOL1254struct psd_info dm_psd_table;1255#endif12561257#if (PHYDM_LA_MODE_SUPPORT)1258struct rt_adcsmp adcsmp;1259#endif12601261#if (defined(CONFIG_PATH_DIVERSITY))1262struct _ODM_PATH_DIVERSITY_ dm_path_div;1263#endif12641265#if (defined(CONFIG_ANT_DETECTION))1266struct _ANT_DETECTED_INFO ant_detected_info;1267#endif12681269#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN | ODM_CE))1270#ifdef PHYDM_BEAMFORMING_SUPPORT1271struct _RT_BEAMFORMING_INFO beamforming_info;1272#endif1273#endif1274#ifdef PHYDM_AUTO_DEGBUG1275struct phydm_auto_dbg_struct auto_dbg_table;1276#endif12771278struct phydm_pause_lv pause_lv_table;1279struct phydm_api_stuc api_table;1280#ifdef PHYDM_POWER_TRAINING_SUPPORT1281struct phydm_pow_train_stuc pow_train_table;1282#endif12831284#ifdef PHYDM_PMAC_TX_SETTING_SUPPORT1285struct phydm_pmac_tx dm_pmac_tx_table;1286#endif12871288#ifdef PHYDM_MP_SUPPORT1289struct phydm_mp dm_mp_table;1290#endif12911292#ifdef PHYDM_CCK_RX_PATHDIV_SUPPORT1293struct phydm_cck_rx_pathdiv dm_cck_rx_pathdiv_table;1294#endif1295/*@==========================================================*/12961297#if (RTL8822C_SUPPORT || RTL8812F_SUPPORT || RTL8197G_SUPPORT)1298/*@-------------------phydm_phystatus report --------------------*/1299struct phydm_physts dm_physts_table;1300#endif13011302#if (DM_ODM_SUPPORT_TYPE & ODM_WIN)13031304#if (RT_PLATFORM != PLATFORM_LINUX)1305} dm_struct; /*@DM_Dynamic_Mechanism_Structure*/1306#else1307};1308#endif13091310#else /*@for AP,CE Team*/1311};1312#endif13131314enum phydm_adv_ota {1315PHYDM_PATHB_1RCCA = BIT(0),1316PHYDM_HP_OTA_SETTING_A = BIT(1),1317PHYDM_HP_OTA_SETTING_B = BIT(2),1318PHYDM_ASUS_OTA_SETTING = BIT(3),1319PHYDM_ASUS_OTA_SETTING_CCK_PATH = BIT(4),1320PHYDM_HP_OTA_SETTING_CCK_PATH = BIT(5),1321PHYDM_LENOVO_OTA_SETTING_NBI_CSI = BIT(6),13221323};13241325enum phydm_bb_op_mode {1326PHYDM_PERFORMANCE_MODE = 0, /*Service one device*/1327PHYDM_BALANCE_MODE = 1, /*@Service more than one device*/1328};13291330enum phydm_structure_type {1331PHYDM_FALSEALMCNT,1332PHYDM_CFOTRACK,1333PHYDM_ADAPTIVITY,1334PHYDM_DFS,1335PHYDM_ROMINFO,13361337};13381339enum odm_bb_config_type {1340CONFIG_BB_PHY_REG,1341CONFIG_BB_AGC_TAB,1342CONFIG_BB_AGC_TAB_2G,1343CONFIG_BB_AGC_TAB_5G,1344CONFIG_BB_PHY_REG_PG,1345CONFIG_BB_PHY_REG_MP,1346CONFIG_BB_AGC_TAB_DIFF,1347CONFIG_BB_RF_CAL_INIT,1348};13491350enum odm_rf_config_type {1351CONFIG_RF_RADIO,1352CONFIG_RF_TXPWR_LMT,1353CONFIG_RF_SYN_RADIO,1354};13551356enum odm_fw_config_type {1357CONFIG_FW_NIC,1358CONFIG_FW_NIC_2,1359CONFIG_FW_AP,1360CONFIG_FW_AP_2,1361CONFIG_FW_MP,1362CONFIG_FW_WOWLAN,1363CONFIG_FW_WOWLAN_2,1364CONFIG_FW_AP_WOWLAN,1365CONFIG_FW_BT,1366};13671368/*status code*/1369#if (DM_ODM_SUPPORT_TYPE != ODM_WIN)1370enum rt_status {1371RT_STATUS_SUCCESS,1372RT_STATUS_FAILURE,1373RT_STATUS_PENDING,1374RT_STATUS_RESOURCE,1375RT_STATUS_INVALID_CONTEXT,1376RT_STATUS_INVALID_PARAMETER,1377RT_STATUS_NOT_SUPPORT,1378RT_STATUS_OS_API_FAILED,1379};1380#endif /*@end of enum rt_status definition*/13811382void1383phydm_watchdog_lps(struct dm_struct *dm);13841385void1386phydm_watchdog_lps_32k(struct dm_struct *dm);13871388void1389phydm_txcurrentcalibration(struct dm_struct *dm);13901391void1392phydm_dm_early_init(struct dm_struct *dm);13931394void1395odm_dm_init(struct dm_struct *dm);13961397void1398odm_dm_reset(struct dm_struct *dm);13991400void1401phydm_fwoffload_ability_init(struct dm_struct *dm,1402enum phydm_offload_ability offload_ability);14031404void1405phydm_fwoffload_ability_clear(struct dm_struct *dm,1406enum phydm_offload_ability offload_ability);14071408void1409phydm_supportability_en(void *dm_void, char input[][16], u32 *_used,1410char *output, u32 *_out_len);14111412void1413phydm_pause_dm_watchdog(void *dm_void, enum phydm_pause_type pause_type);14141415void1416phydm_watchdog(struct dm_struct *dm);14171418void1419phydm_watchdog_mp(struct dm_struct *dm);14201421u81422phydm_pause_func(void *dm_void, enum phydm_func_idx pause_func,1423enum phydm_pause_type pause_type,1424enum phydm_pause_level pause_lv, u8 val_lehgth, u32 *val_buf);14251426void1427phydm_pause_func_console(void *dm_void, char input[][16], u32 *_used,1428char *output, u32 *_out_len);14291430void phydm_pause_dm_by_asso_pkt(struct dm_struct *dm,1431enum phydm_pause_type pause_type, u8 rssi);14321433void1434odm_cmn_info_init(struct dm_struct *dm, enum odm_cmninfo cmn_info, u64 value);14351436void1437odm_cmn_info_hook(struct dm_struct *dm, enum odm_cmninfo cmn_info, void *value);14381439void1440odm_cmn_info_update(struct dm_struct *dm, u32 cmn_info, u64 value);14411442u321443phydm_cmn_info_query(struct dm_struct *dm, enum phydm_info_query info_type);14441445void1446odm_init_all_timers(struct dm_struct *dm);14471448void1449odm_cancel_all_timers(struct dm_struct *dm);14501451void1452odm_release_all_timers(struct dm_struct *dm);14531454void *1455phydm_get_structure(struct dm_struct *dm, u8 structure_type);14561457void1458phydm_dc_cancellation(struct dm_struct *dm);14591460void1461phydm_receiver_blocking(void *dm_void);14621463#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)1464void1465odm_init_all_work_items(1466struct dm_struct *dm1467);1468void1469odm_free_all_work_items(1470struct dm_struct *dm1471);1472#endif /*@#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)*/14731474#if (DM_ODM_SUPPORT_TYPE == ODM_CE)1475void1476odm_dtc(struct dm_struct *dm);1477#endif14781479#if (DM_ODM_SUPPORT_TYPE == ODM_AP)1480void1481odm_init_all_threads(1482struct dm_struct *dm1483);14841485void1486odm_stop_all_threads(1487struct dm_struct *dm1488);1489#endif14901491#endif149214931494