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(PADAPTER Adapter, 55 u32 RegAddr, 56 u32 BitMask); 57 void PHY_SetBBReg8192E(PADAPTER Adapter, 58 u32 RegAddr, 59 u32 BitMask, 60 u32 Data); 61 u32 PHY_QueryRFReg8192E(PADAPTER Adapter, 62 enum rf_path eRFPath, 63 u32 RegAddr, 64 u32 BitMask); 65 void PHY_SetRFReg8192E(PADAPTER Adapter, 66 enum rf_path eRFPath, 67 u32 RegAddr, 68 u32 BitMask, 69 u32 Data); 70 71 /* 72 * Initialization related function 73 * 74 * MAC/BB/RF HAL config */ 75 int PHY_MACConfig8192E(PADAPTER Adapter); 76 int PHY_BBConfig8192E(PADAPTER Adapter); 77 int PHY_RFConfig8192E(PADAPTER Adapter); 78 79 /* RF config */ 80 81 82 /* 83 * BB TX Power R/W 84 * */ 85 void PHY_SetTxPowerLevel8192E(PADAPTER Adapter, u8 channel); 86 87 void 88 PHY_SetTxPowerIndex_8192E( 89 PADAPTER Adapter, 90 u32 PowerIndex, 91 enum rf_path RFPath, 92 u8 Rate 93 ); 94 95 /* 96 * channel switch related funciton 97 * */ 98 void 99 PHY_SetSwChnlBWMode8192E( 100 PADAPTER Adapter, 101 u8 channel, 102 enum channel_width Bandwidth, 103 u8 Offset40, 104 u8 Offset80 105 ); 106 107 void 108 PHY_SetRFEReg_8192E( 109 PADAPTER Adapter 110 ); 111 112 void 113 phy_SpurCalibration_8192E( 114 PADAPTER Adapter, 115 enum spur_cal_method method 116 ); 117 void PHY_SpurCalibration_8192E( PADAPTER Adapter); 118 119 #ifdef CONFIG_SPUR_CAL_NBI 120 void 121 phy_SpurCalibration_8192E_NBI( 122 PADAPTER Adapter 123 ); 124 #endif 125 /* 126 * BB/MAC/RF other monitor API 127 * */ 128 129 void 130 phy_set_rf_path_switch_8192e( 131 struct dm_struct *phydm, 132 bool bMain 133 ); 134 135 /*--------------------------Exported Function prototype---------------------*/ 136 #endif /* __INC_HAL8192CPHYCFG_H */ 137