1 /****************************************************************************** 2 * 3 * Copyright(c) 2012 - 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_HAL8192EPHYCFG_H__ 16 #define __INC_HAL8192EPHYCFG_H__ 17 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-------------------------------*/ 34 35 /*------------------------------Define structure----------------------------*/ 36 37 /* BB/RF related */ 38 39 /*------------------------------Define structure----------------------------*/ 40 41 42 /*------------------------Export global variable----------------------------*/ 43 /*------------------------Export global variable----------------------------*/ 44 45 46 /*------------------------Export Marco Definition---------------------------*/ 47 /*------------------------Export Marco Definition---------------------------*/ 48 49 50 /*--------------------------Exported Function prototype---------------------*/ 51 /* 52 * BB and RF register read/write 53 * */ 54 u32 PHY_QueryBBReg8192E(IN PADAPTER Adapter, 55 IN u32 RegAddr, 56 IN u32 BitMask); 57 void PHY_SetBBReg8192E(IN PADAPTER Adapter, 58 IN u32 RegAddr, 59 IN u32 BitMask, 60 IN u32 Data); 61 u32 PHY_QueryRFReg8192E(IN PADAPTER Adapter, 62 IN enum rf_path eRFPath, 63 IN u32 RegAddr, 64 IN u32 BitMask); 65 void PHY_SetRFReg8192E(IN PADAPTER Adapter, 66 IN enum rf_path eRFPath, 67 IN u32 RegAddr, 68 IN u32 BitMask, 69 IN u32 Data); 70 71 /* 72 * Initialization related function 73 * 74 * MAC/BB/RF HAL config */ 75 int PHY_MACConfig8192E(IN PADAPTER Adapter); 76 int PHY_BBConfig8192E(IN PADAPTER Adapter); 77 int PHY_RFConfig8192E(IN PADAPTER Adapter); 78 79 /* RF config */ 80 81 82 /* 83 * BB TX Power R/W 84 * */ 85 void PHY_GetTxPowerLevel8192E(IN PADAPTER Adapter, OUT s32 *powerlevel); 86 void PHY_SetTxPowerLevel8192E(IN PADAPTER Adapter, IN u8 channel); 87 BOOLEAN PHY_UpdateTxPowerDbm8192E(IN PADAPTER Adapter, IN int powerInDbm); 88 89 VOID 90 PHY_SetTxPowerIndex_8192E( 91 IN PADAPTER Adapter, 92 IN u32 PowerIndex, 93 IN enum rf_path RFPath, 94 IN u8 Rate 95 ); 96 97 u8 98 PHY_GetTxPowerIndex_8192E( 99 IN PADAPTER pAdapter, 100 IN enum rf_path RFPath, 101 IN u8 Rate, 102 IN u8 BandWidth, 103 IN u8 Channel, 104 struct txpwr_idx_comp *tic 105 ); 106 107 /* 108 * channel switch related funciton 109 * */ 110 VOID 111 PHY_SetSwChnlBWMode8192E( 112 IN PADAPTER Adapter, 113 IN u8 channel, 114 IN enum channel_width Bandwidth, 115 IN u8 Offset40, 116 IN u8 Offset80 117 ); 118 119 VOID 120 PHY_SetRFEReg_8192E( 121 IN PADAPTER Adapter 122 ); 123 124 void 125 phy_SpurCalibration_8192E( 126 IN PADAPTER Adapter, 127 IN enum spur_cal_method method 128 ); 129 void PHY_SpurCalibration_8192E(IN PADAPTER Adapter); 130 131 #ifdef CONFIG_SPUR_CAL_NBI 132 void 133 phy_SpurCalibration_8192E_NBI( 134 IN PADAPTER Adapter 135 ); 136 #endif 137 /* 138 * BB/MAC/RF other monitor API 139 * */ 140 141 VOID 142 phy_set_rf_path_switch_8192e( 143 IN PADAPTER pAdapter, 144 IN bool bMain 145 ); 146 147 /*--------------------------Exported Function prototype---------------------*/ 148 #endif /* __INC_HAL8192CPHYCFG_H */ 149