1 /* SPDX-License-Identifier: GPL-2.0 */ 2 /****************************************************************************** 3 * 4 * Copyright(c) 2012 - 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_HAL8192EPHYCFG_H__ 17 #define __INC_HAL8192EPHYCFG_H__ 18 19 20 /*--------------------------Define Parameters-------------------------------*/ 21 #define LOOP_LIMIT 5 22 #define MAX_STALL_TIME 50 /* us */ 23 #define AntennaDiversityValue 0x80 /* (Adapter->bSoftwareAntennaDiversity ? 0x00 : 0x80) */ 24 #define MAX_TXPWR_IDX_NMODE_92S 63 25 #define Reset_Cnt_Limit 3 26 27 #ifdef CONFIG_PCI_HCI 28 #define MAX_AGGR_NUM 0x0B 29 #else 30 #define MAX_AGGR_NUM 0x07 31 #endif /* CONFIG_PCI_HCI */ 32 33 34 /*--------------------------Define Parameters-------------------------------*/ 35 36 /*------------------------------Define structure----------------------------*/ 37 38 /* BB/RF related */ 39 40 /*------------------------------Define structure----------------------------*/ 41 42 43 /*------------------------Export global variable----------------------------*/ 44 /*------------------------Export global variable----------------------------*/ 45 46 47 /*------------------------Export Marco Definition---------------------------*/ 48 /*------------------------Export Marco Definition---------------------------*/ 49 50 51 /*--------------------------Exported Function prototype---------------------*/ 52 /* 53 * BB and RF register read/write 54 * */ 55 u32 PHY_QueryBBReg8192E(PADAPTER Adapter, 56 u32 RegAddr, 57 u32 BitMask); 58 void PHY_SetBBReg8192E(PADAPTER Adapter, 59 u32 RegAddr, 60 u32 BitMask, 61 u32 Data); 62 u32 PHY_QueryRFReg8192E(PADAPTER Adapter, 63 enum rf_path eRFPath, 64 u32 RegAddr, 65 u32 BitMask); 66 void PHY_SetRFReg8192E(PADAPTER Adapter, 67 enum rf_path eRFPath, 68 u32 RegAddr, 69 u32 BitMask, 70 u32 Data); 71 72 /* 73 * Initialization related function 74 * 75 * MAC/BB/RF HAL config */ 76 int PHY_MACConfig8192E(PADAPTER Adapter); 77 int PHY_BBConfig8192E(PADAPTER Adapter); 78 int PHY_RFConfig8192E(PADAPTER Adapter); 79 80 /* RF config */ 81 82 83 /* 84 * BB TX Power R/W 85 * */ 86 void PHY_SetTxPowerLevel8192E(PADAPTER Adapter, u8 channel); 87 88 void 89 PHY_SetTxPowerIndex_8192E( 90 PADAPTER Adapter, 91 u32 PowerIndex, 92 enum rf_path RFPath, 93 u8 Rate 94 ); 95 96 /* 97 * channel switch related funciton 98 * */ 99 void 100 PHY_SetSwChnlBWMode8192E( 101 PADAPTER Adapter, 102 u8 channel, 103 enum channel_width Bandwidth, 104 u8 Offset40, 105 u8 Offset80 106 ); 107 108 void 109 PHY_SetRFEReg_8192E( 110 PADAPTER Adapter 111 ); 112 113 void 114 phy_SpurCalibration_8192E( 115 PADAPTER Adapter, 116 enum spur_cal_method method 117 ); 118 void PHY_SpurCalibration_8192E( PADAPTER Adapter); 119 120 #ifdef CONFIG_SPUR_CAL_NBI 121 void 122 phy_SpurCalibration_8192E_NBI( 123 PADAPTER Adapter 124 ); 125 #endif 126 /* 127 * BB/MAC/RF other monitor API 128 * */ 129 130 void 131 phy_set_rf_path_switch_8192e( 132 struct dm_struct *phydm, 133 bool bMain 134 ); 135 136 /*--------------------------Exported Function prototype---------------------*/ 137 #endif /* __INC_HAL8192CPHYCFG_H */ 138