Ali Bahar | cf3e688 | 2011-09-04 03:14:04 +0800 | [diff] [blame] | 1 | /****************************************************************************** |
| 2 | * |
| 3 | * Copyright(c) 2007 - 2010 Realtek Corporation. All rights reserved. |
| 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 | * You should have received a copy of the GNU General Public License along with |
| 15 | * this program; if not, write to the Free Software Foundation, Inc., |
| 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA |
| 17 | * |
| 18 | * Modifications for inclusion into the Linux staging tree are |
| 19 | * Copyright(c) 2010 Larry Finger. All rights reserved. |
| 20 | * |
| 21 | * Contact information: |
| 22 | * WLAN FAE <wlanfae@realtek.com> |
| 23 | * Larry Finger <Larry.Finger@lwfinger.net> |
| 24 | * |
| 25 | ******************************************************************************/ |
Larry Finger | 2865d42 | 2010-08-20 10:15:30 -0500 | [diff] [blame] | 26 | #ifndef _RTL871X_MP_IOCTL_H |
| 27 | #define _RTL871X_MP_IOCTL_H |
| 28 | |
| 29 | #include "osdep_service.h" |
| 30 | #include "drv_types.h" |
| 31 | #include "mp_custom_oid.h" |
| 32 | #include "rtl871x_ioctl.h" |
| 33 | #include "rtl871x_ioctl_rtl.h" |
| 34 | #include "rtl8712_efuse.h" |
| 35 | |
| 36 | #define TESTFWCMDNUMBER 1000000 |
| 37 | #define TEST_H2CINT_WAIT_TIME 500 |
| 38 | #define TEST_C2HINT_WAIT_TIME 500 |
| 39 | #define HCI_TEST_SYSCFG_HWMASK 1 |
| 40 | #define _BUSCLK_40M (4 << 2) |
| 41 | |
| 42 | struct CFG_DBG_MSG_STRUCT { |
| 43 | u32 DebugLevel; |
| 44 | u32 DebugComponent_H32; |
| 45 | u32 DebugComponent_L32; |
| 46 | }; |
| 47 | |
| 48 | struct mp_rw_reg { |
| 49 | uint offset; |
| 50 | uint width; |
| 51 | u32 value; |
| 52 | }; |
| 53 | |
| 54 | /* for OID_RT_PRO_READ16_EEPROM & OID_RT_PRO_WRITE16_EEPROM */ |
| 55 | struct eeprom_rw_param { |
| 56 | uint offset; |
| 57 | u16 value; |
| 58 | }; |
| 59 | |
| 60 | struct EFUSE_ACCESS_STRUCT { |
| 61 | u16 start_addr; |
| 62 | u16 cnts; |
| 63 | u8 data[0]; |
| 64 | }; |
| 65 | |
| 66 | struct burst_rw_reg { |
| 67 | uint offset; |
| 68 | uint len; |
| 69 | u8 Data[256]; |
| 70 | }; |
| 71 | |
| 72 | struct usb_vendor_req { |
| 73 | u8 bRequest; |
| 74 | u16 wValue; |
| 75 | u16 wIndex; |
| 76 | u16 wLength; |
| 77 | u8 u8Dir;/*0:OUT, 1:IN */ |
| 78 | u8 u8InData; |
| 79 | }; |
| 80 | |
| 81 | struct DR_VARIABLE_STRUCT { |
| 82 | u8 offset; |
| 83 | u32 variable; |
| 84 | }; |
| 85 | |
| 86 | int mp_start_joinbss(struct _adapter *padapter, struct ndis_802_11_ssid *pssid); |
| 87 | |
| 88 | /* oid_rtl_seg_87_11_00 */ |
Larry Finger | 2865d42 | 2010-08-20 10:15:30 -0500 | [diff] [blame] | 89 | uint oid_rt_pro_read_register_hdl(struct oid_par_priv *poid_par_priv); |
| 90 | uint oid_rt_pro_write_register_hdl(struct oid_par_priv *poid_par_priv); |
Larry Finger | 2865d42 | 2010-08-20 10:15:30 -0500 | [diff] [blame] | 91 | /* oid_rtl_seg_81_80_00 */ |
| 92 | uint oid_rt_pro_set_data_rate_hdl( |
| 93 | struct oid_par_priv *poid_par_priv); |
| 94 | uint oid_rt_pro_start_test_hdl(struct oid_par_priv *poid_par_priv); |
| 95 | uint oid_rt_pro_stop_test_hdl(struct oid_par_priv *poid_par_priv); |
| 96 | uint oid_rt_pro_set_channel_direct_call_hdl( |
| 97 | struct oid_par_priv *poid_par_priv); |
| 98 | uint oid_rt_pro_set_antenna_bb_hdl( |
| 99 | struct oid_par_priv *poid_par_priv); |
| 100 | uint oid_rt_pro_set_tx_power_control_hdl( |
| 101 | struct oid_par_priv *poid_par_priv); |
| 102 | /* oid_rtl_seg_81_80_20 */ |
| 103 | uint oid_rt_pro_query_tx_packet_sent_hdl( |
| 104 | struct oid_par_priv *poid_par_priv); |
| 105 | uint oid_rt_pro_query_rx_packet_received_hdl( |
| 106 | struct oid_par_priv *poid_par_priv); |
| 107 | uint oid_rt_pro_query_rx_packet_crc32_error_hdl( |
| 108 | struct oid_par_priv *poid_par_priv); |
| 109 | uint oid_rt_pro_reset_tx_packet_sent_hdl( |
| 110 | struct oid_par_priv *poid_par_priv); |
| 111 | uint oid_rt_pro_reset_rx_packet_received_hdl( |
| 112 | struct oid_par_priv *poid_par_priv); |
| 113 | uint oid_rt_pro_set_modulation_hdl(struct oid_par_priv *poid_par_priv); |
| 114 | uint oid_rt_pro_set_continuous_tx_hdl( |
| 115 | struct oid_par_priv *poid_par_priv); |
| 116 | uint oid_rt_pro_set_single_carrier_tx_hdl( |
| 117 | struct oid_par_priv *poid_par_priv); |
| 118 | uint oid_rt_pro_set_carrier_suppression_tx_hdl( |
| 119 | struct oid_par_priv *poid_par_priv); |
| 120 | uint oid_rt_pro_set_single_tone_tx_hdl( |
| 121 | struct oid_par_priv *poid_par_priv); |
| 122 | /* oid_rtl_seg_81_87 */ |
| 123 | uint oid_rt_pro_write_bb_reg_hdl(struct oid_par_priv *poid_par_priv); |
| 124 | uint oid_rt_pro_read_bb_reg_hdl(struct oid_par_priv *poid_par_priv); |
| 125 | uint oid_rt_pro_write_rf_reg_hdl(struct oid_par_priv *poid_par_priv); |
| 126 | uint oid_rt_pro_read_rf_reg_hdl(struct oid_par_priv *poid_par_priv); |
| 127 | /* oid_rtl_seg_81_85 */ |
| 128 | uint oid_rt_wireless_mode_hdl(struct oid_par_priv *poid_par_priv); |
Larry Finger | 2865d42 | 2010-08-20 10:15:30 -0500 | [diff] [blame] | 129 | uint oid_rt_pro_read_efuse_hdl(struct oid_par_priv *poid_par_priv); |
| 130 | uint oid_rt_pro_write_efuse_hdl(struct oid_par_priv *poid_par_priv); |
Larry Finger | 2865d42 | 2010-08-20 10:15:30 -0500 | [diff] [blame] | 131 | uint oid_rt_get_efuse_current_size_hdl( |
| 132 | struct oid_par_priv *poid_par_priv); |
| 133 | uint oid_rt_pro_efuse_hdl(struct oid_par_priv *poid_par_priv); |
| 134 | uint oid_rt_pro_efuse_map_hdl(struct oid_par_priv *poid_par_priv); |
| 135 | uint oid_rt_set_bandwidth_hdl(struct oid_par_priv *poid_par_priv); |
Larry Finger | 2865d42 | 2010-08-20 10:15:30 -0500 | [diff] [blame] | 136 | uint oid_rt_set_rx_packet_type_hdl(struct oid_par_priv *poid_par_priv); |
| 137 | uint oid_rt_get_efuse_max_size_hdl(struct oid_par_priv *poid_par_priv); |
Larry Finger | 2865d42 | 2010-08-20 10:15:30 -0500 | [diff] [blame] | 138 | uint oid_rt_get_thermal_meter_hdl( |
| 139 | struct oid_par_priv *poid_par_priv); |
| 140 | uint oid_rt_reset_phy_rx_packet_count_hdl( |
| 141 | struct oid_par_priv *poid_par_priv); |
| 142 | uint oid_rt_get_phy_rx_packet_received_hdl( |
| 143 | struct oid_par_priv *poid_par_priv); |
| 144 | uint oid_rt_get_phy_rx_packet_crc32_error_hdl( |
| 145 | struct oid_par_priv *poid_par_priv); |
| 146 | uint oid_rt_set_power_down_hdl( |
| 147 | struct oid_par_priv *poid_par_priv); |
| 148 | uint oid_rt_get_power_mode_hdl( |
| 149 | struct oid_par_priv *poid_par_priv); |
| 150 | #ifdef _RTL871X_MP_IOCTL_C_ /* CAUTION!!! */ |
| 151 | /* This ifdef _MUST_ be left in!! */ |
| 152 | static const struct oid_obj_priv oid_rtl_seg_81_80_00[] = { |
Amitoj Kaur Chawla | bce2fc5 | 2016-03-06 06:14:43 +0530 | [diff] [blame] | 153 | {1, oid_null_function}, /*0x00 OID_RT_PRO_RESET_DUT */ |
| 154 | {1, oid_rt_pro_set_data_rate_hdl}, /*0x01*/ |
| 155 | {1, oid_rt_pro_start_test_hdl}, /*0x02*/ |
| 156 | {1, oid_rt_pro_stop_test_hdl}, /*0x03*/ |
| 157 | {1, oid_null_function}, /*0x04 OID_RT_PRO_SET_PREAMBLE*/ |
| 158 | {1, oid_null_function}, /*0x05 OID_RT_PRO_SET_SCRAMBLER*/ |
| 159 | {1, oid_null_function}, /*0x06 OID_RT_PRO_SET_FILTER_BB*/ |
| 160 | {1, oid_null_function}, /*0x07 |
Raphaël Beamonte | bef611a | 2016-09-09 11:31:45 -0400 | [diff] [blame] | 161 | * OID_RT_PRO_SET_MANUAL_DIVERS_BB |
| 162 | */ |
Amitoj Kaur Chawla | bce2fc5 | 2016-03-06 06:14:43 +0530 | [diff] [blame] | 163 | {1, oid_rt_pro_set_channel_direct_call_hdl}, /*0x08*/ |
| 164 | {1, oid_null_function}, /*0x09 |
Raphaël Beamonte | bef611a | 2016-09-09 11:31:45 -0400 | [diff] [blame] | 165 | * OID_RT_PRO_SET_SLEEP_MODE_DIRECT_CALL |
| 166 | */ |
Amitoj Kaur Chawla | bce2fc5 | 2016-03-06 06:14:43 +0530 | [diff] [blame] | 167 | {1, oid_null_function}, /*0x0A |
Raphaël Beamonte | bef611a | 2016-09-09 11:31:45 -0400 | [diff] [blame] | 168 | * OID_RT_PRO_SET_WAKE_MODE_DIRECT_CALL |
| 169 | */ |
Amitoj Kaur Chawla | bce2fc5 | 2016-03-06 06:14:43 +0530 | [diff] [blame] | 170 | {1, oid_rt_pro_set_continuous_tx_hdl}, /*0x0B |
Raphaël Beamonte | bef611a | 2016-09-09 11:31:45 -0400 | [diff] [blame] | 171 | * OID_RT_PRO_SET_TX_CONTINUOUS_DIRECT_CALL |
| 172 | */ |
Amitoj Kaur Chawla | bce2fc5 | 2016-03-06 06:14:43 +0530 | [diff] [blame] | 173 | {1, oid_rt_pro_set_single_carrier_tx_hdl}, /*0x0C |
Raphaël Beamonte | bef611a | 2016-09-09 11:31:45 -0400 | [diff] [blame] | 174 | * OID_RT_PRO_SET_SINGLE_CARRIER_TX_CONTINUOUS |
| 175 | */ |
Amitoj Kaur Chawla | bce2fc5 | 2016-03-06 06:14:43 +0530 | [diff] [blame] | 176 | {1, oid_null_function}, /*0x0D |
Raphaël Beamonte | bef611a | 2016-09-09 11:31:45 -0400 | [diff] [blame] | 177 | * OID_RT_PRO_SET_TX_ANTENNA_BB |
| 178 | */ |
Amitoj Kaur Chawla | bce2fc5 | 2016-03-06 06:14:43 +0530 | [diff] [blame] | 179 | {1, oid_rt_pro_set_antenna_bb_hdl}, /*0x0E*/ |
| 180 | {1, oid_null_function}, /*0x0F OID_RT_PRO_SET_CR_SCRAMBLER*/ |
| 181 | {1, oid_null_function}, /*0x10 OID_RT_PRO_SET_CR_NEW_FILTER*/ |
| 182 | {1, oid_rt_pro_set_tx_power_control_hdl}, /*0x11 |
Raphaël Beamonte | bef611a | 2016-09-09 11:31:45 -0400 | [diff] [blame] | 183 | * OID_RT_PRO_SET_TX_POWER_CONTROL |
| 184 | */ |
Amitoj Kaur Chawla | bce2fc5 | 2016-03-06 06:14:43 +0530 | [diff] [blame] | 185 | {1, oid_null_function}, /*0x12 OID_RT_PRO_SET_CR_TX_CONFIG*/ |
| 186 | {1, oid_null_function}, /*0x13 |
Raphaël Beamonte | bef611a | 2016-09-09 11:31:45 -0400 | [diff] [blame] | 187 | * OID_RT_PRO_GET_TX_POWER_CONTROL |
| 188 | */ |
Amitoj Kaur Chawla | bce2fc5 | 2016-03-06 06:14:43 +0530 | [diff] [blame] | 189 | {1, oid_null_function}, /*0x14 |
Raphaël Beamonte | bef611a | 2016-09-09 11:31:45 -0400 | [diff] [blame] | 190 | * OID_RT_PRO_GET_CR_SIGNAL_QUALITY |
| 191 | */ |
Amitoj Kaur Chawla | bce2fc5 | 2016-03-06 06:14:43 +0530 | [diff] [blame] | 192 | {1, oid_null_function}, /*0x15 OID_RT_PRO_SET_CR_SETPOINT*/ |
| 193 | {1, oid_null_function}, /*0x16 OID_RT_PRO_SET_INTEGRATOR*/ |
| 194 | {1, oid_null_function}, /*0x17 OID_RT_PRO_SET_SIGNAL_QUALITY*/ |
| 195 | {1, oid_null_function}, /*0x18 OID_RT_PRO_GET_INTEGRATOR*/ |
| 196 | {1, oid_null_function}, /*0x19 OID_RT_PRO_GET_SIGNAL_QUALITY*/ |
| 197 | {1, oid_null_function}, /*0x1A OID_RT_PRO_QUERY_EEPROM_TYPE*/ |
| 198 | {1, oid_null_function}, /*0x1B OID_RT_PRO_WRITE_MAC_ADDRESS*/ |
| 199 | {1, oid_null_function}, /*0x1C OID_RT_PRO_READ_MAC_ADDRESS*/ |
| 200 | {1, oid_null_function}, /*0x1D OID_RT_PRO_WRITE_CIS_DATA*/ |
| 201 | {1, oid_null_function}, /*0x1E OID_RT_PRO_READ_CIS_DATA*/ |
| 202 | {1, oid_null_function} /*0x1F OID_RT_PRO_WRITE_POWER_CONTROL*/ |
Larry Finger | 2865d42 | 2010-08-20 10:15:30 -0500 | [diff] [blame] | 203 | }; |
| 204 | |
| 205 | static const struct oid_obj_priv oid_rtl_seg_81_80_20[] = { |
Amitoj Kaur Chawla | bce2fc5 | 2016-03-06 06:14:43 +0530 | [diff] [blame] | 206 | {1, oid_null_function}, /*0x20 OID_RT_PRO_READ_POWER_CONTROL*/ |
| 207 | {1, oid_null_function}, /*0x21 OID_RT_PRO_WRITE_EEPROM*/ |
| 208 | {1, oid_null_function}, /*0x22 OID_RT_PRO_READ_EEPROM*/ |
| 209 | {1, oid_rt_pro_reset_tx_packet_sent_hdl}, /*0x23*/ |
| 210 | {1, oid_rt_pro_query_tx_packet_sent_hdl}, /*0x24*/ |
| 211 | {1, oid_rt_pro_reset_rx_packet_received_hdl}, /*0x25*/ |
| 212 | {1, oid_rt_pro_query_rx_packet_received_hdl}, /*0x26*/ |
| 213 | {1, oid_rt_pro_query_rx_packet_crc32_error_hdl},/*0x27*/ |
| 214 | {1, oid_null_function}, /*0x28 |
Raphaël Beamonte | bef611a | 2016-09-09 11:31:45 -0400 | [diff] [blame] | 215 | *OID_RT_PRO_QUERY_CURRENT_ADDRESS |
| 216 | */ |
Amitoj Kaur Chawla | bce2fc5 | 2016-03-06 06:14:43 +0530 | [diff] [blame] | 217 | {1, oid_null_function}, /*0x29 |
Raphaël Beamonte | bef611a | 2016-09-09 11:31:45 -0400 | [diff] [blame] | 218 | *OID_RT_PRO_QUERY_PERMANENT_ADDRESS |
| 219 | */ |
Amitoj Kaur Chawla | bce2fc5 | 2016-03-06 06:14:43 +0530 | [diff] [blame] | 220 | {1, oid_null_function}, /*0x2A |
Raphaël Beamonte | bef611a | 2016-09-09 11:31:45 -0400 | [diff] [blame] | 221 | *OID_RT_PRO_SET_PHILIPS_RF_PARAMETERS |
| 222 | */ |
Amitoj Kaur Chawla | bce2fc5 | 2016-03-06 06:14:43 +0530 | [diff] [blame] | 223 | {1, oid_rt_pro_set_carrier_suppression_tx_hdl},/*0x2B |
Raphaël Beamonte | bef611a | 2016-09-09 11:31:45 -0400 | [diff] [blame] | 224 | *OID_RT_PRO_SET_CARRIER_SUPPRESSION_TX |
| 225 | */ |
Amitoj Kaur Chawla | bce2fc5 | 2016-03-06 06:14:43 +0530 | [diff] [blame] | 226 | {1, oid_null_function}, /*0x2C OID_RT_PRO_RECEIVE_PACKET*/ |
| 227 | {1, oid_null_function}, /*0x2D OID_RT_PRO_WRITE_EEPROM_BYTE*/ |
| 228 | {1, oid_null_function}, /*0x2E OID_RT_PRO_READ_EEPROM_BYTE*/ |
| 229 | {1, oid_rt_pro_set_modulation_hdl} /*0x2F*/ |
Larry Finger | 2865d42 | 2010-08-20 10:15:30 -0500 | [diff] [blame] | 230 | }; |
| 231 | |
| 232 | static const struct oid_obj_priv oid_rtl_seg_81_80_40[] = { |
Amitoj Kaur Chawla | bce2fc5 | 2016-03-06 06:14:43 +0530 | [diff] [blame] | 233 | {1, oid_null_function}, /*0x40*/ |
| 234 | {1, oid_null_function}, /*0x41*/ |
| 235 | {1, oid_null_function}, /*0x42*/ |
| 236 | {1, oid_rt_pro_set_single_tone_tx_hdl}, /*0x43*/ |
| 237 | {1, oid_null_function}, /*0x44*/ |
| 238 | {1, oid_null_function} /*0x45*/ |
Larry Finger | 2865d42 | 2010-08-20 10:15:30 -0500 | [diff] [blame] | 239 | }; |
| 240 | |
| 241 | static const struct oid_obj_priv oid_rtl_seg_81_80_80[] = { |
Amitoj Kaur Chawla | bce2fc5 | 2016-03-06 06:14:43 +0530 | [diff] [blame] | 242 | {1, oid_null_function}, /*0x80 OID_RT_DRIVER_OPTION*/ |
| 243 | {1, oid_null_function}, /*0x81 OID_RT_RF_OFF*/ |
| 244 | {1, oid_null_function} /*0x82 OID_RT_AUTH_STATUS*/ |
Larry Finger | 2865d42 | 2010-08-20 10:15:30 -0500 | [diff] [blame] | 245 | |
| 246 | }; |
| 247 | |
| 248 | static const struct oid_obj_priv oid_rtl_seg_81_85[] = { |
Amitoj Kaur Chawla | bce2fc5 | 2016-03-06 06:14:43 +0530 | [diff] [blame] | 249 | {1, oid_rt_wireless_mode_hdl} /*0x00 OID_RT_WIRELESS_MODE*/ |
Larry Finger | 2865d42 | 2010-08-20 10:15:30 -0500 | [diff] [blame] | 250 | }; |
| 251 | |
| 252 | #else /* _RTL871X_MP_IOCTL_C_ */ |
| 253 | extern struct oid_obj_priv oid_rtl_seg_81_80_00[32]; |
| 254 | extern struct oid_obj_priv oid_rtl_seg_81_80_20[16]; |
| 255 | extern struct oid_obj_priv oid_rtl_seg_81_80_40[6]; |
| 256 | extern struct oid_obj_priv oid_rtl_seg_81_80_80[3]; |
| 257 | extern struct oid_obj_priv oid_rtl_seg_81_85[1]; |
| 258 | extern struct oid_obj_priv oid_rtl_seg_81_87[5]; |
| 259 | extern struct oid_obj_priv oid_rtl_seg_87_11_00[32]; |
| 260 | extern struct oid_obj_priv oid_rtl_seg_87_11_20[5]; |
| 261 | extern struct oid_obj_priv oid_rtl_seg_87_11_50[2]; |
| 262 | extern struct oid_obj_priv oid_rtl_seg_87_11_80[1]; |
| 263 | extern struct oid_obj_priv oid_rtl_seg_87_11_B0[1]; |
| 264 | extern struct oid_obj_priv oid_rtl_seg_87_11_F0[16]; |
| 265 | extern struct oid_obj_priv oid_rtl_seg_87_12_00[32]; |
| 266 | |
| 267 | #endif /* _RTL871X_MP_IOCTL_C_ */ |
| 268 | |
| 269 | |
| 270 | enum MP_MODE { |
| 271 | MP_START_MODE, |
| 272 | MP_STOP_MODE, |
| 273 | MP_ERR_MODE |
| 274 | }; |
| 275 | |
Javier M. Mellid | 0593758 | 2011-04-02 03:01:49 +0200 | [diff] [blame] | 276 | struct rwreg_param { |
Larry Finger | 2865d42 | 2010-08-20 10:15:30 -0500 | [diff] [blame] | 277 | unsigned int offset; |
| 278 | unsigned int width; |
| 279 | unsigned int value; |
| 280 | }; |
| 281 | |
Javier M. Mellid | 0593758 | 2011-04-02 03:01:49 +0200 | [diff] [blame] | 282 | struct bbreg_param { |
Larry Finger | 2865d42 | 2010-08-20 10:15:30 -0500 | [diff] [blame] | 283 | unsigned int offset; |
| 284 | unsigned int phymask; |
| 285 | unsigned int value; |
| 286 | }; |
| 287 | |
Javier M. Mellid | 0593758 | 2011-04-02 03:01:49 +0200 | [diff] [blame] | 288 | struct txpower_param { |
Larry Finger | 2865d42 | 2010-08-20 10:15:30 -0500 | [diff] [blame] | 289 | unsigned int pwr_index; |
| 290 | }; |
| 291 | |
Javier M. Mellid | 0593758 | 2011-04-02 03:01:49 +0200 | [diff] [blame] | 292 | struct datarate_param { |
Larry Finger | 2865d42 | 2010-08-20 10:15:30 -0500 | [diff] [blame] | 293 | unsigned int rate_index; |
| 294 | }; |
| 295 | |
| 296 | struct rfintfs_parm { |
| 297 | unsigned int rfintfs; |
| 298 | }; |
| 299 | |
| 300 | struct mp_xmit_packet { |
| 301 | unsigned int len; |
Larry Finger | 2865d42 | 2010-08-20 10:15:30 -0500 | [diff] [blame] | 302 | }; |
| 303 | |
| 304 | struct psmode_param { |
| 305 | unsigned int ps_mode; |
| 306 | unsigned int smart_ps; |
| 307 | }; |
| 308 | |
| 309 | struct mp_ioctl_handler { |
| 310 | unsigned int paramsize; |
| 311 | unsigned int (*handler)(struct oid_par_priv *poid_par_priv); |
| 312 | unsigned int oid; |
| 313 | }; |
| 314 | |
Javier M. Mellid | 0593758 | 2011-04-02 03:01:49 +0200 | [diff] [blame] | 315 | struct mp_ioctl_param { |
Larry Finger | 2865d42 | 2010-08-20 10:15:30 -0500 | [diff] [blame] | 316 | unsigned int subcode; |
| 317 | unsigned int len; |
| 318 | unsigned char data[0]; |
| 319 | }; |
| 320 | |
| 321 | #define GEN_MP_IOCTL_SUBCODE(code) _MP_IOCTL_ ## code ## _CMD_ |
| 322 | |
| 323 | enum RTL871X_MP_IOCTL_SUBCODE { |
| 324 | GEN_MP_IOCTL_SUBCODE(MP_START), /*0*/ |
| 325 | GEN_MP_IOCTL_SUBCODE(MP_STOP), /*1*/ |
| 326 | GEN_MP_IOCTL_SUBCODE(READ_REG), /*2*/ |
| 327 | GEN_MP_IOCTL_SUBCODE(WRITE_REG), |
| 328 | GEN_MP_IOCTL_SUBCODE(SET_CHANNEL), /*4*/ |
| 329 | GEN_MP_IOCTL_SUBCODE(SET_TXPOWER), /*5*/ |
| 330 | GEN_MP_IOCTL_SUBCODE(SET_DATARATE), /*6*/ |
| 331 | GEN_MP_IOCTL_SUBCODE(READ_BB_REG), /*7*/ |
| 332 | GEN_MP_IOCTL_SUBCODE(WRITE_BB_REG), |
| 333 | GEN_MP_IOCTL_SUBCODE(READ_RF_REG), /*9*/ |
| 334 | GEN_MP_IOCTL_SUBCODE(WRITE_RF_REG), |
| 335 | GEN_MP_IOCTL_SUBCODE(SET_RF_INTFS), |
| 336 | GEN_MP_IOCTL_SUBCODE(IOCTL_XMIT_PACKET), /*12*/ |
| 337 | GEN_MP_IOCTL_SUBCODE(PS_STATE), /*13*/ |
| 338 | GEN_MP_IOCTL_SUBCODE(READ16_EEPROM), /*14*/ |
| 339 | GEN_MP_IOCTL_SUBCODE(WRITE16_EEPROM), /*15*/ |
| 340 | GEN_MP_IOCTL_SUBCODE(SET_PTM), /*16*/ |
| 341 | GEN_MP_IOCTL_SUBCODE(READ_TSSI), /*17*/ |
| 342 | GEN_MP_IOCTL_SUBCODE(CNTU_TX), /*18*/ |
| 343 | GEN_MP_IOCTL_SUBCODE(SET_BANDWIDTH), /*19*/ |
| 344 | GEN_MP_IOCTL_SUBCODE(SET_RX_PKT_TYPE), /*20*/ |
| 345 | GEN_MP_IOCTL_SUBCODE(RESET_PHY_RX_PKT_CNT), /*21*/ |
| 346 | GEN_MP_IOCTL_SUBCODE(GET_PHY_RX_PKT_RECV), /*22*/ |
| 347 | GEN_MP_IOCTL_SUBCODE(GET_PHY_RX_PKT_ERROR), /*23*/ |
| 348 | GEN_MP_IOCTL_SUBCODE(SET_POWER_DOWN), /*24*/ |
| 349 | GEN_MP_IOCTL_SUBCODE(GET_THERMAL_METER), /*25*/ |
| 350 | GEN_MP_IOCTL_SUBCODE(GET_POWER_MODE), /*26*/ |
| 351 | GEN_MP_IOCTL_SUBCODE(EFUSE), /*27*/ |
| 352 | GEN_MP_IOCTL_SUBCODE(EFUSE_MAP), /*28*/ |
| 353 | GEN_MP_IOCTL_SUBCODE(GET_EFUSE_MAX_SIZE), /*29*/ |
| 354 | GEN_MP_IOCTL_SUBCODE(GET_EFUSE_CURRENT_SIZE), /*30*/ |
| 355 | GEN_MP_IOCTL_SUBCODE(SC_TX), /*31*/ |
| 356 | GEN_MP_IOCTL_SUBCODE(CS_TX), /*32*/ |
| 357 | GEN_MP_IOCTL_SUBCODE(ST_TX), /*33*/ |
| 358 | GEN_MP_IOCTL_SUBCODE(SET_ANTENNA), /*34*/ |
| 359 | MAX_MP_IOCTL_SUBCODE, |
| 360 | }; |
| 361 | |
| 362 | unsigned int mp_ioctl_xmit_packet_hdl(struct oid_par_priv *poid_par_priv); |
| 363 | |
| 364 | #ifdef _RTL871X_MP_IOCTL_C_ /* CAUTION!!! */ |
| 365 | /* This ifdef _MUST_ be left in!! */ |
| 366 | |
Larry Finger | e3dc896 | 2011-01-14 14:54:13 -0600 | [diff] [blame] | 367 | static struct mp_ioctl_handler mp_ioctl_hdl[] = { |
Larry Finger | 2865d42 | 2010-08-20 10:15:30 -0500 | [diff] [blame] | 368 | {sizeof(u32), oid_rt_pro_start_test_hdl, |
| 369 | OID_RT_PRO_START_TEST},/*0*/ |
| 370 | {sizeof(u32), oid_rt_pro_stop_test_hdl, |
| 371 | OID_RT_PRO_STOP_TEST},/*1*/ |
| 372 | {sizeof(struct rwreg_param), |
| 373 | oid_rt_pro_read_register_hdl, |
| 374 | OID_RT_PRO_READ_REGISTER},/*2*/ |
| 375 | {sizeof(struct rwreg_param), |
| 376 | oid_rt_pro_write_register_hdl, |
| 377 | OID_RT_PRO_WRITE_REGISTER}, |
| 378 | {sizeof(u32), |
| 379 | oid_rt_pro_set_channel_direct_call_hdl, |
| 380 | OID_RT_PRO_SET_CHANNEL_DIRECT_CALL}, |
| 381 | {sizeof(struct txpower_param), |
| 382 | oid_rt_pro_set_tx_power_control_hdl, |
| 383 | OID_RT_PRO_SET_TX_POWER_CONTROL}, |
| 384 | {sizeof(u32), |
| 385 | oid_rt_pro_set_data_rate_hdl, |
| 386 | OID_RT_PRO_SET_DATA_RATE}, |
| 387 | {sizeof(struct bb_reg_param), |
| 388 | oid_rt_pro_read_bb_reg_hdl, |
| 389 | OID_RT_PRO_READ_BB_REG},/*7*/ |
| 390 | {sizeof(struct bb_reg_param), |
| 391 | oid_rt_pro_write_bb_reg_hdl, |
| 392 | OID_RT_PRO_WRITE_BB_REG}, |
| 393 | {sizeof(struct rwreg_param), |
| 394 | oid_rt_pro_read_rf_reg_hdl, |
| 395 | OID_RT_PRO_RF_READ_REGISTRY},/*9*/ |
| 396 | {sizeof(struct rwreg_param), |
| 397 | oid_rt_pro_write_rf_reg_hdl, |
| 398 | OID_RT_PRO_RF_WRITE_REGISTRY}, |
| 399 | {sizeof(struct rfintfs_parm), NULL, 0}, |
Amitoj Kaur Chawla | bce2fc5 | 2016-03-06 06:14:43 +0530 | [diff] [blame] | 400 | {0, mp_ioctl_xmit_packet_hdl, 0},/*12*/ |
Larry Finger | 2865d42 | 2010-08-20 10:15:30 -0500 | [diff] [blame] | 401 | {sizeof(struct psmode_param), NULL, 0},/*13*/ |
| 402 | {sizeof(struct eeprom_rw_param), NULL, 0},/*14*/ |
| 403 | {sizeof(struct eeprom_rw_param), NULL, 0},/*15*/ |
Ali Bahar | ac9bfc1 | 2011-09-04 03:14:13 +0800 | [diff] [blame] | 404 | {sizeof(unsigned char), NULL, 0},/*16*/ |
Larry Finger | 2865d42 | 2010-08-20 10:15:30 -0500 | [diff] [blame] | 405 | {sizeof(u32), NULL, 0},/*17*/ |
| 406 | {sizeof(u32), oid_rt_pro_set_continuous_tx_hdl, |
| 407 | OID_RT_PRO_SET_CONTINUOUS_TX},/*18*/ |
| 408 | {sizeof(u32), oid_rt_set_bandwidth_hdl, |
| 409 | OID_RT_SET_BANDWIDTH},/*19*/ |
| 410 | {sizeof(u32), oid_rt_set_rx_packet_type_hdl, |
| 411 | OID_RT_SET_RX_PACKET_TYPE},/*20*/ |
| 412 | {0, oid_rt_reset_phy_rx_packet_count_hdl, |
| 413 | OID_RT_RESET_PHY_RX_PACKET_COUNT},/*21*/ |
| 414 | {sizeof(u32), oid_rt_get_phy_rx_packet_received_hdl, |
| 415 | OID_RT_GET_PHY_RX_PACKET_RECEIVED},/*22*/ |
| 416 | {sizeof(u32), oid_rt_get_phy_rx_packet_crc32_error_hdl, |
| 417 | OID_RT_GET_PHY_RX_PACKET_CRC32_ERROR},/*23*/ |
| 418 | {sizeof(unsigned char), oid_rt_set_power_down_hdl, |
| 419 | OID_RT_SET_POWER_DOWN},/*24*/ |
| 420 | {sizeof(u32), oid_rt_get_thermal_meter_hdl, |
| 421 | OID_RT_PRO_GET_THERMAL_METER},/*25*/ |
| 422 | {sizeof(u32), oid_rt_get_power_mode_hdl, |
| 423 | OID_RT_GET_POWER_MODE},/*26*/ |
| 424 | {sizeof(struct EFUSE_ACCESS_STRUCT), |
| 425 | oid_rt_pro_efuse_hdl, OID_RT_PRO_EFUSE},/*27*/ |
| 426 | {EFUSE_MAP_MAX_SIZE, oid_rt_pro_efuse_map_hdl, |
| 427 | OID_RT_PRO_EFUSE_MAP},/*28*/ |
| 428 | {sizeof(u32), oid_rt_get_efuse_max_size_hdl, |
| 429 | OID_RT_GET_EFUSE_MAX_SIZE},/*29*/ |
| 430 | {sizeof(u32), oid_rt_get_efuse_current_size_hdl, |
| 431 | OID_RT_GET_EFUSE_CURRENT_SIZE},/*30*/ |
| 432 | {sizeof(u32), oid_rt_pro_set_single_carrier_tx_hdl, |
| 433 | OID_RT_PRO_SET_SINGLE_CARRIER_TX},/*31*/ |
| 434 | {sizeof(u32), oid_rt_pro_set_carrier_suppression_tx_hdl, |
| 435 | OID_RT_PRO_SET_CARRIER_SUPPRESSION_TX},/*32*/ |
| 436 | {sizeof(u32), oid_rt_pro_set_single_tone_tx_hdl, |
| 437 | OID_RT_PRO_SET_SINGLE_TONE_TX},/*33*/ |
| 438 | {sizeof(u32), oid_rt_pro_set_antenna_bb_hdl, |
| 439 | OID_RT_PRO_SET_ANTENNA_BB},/*34*/ |
| 440 | }; |
| 441 | |
| 442 | #else /* _RTL871X_MP_IOCTL_C_ */ |
| 443 | extern struct mp_ioctl_handler mp_ioctl_hdl[]; |
| 444 | #endif /* _RTL871X_MP_IOCTL_C_ */ |
| 445 | |
| 446 | #endif |
| 447 | |