Path: blob/master/ALFA-W1F1/RTL8814AU/hal/phydm/phydm_cck_pd.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_CCK_PD_H__26#define __PHYDM_CCK_PD_H__2728#define CCK_PD_VERSION "3.3" /* @ modify invalid type4 API*/2930/*@31* 1 ============================================================32* 1 Definition33* 1 ============================================================34*/35#define CCK_FA_MA_RESET 0xffffffff3637#define INVALID_CS_RATIO_0 27 /* @ only for type4 ICs*/38#define INVALID_CS_RATIO_1 29 /* @ only for type4 ICs*/39#define MAXVALID_CS_RATIO 3140#define MAXVALID_PD_THRES 25541/*@Run time flag of CCK_PD HW type*/42#define CCK_PD_IC_TYPE1 (ODM_RTL8188E | ODM_RTL8812 | ODM_RTL8821 |\43ODM_RTL8192E | ODM_RTL8723B | ODM_RTL8814A |\44ODM_RTL8881A | ODM_RTL8822B | ODM_RTL8703B |\45ODM_RTL8195A | ODM_RTL8188F)4647#define CCK_PD_IC_TYPE2 (ODM_RTL8197F | ODM_RTL8821C | ODM_RTL8723D |\48ODM_RTL8710B | ODM_RTL8195B) /*extend 0xaaa*/4950#define CCK_PD_IC_TYPE3 (ODM_RTL8192F | ODM_RTL8721D | ODM_RTL8710C)51/*@extend for different bw & path*/5253#define CCK_PD_IC_TYPE4 ODM_IC_JGR3_SERIES /*@extend for different bw & path*/5455/*@Compile time flag of CCK_PD HW type*/56#if (RTL8188E_SUPPORT || RTL8812A_SUPPORT || RTL8821A_SUPPORT ||\57RTL8192E_SUPPORT || RTL8723B_SUPPORT || RTL8814A_SUPPORT ||\58RTL8881A_SUPPORT || RTL8822B_SUPPORT || RTL8703B_SUPPORT ||\59RTL8195A_SUPPORT || RTL8188F_SUPPORT)60#define PHYDM_COMPILE_CCKPD_TYPE1 /*@only 0xa0a*/61#endif6263#if (RTL8197F_SUPPORT || RTL8821C_SUPPORT || RTL8723D_SUPPORT ||\64RTL8710B_SUPPORT || RTL8195B_SUPPORT)65#define PHYDM_COMPILE_CCKPD_TYPE2 /*@extend 0xaaa*/66#endif6768#if (RTL8192F_SUPPORT || RTL8721D_SUPPORT || RTL8710C_SUPPORT)69#define PHYDM_COMPILE_CCKPD_TYPE3 /*@extend for different & path*/70#endif7172#ifdef PHYDM_IC_JGR3_SERIES_SUPPORT73#define PHYDM_COMPILE_CCKPD_TYPE4 /*@extend for different bw & path*/74#endif75/*@76* 1 ============================================================77* 1 enumeration78* 1 ============================================================79*/80enum cckpd_lv {81CCK_PD_LV_INIT = 0xff,82CCK_PD_LV_0 = 0,83CCK_PD_LV_1 = 1,84CCK_PD_LV_2 = 2,85CCK_PD_LV_3 = 3,86CCK_PD_LV_4 = 4,87CCK_PD_LV_MAX = 588};8990enum cckpd_mode {91CCK_BW20_1R = 0,92CCK_BW20_2R = 1,93CCK_BW20_3R = 2,94CCK_BW20_4R = 3,95CCK_BW40_1R = 4,96CCK_BW40_2R = 5,97CCK_BW40_3R = 6,98CCK_BW40_4R = 799};100101/*@102* 1 ============================================================103* 1 structure104* 1 ============================================================105*/106107#ifdef PHYDM_SUPPORT_CCKPD108struct phydm_cckpd_struct {109u8 cckpd_hw_type;110u8 cur_cck_cca_thres; /*@current cck_pd value 0xa0a*/111u32 cck_fa_ma;112u32 rvrt_val; /*all rvrt_val for pause API must set to u32*/113u8 pause_lv;114u8 cck_n_rx;115enum channel_width cck_bw;116enum cckpd_lv cck_pd_lv;117#ifdef PHYDM_COMPILE_CCKPD_TYPE2118u8 cck_cca_th_aaa; /*@current cs_ratio value 0xaaa*/119u8 aaa_default; /*@Init cs_ratio value - 0xaaa*/120#endif121#ifdef PHYDM_COMPILE_CCKPD_TYPE3122/*Default value*/123u8 cck_pd_20m_1r;124u8 cck_pd_20m_2r;125u8 cck_pd_40m_1r;126u8 cck_pd_40m_2r;127u8 cck_cs_ratio_20m_1r;128u8 cck_cs_ratio_20m_2r;129u8 cck_cs_ratio_40m_1r;130u8 cck_cs_ratio_40m_2r;131/*Current value*/132u8 cur_cck_pd_20m_1r;133u8 cur_cck_pd_20m_2r;134u8 cur_cck_pd_40m_1r;135u8 cur_cck_pd_40m_2r;136u8 cur_cck_cs_ratio_20m_1r;137u8 cur_cck_cs_ratio_20m_2r;138u8 cur_cck_cs_ratio_40m_1r;139u8 cur_cck_cs_ratio_40m_2r;140#endif141#ifdef PHYDM_COMPILE_CCKPD_TYPE4142/*@[bw][nrx][0:PD/1:CS][lv]*/143u8 cck_pd_table_jgr3[2][4][2][CCK_PD_LV_MAX];144#endif145};146#endif147148/*@149* 1 ============================================================150* 1 function prototype151* 1 ============================================================152*/153void phydm_set_cckpd_val(void *dm_void, u32 *val_buf, u8 val_len);154155void phydm_cck_pd_th(void *dm_void);156157void phydm_cck_pd_init(void *dm_void);158#endif159160161