Path: blob/master/ALFA-W1F1/RTL8814AU/hal/phydm/phydm_api.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 __PHYDM_API_H__26#define __PHYDM_API_H__2728/* 2019.03.05 add reset txagc API for jgr3 ics*/29#define PHYDM_API_VERSION "2.1"3031/* @1 ============================================================32* 1 Definition33* 1 ============================================================34*/35#define N_IC_TX_OFFEST_5_BIT (ODM_RTL8188E | ODM_RTL8192E)3637#define N_IC_TX_OFFEST_6_BIT (ODM_RTL8723D | ODM_RTL8197F | ODM_RTL8710B |\38ODM_RTL8723B | ODM_RTL8703B | ODM_RTL8195A |\39ODM_RTL8188F)4041#define N_IC_TX_OFFEST_7_BIT (ODM_RTL8721D | ODM_RTL8710C)4243#define CN_CNT_MAX 10 /*@max condition number threshold*/4445#define FUNC_ENABLE 146#define FUNC_DISABLE 24748/*@NBI API------------------------------------*/49#define NBI_128TONE 27 /*register table size*/50#define NBI_256TONE 59 /*register table size*/5152#define NUM_START_CH_80M 753#define NUM_START_CH_40M 145455#define CH_OFFSET_40M 256#define CH_OFFSET_80M 65758#define FFT_128_TYPE 159#define FFT_256_TYPE 26061#define FREQ_POSITIVE 162#define FREQ_NEGATIVE 263/*@------------------------------------------------*/6465enum phystat_rpt {66PHY_PWDB = 0,67PHY_EVM = 1,68PHY_CFO = 2,69PHY_RXSNR = 3,70PHY_LGAIN = 4,71PHY_HT_AAGC_GAIN = 5,72};7374#ifndef PHYDM_COMMON_API_SUPPORT75#define INVALID_RF_DATA 0xffffffff76#define INVALID_TXAGC_DATA 0xff77#endif7879/* @1 ============================================================80* 1 structure81* 1 ============================================================82*/8384struct phydm_api_stuc {85u32 rxiqc_reg1; /*N-mode: for pathA REG0xc14*/86u32 rxiqc_reg2; /*N-mode: for pathB REG0xc1c*/87u8 tx_queue_bitmap; /*REG0x520[23:16]*/88u8 ccktx_path;89};9091/* @1 ============================================================92* 1 enumeration93* 1 ============================================================94*/9596/* @1 ============================================================97* 1 function prototype98* 1 ============================================================99*/100void phydm_reset_bb_hw_cnt(void *dm_void);101102void phydm_dynamic_ant_weighting(void *dm_void);103104#ifdef DYN_ANT_WEIGHTING_SUPPORT105void phydm_ant_weight_dbg(void *dm_void, char input[][16], u32 *_used,106char *output, u32 *_out_len);107#endif108109void phydm_trx_antenna_setting_init(void *dm_void, u8 num_rf_path);110111void phydm_config_ofdm_rx_path(void *dm_void, enum bb_path path);112113void phydm_config_cck_rx_path(void *dm_void, enum bb_path path);114115void phydm_config_cck_rx_antenna_init(void *dm_void);116117void phydm_config_trx_path(void *dm_void, char input[][16], u32 *_used,118char *output, u32 *_out_len);119120void phydm_config_ofdm_tx_path(void *dm_void, enum bb_path path);121122void phydm_config_cck_tx_path(void *dm_void, enum bb_path path);123124void phydm_tx_2path(void *dm_void);125126void phydm_stop_3_wire(void *dm_void, u8 set_type);127128u8 phydm_stop_ic_trx(void *dm_void, u8 set_type);129130void phydm_dis_cck_trx(void *dm_void, u8 set_type);131132void phydm_set_ext_switch(void *dm_void, u32 ext_ant_switch);133134void phydm_nbi_enable(void *dm_void, u32 enable);135136u8 phydm_csi_mask_setting(void *dm_void, u32 enable, u32 ch, u32 bw, u32 f_intf,137u32 sec_ch);138139u8 phydm_nbi_setting(void *dm_void, u32 enable, u32 ch, u32 bw, u32 f_intf,140u32 sec_ch);141142void phydm_nbi_debug(void *dm_void, char input[][16], u32 *_used,143char *output, u32 *_out_len);144145void phydm_csi_debug(void *dm_void, char input[][16], u32 *_used,146char *output, u32 *_out_len);147148void phydm_stop_ck320(void *dm_void, u8 enable);149150boolean151phydm_set_bb_txagc_offset(void *dm_void, s8 power_offset, u8 add_half_db);152#ifdef PHYDM_IC_JGR3_SERIES_SUPPORT153u8 phydm_csi_mask_setting_jgr3(void *dm_void, u32 enable, u32 ch, u32 bw,154u32 f_intf, u32 sec_ch, u8 wgt);155156void phydm_set_csi_mask_jgr3(void *dm_void, u32 tone_idx_tmp, u8 tone_direction,157u8 wgt);158159u8 phydm_nbi_setting_jgr3(void *dm_void, u32 enable, u32 ch, u32 bw, u32 f_intf,160u32 sec_ch, u8 path);161162void phydm_set_nbi_reg_jgr3(void *dm_void, u32 tone_idx_tmp, u8 tone_direction,163u8 path);164165void phydm_nbi_enable_jgr3(void *dm_void, u32 enable, u8 path);166167u8 phydm_phystat_rpt_jgr3(void *dm_void, enum phystat_rpt info,168enum rf_path ant_path);169void phydm_user_position_for_sniffer(void *dm_void, u8 user_position);170171#endif172173#ifdef PHYDM_COMMON_API_SUPPORT174void phydm_reset_txagc(void *dm_void);175176boolean177phydm_api_shift_txagc(void *dm_void, u32 pwr_offset, enum rf_path path,178boolean is_positive);179boolean180phydm_api_set_txagc(void *dm_void, u32 power_index, enum rf_path path,181u8 hw_rate, boolean is_single_rate);182183u8 phydm_api_get_txagc(void *dm_void, enum rf_path path, u8 hw_rate);184185boolean186phydm_api_switch_bw_channel(void *dm_void, u8 central_ch, u8 primary_ch_idx,187enum channel_width bandwidth);188189boolean190phydm_api_trx_mode(void *dm_void, enum bb_path tx_path, enum bb_path rx_path,191enum bb_path tx_path_ctrl);192193#endif194195#ifdef CONFIG_MCC_DM196#ifdef DYN_ANT_WEIGHTING_SUPPORT197void phydm_dynamic_ant_weighting_mcc_8822b(void *dm_void);198#endif /*#ifdef DYN_ANT_WEIGHTING_SUPPORT*/199void phydm_fill_mcccmd(void *dm_void, u8 regid, u16 reg_add,200u8 val0, u8 val1);201u8 phydm_check(void *dm_void);202void phydm_mcc_init(void *dm_void);203void phydm_mcc_switch(void *dm_void);204#endif /*#ifdef CONFIG_MCC_DM*/205206#endif207208209