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