Path: blob/master/ALFA-W1F1/RTL8814AU/hal/phydm/phydm_adaptivity.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 __PHYDMADAPTIVITY_H__26#define __PHYDMADAPTIVITY_H__2728#define ADAPTIVITY_VERSION "9.7.07" /*@20190321 changed by Kevin,29*add 8721D threshold l2h init30*/31#define ADC_BACKOFF 1232#define EDCCA_TH_L2H_LB 4833#define TH_L2H_DIFF_IGI 834#define EDCCA_HL_DIFF_NORMAL 835#define IGI_2_DBM(igi) (igi - 110)36/*@ [PHYDM-337][Old IC] EDCCA TH = IGI + REG setting*/37#define ODM_IC_PWDB_EDCCA (ODM_RTL8188E | ODM_RTL8723B | ODM_RTL8192E |\38ODM_RTL8881A | ODM_RTL8821 | ODM_RTL8812)3940#if (DM_ODM_SUPPORT_TYPE & (ODM_CE | ODM_AP))41#define ADAPT_DC_BACKOFF 242#elif (DM_ODM_SUPPORT_TYPE & ODM_WIN)43#define ADAPT_DC_BACKOFF 444#elif (DM_ODM_SUPPORT_TYPE & ODM_IOT)45#define ADAPT_DC_BACKOFF 046#endif47#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN))48enum phydm_regulation_type {49REGULATION_FCC = 0,50REGULATION_MKK = 1,51REGULATION_ETSI = 2,52REGULATION_WW = 3,53MAX_REGULATION_NUM = 454};55#endif5657enum phydm_edcca_mode {58PHYDM_EDCCA_NORMAL_MODE = 0,59PHYDM_EDCCA_ADAPT_MODE = 160};6162enum phydm_adapinfo {63PHYDM_ADAPINFO_CARRIER_SENSE_ENABLE = 0,64PHYDM_ADAPINFO_TH_L2H_INI,65PHYDM_ADAPINFO_TH_EDCCA_HL_DIFF,66PHYDM_ADAPINFO_AP_NUM_TH,67PHYDM_ADAPINFO_DOMAIN_CODE_2G,68PHYDM_ADAPINFO_DOMAIN_CODE_5G69};7071enum phydm_mac_edcca_type {72PHYDM_IGNORE_EDCCA = 0,73PHYDM_DONT_IGNORE_EDCCA = 174};7576enum phydm_adaptivity_debug_mode {77PHYDM_ADAPT_MSG = 0,78PHYDM_ADAPT_DEBUG = 1,79PHYDM_ADAPT_RESUME = 2,80};8182struct phydm_adaptivity_struct {83boolean mode_cvrt_en;84s8 th_l2h_ini_backup;85s8 th_edcca_hl_diff_backup;86s8 igi_base;87s8 h2l_lb;88s8 l2h_lb;89u8 ap_num_th;90u8 l2h_dyn_min;91u32 adaptivity_dbg_port; /*N:0x208, AC:0x209*/92u8 debug_mode;93u16 igi_up_bound_lmt_cnt; /*@When igi_up_bound_lmt_cnt !=0, limit IGI upper bound to "adapt_igi_up"*/94u16 igi_up_bound_lmt_val; /*@max value of igi_up_bound_lmt_cnt*/95boolean igi_lmt_en;96u8 adapt_igi_up;97u32 rvrt_val[2]; /*@all rvrt_val for pause API must set to u32*/98s8 th_l2h;99s8 th_h2l;100u8 regulation_2g;101u8 regulation_5g;102};103104#ifdef PHYDM_SUPPORT_ADAPTIVITY105void phydm_adaptivity_debug(void *dm_void, char input[][16], u32 *_used,106char *output, u32 *_out_len);107108void phydm_set_edcca_val(void *dm_void, u32 *val_buf, u8 val_len);109#endif110111void phydm_set_edcca_threshold_api(void *dm_void);112113void phydm_adaptivity_info_init(void *dm_void, enum phydm_adapinfo cmn_info,114u32 value);115116void phydm_adaptivity_info_update(void *dm_void, enum phydm_adapinfo cmn_info,117u32 value);118119void phydm_adaptivity_init(void *dm_void);120121void phydm_adaptivity(void *dm_void);122123#endif124125126