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 16 17 #ifndef __PHYDM_API_H__ 18 #define __PHYDM_API_H__ 19 20 #define PHYDM_API_VERSION "1.0" /* 2017.07.10 Dino, Add phydm_api.h*/ 21 22 23 /* 1 ============================================================ 24 * 1 Definition 25 * 1 ============================================================ */ 26 27 28 #define FUNC_ENABLE 1 29 #define FUNC_DISABLE 2 30 31 /*NBI API------------------------------------*/ 32 #define NBI_TABLE_SIZE_128 27 33 #define NBI_TABLE_SIZE_256 59 34 35 #define NUM_START_CH_80M 7 36 #define NUM_START_CH_40M 14 37 38 #define CH_OFFSET_40M 2 39 #define CH_OFFSET_80M 6 40 41 #define FFT_128_TYPE 1 42 #define FFT_256_TYPE 2 43 44 #define FREQ_POSITIVE 1 45 #define FREQ_NEGATIVE 2 46 /*------------------------------------------------*/ 47 48 /* 1 ============================================================ 49 * 1 structure 50 * 1 ============================================================ */ 51 52 struct phydm_api_stuc { 53 54 u32 rx_iqc_reg_1; /*N-mode: for pathA REG0xc14*/ 55 u32 rx_iqc_reg_2; /*N-mode: for pathB REG0xc1c*/ 56 u8 tx_queue_bitmap;/*REG0x520[23:16]*/ 57 58 }; 59 60 /* 1 ============================================================ 61 * 1 enumeration 62 * 1 ============================================================ */ 63 64 65 66 /* 1 ============================================================ 67 * 1 function prototype 68 * 1 ============================================================ */ 69 70 void 71 phydm_init_trx_antenna_setting( 72 void *p_dm_void 73 ); 74 75 void 76 phydm_config_ofdm_rx_path( 77 void *p_dm_void, 78 u32 path 79 ); 80 81 void 82 phydm_config_cck_rx_path( 83 void *p_dm_void, 84 enum bb_path path 85 ); 86 87 void 88 phydm_config_cck_rx_antenna_init( 89 void *p_dm_void 90 ); 91 92 void 93 phydm_config_trx_path( 94 void *p_dm_void, 95 u32 *const dm_value, 96 u32 *_used, 97 char *output, 98 u32 *_out_len 99 ); 100 101 void 102 phydm_stop_3_wire( 103 void *p_dm_void, 104 u8 set_type 105 ); 106 107 u8 108 phydm_stop_ic_trx( 109 void *p_dm_void, 110 u8 set_type 111 ); 112 113 void 114 phydm_set_ext_switch( 115 void *p_dm_void, 116 u32 *const dm_value, 117 u32 *_used, 118 char *output, 119 u32 *_out_len 120 ); 121 122 void 123 phydm_nbi_enable( 124 void *p_dm_void, 125 u32 enable 126 ); 127 128 u8 129 phydm_csi_mask_setting( 130 void *p_dm_void, 131 u32 enable, 132 u32 channel, 133 u32 bw, 134 u32 f_interference, 135 u32 Second_ch 136 ); 137 138 u8 139 phydm_nbi_setting( 140 void *p_dm_void, 141 u32 enable, 142 u32 channel, 143 u32 bw, 144 u32 f_interference, 145 u32 second_ch 146 ); 147 148 149 void 150 phydm_api_debug( 151 void *p_dm_void, 152 u32 function_map, 153 u32 *const dm_value, 154 u32 *_used, 155 char *output, 156 u32 *_out_len 157 ); 158 159 void 160 phydm_stop_ck320( 161 void *p_dm_void, 162 u8 enable 163 ); 164 165 #ifdef PHYDM_COMMON_API_SUPPORT 166 167 boolean 168 phydm_api_set_txagc( 169 void *p_dm_void, 170 u32 power_index, 171 enum rf_path path, 172 u8 hw_rate, 173 boolean is_single_rate 174 ); 175 176 u8 177 phydm_api_get_txagc( 178 void *p_dm_void, 179 enum rf_path path, 180 u8 hw_rate 181 ); 182 183 boolean 184 phydm_api_switch_bw_channel( 185 void *p_dm_void, 186 u8 central_ch, 187 u8 primary_ch_idx, 188 enum channel_width bandwidth 189 ); 190 191 boolean 192 phydm_api_trx_mode( 193 void *p_dm_void, 194 enum bb_path tx_path, 195 enum bb_path rx_path, 196 boolean is_tx2_path 197 ); 198 199 #endif 200 201 #endif 202