Path: blob/master/ALFA-W1F1/RTL8814AU/hal/phydm/phydm_hwconfig.c
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/*@************************************************************26* include files27************************************************************/2829#include "mp_precomp.h"30#include "phydm_precomp.h"3132#define READ_AND_CONFIG_MP(ic, txt) (odm_read_and_config_mp_##ic##txt(dm))33#define READ_AND_CONFIG_TC(ic, txt) (odm_read_and_config_tc_##ic##txt(dm))3435#if (PHYDM_TESTCHIP_SUPPORT == 1)36#define READ_AND_CONFIG(ic, txt) \37do { \38if (dm->is_mp_chip) \39READ_AND_CONFIG_MP(ic, txt); \40else \41READ_AND_CONFIG_TC(ic, txt); \42} while (0)43#else44#define READ_AND_CONFIG READ_AND_CONFIG_MP45#endif4647#define GET_VERSION_MP(ic, txt) (odm_get_version_mp_##ic##txt())48#define GET_VERSION_TC(ic, txt) (odm_get_version_tc_##ic##txt())4950#if (PHYDM_TESTCHIP_SUPPORT == 1)51#define GET_VERSION(ic, txt) (dm->is_mp_chip ? GET_VERSION_MP(ic, txt) : GET_VERSION_TC(ic, txt))52#else53#define GET_VERSION(ic, txt) GET_VERSION_MP(ic, txt)54#endif5556enum hal_status57odm_config_rf_with_header_file(struct dm_struct *dm,58enum odm_rf_config_type config_type,59u8 e_rf_path)60{61#if (DM_ODM_SUPPORT_TYPE & ODM_WIN)62void *adapter = dm->adapter;63PMGNT_INFO mgnt_info = &((PADAPTER)adapter)->MgntInfo;64#endif65enum hal_status result = HAL_STATUS_SUCCESS;6667PHYDM_DBG(dm, ODM_COMP_INIT, "===>%s (%s)\n", __func__,68(dm->is_mp_chip) ? "MPChip" : "TestChip");69PHYDM_DBG(dm, ODM_COMP_INIT,70"support_platform: 0x%X, support_interface: 0x%X, board_type: 0x%X\n",71dm->support_platform, dm->support_interface, dm->board_type);7273/* @1 AP doesn't use PHYDM power tracking table in these ICs */74#if (DM_ODM_SUPPORT_TYPE != ODM_AP)75#if (RTL8812A_SUPPORT == 1)76if (dm->support_ic_type == ODM_RTL8812) {77if (config_type == CONFIG_RF_RADIO) {78if (e_rf_path == RF_PATH_A)79READ_AND_CONFIG_MP(8812a, _radioa);80else if (e_rf_path == RF_PATH_B)81READ_AND_CONFIG_MP(8812a, _radiob);82} else if (config_type == CONFIG_RF_TXPWR_LMT) {83#if (DM_ODM_SUPPORT_TYPE & ODM_WIN) && (DEV_BUS_TYPE == RT_PCI_INTERFACE)84HAL_DATA_TYPE * hal_data = GET_HAL_DATA(((PADAPTER)adapter));85if ((hal_data->EEPROMSVID == 0x17AA && hal_data->EEPROMSMID == 0xA811) ||86(hal_data->EEPROMSVID == 0x10EC && hal_data->EEPROMSMID == 0xA812) ||87(hal_data->EEPROMSVID == 0x10EC && hal_data->EEPROMSMID == 0x8812))88READ_AND_CONFIG_MP(8812a, _txpwr_lmt_hm812a03);89else90#endif91READ_AND_CONFIG_MP(8812a, _txpwr_lmt);92}93}94#endif95#if (RTL8821A_SUPPORT == 1)96if (dm->support_ic_type == ODM_RTL8821) {97if (config_type == CONFIG_RF_RADIO) {98if (e_rf_path == RF_PATH_A)99READ_AND_CONFIG_MP(8821a, _radioa);100} else if (config_type == CONFIG_RF_TXPWR_LMT) {101if (dm->support_interface == ODM_ITRF_USB) {102if (dm->ext_pa_5g || dm->ext_lna_5g)103READ_AND_CONFIG_MP(8821a, _txpwr_lmt_8811a_u_fem);104else105READ_AND_CONFIG_MP(8821a, _txpwr_lmt_8811a_u_ipa);106} else {107#if (DM_ODM_SUPPORT_TYPE & ODM_WIN)108if (mgnt_info->CustomerID == RT_CID_8821AE_ASUS_MB)109READ_AND_CONFIG_MP(8821a, _txpwr_lmt_8821a_sar_8mm);110else if (mgnt_info->CustomerID == RT_CID_ASUS_NB)111READ_AND_CONFIG_MP(8821a, _txpwr_lmt_8821a_sar_5mm);112else113#endif114READ_AND_CONFIG_MP(8821a, _txpwr_lmt_8821a);115}116}117}118#endif119#if (RTL8192E_SUPPORT == 1)120if (dm->support_ic_type == ODM_RTL8192E) {121if (config_type == CONFIG_RF_RADIO) {122if (e_rf_path == RF_PATH_A)123READ_AND_CONFIG_MP(8192e, _radioa);124else if (e_rf_path == RF_PATH_B)125READ_AND_CONFIG_MP(8192e, _radiob);126} else if (config_type == CONFIG_RF_TXPWR_LMT) {127#if (DM_ODM_SUPPORT_TYPE & ODM_WIN) && (DEV_BUS_TYPE == RT_PCI_INTERFACE) /*Refine by Vincent Lan for 5mm SAR pwr limit*/128HAL_DATA_TYPE * hal_data = GET_HAL_DATA(((PADAPTER)adapter));129130if ((hal_data->EEPROMSVID == 0x11AD && hal_data->EEPROMSMID == 0x8192) ||131(hal_data->EEPROMSVID == 0x11AD && hal_data->EEPROMSMID == 0x8193))132READ_AND_CONFIG_MP(8192e, _txpwr_lmt_8192e_sar_5mm);133else134#endif135READ_AND_CONFIG_MP(8192e, _txpwr_lmt);136}137}138#endif139#if (RTL8723D_SUPPORT == 1)140if (dm->support_ic_type == ODM_RTL8723D) {141if (config_type == CONFIG_RF_RADIO) {142if (e_rf_path == RF_PATH_A)143READ_AND_CONFIG_MP(8723d, _radioa);144} else if (config_type == CONFIG_RF_TXPWR_LMT) {145READ_AND_CONFIG_MP(8723d, _txpwr_lmt);146}147}148#endif149/* @JJ ADD 20161014 */150#if (RTL8710B_SUPPORT == 1)151if (dm->support_ic_type == ODM_RTL8710B) {152if (config_type == CONFIG_RF_RADIO) {153if (e_rf_path == RF_PATH_A)154READ_AND_CONFIG_MP(8710b, _radioa);155} else if (config_type == CONFIG_RF_TXPWR_LMT)156READ_AND_CONFIG_MP(8710b, _txpwr_lmt);157}158#endif159160#endif /* @(DM_ODM_SUPPORT_TYPE != ODM_AP) */161/* @1 All platforms support */162#if (RTL8188E_SUPPORT == 1)163if (dm->support_ic_type == ODM_RTL8188E) {164if (config_type == CONFIG_RF_RADIO) {165if (e_rf_path == RF_PATH_A)166READ_AND_CONFIG_MP(8188e, _radioa);167} else if (config_type == CONFIG_RF_TXPWR_LMT)168READ_AND_CONFIG_MP(8188e, _txpwr_lmt);169}170#endif171#if (RTL8723B_SUPPORT == 1)172if (dm->support_ic_type == ODM_RTL8723B) {173if (config_type == CONFIG_RF_RADIO)174READ_AND_CONFIG_MP(8723b, _radioa);175else if (config_type == CONFIG_RF_TXPWR_LMT)176READ_AND_CONFIG_MP(8723b, _txpwr_lmt);177}178#endif179#if (RTL8814A_SUPPORT == 1)180if (dm->support_ic_type == ODM_RTL8814A) {181if (config_type == CONFIG_RF_RADIO) {182if (e_rf_path == RF_PATH_A)183READ_AND_CONFIG_MP(8814a, _radioa);184else if (e_rf_path == RF_PATH_B)185READ_AND_CONFIG_MP(8814a, _radiob);186else if (e_rf_path == RF_PATH_C)187READ_AND_CONFIG_MP(8814a, _radioc);188else if (e_rf_path == RF_PATH_D)189READ_AND_CONFIG_MP(8814a, _radiod);190} else if (config_type == CONFIG_RF_TXPWR_LMT) {191if (dm->rfe_type == 0)192READ_AND_CONFIG_MP(8814a, _txpwr_lmt_type0);193else if (dm->rfe_type == 1)194READ_AND_CONFIG_MP(8814a, _txpwr_lmt_type1);195else if (dm->rfe_type == 2)196READ_AND_CONFIG_MP(8814a, _txpwr_lmt_type2);197else if (dm->rfe_type == 3)198READ_AND_CONFIG_MP(8814a, _txpwr_lmt_type3);199else if (dm->rfe_type == 5)200READ_AND_CONFIG_MP(8814a, _txpwr_lmt_type5);201else if (dm->rfe_type == 7)202READ_AND_CONFIG_MP(8814a, _txpwr_lmt_type7);203else if (dm->rfe_type == 8)204READ_AND_CONFIG_MP(8814a, _txpwr_lmt_type8);205else206READ_AND_CONFIG_MP(8814a, _txpwr_lmt);207}208}209#endif210#if (RTL8703B_SUPPORT == 1)211if (dm->support_ic_type == ODM_RTL8703B) {212if (config_type == CONFIG_RF_RADIO) {213if (e_rf_path == RF_PATH_A)214READ_AND_CONFIG_MP(8703b, _radioa);215}216}217#endif218#if (RTL8188F_SUPPORT == 1)219if (dm->support_ic_type == ODM_RTL8188F) {220if (config_type == CONFIG_RF_RADIO) {221if (e_rf_path == RF_PATH_A)222READ_AND_CONFIG_MP(8188f, _radioa);223} else if (config_type == CONFIG_RF_TXPWR_LMT)224READ_AND_CONFIG_MP(8188f, _txpwr_lmt);225}226#endif227#if (RTL8822B_SUPPORT == 1)228if (dm->support_ic_type == ODM_RTL8822B) {229if (config_type == CONFIG_RF_RADIO) {230if (e_rf_path == RF_PATH_A)231READ_AND_CONFIG_MP(8822b, _radioa);232else if (e_rf_path == RF_PATH_B)233READ_AND_CONFIG_MP(8822b, _radiob);234} else if (config_type == CONFIG_RF_TXPWR_LMT) {235if (dm->rfe_type == 5)236READ_AND_CONFIG_MP(8822b, _txpwr_lmt_type5);237else if (dm->rfe_type == 2)238READ_AND_CONFIG_MP(8822b, _txpwr_lmt_type2);239else if (dm->rfe_type == 3)240READ_AND_CONFIG_MP(8822b, _txpwr_lmt_type3);241else if (dm->rfe_type == 4)242READ_AND_CONFIG_MP(8822b, _txpwr_lmt_type4);243else if (dm->rfe_type == 12)244READ_AND_CONFIG_MP(8822b, _txpwr_lmt_type12);245else if (dm->rfe_type == 15)246READ_AND_CONFIG_MP(8822b, _txpwr_lmt_type15);247else if (dm->rfe_type == 16)248READ_AND_CONFIG_MP(8822b, _txpwr_lmt_type16);249else if (dm->rfe_type == 17)250READ_AND_CONFIG_MP(8822b, _txpwr_lmt_type17);251else if (dm->rfe_type == 18)252READ_AND_CONFIG_MP(8822b, _txpwr_lmt_type18);253else254READ_AND_CONFIG_MP(8822b, _txpwr_lmt);255}256}257#endif258259#if (RTL8197F_SUPPORT == 1)260if (dm->support_ic_type == ODM_RTL8197F) {261if (config_type == CONFIG_RF_RADIO) {262if (e_rf_path == RF_PATH_A)263READ_AND_CONFIG_MP(8197f, _radioa);264else if (e_rf_path == RF_PATH_B)265READ_AND_CONFIG_MP(8197f, _radiob);266}267}268#endif269/*@jj add 20170822*/270#if (RTL8192F_SUPPORT == 1)271if (dm->support_ic_type == ODM_RTL8192F) {272if (config_type == CONFIG_RF_RADIO) {273if (e_rf_path == RF_PATH_A)274READ_AND_CONFIG_MP(8192f, _radioa);275else if (e_rf_path == RF_PATH_B)276READ_AND_CONFIG_MP(8192f, _radiob);277} else if (config_type == CONFIG_RF_TXPWR_LMT) {278if (dm->rfe_type == 0)279READ_AND_CONFIG_MP(8192f, _txpwr_lmt_type0);280else if (dm->rfe_type == 1)281READ_AND_CONFIG_MP(8192f, _txpwr_lmt_type1);282else if (dm->rfe_type == 2)283READ_AND_CONFIG_MP(8192f, _txpwr_lmt_type2);284else if (dm->rfe_type == 3)285READ_AND_CONFIG_MP(8192f, _txpwr_lmt_type3);286else if (dm->rfe_type == 4)287READ_AND_CONFIG_MP(8192f, _txpwr_lmt_type4);288else if (dm->rfe_type == 5)289READ_AND_CONFIG_MP(8192f, _txpwr_lmt_type5);290else if (dm->rfe_type == 6)291READ_AND_CONFIG_MP(8192f, _txpwr_lmt_type6);292else if (dm->rfe_type == 7)293READ_AND_CONFIG_MP(8192f, _txpwr_lmt_type7);294else if (dm->rfe_type == 8)295READ_AND_CONFIG_MP(8192f, _txpwr_lmt_type8);296else if (dm->rfe_type == 9)297READ_AND_CONFIG_MP(8192f, _txpwr_lmt_type9);298else if (dm->rfe_type == 10)299READ_AND_CONFIG_MP(8192f, _txpwr_lmt_type10);300else if (dm->rfe_type == 11)301READ_AND_CONFIG_MP(8192f, _txpwr_lmt_type11);302else if (dm->rfe_type == 12)303READ_AND_CONFIG_MP(8192f, _txpwr_lmt_type12);304else if (dm->rfe_type == 13)305READ_AND_CONFIG_MP(8192f, _txpwr_lmt_type13);306else if (dm->rfe_type == 14)307READ_AND_CONFIG_MP(8192f, _txpwr_lmt_type14);308else if (dm->rfe_type == 15)309READ_AND_CONFIG_MP(8192f, _txpwr_lmt_type15);310else if (dm->rfe_type == 16)311READ_AND_CONFIG_MP(8192f, _txpwr_lmt_type16);312else if (dm->rfe_type == 17)313READ_AND_CONFIG_MP(8192f, _txpwr_lmt_type17);314else if (dm->rfe_type == 18)315READ_AND_CONFIG_MP(8192f, _txpwr_lmt_type18);316else if (dm->rfe_type == 19)317READ_AND_CONFIG_MP(8192f, _txpwr_lmt_type19);318else if (dm->rfe_type == 20)319READ_AND_CONFIG_MP(8192f, _txpwr_lmt_type20);320else if (dm->rfe_type == 21)321READ_AND_CONFIG_MP(8192f, _txpwr_lmt_type21);322else if (dm->rfe_type == 22)323READ_AND_CONFIG_MP(8192f, _txpwr_lmt_type22);324else if (dm->rfe_type == 23)325READ_AND_CONFIG_MP(8192f, _txpwr_lmt_type23);326else if (dm->rfe_type == 24)327READ_AND_CONFIG_MP(8192f, _txpwr_lmt_type24);328else if (dm->rfe_type == 25)329READ_AND_CONFIG_MP(8192f, _txpwr_lmt_type25);330else if (dm->rfe_type == 26)331READ_AND_CONFIG_MP(8192f, _txpwr_lmt_type26);332else if (dm->rfe_type == 27)333READ_AND_CONFIG_MP(8192f, _txpwr_lmt_type27);334else if (dm->rfe_type == 28)335READ_AND_CONFIG_MP(8192f, _txpwr_lmt_type28);336else if (dm->rfe_type == 29)337READ_AND_CONFIG_MP(8192f, _txpwr_lmt_type29);338else if (dm->rfe_type == 30)339READ_AND_CONFIG_MP(8192f, _txpwr_lmt_type30);340else if (dm->rfe_type == 31)341READ_AND_CONFIG_MP(8192f, _txpwr_lmt_type31);342else343READ_AND_CONFIG_MP(8192f, _txpwr_lmt);344}345}346#endif347#if (RTL8721D_SUPPORT == 1)348if (dm->support_ic_type == ODM_RTL8721D) {349if (config_type == CONFIG_RF_RADIO) {350if (e_rf_path == RF_PATH_A)351READ_AND_CONFIG_MP(8721d, _radioa);352} else if (config_type == CONFIG_RF_TXPWR_LMT) {353if (dm->power_voltage == ODM_POWER_18V)354READ_AND_CONFIG_MP(8721d, _txpwr_lmt_type0);355else356READ_AND_CONFIG_MP(8721d, _txpwr_lmt_type1);357}358}359#endif360361#if (RTL8710C_SUPPORT == 1)362if (dm->support_ic_type == ODM_RTL8710C) {363if (config_type == CONFIG_RF_RADIO) {364if (e_rf_path == RF_PATH_A)365READ_AND_CONFIG_MP(8710c, _radioa);366} else if (config_type == CONFIG_RF_TXPWR_LMT)367READ_AND_CONFIG_MP(8710c, _txpwr_lmt);368}369#endif370371#if (RTL8821C_SUPPORT == 1)372if (dm->support_ic_type == ODM_RTL8821C) {373if (config_type == CONFIG_RF_RADIO) {374if (e_rf_path == RF_PATH_A)375READ_AND_CONFIG(8821c, _radioa);376} else if (config_type == CONFIG_RF_TXPWR_LMT) {377READ_AND_CONFIG(8821c, _txpwr_lmt);378}379}380#endif381#if (RTL8195B_SUPPORT == 1)382if (dm->support_ic_type == ODM_RTL8195B) {383if (config_type == CONFIG_RF_RADIO) {384if (e_rf_path == RF_PATH_A)385READ_AND_CONFIG(8195b, _radioa);386} else if (config_type == CONFIG_RF_TXPWR_LMT) {387READ_AND_CONFIG(8195b, _txpwr_lmt);388}389}390#endif391#if (RTL8198F_SUPPORT == 1)392if (dm->support_ic_type == ODM_RTL8198F) {393if (config_type == CONFIG_RF_RADIO) {394if (e_rf_path == RF_PATH_A)395READ_AND_CONFIG_MP(8198f, _radioa);396else if (e_rf_path == RF_PATH_B)397READ_AND_CONFIG_MP(8198f, _radiob);398else if (e_rf_path == RF_PATH_C)399READ_AND_CONFIG_MP(8198f, _radioc);400else if (e_rf_path == RF_PATH_D)401READ_AND_CONFIG_MP(8198f, _radiod);402}403}404#endif405/*#if (RTL8814B_SUPPORT == 1)406if (dm->support_ic_type == ODM_RTL8814B) {407if (config_type == CONFIG_RF_RADIO) {408if (e_rf_path == RF_PATH_A)409READ_AND_CONFIG_MP(8814b, _radioa);410else if (e_rf_path == RF_PATH_B)411READ_AND_CONFIG_MP(8814b, _radiob);412else if (e_rf_path == RF_PATH_C)413READ_AND_CONFIG_MP(8814b, _radioc);414else if (e_rf_path == RF_PATH_D)415READ_AND_CONFIG_MP(8814b, _radiod);416}417}418#endif419*/420#if (RTL8822C_SUPPORT)421if (dm->support_ic_type == ODM_RTL8822C) {422if (config_type == CONFIG_RF_RADIO) {423if (e_rf_path == RF_PATH_A)424READ_AND_CONFIG_MP(8822c, _radioa);425else if (e_rf_path == RF_PATH_B)426READ_AND_CONFIG_MP(8822c, _radiob);427} else if (config_type == CONFIG_RF_TXPWR_LMT) {428READ_AND_CONFIG_MP(8822c, _txpwr_lmt);429}430}431#endif432#if (RTL8812F_SUPPORT)433if (dm->support_ic_type == ODM_RTL8812F) {434if (config_type == CONFIG_RF_RADIO) {435if (e_rf_path == RF_PATH_A)436READ_AND_CONFIG_MP(8812f, _radioa);437else if (e_rf_path == RF_PATH_B)438READ_AND_CONFIG_MP(8812f, _radiob);439}440}441#endif442#if (RTL8197G_SUPPORT)443if (dm->support_ic_type == ODM_RTL8197G) {444if (config_type == CONFIG_RF_RADIO) {445if (e_rf_path == RF_PATH_A)446READ_AND_CONFIG_MP(8197g, _radioa);447else if (e_rf_path == RF_PATH_B)448READ_AND_CONFIG_MP(8197g, _radiob);449}450}451#endif452453/*8814B need review, when phydm has related files*/454#if (RTL8814B_SUPPORT)455if (dm->support_ic_type == ODM_RTL8814B) {456if (config_type == CONFIG_RF_RADIO) {457if (e_rf_path == RF_PATH_A)458READ_AND_CONFIG_MP(8814b, _radioa);459else if (e_rf_path == RF_PATH_B)460READ_AND_CONFIG_MP(8814b, _radiob);461else if (e_rf_path == RF_PATH_C)462READ_AND_CONFIG_MP(8814b, _radioc);463else if (e_rf_path == RF_PATH_D)464READ_AND_CONFIG_MP(8814b, _radiod);465}466if (config_type == CONFIG_RF_SYN_RADIO) {467if (e_rf_path == RF_SYN0)468READ_AND_CONFIG_MP(8814b, _radiosyn0);469else if (e_rf_path == RF_SYN1)470READ_AND_CONFIG_MP(8814b, _radiosyn1);471} else if (config_type == CONFIG_RF_TXPWR_LMT) {472READ_AND_CONFIG_MP(8814b, _txpwr_lmt);473}474}475#endif476477if (config_type == CONFIG_RF_RADIO) {478if (dm->fw_offload_ability & PHYDM_PHY_PARAM_OFFLOAD) {479result = phydm_set_reg_by_fw(dm,480PHYDM_HALMAC_CMD_END,4810,4820,4830,484(enum rf_path)0,4850);486PHYDM_DBG(dm, ODM_COMP_INIT,487"rf param offload end!result = %d", result);488}489}490491return result;492}493494enum hal_status495odm_config_rf_with_tx_pwr_track_header_file(struct dm_struct *dm)496{497PHYDM_DBG(dm, ODM_COMP_INIT, "===>%s (%s)\n", __func__,498(dm->is_mp_chip) ? "MPChip" : "TestChip");499PHYDM_DBG(dm, ODM_COMP_INIT,500"support_platform: 0x%X, support_interface: 0x%X, board_type: 0x%X\n",501dm->support_platform, dm->support_interface, dm->board_type);502503/* @1 AP doesn't use PHYDM power tracking table in these ICs */504#if (DM_ODM_SUPPORT_TYPE != ODM_AP)505#if RTL8821A_SUPPORT506if (dm->support_ic_type == ODM_RTL8821) {507if (dm->support_interface == ODM_ITRF_PCIE)508READ_AND_CONFIG_MP(8821a, _txpowertrack_pcie);509else if (dm->support_interface == ODM_ITRF_USB)510READ_AND_CONFIG_MP(8821a, _txpowertrack_usb);511else if (dm->support_interface == ODM_ITRF_SDIO)512READ_AND_CONFIG_MP(8821a, _txpowertrack_sdio);513}514#endif515#if RTL8812A_SUPPORT516if (dm->support_ic_type == ODM_RTL8812) {517if (dm->support_interface == ODM_ITRF_PCIE)518READ_AND_CONFIG_MP(8812a, _txpowertrack_pcie);519else if (dm->support_interface == ODM_ITRF_USB) {520if (dm->rfe_type == 3 && dm->is_mp_chip)521READ_AND_CONFIG_MP(8812a, _txpowertrack_rfe3);522else523READ_AND_CONFIG_MP(8812a, _txpowertrack_usb);524}525}526#endif527#if RTL8192E_SUPPORT528if (dm->support_ic_type == ODM_RTL8192E) {529if (dm->support_interface == ODM_ITRF_PCIE)530READ_AND_CONFIG_MP(8192e, _txpowertrack_pcie);531else if (dm->support_interface == ODM_ITRF_USB)532READ_AND_CONFIG_MP(8192e, _txpowertrack_usb);533else if (dm->support_interface == ODM_ITRF_SDIO)534READ_AND_CONFIG_MP(8192e, _txpowertrack_sdio);535}536#endif537#if RTL8723D_SUPPORT538if (dm->support_ic_type == ODM_RTL8723D) {539if (dm->support_interface == ODM_ITRF_PCIE)540READ_AND_CONFIG_MP(8723d, _txpowertrack_pcie);541else if (dm->support_interface == ODM_ITRF_USB)542READ_AND_CONFIG_MP(8723d, _txpowertrack_usb);543else if (dm->support_interface == ODM_ITRF_SDIO)544READ_AND_CONFIG_MP(8723d, _txpowertrack_sdio);545546READ_AND_CONFIG_MP(8723d, _txxtaltrack);547}548#endif549/* @JJ ADD 20161014 */550#if RTL8710B_SUPPORT551if (dm->support_ic_type == ODM_RTL8710B) {552if (dm->package_type == 1)553READ_AND_CONFIG_MP(8710b, _txpowertrack_qfn48m_smic);554else if (dm->package_type == 5)555READ_AND_CONFIG_MP(8710b, _txpowertrack_qfn48m_umc);556557READ_AND_CONFIG_MP(8710b, _txxtaltrack);558}559#endif560#if RTL8188E_SUPPORT561if (dm->support_ic_type == ODM_RTL8188E) {562if (odm_get_mac_reg(dm, R_0xf0, 0xF000) >= 8) { /*@if 0xF0[15:12] >= 8, SMIC*/563if (dm->support_interface == ODM_ITRF_PCIE)564READ_AND_CONFIG_MP(8188e, _txpowertrack_pcie_icut);565else if (dm->support_interface == ODM_ITRF_USB)566READ_AND_CONFIG_MP(8188e, _txpowertrack_usb_icut);567else if (dm->support_interface == ODM_ITRF_SDIO)568READ_AND_CONFIG_MP(8188e, _txpowertrack_sdio_icut);569} else { /*@else 0xF0[15:12] < 8, TSMC*/570if (dm->support_interface == ODM_ITRF_PCIE)571READ_AND_CONFIG_MP(8188e, _txpowertrack_pcie);572else if (dm->support_interface == ODM_ITRF_USB)573READ_AND_CONFIG_MP(8188e, _txpowertrack_usb);574else if (dm->support_interface == ODM_ITRF_SDIO)575READ_AND_CONFIG_MP(8188e, _txpowertrack_sdio);576}577}578#endif579#endif /* @(DM_ODM_SUPPORT_TYPE != ODM_AP) */580/* @1 All platforms support */581#if RTL8723B_SUPPORT582if (dm->support_ic_type == ODM_RTL8723B) {583if (dm->support_interface == ODM_ITRF_PCIE)584READ_AND_CONFIG_MP(8723b, _txpowertrack_pcie);585else if (dm->support_interface == ODM_ITRF_USB)586READ_AND_CONFIG_MP(8723b, _txpowertrack_usb);587else if (dm->support_interface == ODM_ITRF_SDIO)588READ_AND_CONFIG_MP(8723b, _txpowertrack_sdio);589}590#endif591#if RTL8814A_SUPPORT592if (dm->support_ic_type == ODM_RTL8814A) {593if (dm->rfe_type == 0)594READ_AND_CONFIG_MP(8814a, _txpowertrack_type0);595else if (dm->rfe_type == 2)596READ_AND_CONFIG_MP(8814a, _txpowertrack_type2);597else if (dm->rfe_type == 5)598READ_AND_CONFIG_MP(8814a, _txpowertrack_type5);599else if (dm->rfe_type == 7)600READ_AND_CONFIG_MP(8814a, _txpowertrack_type7);601else if (dm->rfe_type == 8)602READ_AND_CONFIG_MP(8814a, _txpowertrack_type8);603else604READ_AND_CONFIG_MP(8814a, _txpowertrack);605606READ_AND_CONFIG_MP(8814a, _txpowertssi);607}608#endif609#if RTL8703B_SUPPORT610if (dm->support_ic_type == ODM_RTL8703B) {611if (dm->support_interface == ODM_ITRF_USB)612READ_AND_CONFIG_MP(8703b, _txpowertrack_usb);613else if (dm->support_interface == ODM_ITRF_SDIO)614READ_AND_CONFIG_MP(8703b, _txpowertrack_sdio);615616READ_AND_CONFIG_MP(8703b, _txxtaltrack);617}618#endif619#if RTL8188F_SUPPORT620if (dm->support_ic_type == ODM_RTL8188F) {621if (dm->support_interface == ODM_ITRF_USB)622READ_AND_CONFIG_MP(8188f, _txpowertrack_usb);623else if (dm->support_interface == ODM_ITRF_SDIO)624READ_AND_CONFIG_MP(8188f, _txpowertrack_sdio);625}626#endif627#if RTL8822B_SUPPORT628if (dm->support_ic_type == ODM_RTL8822B) {629if (dm->rfe_type == 0)630READ_AND_CONFIG_MP(8822b, _txpowertrack_type0);631else if (dm->rfe_type == 1)632READ_AND_CONFIG_MP(8822b, _txpowertrack_type1);633else if (dm->rfe_type == 2)634READ_AND_CONFIG_MP(8822b, _txpowertrack_type2);635else if ((dm->rfe_type == 3) || (dm->rfe_type == 5))636READ_AND_CONFIG_MP(8822b, _txpowertrack_type3_type5);637else if (dm->rfe_type == 4)638READ_AND_CONFIG_MP(8822b, _txpowertrack_type4);639else if (dm->rfe_type == 6)640READ_AND_CONFIG_MP(8822b, _txpowertrack_type6);641else if (dm->rfe_type == 7)642READ_AND_CONFIG_MP(8822b, _txpowertrack_type7);643else if (dm->rfe_type == 8)644READ_AND_CONFIG_MP(8822b, _txpowertrack_type8);645else if (dm->rfe_type == 9)646READ_AND_CONFIG_MP(8822b, _txpowertrack_type9);647else if (dm->rfe_type == 10)648READ_AND_CONFIG_MP(8822b, _txpowertrack_type10);649else if (dm->rfe_type == 11)650READ_AND_CONFIG_MP(8822b, _txpowertrack_type11);651else if (dm->rfe_type == 12)652READ_AND_CONFIG_MP(8822b, _txpowertrack_type12);653else if (dm->rfe_type == 13)654READ_AND_CONFIG_MP(8822b, _txpowertrack_type13);655else if (dm->rfe_type == 14)656READ_AND_CONFIG_MP(8822b, _txpowertrack_type14);657else if (dm->rfe_type == 15)658READ_AND_CONFIG_MP(8822b, _txpowertrack_type15);659else if (dm->rfe_type == 16)660READ_AND_CONFIG_MP(8822b, _txpowertrack_type16);661else if (dm->rfe_type == 17)662READ_AND_CONFIG_MP(8822b, _txpowertrack_type17);663else if (dm->rfe_type == 18)664READ_AND_CONFIG_MP(8822b, _txpowertrack_type18);665else666READ_AND_CONFIG_MP(8822b, _txpowertrack);667}668#endif669#if RTL8197F_SUPPORT670if (dm->support_ic_type == ODM_RTL8197F) {671if (dm->rfe_type == 0)672READ_AND_CONFIG_MP(8197f, _txpowertrack_type0);673else if (dm->rfe_type == 1)674READ_AND_CONFIG_MP(8197f, _txpowertrack_type1);675else676READ_AND_CONFIG_MP(8197f, _txpowertrack);677}678#endif679/*@jj add 20170822*/680#if RTL8192F_SUPPORT681if (dm->support_ic_type == ODM_RTL8192F) {682if (dm->rfe_type == 0)683READ_AND_CONFIG_MP(8192f, _txpowertrack_type0);684else if (dm->rfe_type == 1)685READ_AND_CONFIG_MP(8192f, _txpowertrack_type1);686else if (dm->rfe_type == 2)687READ_AND_CONFIG_MP(8192f, _txpowertrack_type2);688else if (dm->rfe_type == 3)689READ_AND_CONFIG_MP(8192f, _txpowertrack_type3);690else if (dm->rfe_type == 4)691READ_AND_CONFIG_MP(8192f, _txpowertrack_type4);692else if (dm->rfe_type == 5)693READ_AND_CONFIG_MP(8192f, _txpowertrack_type5);694else if (dm->rfe_type == 6)695READ_AND_CONFIG_MP(8192f, _txpowertrack_type6);696else if (dm->rfe_type == 7)697READ_AND_CONFIG_MP(8192f, _txpowertrack_type7);698else if (dm->rfe_type == 8)699READ_AND_CONFIG_MP(8192f, _txpowertrack_type8);700else if (dm->rfe_type == 9)701READ_AND_CONFIG_MP(8192f, _txpowertrack_type9);702else if (dm->rfe_type == 10)703READ_AND_CONFIG_MP(8192f, _txpowertrack_type10);704else if (dm->rfe_type == 11)705READ_AND_CONFIG_MP(8192f, _txpowertrack_type11);706else if (dm->rfe_type == 12)707READ_AND_CONFIG_MP(8192f, _txpowertrack_type12);708else if (dm->rfe_type == 13)709READ_AND_CONFIG_MP(8192f, _txpowertrack_type13);710else if (dm->rfe_type == 14)711READ_AND_CONFIG_MP(8192f, _txpowertrack_type14);712else if (dm->rfe_type == 15)713READ_AND_CONFIG_MP(8192f, _txpowertrack_type15);714else if (dm->rfe_type == 16)715READ_AND_CONFIG_MP(8192f, _txpowertrack_type16);716else if (dm->rfe_type == 17)717READ_AND_CONFIG_MP(8192f, _txpowertrack_type17);718else if (dm->rfe_type == 18)719READ_AND_CONFIG_MP(8192f, _txpowertrack_type18);720else if (dm->rfe_type == 19)721READ_AND_CONFIG_MP(8192f, _txpowertrack_type19);722else if (dm->rfe_type == 20)723READ_AND_CONFIG_MP(8192f, _txpowertrack_type20);724else if (dm->rfe_type == 21)725READ_AND_CONFIG_MP(8192f, _txpowertrack_type21);726else if (dm->rfe_type == 22)727READ_AND_CONFIG_MP(8192f, _txpowertrack_type22);728else if (dm->rfe_type == 23)729READ_AND_CONFIG_MP(8192f, _txpowertrack_type23);730else if (dm->rfe_type == 24)731READ_AND_CONFIG_MP(8192f, _txpowertrack_type24);732else if (dm->rfe_type == 25)733READ_AND_CONFIG_MP(8192f, _txpowertrack_type25);734else if (dm->rfe_type == 26)735READ_AND_CONFIG_MP(8192f, _txpowertrack_type26);736else if (dm->rfe_type == 27)737READ_AND_CONFIG_MP(8192f, _txpowertrack_type27);738else if (dm->rfe_type == 28)739READ_AND_CONFIG_MP(8192f, _txpowertrack_type28);740else if (dm->rfe_type == 29)741READ_AND_CONFIG_MP(8192f, _txpowertrack_type29);742else if (dm->rfe_type == 30)743READ_AND_CONFIG_MP(8192f, _txpowertrack_type30);744else if (dm->rfe_type == 31)745READ_AND_CONFIG_MP(8192f, _txpowertrack_type31);746else747READ_AND_CONFIG_MP(8192f, _txpowertrack);748749READ_AND_CONFIG_MP(8192f, _txxtaltrack);750}751#endif752753#if RTL8721D_SUPPORT754if (dm->support_ic_type == ODM_RTL8721D) {755#if 0756if (dm->package_type == 1)757READ_AND_CONFIG_MP(8721d, _txpowertrack_qfn48m_smic);758else if (dm->package_type == 5)759READ_AND_CONFIG_MP(8721d, _txpowertrack_qfn48m_umc);760#endif761READ_AND_CONFIG_MP(8721d, _txpowertrack);762READ_AND_CONFIG_MP(8721d, _txxtaltrack);763}764#endif765766#if RTL8710C_SUPPORT767if (dm->support_ic_type == ODM_RTL8710C) {768#if 0769if (dm->package_type == 1)770READ_AND_CONFIG_MP(8710c, _txpowertrack_qfn48m_smic);771else if (dm->package_type == 5)772READ_AND_CONFIG_MP(8710c, _txpowertrack_qfn48m_umc);773#endif774READ_AND_CONFIG_MP(8710c, _txpowertrack);775READ_AND_CONFIG_MP(8710c, _txxtaltrack);776}777#endif778779#if RTL8821C_SUPPORT780if (dm->support_ic_type == ODM_RTL8821C) {781if (dm->rfe_type == 0x5)782READ_AND_CONFIG(8821c, _txpowertrack_type0x28);783else if (dm->rfe_type == 0x4)784READ_AND_CONFIG(8821c, _txpowertrack_type0x20);785else786READ_AND_CONFIG(8821c, _txpowertrack);787}788#endif789790#if RTL8198F_SUPPORT791if (dm->support_ic_type == ODM_RTL8198F) {792if (dm->rfe_type == 0)793READ_AND_CONFIG_MP(8198f, _txpowertrack_type0);794else if (dm->rfe_type == 1)795READ_AND_CONFIG_MP(8198f, _txpowertrack_type1);796else if (dm->rfe_type == 3)797READ_AND_CONFIG_MP(8198f, _txpowertrack_type3);798else799READ_AND_CONFIG_MP(8198f, _txpowertrack);800}801#endif802803#if RTL8195B_SUPPORT804if (dm->support_ic_type == ODM_RTL8195B) {805READ_AND_CONFIG_MP(8195b, _txpowertrack);806READ_AND_CONFIG_MP(8195b, _txxtaltrack);807}808#endif809810#if (RTL8822C_SUPPORT)811if (dm->support_ic_type == ODM_RTL8822C) {812if (dm->en_tssi_mode)813READ_AND_CONFIG_MP(8822c, _txpowertracktssi);814else815READ_AND_CONFIG_MP(8822c, _txpowertrack);816}817#endif818819#if (RTL8812F_SUPPORT)820if (dm->support_ic_type == ODM_RTL8812F) {821if (dm->rfe_type == 0)822READ_AND_CONFIG_MP(8812f, _txpowertrack_type0);823else if (dm->rfe_type == 1)824READ_AND_CONFIG_MP(8812f, _txpowertrack_type1);825else if (dm->rfe_type == 2)826READ_AND_CONFIG_MP(8812f, _txpowertrack_type2);827else if (dm->rfe_type == 3)828READ_AND_CONFIG_MP(8812f, _txpowertrack_type3);829else830READ_AND_CONFIG_MP(8812f, _txpowertrack);831}832#endif833834#if (RTL8197G_SUPPORT)835if (dm->support_ic_type == ODM_RTL8197G)836READ_AND_CONFIG_MP(8197g, _txpowertrack);837#endif838839#if RTL8814B_SUPPORT840if (dm->support_ic_type == ODM_RTL8814B) {841if (dm->rfe_type == 0)842READ_AND_CONFIG_MP(8814b, _txpowertrack_type0);843else if (dm->rfe_type == 1)844READ_AND_CONFIG_MP(8814b, _txpowertrack_type1);845else if (dm->rfe_type == 2)846READ_AND_CONFIG_MP(8814b, _txpowertrack_type2);847#if 0848else if (dm->rfe_type == 3)849READ_AND_CONFIG_MP(8814b, _txpowertrack_type3);850else if (dm->rfe_type == 6)851READ_AND_CONFIG_MP(8814b, _txpowertrack_type6);852#endif853else854READ_AND_CONFIG_MP(8814b, _txpowertrack);855}856#endif857858return HAL_STATUS_SUCCESS;859}860861enum hal_status862odm_config_bb_with_header_file(struct dm_struct *dm,863enum odm_bb_config_type config_type)864{865#if (DM_ODM_SUPPORT_TYPE & ODM_WIN)866void *adapter = dm->adapter;867PMGNT_INFO mgnt_info = &((PADAPTER)adapter)->MgntInfo;868#endif869enum hal_status result = HAL_STATUS_SUCCESS;870871/* @1 AP doesn't use PHYDM initialization in these ICs */872#if (DM_ODM_SUPPORT_TYPE != ODM_AP)873#if (RTL8812A_SUPPORT == 1)874if (dm->support_ic_type == ODM_RTL8812) {875if (config_type == CONFIG_BB_PHY_REG)876READ_AND_CONFIG_MP(8812a, _phy_reg);877else if (config_type == CONFIG_BB_AGC_TAB)878READ_AND_CONFIG_MP(8812a, _agc_tab);879else if (config_type == CONFIG_BB_PHY_REG_PG) {880if (dm->rfe_type == 3 && dm->is_mp_chip)881READ_AND_CONFIG_MP(8812a, _phy_reg_pg_asus);882#if (DM_ODM_SUPPORT_TYPE & ODM_WIN)883else if (mgnt_info->CustomerID == RT_CID_WNC_NEC && dm->is_mp_chip)884READ_AND_CONFIG_MP(8812a, _phy_reg_pg_nec);885#if RT_PLATFORM == PLATFORM_MACOSX886/*@{1827}{1024} for BUFFALO power by rate table. Isaiah 2013-11-29*/887else if (mgnt_info->CustomerID == RT_CID_DNI_BUFFALO)888READ_AND_CONFIG_MP(8812a, _phy_reg_pg_dni);889/* TP-Link T4UH, Isaiah 2015-03-16*/890else if (mgnt_info->CustomerID == RT_CID_TPLINK_HPWR) {891pr_debug("RT_CID_TPLINK_HPWR:: _PHY_REG_PG_TPLINK\n");892READ_AND_CONFIG_MP(8812a, _phy_reg_pg_tplink);893}894#endif895#endif896else897READ_AND_CONFIG_MP(8812a, _phy_reg_pg);898} else if (config_type == CONFIG_BB_PHY_REG_MP)899READ_AND_CONFIG_MP(8812a, _phy_reg_mp);900else if (config_type == CONFIG_BB_AGC_TAB_DIFF) {901dm->fw_offload_ability &= ~PHYDM_PHY_PARAM_OFFLOAD;902/*@AGC_TAB DIFF dont support FW offload*/903if ((*dm->channel >= 36) && (*dm->channel <= 64))904AGC_DIFF_CONFIG_MP(8812a, lb);905else if (*dm->channel >= 100)906AGC_DIFF_CONFIG_MP(8812a, hb);907}908}909#endif910#if (RTL8821A_SUPPORT == 1)911if (dm->support_ic_type == ODM_RTL8821) {912if (config_type == CONFIG_BB_PHY_REG)913READ_AND_CONFIG_MP(8821a, _phy_reg);914else if (config_type == CONFIG_BB_AGC_TAB)915READ_AND_CONFIG_MP(8821a, _agc_tab);916else if (config_type == CONFIG_BB_PHY_REG_PG) {917#if (DM_ODM_SUPPORT_TYPE & ODM_WIN)918#if (DEV_BUS_TYPE == RT_PCI_INTERFACE)919HAL_DATA_TYPE * hal_data = GET_HAL_DATA(((PADAPTER)adapter));920921if ((hal_data->EEPROMSVID == 0x1043 && hal_data->EEPROMSMID == 0x207F))922READ_AND_CONFIG_MP(8821a, _phy_reg_pg_e202_sa);923else924#endif925#if (RT_PLATFORM == PLATFORM_MACOSX)926/*@ for BUFFALO pwr by rate table */927if (mgnt_info->CustomerID == RT_CID_DNI_BUFFALO) {928/*@ for BUFFALO pwr by rate table (JP/US)*/929if (mgnt_info->ChannelPlan == RT_CHANNEL_DOMAIN_US_2G_CANADA_5G)930READ_AND_CONFIG_MP(8821a, _phy_reg_pg_dni_us);931else932READ_AND_CONFIG_MP(8821a, _phy_reg_pg_dni_jp);933} else934#endif935#endif936READ_AND_CONFIG_MP(8821a, _phy_reg_pg);937}938}939#endif940#if (RTL8192E_SUPPORT == 1)941if (dm->support_ic_type == ODM_RTL8192E) {942if (config_type == CONFIG_BB_PHY_REG)943READ_AND_CONFIG_MP(8192e, _phy_reg);944else if (config_type == CONFIG_BB_AGC_TAB)945READ_AND_CONFIG_MP(8192e, _agc_tab);946else if (config_type == CONFIG_BB_PHY_REG_PG)947READ_AND_CONFIG_MP(8192e, _phy_reg_pg);948}949#endif950#if (RTL8723D_SUPPORT == 1)951if (dm->support_ic_type == ODM_RTL8723D) {952if (config_type == CONFIG_BB_PHY_REG)953READ_AND_CONFIG_MP(8723d, _phy_reg);954else if (config_type == CONFIG_BB_AGC_TAB)955READ_AND_CONFIG_MP(8723d, _agc_tab);956else if (config_type == CONFIG_BB_PHY_REG_PG)957READ_AND_CONFIG_MP(8723d, _phy_reg_pg);958}959#endif960/* @JJ ADD 20161014 */961#if (RTL8710B_SUPPORT == 1)962if (dm->support_ic_type == ODM_RTL8710B) {963if (config_type == CONFIG_BB_PHY_REG)964READ_AND_CONFIG_MP(8710b, _phy_reg);965else if (config_type == CONFIG_BB_AGC_TAB)966READ_AND_CONFIG_MP(8710b, _agc_tab);967else if (config_type == CONFIG_BB_PHY_REG_PG)968READ_AND_CONFIG_MP(8710b, _phy_reg_pg);969}970#endif971972#endif /* @(DM_ODM_SUPPORT_TYPE != ODM_AP) */973/* @1 All platforms support */974#if (RTL8188E_SUPPORT == 1)975if (dm->support_ic_type == ODM_RTL8188E) {976if (config_type == CONFIG_BB_PHY_REG)977READ_AND_CONFIG_MP(8188e, _phy_reg);978else if (config_type == CONFIG_BB_AGC_TAB)979READ_AND_CONFIG_MP(8188e, _agc_tab);980else if (config_type == CONFIG_BB_PHY_REG_PG)981READ_AND_CONFIG_MP(8188e, _phy_reg_pg);982}983#endif984#if (RTL8723B_SUPPORT == 1)985if (dm->support_ic_type == ODM_RTL8723B) {986if (config_type == CONFIG_BB_PHY_REG)987READ_AND_CONFIG_MP(8723b, _phy_reg);988else if (config_type == CONFIG_BB_AGC_TAB)989READ_AND_CONFIG_MP(8723b, _agc_tab);990else if (config_type == CONFIG_BB_PHY_REG_PG)991READ_AND_CONFIG_MP(8723b, _phy_reg_pg);992}993#endif994#if (RTL8814A_SUPPORT == 1)995if (dm->support_ic_type == ODM_RTL8814A) {996if (config_type == CONFIG_BB_PHY_REG)997READ_AND_CONFIG_MP(8814a, _phy_reg);998else if (config_type == CONFIG_BB_AGC_TAB)999READ_AND_CONFIG_MP(8814a, _agc_tab);1000else if (config_type == CONFIG_BB_PHY_REG_PG) {1001if (dm->rfe_type == 0)1002READ_AND_CONFIG_MP(8814a, _phy_reg_pg_type0);1003else if (dm->rfe_type == 2)1004READ_AND_CONFIG_MP(8814a, _phy_reg_pg_type2);1005else if (dm->rfe_type == 3)1006READ_AND_CONFIG_MP(8814a, _phy_reg_pg_type3);1007else if (dm->rfe_type == 4)1008READ_AND_CONFIG_MP(8814a, _phy_reg_pg_type4);1009else if (dm->rfe_type == 5)1010READ_AND_CONFIG_MP(8814a, _phy_reg_pg_type5);1011else if (dm->rfe_type == 7)1012READ_AND_CONFIG_MP(8814a, _phy_reg_pg_type7);1013else if (dm->rfe_type == 8)1014READ_AND_CONFIG_MP(8814a, _phy_reg_pg_type8);1015else1016READ_AND_CONFIG_MP(8814a, _phy_reg_pg);1017} else if (config_type == CONFIG_BB_PHY_REG_MP)1018READ_AND_CONFIG_MP(8814a, _phy_reg_mp);1019}1020#endif1021#if (RTL8703B_SUPPORT == 1)1022if (dm->support_ic_type == ODM_RTL8703B) {1023if (config_type == CONFIG_BB_PHY_REG)1024READ_AND_CONFIG_MP(8703b, _phy_reg);1025else if (config_type == CONFIG_BB_AGC_TAB)1026READ_AND_CONFIG_MP(8703b, _agc_tab);1027else if (config_type == CONFIG_BB_PHY_REG_PG)1028READ_AND_CONFIG_MP(8703b, _phy_reg_pg);1029}1030#endif1031#if (RTL8188F_SUPPORT == 1)1032if (dm->support_ic_type == ODM_RTL8188F) {1033if (config_type == CONFIG_BB_PHY_REG)1034READ_AND_CONFIG_MP(8188f, _phy_reg);1035else if (config_type == CONFIG_BB_AGC_TAB)1036READ_AND_CONFIG_MP(8188f, _agc_tab);1037else if (config_type == CONFIG_BB_PHY_REG_PG)1038READ_AND_CONFIG_MP(8188f, _phy_reg_pg);1039}1040#endif1041#if (RTL8822B_SUPPORT == 1)1042if (dm->support_ic_type == ODM_RTL8822B) {1043if (config_type == CONFIG_BB_PHY_REG) {1044READ_AND_CONFIG_MP(8822b, _phy_reg);1045} else if (config_type == CONFIG_BB_AGC_TAB) {1046READ_AND_CONFIG_MP(8822b, _agc_tab);1047} else if (config_type == CONFIG_BB_PHY_REG_PG) {1048if (dm->rfe_type == 2)1049READ_AND_CONFIG_MP(8822b, _phy_reg_pg_type2);1050else if (dm->rfe_type == 3)1051READ_AND_CONFIG_MP(8822b, _phy_reg_pg_type3);1052else if (dm->rfe_type == 4)1053READ_AND_CONFIG_MP(8822b, _phy_reg_pg_type4);1054else if (dm->rfe_type == 5)1055READ_AND_CONFIG_MP(8822b, _phy_reg_pg_type5);1056else if (dm->rfe_type == 12)1057READ_AND_CONFIG_MP(8822b, _phy_reg_pg_type12);1058else if (dm->rfe_type == 15)1059READ_AND_CONFIG_MP(8822b, _phy_reg_pg_type15);1060else if (dm->rfe_type == 16)1061READ_AND_CONFIG_MP(8822b, _phy_reg_pg_type16);1062else if (dm->rfe_type == 17)1063READ_AND_CONFIG_MP(8822b, _phy_reg_pg_type17);1064else if (dm->rfe_type == 18)1065READ_AND_CONFIG_MP(8822b, _phy_reg_pg_type18);1066else1067READ_AND_CONFIG_MP(8822b, _phy_reg_pg);1068}1069}1070#endif10711072#if (RTL8197F_SUPPORT == 1)1073if (dm->support_ic_type == ODM_RTL8197F) {1074if (config_type == CONFIG_BB_PHY_REG) {1075READ_AND_CONFIG_MP(8197f, _phy_reg);1076if (dm->cut_version == ODM_CUT_A)1077phydm_phypara_a_cut(dm);1078} else if (config_type == CONFIG_BB_AGC_TAB)1079READ_AND_CONFIG_MP(8197f, _agc_tab);1080}1081#endif1082/*@jj add 20170822*/1083#if (RTL8192F_SUPPORT == 1)1084if (dm->support_ic_type == ODM_RTL8192F) {1085if (config_type == CONFIG_BB_PHY_REG) {1086READ_AND_CONFIG_MP(8192f, _phy_reg);1087} else if (config_type == CONFIG_BB_AGC_TAB) {1088READ_AND_CONFIG_MP(8192f, _agc_tab);1089} else if (config_type == CONFIG_BB_PHY_REG_PG) {1090if (dm->rfe_type == 0)1091READ_AND_CONFIG_MP(8192f, _phy_reg_pg_type0);1092else if (dm->rfe_type == 1)1093READ_AND_CONFIG_MP(8192f, _phy_reg_pg_type1);1094else if (dm->rfe_type == 2)1095READ_AND_CONFIG_MP(8192f, _phy_reg_pg_type2);1096else if (dm->rfe_type == 3)1097READ_AND_CONFIG_MP(8192f, _phy_reg_pg_type3);1098else if (dm->rfe_type == 4)1099READ_AND_CONFIG_MP(8192f, _phy_reg_pg_type4);1100else if (dm->rfe_type == 5)1101READ_AND_CONFIG_MP(8192f, _phy_reg_pg_type5);1102else if (dm->rfe_type == 6)1103READ_AND_CONFIG_MP(8192f, _phy_reg_pg_type6);1104else if (dm->rfe_type == 7)1105READ_AND_CONFIG_MP(8192f, _phy_reg_pg_type7);1106else if (dm->rfe_type == 8)1107READ_AND_CONFIG_MP(8192f, _phy_reg_pg_type8);1108else if (dm->rfe_type == 9)1109READ_AND_CONFIG_MP(8192f, _phy_reg_pg_type9);1110else if (dm->rfe_type == 10)1111READ_AND_CONFIG_MP(8192f, _phy_reg_pg_type10);1112else if (dm->rfe_type == 11)1113READ_AND_CONFIG_MP(8192f, _phy_reg_pg_type11);1114else if (dm->rfe_type == 12)1115READ_AND_CONFIG_MP(8192f, _phy_reg_pg_type12);1116else if (dm->rfe_type == 13)1117READ_AND_CONFIG_MP(8192f, _phy_reg_pg_type13);1118else if (dm->rfe_type == 14)1119READ_AND_CONFIG_MP(8192f, _phy_reg_pg_type14);1120else if (dm->rfe_type == 15)1121READ_AND_CONFIG_MP(8192f, _phy_reg_pg_type15);1122else if (dm->rfe_type == 16)1123READ_AND_CONFIG_MP(8192f, _phy_reg_pg_type16);1124else if (dm->rfe_type == 17)1125READ_AND_CONFIG_MP(8192f, _phy_reg_pg_type17);1126else if (dm->rfe_type == 18)1127READ_AND_CONFIG_MP(8192f, _phy_reg_pg_type18);1128else if (dm->rfe_type == 19)1129READ_AND_CONFIG_MP(8192f, _phy_reg_pg_type19);1130else if (dm->rfe_type == 20)1131READ_AND_CONFIG_MP(8192f, _phy_reg_pg_type20);1132else if (dm->rfe_type == 21)1133READ_AND_CONFIG_MP(8192f, _phy_reg_pg_type21);1134else if (dm->rfe_type == 22)1135READ_AND_CONFIG_MP(8192f, _phy_reg_pg_type22);1136else if (dm->rfe_type == 23)1137READ_AND_CONFIG_MP(8192f, _phy_reg_pg_type23);1138else if (dm->rfe_type == 24)1139READ_AND_CONFIG_MP(8192f, _phy_reg_pg_type24);1140else if (dm->rfe_type == 25)1141READ_AND_CONFIG_MP(8192f, _phy_reg_pg_type25);1142else if (dm->rfe_type == 26)1143READ_AND_CONFIG_MP(8192f, _phy_reg_pg_type26);1144else if (dm->rfe_type == 27)1145READ_AND_CONFIG_MP(8192f, _phy_reg_pg_type27);1146else if (dm->rfe_type == 28)1147READ_AND_CONFIG_MP(8192f, _phy_reg_pg_type28);1148else if (dm->rfe_type == 29)1149READ_AND_CONFIG_MP(8192f, _phy_reg_pg_type29);1150else if (dm->rfe_type == 30)1151READ_AND_CONFIG_MP(8192f, _phy_reg_pg_type30);1152else if (dm->rfe_type == 31)1153READ_AND_CONFIG_MP(8192f, _phy_reg_pg_type31);1154else1155READ_AND_CONFIG_MP(8192f, _phy_reg_pg);1156}1157}1158#endif1159#if (RTL8721D_SUPPORT == 1)1160if (dm->support_ic_type == ODM_RTL8721D) {1161if (config_type == CONFIG_BB_PHY_REG)1162READ_AND_CONFIG_MP(8721d, _phy_reg);1163else if (config_type == CONFIG_BB_AGC_TAB)1164READ_AND_CONFIG_MP(8721d, _agc_tab);1165else if (config_type == CONFIG_BB_PHY_REG_PG) {1166if (dm->power_voltage == ODM_POWER_18V)1167READ_AND_CONFIG_MP(8721d, _phy_reg_pg_type0);1168else1169READ_AND_CONFIG_MP(8721d, _phy_reg_pg_type1);1170}1171}1172#endif11731174#if (RTL8710C_SUPPORT == 1)1175if (dm->support_ic_type == ODM_RTL8710C) {1176if (config_type == CONFIG_BB_PHY_REG)1177READ_AND_CONFIG_MP(8710c, _phy_reg);1178else if (config_type == CONFIG_BB_AGC_TAB)1179READ_AND_CONFIG_MP(8710c, _agc_tab);1180else if (config_type == CONFIG_BB_PHY_REG_PG)1181READ_AND_CONFIG_MP(8710c, _phy_reg_pg);1182}1183#endif11841185#if (RTL8821C_SUPPORT == 1)1186if (dm->support_ic_type == ODM_RTL8821C) {1187if (config_type == CONFIG_BB_PHY_REG) {1188READ_AND_CONFIG(8821c, _phy_reg);1189} else if (config_type == CONFIG_BB_AGC_TAB) {1190READ_AND_CONFIG(8821c, _agc_tab);1191/* @According to RFEtype, choosing correct AGC table*/1192if (dm->default_rf_set_8821c == SWITCH_TO_BTG)1193AGC_DIFF_CONFIG_MP(8821c, btg);1194} else if (config_type == CONFIG_BB_PHY_REG_PG) {1195if (dm->rfe_type == 0x5)1196READ_AND_CONFIG(8821c, _phy_reg_pg_type0x28);1197else1198READ_AND_CONFIG(8821c, _phy_reg_pg);1199} else if (config_type == CONFIG_BB_AGC_TAB_DIFF) {1200dm->fw_offload_ability &= ~PHYDM_PHY_PARAM_OFFLOAD;1201/*@AGC_TAB DIFF dont support FW offload*/1202if (dm->current_rf_set_8821c == SWITCH_TO_BTG)1203AGC_DIFF_CONFIG_MP(8821c, btg);1204else if (dm->current_rf_set_8821c == SWITCH_TO_WLG)1205AGC_DIFF_CONFIG_MP(8821c, wlg);1206} else if (config_type == CONFIG_BB_PHY_REG_MP) {1207READ_AND_CONFIG(8821c, _phy_reg_mp);1208}1209}1210#endif12111212#if (RTL8195A_SUPPORT == 1)1213if (dm->support_ic_type == ODM_RTL8195A) {1214if (config_type == CONFIG_BB_PHY_REG)1215READ_AND_CONFIG(8195a, _phy_reg);1216else if (config_type == CONFIG_BB_AGC_TAB)1217READ_AND_CONFIG(8195a, _agc_tab);1218else if (config_type == CONFIG_BB_PHY_REG_PG)1219READ_AND_CONFIG(8195a, _phy_reg_pg);1220}1221#endif1222#if (RTL8195B_SUPPORT == 1)1223if (dm->support_ic_type == ODM_RTL8195B) {1224if (config_type == CONFIG_BB_PHY_REG)1225READ_AND_CONFIG(8195b, _phy_reg);1226else if (config_type == CONFIG_BB_AGC_TAB)1227READ_AND_CONFIG(8195b, _agc_tab);1228else if (config_type == CONFIG_BB_PHY_REG_PG)1229READ_AND_CONFIG(8195b, _phy_reg_pg);1230}1231#endif1232#if (RTL8198F_SUPPORT == 1)1233if (dm->support_ic_type == ODM_RTL8198F) {1234if (config_type == CONFIG_BB_PHY_REG)1235READ_AND_CONFIG_MP(8198f, _phy_reg);1236else if (config_type == CONFIG_BB_AGC_TAB)1237READ_AND_CONFIG_MP(8198f, _agc_tab);1238}1239#endif1240#if (RTL8814B_SUPPORT == 1)1241if (dm->support_ic_type == ODM_RTL8814B) {1242if (config_type == CONFIG_BB_PHY_REG)1243READ_AND_CONFIG_MP(8814b, _phy_reg);1244else if (config_type == CONFIG_BB_AGC_TAB)1245READ_AND_CONFIG_MP(8814b, _agc_tab);1246else if (config_type == CONFIG_BB_PHY_REG_PG) {1247if (dm->rfe_type == 1)1248READ_AND_CONFIG(8814b, _phy_reg_pg_type1);1249else1250READ_AND_CONFIG(8814b, _phy_reg_pg);1251}1252}1253#endif1254#if (RTL8822C_SUPPORT)1255if (dm->support_ic_type == ODM_RTL8822C) {1256if (config_type == CONFIG_BB_PHY_REG)1257READ_AND_CONFIG_MP(8822c, _phy_reg);1258else if (config_type == CONFIG_BB_AGC_TAB)1259READ_AND_CONFIG_MP(8822c, _agc_tab);1260else if (config_type == CONFIG_BB_PHY_REG_PG)1261READ_AND_CONFIG(8822c, _phy_reg_pg);1262}1263#endif1264#if (RTL8812F_SUPPORT)1265if (dm->support_ic_type == ODM_RTL8812F) {1266if (config_type == CONFIG_BB_PHY_REG)1267READ_AND_CONFIG_MP(8812f, _phy_reg);1268else if (config_type == CONFIG_BB_AGC_TAB)1269READ_AND_CONFIG_MP(8812f, _agc_tab);1270else if (config_type == CONFIG_BB_PHY_REG_PG)1271READ_AND_CONFIG(8812f, _phy_reg_pg);1272}1273#endif1274#if (RTL8197G_SUPPORT)1275if (dm->support_ic_type == ODM_RTL8197G) {1276if (config_type == CONFIG_BB_PHY_REG)1277READ_AND_CONFIG_MP(8197g, _phy_reg);1278else if (config_type == CONFIG_BB_AGC_TAB)1279READ_AND_CONFIG_MP(8197g, _agc_tab);1280else if (config_type == CONFIG_BB_PHY_REG_PG)1281READ_AND_CONFIG(8197g, _phy_reg_pg);1282}1283#endif12841285if (config_type == CONFIG_BB_PHY_REG ||1286config_type == CONFIG_BB_AGC_TAB)1287if (dm->fw_offload_ability & PHYDM_PHY_PARAM_OFFLOAD) {1288result = phydm_set_reg_by_fw(dm,1289PHYDM_HALMAC_CMD_END,12900,12910,12920,1293(enum rf_path)0,12940);1295PHYDM_DBG(dm, ODM_COMP_INIT,1296"phy param offload end!result = %d", result);1297}12981299return result;1300}13011302enum hal_status1303odm_config_mac_with_header_file(struct dm_struct *dm)1304{1305enum hal_status result = HAL_STATUS_SUCCESS;13061307PHYDM_DBG(dm, ODM_COMP_INIT, "===>%s (%s)\n", __func__,1308(dm->is_mp_chip) ? "MPChip" : "TestChip");1309PHYDM_DBG(dm, ODM_COMP_INIT,1310"support_platform: 0x%X, support_interface: 0x%X, board_type: 0x%X\n",1311dm->support_platform, dm->support_interface, dm->board_type);13121313#if (RTL8822C_SUPPORT || RTL8812F_SUPPORT || RTL8814B_SUPPORT)1314if (dm->support_ic_type &1315(ODM_RTL8822C | ODM_RTL8812F | ODM_RTL8814B)) {1316PHYDM_DBG(dm, ODM_COMP_INIT, "MAC para-package in HALMAC\n");1317return result;1318}1319#endif13201321/* @1 AP doesn't use PHYDM initialization in these ICs */1322#if (DM_ODM_SUPPORT_TYPE != ODM_AP)1323#if (RTL8812A_SUPPORT == 1)1324if (dm->support_ic_type == ODM_RTL8812)1325READ_AND_CONFIG_MP(8812a, _mac_reg);1326#endif1327#if (RTL8821A_SUPPORT == 1)1328if (dm->support_ic_type == ODM_RTL8821)1329READ_AND_CONFIG_MP(8821a, _mac_reg);1330#endif1331#if (RTL8192E_SUPPORT == 1)1332if (dm->support_ic_type == ODM_RTL8192E)1333READ_AND_CONFIG_MP(8192e, _mac_reg);1334#endif1335#if (RTL8723D_SUPPORT == 1)1336if (dm->support_ic_type == ODM_RTL8723D)1337READ_AND_CONFIG_MP(8723d, _mac_reg);1338#endif1339#if (RTL8710B_SUPPORT == 1)1340if (dm->support_ic_type == ODM_RTL8710B)1341READ_AND_CONFIG_MP(8710b, _mac_reg);1342#endif1343#endif /* @(DM_ODM_SUPPORT_TYPE != ODM_AP) */13441345/* @1 All platforms support */1346#if (RTL8188E_SUPPORT == 1)1347if (dm->support_ic_type == ODM_RTL8188E)1348READ_AND_CONFIG_MP(8188e, _mac_reg);1349#endif1350#if (RTL8723B_SUPPORT == 1)1351if (dm->support_ic_type == ODM_RTL8723B)1352READ_AND_CONFIG_MP(8723b, _mac_reg);1353#endif1354#if (RTL8814A_SUPPORT == 1)1355if (dm->support_ic_type == ODM_RTL8814A)1356READ_AND_CONFIG_MP(8814a, _mac_reg);1357#endif1358#if (RTL8703B_SUPPORT == 1)1359if (dm->support_ic_type == ODM_RTL8703B)1360READ_AND_CONFIG_MP(8703b, _mac_reg);1361#endif1362#if (RTL8188F_SUPPORT == 1)1363if (dm->support_ic_type == ODM_RTL8188F)1364READ_AND_CONFIG_MP(8188f, _mac_reg);1365#endif1366#if (RTL8822B_SUPPORT == 1)1367if (dm->support_ic_type == ODM_RTL8822B)1368READ_AND_CONFIG_MP(8822b, _mac_reg);1369#endif1370#if (RTL8197F_SUPPORT == 1)1371if (dm->support_ic_type == ODM_RTL8197F)1372READ_AND_CONFIG_MP(8197f, _mac_reg);1373#endif1374#if (RTL8192F_SUPPORT == 1)1375if (dm->support_ic_type == ODM_RTL8192F)1376READ_AND_CONFIG_MP(8192f, _mac_reg);1377#endif1378#if (RTL8721D_SUPPORT == 1)1379if (dm->support_ic_type == ODM_RTL8721D)1380READ_AND_CONFIG_MP(8721d, _mac_reg);1381#endif13821383#if (RTL8710C_SUPPORT == 1)1384if (dm->support_ic_type == ODM_RTL8710C)1385READ_AND_CONFIG_MP(8710c, _mac_reg);1386#endif13871388#if (RTL8821C_SUPPORT == 1)1389if (dm->support_ic_type == ODM_RTL8821C)1390READ_AND_CONFIG(8821c, _mac_reg);1391#endif1392#if (RTL8195A_SUPPORT == 1)1393if (dm->support_ic_type == ODM_RTL8195A)1394READ_AND_CONFIG_MP(8195a, _mac_reg);1395#endif1396#if (RTL8195B_SUPPORT == 1)1397if (dm->support_ic_type == ODM_RTL8195B)1398READ_AND_CONFIG_MP(8195b, _mac_reg);1399#endif1400#if (RTL8198F_SUPPORT == 1)1401if (dm->support_ic_type == ODM_RTL8198F)1402READ_AND_CONFIG_MP(8198f, _mac_reg);1403#endif1404#if (RTL8197G_SUPPORT == 1)1405if (dm->support_ic_type == ODM_RTL8197G)1406READ_AND_CONFIG_MP(8197g, _mac_reg);1407#endif14081409if (dm->fw_offload_ability & PHYDM_PHY_PARAM_OFFLOAD) {1410result = phydm_set_reg_by_fw(dm,1411PHYDM_HALMAC_CMD_END,14120,14130,14140,1415(enum rf_path)0,14160);1417PHYDM_DBG(dm, ODM_COMP_INIT,1418"mac param offload end!result = %d", result);1419}14201421return result;1422}14231424u32 odm_get_hw_img_version(struct dm_struct *dm)1425{1426u32 version = 0;14271428switch (dm->support_ic_type) {1429/* @1 AP doesn't use PHYDM initialization in these ICs */1430#if (DM_ODM_SUPPORT_TYPE != ODM_AP)1431#if (RTL8821A_SUPPORT)1432case ODM_RTL8821:1433version = odm_get_version_mp_8821a_phy_reg();1434break;1435#endif1436#if (RTL8192E_SUPPORT)1437case ODM_RTL8192E:1438version = odm_get_version_mp_8192e_phy_reg();1439break;1440#endif1441#if (RTL8812A_SUPPORT)1442case ODM_RTL8812:1443version = odm_get_version_mp_8812a_phy_reg();1444break;1445#endif1446#endif /* @(DM_ODM_SUPPORT_TYPE != ODM_AP) */1447#if (RTL8723D_SUPPORT)1448case ODM_RTL8723D:1449version = odm_get_version_mp_8723d_phy_reg();1450break;1451#endif1452#if (RTL8710B_SUPPORT)1453case ODM_RTL8710B:1454version = odm_get_version_mp_8710b_phy_reg();1455break;1456#endif1457#if (RTL8188E_SUPPORT)1458case ODM_RTL8188E:1459version = odm_get_version_mp_8188e_phy_reg();1460break;1461#endif1462#if (RTL8723B_SUPPORT)1463case ODM_RTL8723B:1464version = odm_get_version_mp_8723b_phy_reg();1465break;1466#endif1467#if (RTL8814A_SUPPORT)1468case ODM_RTL8814A:1469version = odm_get_version_mp_8814a_phy_reg();1470break;1471#endif1472#if (RTL8703B_SUPPORT)1473case ODM_RTL8703B:1474version = odm_get_version_mp_8703b_phy_reg();1475break;1476#endif1477#if (RTL8188F_SUPPORT)1478case ODM_RTL8188F:1479version = odm_get_version_mp_8188f_phy_reg();1480break;1481#endif1482#if (RTL8822B_SUPPORT)1483case ODM_RTL8822B:1484version = odm_get_version_mp_8822b_phy_reg();1485break;1486#endif1487#if (RTL8197F_SUPPORT)1488case ODM_RTL8197F:1489version = odm_get_version_mp_8197f_phy_reg();1490break;1491#endif14921493#if (RTL8192F_SUPPORT)1494case ODM_RTL8192F:1495version = odm_get_version_mp_8192f_phy_reg();1496break;1497#endif1498#if (RTL8721D_SUPPORT)1499case ODM_RTL8721D:1500version = odm_get_version_mp_8721d_phy_reg();1501break;1502#endif1503#if (RTL8710C_SUPPORT)1504case ODM_RTL8710C:1505version = GET_VERSION_MP(8710c, _mac_reg);1506#endif1507#if (RTL8821C_SUPPORT)1508case ODM_RTL8821C:1509version = odm_get_version_mp_8821c_phy_reg();1510break;1511#endif1512#if (RTL8195B_SUPPORT)1513case ODM_RTL8195B:1514version = odm_get_version_mp_8195b_phy_reg();1515break;1516#endif1517#if (RTL8198F_SUPPORT)1518case ODM_RTL8198F:1519version = odm_get_version_mp_8198f_phy_reg();1520break;1521#endif1522#if (RTL8822C_SUPPORT)1523case ODM_RTL8822C:1524version = odm_get_version_mp_8822c_phy_reg();1525break;1526#endif1527#if (RTL8812F_SUPPORT)1528case ODM_RTL8812F:1529version = odm_get_version_mp_8812f_phy_reg();1530break;1531#endif1532#if (RTL8197G_SUPPORT)1533case ODM_RTL8197G:1534version = odm_get_version_mp_8197g_phy_reg();1535break;1536#endif1537#if (RTL8814B_SUPPORT)1538case ODM_RTL8814B:1539version = odm_get_version_mp_8814b_phy_reg();1540break;1541#endif1542}15431544return version;1545}15461547u32 query_phydm_trx_capability(struct dm_struct *dm)1548{1549u32 value32 = 0xFFFFFFFF;15501551#if (RTL8821C_SUPPORT == 1)1552if (dm->support_ic_type == ODM_RTL8821C)1553value32 = query_phydm_trx_capability_8821c(dm);1554#endif1555#if (RTL8195B_SUPPORT == 1)1556if (dm->support_ic_type == ODM_RTL8195B)1557value32 = query_phydm_trx_capability_8195b(dm);1558#endif1559return value32;1560}15611562u32 query_phydm_stbc_capability(struct dm_struct *dm)1563{1564u32 value32 = 0xFFFFFFFF;15651566#if (RTL8821C_SUPPORT == 1)1567if (dm->support_ic_type == ODM_RTL8821C)1568value32 = query_phydm_stbc_capability_8821c(dm);1569#endif1570#if (RTL8195B_SUPPORT == 1)1571if (dm->support_ic_type == ODM_RTL8195B)1572value32 = query_phydm_stbc_capability_8195b(dm);1573#endif15741575return value32;1576}15771578u32 query_phydm_ldpc_capability(struct dm_struct *dm)1579{1580u32 value32 = 0xFFFFFFFF;15811582#if (RTL8821C_SUPPORT == 1)1583if (dm->support_ic_type == ODM_RTL8821C)1584value32 = query_phydm_ldpc_capability_8821c(dm);1585#endif1586#if (RTL8195B_SUPPORT == 1)1587if (dm->support_ic_type == ODM_RTL8195B)1588value32 = query_phydm_ldpc_capability_8195b(dm);1589#endif1590return value32;1591}15921593u32 query_phydm_txbf_parameters(struct dm_struct *dm)1594{1595u32 value32 = 0xFFFFFFFF;15961597#if (RTL8821C_SUPPORT == 1)1598if (dm->support_ic_type == ODM_RTL8821C)1599value32 = query_phydm_txbf_parameters_8821c(dm);1600#endif1601#if (RTL8195B_SUPPORT == 1)1602if (dm->support_ic_type == ODM_RTL8195B)1603value32 = query_phydm_txbf_parameters_8195b(dm);1604#endif1605return value32;1606}16071608u32 query_phydm_txbf_capability(struct dm_struct *dm)1609{1610u32 value32 = 0xFFFFFFFF;16111612#if (RTL8821C_SUPPORT == 1)1613if (dm->support_ic_type == ODM_RTL8821C)1614value32 = query_phydm_txbf_capability_8821c(dm);1615#endif1616#if (RTL8195B_SUPPORT == 1)1617if (dm->support_ic_type == ODM_RTL8195B)1618value32 = query_phydm_txbf_capability_8195b(dm);1619#endif1620return value32;1621}162216231624