1 /* SPDX-License-Identifier: GPL-2.0 */ 2 /****************************************************************************** 3 * 4 * Copyright(c) 2007 - 2017 Realtek Corporation. 5 * 6 * This program is free software; you can redistribute it and/or modify it 7 * under the terms of version 2 of the GNU General Public License as 8 * published by the Free Software Foundation. 9 * 10 * This program is distributed in the hope that it will be useful, but WITHOUT 11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 13 * more details. 14 * 15 *****************************************************************************/ 16 #ifndef __INC_HAL8723DPHYCFG_H__ 17 #define __INC_HAL8723DPHYCFG_H__ 18 19 /*--------------------------Define Parameters-------------------------------*/ 20 #define LOOP_LIMIT 5 21 #define MAX_STALL_TIME 50 /* us */ 22 #define AntennaDiversityValue 0x80 /* (Adapter->bSoftwareAntennaDiversity ? 0x00 : 0x80) */ 23 #define MAX_TXPWR_IDX_NMODE_92S 63 24 #define Reset_Cnt_Limit 3 25 26 #ifdef CONFIG_PCI_HCI 27 #define MAX_AGGR_NUM 0x0B 28 #else 29 #define MAX_AGGR_NUM 0x07 30 #endif /* CONFIG_PCI_HCI */ 31 32 33 /*--------------------------Define Parameters End-------------------------------*/ 34 35 36 /*------------------------------Define structure----------------------------*/ 37 38 /*------------------------------Define structure End----------------------------*/ 39 40 /*--------------------------Exported Function prototype---------------------*/ 41 u32 42 PHY_QueryBBReg_8723D( 43 PADAPTER Adapter, 44 u32 RegAddr, 45 u32 BitMask 46 ); 47 48 void 49 PHY_SetBBReg_8723D( 50 PADAPTER Adapter, 51 u32 RegAddr, 52 u32 BitMask, 53 u32 Data 54 ); 55 56 u32 57 PHY_QueryRFReg_8723D( 58 PADAPTER Adapter, 59 enum rf_path eRFPath, 60 u32 RegAddr, 61 u32 BitMask 62 ); 63 64 void 65 PHY_SetRFReg_8723D( 66 PADAPTER Adapter, 67 enum rf_path eRFPath, 68 u32 RegAddr, 69 u32 BitMask, 70 u32 Data 71 ); 72 73 /* MAC/BB/RF HAL config */ 74 int PHY_BBConfig8723D(PADAPTER Adapter); 75 76 int PHY_RFConfig8723D(PADAPTER Adapter); 77 78 s32 PHY_MACConfig8723D(PADAPTER padapter); 79 80 int 81 PHY_ConfigRFWithParaFile_8723D( 82 PADAPTER Adapter, 83 u8 *pFileName, 84 enum rf_path eRFPath 85 ); 86 87 void 88 PHY_SetTxPowerIndex_8723D( 89 PADAPTER Adapter, 90 u32 PowerIndex, 91 enum rf_path RFPath, 92 u8 Rate 93 ); 94 95 u8 96 PHY_GetTxPowerIndex_8723D( 97 PADAPTER pAdapter, 98 enum rf_path RFPath, 99 u8 Rate, 100 u8 BandWidth, 101 u8 Channel, 102 struct txpwr_idx_comp *tic 103 ); 104 105 void 106 PHY_SetTxPowerLevel8723D( 107 PADAPTER Adapter, 108 u8 channel 109 ); 110 111 void 112 PHY_SetSwChnlBWMode8723D( 113 PADAPTER Adapter, 114 u8 channel, 115 enum channel_width Bandwidth, 116 u8 Offset40, 117 u8 Offset80 118 ); 119 120 void phy_set_rf_path_switch_8723d( 121 struct dm_struct *phydm, 122 bool bMain 123 ); 124 /*--------------------------Exported Function prototype End---------------------*/ 125 126 #endif 127