rtw_mp_ioctl.h 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590
  1. /******************************************************************************
  2. *
  3. * Copyright(c) 2007 - 2011 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. *
  19. ******************************************************************************/
  20. #ifndef _RTW_MP_IOCTL_H_
  21. #define _RTW_MP_IOCTL_H_
  22. #include <mp_custom_oid.h>
  23. #include <rtw_mp.h>
  24. #if 0
  25. #define TESTFWCMDNUMBER 1000000
  26. #define TEST_H2CINT_WAIT_TIME 500
  27. #define TEST_C2HINT_WAIT_TIME 500
  28. #define HCI_TEST_SYSCFG_HWMASK 1
  29. #define _BUSCLK_40M (4 << 2)
  30. #endif
  31. //------------------------------------------------------------------------------
  32. typedef struct CFG_DBG_MSG_STRUCT {
  33. u32 DebugLevel;
  34. u32 DebugComponent_H32;
  35. u32 DebugComponent_L32;
  36. }CFG_DBG_MSG_STRUCT,*PCFG_DBG_MSG_STRUCT;
  37. typedef struct _RW_REG {
  38. u32 offset;
  39. u32 width;
  40. u32 value;
  41. }mp_rw_reg,RW_Reg, *pRW_Reg;
  42. //for OID_RT_PRO_READ16_EEPROM & OID_RT_PRO_WRITE16_EEPROM
  43. typedef struct _EEPROM_RW_PARAM {
  44. u32 offset;
  45. u16 value;
  46. }eeprom_rw_param,EEPROM_RWParam, *pEEPROM_RWParam;
  47. typedef struct _EFUSE_ACCESS_STRUCT_ {
  48. u16 start_addr;
  49. u16 cnts;
  50. u8 data[0];
  51. }EFUSE_ACCESS_STRUCT, *PEFUSE_ACCESS_STRUCT;
  52. typedef struct _BURST_RW_REG {
  53. u32 offset;
  54. u32 len;
  55. u8 Data[256];
  56. }burst_rw_reg,Burst_RW_Reg, *pBurst_RW_Reg;
  57. typedef struct _USB_VendorReq{
  58. u8 bRequest;
  59. u16 wValue;
  60. u16 wIndex;
  61. u16 wLength;
  62. u8 u8Dir;//0:OUT, 1:IN
  63. u8 u8InData;
  64. }usb_vendor_req, USB_VendorReq, *pUSB_VendorReq;
  65. typedef struct _DR_VARIABLE_STRUCT_ {
  66. u8 offset;
  67. u32 variable;
  68. }DR_VARIABLE_STRUCT;
  69. //int mp_start_joinbss(_adapter *padapter, NDIS_802_11_SSID *pssid);
  70. //void _irqlevel_changed_(_irqL *irqlevel, /*BOOLEAN*/unsigned char bLower);
  71. #ifdef PLATFORM_OS_XP
  72. static void _irqlevel_changed_(_irqL *irqlevel, u8 bLower)
  73. {
  74. if (bLower == LOWER) {
  75. *irqlevel = KeGetCurrentIrql();
  76. if (*irqlevel > PASSIVE_LEVEL) {
  77. KeLowerIrql(PASSIVE_LEVEL);
  78. }
  79. } else {
  80. if (KeGetCurrentIrql() == PASSIVE_LEVEL) {
  81. KeRaiseIrql(DISPATCH_LEVEL, irqlevel);
  82. }
  83. }
  84. }
  85. #else
  86. #define _irqlevel_changed_(a,b)
  87. #endif
  88. //oid_rtl_seg_81_80_00
  89. NDIS_STATUS oid_rt_pro_set_data_rate_hdl(struct oid_par_priv* poid_par_priv);
  90. NDIS_STATUS oid_rt_pro_start_test_hdl(struct oid_par_priv* poid_par_priv);
  91. NDIS_STATUS oid_rt_pro_stop_test_hdl(struct oid_par_priv* poid_par_priv);
  92. NDIS_STATUS oid_rt_pro_set_channel_direct_call_hdl(struct oid_par_priv* poid_par_priv);
  93. NDIS_STATUS oid_rt_pro_set_antenna_bb_hdl(struct oid_par_priv* poid_par_priv);
  94. NDIS_STATUS oid_rt_pro_set_tx_power_control_hdl(struct oid_par_priv* poid_par_priv);
  95. //oid_rtl_seg_81_80_20
  96. NDIS_STATUS oid_rt_pro_query_tx_packet_sent_hdl(struct oid_par_priv* poid_par_priv);
  97. NDIS_STATUS oid_rt_pro_query_rx_packet_received_hdl(struct oid_par_priv* poid_par_priv);
  98. NDIS_STATUS oid_rt_pro_query_rx_packet_crc32_error_hdl(struct oid_par_priv* poid_par_priv);
  99. NDIS_STATUS oid_rt_pro_reset_tx_packet_sent_hdl(struct oid_par_priv* poid_par_priv);
  100. NDIS_STATUS oid_rt_pro_reset_rx_packet_received_hdl(struct oid_par_priv* poid_par_priv);
  101. NDIS_STATUS oid_rt_pro_set_modulation_hdl(struct oid_par_priv* poid_par_priv);
  102. NDIS_STATUS oid_rt_pro_set_continuous_tx_hdl(struct oid_par_priv* poid_par_priv);
  103. NDIS_STATUS oid_rt_pro_set_single_carrier_tx_hdl(struct oid_par_priv* poid_par_priv);
  104. NDIS_STATUS oid_rt_pro_set_carrier_suppression_tx_hdl(struct oid_par_priv* poid_par_priv);
  105. NDIS_STATUS oid_rt_pro_set_single_tone_tx_hdl(struct oid_par_priv* poid_par_priv);
  106. //oid_rtl_seg_81_87
  107. NDIS_STATUS oid_rt_pro_write_bb_reg_hdl(struct oid_par_priv* poid_par_priv);
  108. NDIS_STATUS oid_rt_pro_read_bb_reg_hdl(struct oid_par_priv* poid_par_priv);
  109. NDIS_STATUS oid_rt_pro_write_rf_reg_hdl(struct oid_par_priv* poid_par_priv);
  110. NDIS_STATUS oid_rt_pro_read_rf_reg_hdl(struct oid_par_priv* poid_par_priv);
  111. //oid_rtl_seg_81_85
  112. NDIS_STATUS oid_rt_wireless_mode_hdl(struct oid_par_priv* poid_par_priv);
  113. // oid_rtl_seg_87_11_00
  114. NDIS_STATUS oid_rt_pro8711_join_bss_hdl(struct oid_par_priv* poid_par_priv);
  115. NDIS_STATUS oid_rt_pro_read_register_hdl(struct oid_par_priv* poid_par_priv);
  116. NDIS_STATUS oid_rt_pro_write_register_hdl(struct oid_par_priv* poid_par_priv);
  117. NDIS_STATUS oid_rt_pro_burst_read_register_hdl(struct oid_par_priv* poid_par_priv);
  118. NDIS_STATUS oid_rt_pro_burst_write_register_hdl(struct oid_par_priv* poid_par_priv);
  119. NDIS_STATUS oid_rt_pro_write_txcmd_hdl(struct oid_par_priv* poid_par_priv);
  120. NDIS_STATUS oid_rt_pro_read16_eeprom_hdl(struct oid_par_priv* poid_par_priv);
  121. NDIS_STATUS oid_rt_pro_write16_eeprom_hdl (struct oid_par_priv* poid_par_priv);
  122. NDIS_STATUS oid_rt_pro8711_wi_poll_hdl(struct oid_par_priv* poid_par_priv);
  123. NDIS_STATUS oid_rt_pro8711_pkt_loss_hdl(struct oid_par_priv* poid_par_priv);
  124. NDIS_STATUS oid_rt_rd_attrib_mem_hdl(struct oid_par_priv* poid_par_priv);
  125. NDIS_STATUS oid_rt_wr_attrib_mem_hdl (struct oid_par_priv* poid_par_priv);
  126. NDIS_STATUS oid_rt_pro_set_rf_intfs_hdl(struct oid_par_priv* poid_par_priv);
  127. NDIS_STATUS oid_rt_poll_rx_status_hdl(struct oid_par_priv* poid_par_priv);
  128. // oid_rtl_seg_87_11_20
  129. NDIS_STATUS oid_rt_pro_cfg_debug_message_hdl(struct oid_par_priv* poid_par_priv);
  130. NDIS_STATUS oid_rt_pro_set_data_rate_ex_hdl(struct oid_par_priv* poid_par_priv);
  131. NDIS_STATUS oid_rt_pro_set_basic_rate_hdl(struct oid_par_priv* poid_par_priv);
  132. NDIS_STATUS oid_rt_pro_read_tssi_hdl(struct oid_par_priv* poid_par_priv);
  133. NDIS_STATUS oid_rt_pro_set_power_tracking_hdl(struct oid_par_priv* poid_par_priv);
  134. //oid_rtl_seg_87_11_50
  135. NDIS_STATUS oid_rt_pro_qry_pwrstate_hdl(struct oid_par_priv* poid_par_priv);
  136. NDIS_STATUS oid_rt_pro_set_pwrstate_hdl(struct oid_par_priv* poid_par_priv);
  137. //oid_rtl_seg_87_11_F0
  138. NDIS_STATUS oid_rt_pro_h2c_set_rate_table_hdl(struct oid_par_priv* poid_par_priv);
  139. NDIS_STATUS oid_rt_pro_h2c_get_rate_table_hdl(struct oid_par_priv* poid_par_priv);
  140. //oid_rtl_seg_87_12_00
  141. NDIS_STATUS oid_rt_pro_encryption_ctrl_hdl(struct oid_par_priv* poid_par_priv);
  142. NDIS_STATUS oid_rt_pro_add_sta_info_hdl(struct oid_par_priv* poid_par_priv);
  143. NDIS_STATUS oid_rt_pro_dele_sta_info_hdl(struct oid_par_priv* poid_par_priv);
  144. NDIS_STATUS oid_rt_pro_query_dr_variable_hdl(struct oid_par_priv* poid_par_priv);
  145. NDIS_STATUS oid_rt_pro_rx_packet_type_hdl(struct oid_par_priv* poid_par_priv);
  146. NDIS_STATUS oid_rt_pro_read_efuse_hdl(struct oid_par_priv *poid_par_priv);
  147. NDIS_STATUS oid_rt_pro_write_efuse_hdl(struct oid_par_priv *poid_par_priv);
  148. NDIS_STATUS oid_rt_pro_rw_efuse_pgpkt_hdl(struct oid_par_priv *poid_par_priv);
  149. NDIS_STATUS oid_rt_get_efuse_current_size_hdl(struct oid_par_priv *poid_par_priv);
  150. NDIS_STATUS oid_rt_pro_efuse_hdl(struct oid_par_priv *poid_par_priv);
  151. NDIS_STATUS oid_rt_pro_efuse_map_hdl(struct oid_par_priv *poid_par_priv);
  152. NDIS_STATUS oid_rt_set_bandwidth_hdl(struct oid_par_priv* poid_par_priv);
  153. NDIS_STATUS oid_rt_set_crystal_cap_hdl(struct oid_par_priv* poid_par_priv);
  154. NDIS_STATUS oid_rt_set_rx_packet_type_hdl(struct oid_par_priv* poid_par_priv);
  155. NDIS_STATUS oid_rt_get_efuse_max_size_hdl(struct oid_par_priv* poid_par_priv);
  156. NDIS_STATUS oid_rt_pro_set_tx_agc_offset_hdl(struct oid_par_priv* poid_par_priv);
  157. NDIS_STATUS oid_rt_pro_set_pkt_test_mode_hdl(struct oid_par_priv* poid_par_priv);
  158. NDIS_STATUS oid_rt_get_thermal_meter_hdl(struct oid_par_priv* poid_par_priv);
  159. NDIS_STATUS oid_rt_reset_phy_rx_packet_count_hdl(struct oid_par_priv* poid_par_priv);
  160. NDIS_STATUS oid_rt_get_phy_rx_packet_received_hdl(struct oid_par_priv* poid_par_priv);
  161. NDIS_STATUS oid_rt_get_phy_rx_packet_crc32_error_hdl(struct oid_par_priv* poid_par_priv);
  162. NDIS_STATUS oid_rt_set_power_down_hdl(struct oid_par_priv* poid_par_priv);
  163. NDIS_STATUS oid_rt_get_power_mode_hdl(struct oid_par_priv* poid_par_priv);
  164. NDIS_STATUS oid_rt_pro_trigger_gpio_hdl(struct oid_par_priv *poid_par_priv);
  165. #ifdef _RTW_MP_IOCTL_C_
  166. const struct oid_obj_priv oid_rtl_seg_81_80_00[] =
  167. {
  168. {1, &oid_null_function}, //0x00 OID_RT_PRO_RESET_DUT
  169. {1, &oid_rt_pro_set_data_rate_hdl}, //0x01
  170. {1, &oid_rt_pro_start_test_hdl}, //0x02
  171. {1, &oid_rt_pro_stop_test_hdl}, //0x03
  172. {1, &oid_null_function}, //0x04 OID_RT_PRO_SET_PREAMBLE
  173. {1, &oid_null_function}, //0x05 OID_RT_PRO_SET_SCRAMBLER
  174. {1, &oid_null_function}, //0x06 OID_RT_PRO_SET_FILTER_BB
  175. {1, &oid_null_function}, //0x07 OID_RT_PRO_SET_MANUAL_DIVERSITY_BB
  176. {1, &oid_rt_pro_set_channel_direct_call_hdl}, //0x08
  177. {1, &oid_null_function}, //0x09 OID_RT_PRO_SET_SLEEP_MODE_DIRECT_CALL
  178. {1, &oid_null_function}, //0x0A OID_RT_PRO_SET_WAKE_MODE_DIRECT_CALL
  179. {1, &oid_rt_pro_set_continuous_tx_hdl}, //0x0B OID_RT_PRO_SET_TX_CONTINUOUS_DIRECT_CALL
  180. {1, &oid_rt_pro_set_single_carrier_tx_hdl}, //0x0C OID_RT_PRO_SET_SINGLE_CARRIER_TX_CONTINUOUS
  181. {1, &oid_null_function}, //0x0D OID_RT_PRO_SET_TX_ANTENNA_BB
  182. {1, &oid_rt_pro_set_antenna_bb_hdl}, //0x0E
  183. {1, &oid_null_function}, //0x0F OID_RT_PRO_SET_CR_SCRAMBLER
  184. {1, &oid_null_function}, //0x10 OID_RT_PRO_SET_CR_NEW_FILTER
  185. {1, &oid_rt_pro_set_tx_power_control_hdl}, //0x11 OID_RT_PRO_SET_TX_POWER_CONTROL
  186. {1, &oid_null_function}, //0x12 OID_RT_PRO_SET_CR_TX_CONFIG
  187. {1, &oid_null_function}, //0x13 OID_RT_PRO_GET_TX_POWER_CONTROL
  188. {1, &oid_null_function}, //0x14 OID_RT_PRO_GET_CR_SIGNAL_QUALITY
  189. {1, &oid_null_function}, //0x15 OID_RT_PRO_SET_CR_SETPOINT
  190. {1, &oid_null_function}, //0x16 OID_RT_PRO_SET_INTEGRATOR
  191. {1, &oid_null_function}, //0x17 OID_RT_PRO_SET_SIGNAL_QUALITY
  192. {1, &oid_null_function}, //0x18 OID_RT_PRO_GET_INTEGRATOR
  193. {1, &oid_null_function}, //0x19 OID_RT_PRO_GET_SIGNAL_QUALITY
  194. {1, &oid_null_function}, //0x1A OID_RT_PRO_QUERY_EEPROM_TYPE
  195. {1, &oid_null_function}, //0x1B OID_RT_PRO_WRITE_MAC_ADDRESS
  196. {1, &oid_null_function}, //0x1C OID_RT_PRO_READ_MAC_ADDRESS
  197. {1, &oid_null_function}, //0x1D OID_RT_PRO_WRITE_CIS_DATA
  198. {1, &oid_null_function}, //0x1E OID_RT_PRO_READ_CIS_DATA
  199. {1, &oid_null_function} //0x1F OID_RT_PRO_WRITE_POWER_CONTROL
  200. };
  201. const struct oid_obj_priv oid_rtl_seg_81_80_20[] =
  202. {
  203. {1, &oid_null_function}, //0x20 OID_RT_PRO_READ_POWER_CONTROL
  204. {1, &oid_null_function}, //0x21 OID_RT_PRO_WRITE_EEPROM
  205. {1, &oid_null_function}, //0x22 OID_RT_PRO_READ_EEPROM
  206. {1, &oid_rt_pro_reset_tx_packet_sent_hdl}, //0x23
  207. {1, &oid_rt_pro_query_tx_packet_sent_hdl}, //0x24
  208. {1, &oid_rt_pro_reset_rx_packet_received_hdl}, //0x25
  209. {1, &oid_rt_pro_query_rx_packet_received_hdl}, //0x26
  210. {1, &oid_rt_pro_query_rx_packet_crc32_error_hdl}, //0x27
  211. {1, &oid_null_function}, //0x28 OID_RT_PRO_QUERY_CURRENT_ADDRESS
  212. {1, &oid_null_function}, //0x29 OID_RT_PRO_QUERY_PERMANENT_ADDRESS
  213. {1, &oid_null_function}, //0x2A OID_RT_PRO_SET_PHILIPS_RF_PARAMETERS
  214. {1, &oid_rt_pro_set_carrier_suppression_tx_hdl},//0x2B OID_RT_PRO_SET_CARRIER_SUPPRESSION_TX
  215. {1, &oid_null_function}, //0x2C OID_RT_PRO_RECEIVE_PACKET
  216. {1, &oid_null_function}, //0x2D OID_RT_PRO_WRITE_EEPROM_BYTE
  217. {1, &oid_null_function}, //0x2E OID_RT_PRO_READ_EEPROM_BYTE
  218. {1, &oid_rt_pro_set_modulation_hdl} //0x2F
  219. };
  220. const struct oid_obj_priv oid_rtl_seg_81_80_40[] =
  221. {
  222. {1, &oid_null_function}, //0x40
  223. {1, &oid_null_function}, //0x41
  224. {1, &oid_null_function}, //0x42
  225. {1, &oid_rt_pro_set_single_tone_tx_hdl}, //0x43
  226. {1, &oid_null_function}, //0x44
  227. {1, &oid_null_function} //0x45
  228. };
  229. const struct oid_obj_priv oid_rtl_seg_81_80_80[] =
  230. {
  231. {1, &oid_null_function}, //0x80 OID_RT_DRIVER_OPTION
  232. {1, &oid_null_function}, //0x81 OID_RT_RF_OFF
  233. {1, &oid_null_function} //0x82 OID_RT_AUTH_STATUS
  234. };
  235. const struct oid_obj_priv oid_rtl_seg_81_85[] =
  236. {
  237. {1, &oid_rt_wireless_mode_hdl} //0x00 OID_RT_WIRELESS_MODE
  238. };
  239. struct oid_obj_priv oid_rtl_seg_81_87[] =
  240. {
  241. {1, &oid_null_function}, //0x80 OID_RT_PRO8187_WI_POLL
  242. {1, &oid_rt_pro_write_bb_reg_hdl}, //0x81
  243. {1, &oid_rt_pro_read_bb_reg_hdl}, //0x82
  244. {1, &oid_rt_pro_write_rf_reg_hdl}, //0x82
  245. {1, &oid_rt_pro_read_rf_reg_hdl} //0x83
  246. };
  247. struct oid_obj_priv oid_rtl_seg_87_11_00[] =
  248. {
  249. {1, &oid_rt_pro8711_join_bss_hdl}, //0x00 //S
  250. {1, &oid_rt_pro_read_register_hdl}, //0x01
  251. {1, &oid_rt_pro_write_register_hdl}, //0x02
  252. {1, &oid_rt_pro_burst_read_register_hdl}, //0x03
  253. {1, &oid_rt_pro_burst_write_register_hdl}, //0x04
  254. {1, &oid_rt_pro_write_txcmd_hdl}, //0x05
  255. {1, &oid_rt_pro_read16_eeprom_hdl}, //0x06
  256. {1, &oid_rt_pro_write16_eeprom_hdl}, //0x07
  257. {1, &oid_null_function}, //0x08 OID_RT_PRO_H2C_SET_COMMAND
  258. {1, &oid_null_function}, //0x09 OID_RT_PRO_H2C_QUERY_RESULT
  259. {1, &oid_rt_pro8711_wi_poll_hdl}, //0x0A
  260. {1, &oid_rt_pro8711_pkt_loss_hdl}, //0x0B
  261. {1, &oid_rt_rd_attrib_mem_hdl}, //0x0C
  262. {1, &oid_rt_wr_attrib_mem_hdl}, //0x0D
  263. {1, &oid_null_function}, //0x0E
  264. {1, &oid_null_function}, //0x0F
  265. {1, &oid_null_function}, //0x10 OID_RT_PRO_H2C_CMD_MODE
  266. {1, &oid_null_function}, //0x11 OID_RT_PRO_H2C_CMD_RSP_MODE
  267. {1, &oid_null_function}, //0X12 OID_RT_PRO_WAIT_C2H_EVENT
  268. {1, &oid_null_function}, //0X13 OID_RT_PRO_RW_ACCESS_PROTOCOL_TEST
  269. {1, &oid_null_function}, //0X14 OID_RT_PRO_SCSI_ACCESS_TEST
  270. {1, &oid_null_function}, //0X15 OID_RT_PRO_SCSI_TCPIPOFFLOAD_OUT
  271. {1, &oid_null_function}, //0X16 OID_RT_PRO_SCSI_TCPIPOFFLOAD_IN
  272. {1, &oid_null_function}, //0X17 OID_RT_RRO_RX_PKT_VIA_IOCTRL
  273. {1, &oid_null_function}, //0X18 OID_RT_RRO_RX_PKTARRAY_VIA_IOCTRL
  274. {1, &oid_null_function}, //0X19 OID_RT_RPO_SET_PWRMGT_TEST
  275. {1, &oid_null_function}, //0X1A
  276. {1, &oid_null_function}, //0X1B OID_RT_PRO_QRY_PWRMGT_TEST
  277. {1, &oid_null_function}, //0X1C OID_RT_RPO_ASYNC_RWIO_TEST
  278. {1, &oid_null_function}, //0X1D OID_RT_RPO_ASYNC_RWIO_POLL
  279. {1, &oid_rt_pro_set_rf_intfs_hdl}, //0X1E
  280. {1, &oid_rt_poll_rx_status_hdl} //0X1F
  281. };
  282. struct oid_obj_priv oid_rtl_seg_87_11_20[] =
  283. {
  284. {1, &oid_rt_pro_cfg_debug_message_hdl}, //0x20
  285. {1, &oid_rt_pro_set_data_rate_ex_hdl}, //0x21
  286. {1, &oid_rt_pro_set_basic_rate_hdl}, //0x22
  287. {1, &oid_rt_pro_read_tssi_hdl}, //0x23
  288. {1, &oid_rt_pro_set_power_tracking_hdl} //0x24
  289. };
  290. struct oid_obj_priv oid_rtl_seg_87_11_50[] =
  291. {
  292. {1, &oid_rt_pro_qry_pwrstate_hdl}, //0x50
  293. {1, &oid_rt_pro_set_pwrstate_hdl} //0x51
  294. };
  295. struct oid_obj_priv oid_rtl_seg_87_11_80[] =
  296. {
  297. {1, &oid_null_function} //0x80
  298. };
  299. struct oid_obj_priv oid_rtl_seg_87_11_B0[] =
  300. {
  301. {1, &oid_null_function} //0xB0
  302. };
  303. struct oid_obj_priv oid_rtl_seg_87_11_F0[] =
  304. {
  305. {1, &oid_null_function}, //0xF0
  306. {1, &oid_null_function}, //0xF1
  307. {1, &oid_null_function}, //0xF2
  308. {1, &oid_null_function}, //0xF3
  309. {1, &oid_null_function}, //0xF4
  310. {1, &oid_null_function}, //0xF5
  311. {1, &oid_null_function}, //0xF6
  312. {1, &oid_null_function}, //0xF7
  313. {1, &oid_null_function}, //0xF8
  314. {1, &oid_null_function}, //0xF9
  315. {1, &oid_null_function}, //0xFA
  316. {1, &oid_rt_pro_h2c_set_rate_table_hdl}, //0xFB
  317. {1, &oid_rt_pro_h2c_get_rate_table_hdl}, //0xFC
  318. {1, &oid_null_function}, //0xFD
  319. {1, &oid_null_function}, //0xFE OID_RT_PRO_H2C_C2H_LBK_TEST
  320. {1, &oid_null_function} //0xFF
  321. };
  322. struct oid_obj_priv oid_rtl_seg_87_12_00[]=
  323. {
  324. {1, &oid_rt_pro_encryption_ctrl_hdl}, //0x00 Q&S
  325. {1, &oid_rt_pro_add_sta_info_hdl}, //0x01 S
  326. {1, &oid_rt_pro_dele_sta_info_hdl}, //0x02 S
  327. {1, &oid_rt_pro_query_dr_variable_hdl}, //0x03 Q
  328. {1, &oid_rt_pro_rx_packet_type_hdl}, //0x04 Q,S
  329. {1, &oid_rt_pro_read_efuse_hdl}, //0x05 Q OID_RT_PRO_READ_EFUSE
  330. {1, &oid_rt_pro_write_efuse_hdl}, //0x06 S OID_RT_PRO_WRITE_EFUSE
  331. {1, &oid_rt_pro_rw_efuse_pgpkt_hdl}, //0x07 Q,S
  332. {1, &oid_rt_get_efuse_current_size_hdl}, //0x08 Q
  333. {1, &oid_rt_set_bandwidth_hdl}, //0x09
  334. {1, &oid_rt_set_crystal_cap_hdl}, //0x0a
  335. {1, &oid_rt_set_rx_packet_type_hdl}, //0x0b S
  336. {1, &oid_rt_get_efuse_max_size_hdl}, //0x0c
  337. {1, &oid_rt_pro_set_tx_agc_offset_hdl}, //0x0d
  338. {1, &oid_rt_pro_set_pkt_test_mode_hdl}, //0x0e
  339. {1, &oid_null_function}, //0x0f OID_RT_PRO_FOR_EVM_TEST_SETTING
  340. {1, &oid_rt_get_thermal_meter_hdl}, //0x10 Q OID_RT_PRO_GET_THERMAL_METER
  341. {1, &oid_rt_reset_phy_rx_packet_count_hdl}, //0x11 S OID_RT_RESET_PHY_RX_PACKET_COUNT
  342. {1, &oid_rt_get_phy_rx_packet_received_hdl}, //0x12 Q OID_RT_GET_PHY_RX_PACKET_RECEIVED
  343. {1, &oid_rt_get_phy_rx_packet_crc32_error_hdl}, //0x13 Q OID_RT_GET_PHY_RX_PACKET_CRC32_ERROR
  344. {1, &oid_rt_set_power_down_hdl}, //0x14 Q OID_RT_SET_POWER_DOWN
  345. {1, &oid_rt_get_power_mode_hdl} //0x15 Q OID_RT_GET_POWER_MODE
  346. };
  347. #else /* _RTL871X_MP_IOCTL_C_ */
  348. extern struct oid_obj_priv oid_rtl_seg_81_80_00[32];
  349. extern struct oid_obj_priv oid_rtl_seg_81_80_20[16];
  350. extern struct oid_obj_priv oid_rtl_seg_81_80_40[6];
  351. extern struct oid_obj_priv oid_rtl_seg_81_80_80[3];
  352. extern struct oid_obj_priv oid_rtl_seg_81_85[1];
  353. extern struct oid_obj_priv oid_rtl_seg_81_87[5];
  354. extern struct oid_obj_priv oid_rtl_seg_87_11_00[32];
  355. extern struct oid_obj_priv oid_rtl_seg_87_11_20[5];
  356. extern struct oid_obj_priv oid_rtl_seg_87_11_50[2];
  357. extern struct oid_obj_priv oid_rtl_seg_87_11_80[1];
  358. extern struct oid_obj_priv oid_rtl_seg_87_11_B0[1];
  359. extern struct oid_obj_priv oid_rtl_seg_87_11_F0[16];
  360. extern struct oid_obj_priv oid_rtl_seg_87_12_00[32];
  361. #endif /* _RTL871X_MP_IOCTL_C_ */
  362. struct rwreg_param{
  363. u32 offset;
  364. u32 width;
  365. u32 value;
  366. };
  367. struct bbreg_param{
  368. u32 offset;
  369. u32 phymask;
  370. u32 value;
  371. };
  372. /*
  373. struct rfchannel_param{
  374. u32 ch;
  375. u32 modem;
  376. };
  377. */
  378. struct txpower_param{
  379. u32 pwr_index;
  380. };
  381. struct datarate_param{
  382. u32 rate_index;
  383. };
  384. struct rfintfs_parm {
  385. u32 rfintfs;
  386. };
  387. typedef struct _mp_xmit_parm_ {
  388. u8 enable;
  389. u32 count;
  390. u16 length;
  391. u8 payload_type;
  392. u8 da[ETH_ALEN];
  393. }MP_XMIT_PARM, *PMP_XMIT_PARM;
  394. struct mp_xmit_packet {
  395. u32 len;
  396. u32 mem[MAX_MP_XMITBUF_SZ >> 2];
  397. };
  398. struct psmode_param {
  399. u32 ps_mode;
  400. u32 smart_ps;
  401. };
  402. //for OID_RT_PRO_READ16_EEPROM & OID_RT_PRO_WRITE16_EEPROM
  403. struct eeprom_rw_param {
  404. u32 offset;
  405. u16 value;
  406. };
  407. struct mp_ioctl_handler {
  408. u32 paramsize;
  409. u32 (*handler)(struct oid_par_priv* poid_par_priv);
  410. u32 oid;
  411. };
  412. struct mp_ioctl_param{
  413. u32 subcode;
  414. u32 len;
  415. u8 data[0];
  416. };
  417. #define GEN_MP_IOCTL_SUBCODE(code) _MP_IOCTL_ ## code ## _CMD_
  418. enum RTL871X_MP_IOCTL_SUBCODE {
  419. GEN_MP_IOCTL_SUBCODE(MP_START), /*0*/
  420. GEN_MP_IOCTL_SUBCODE(MP_STOP),
  421. GEN_MP_IOCTL_SUBCODE(READ_REG),
  422. GEN_MP_IOCTL_SUBCODE(WRITE_REG),
  423. GEN_MP_IOCTL_SUBCODE(READ_BB_REG),
  424. GEN_MP_IOCTL_SUBCODE(WRITE_BB_REG), /*5*/
  425. GEN_MP_IOCTL_SUBCODE(READ_RF_REG),
  426. GEN_MP_IOCTL_SUBCODE(WRITE_RF_REG),
  427. GEN_MP_IOCTL_SUBCODE(SET_CHANNEL),
  428. GEN_MP_IOCTL_SUBCODE(SET_TXPOWER),
  429. GEN_MP_IOCTL_SUBCODE(SET_DATARATE), /*10*/
  430. GEN_MP_IOCTL_SUBCODE(SET_BANDWIDTH),
  431. GEN_MP_IOCTL_SUBCODE(SET_ANTENNA),
  432. GEN_MP_IOCTL_SUBCODE(CNTU_TX),
  433. GEN_MP_IOCTL_SUBCODE(SC_TX),
  434. GEN_MP_IOCTL_SUBCODE(CS_TX), /*15*/
  435. GEN_MP_IOCTL_SUBCODE(ST_TX),
  436. GEN_MP_IOCTL_SUBCODE(IOCTL_XMIT_PACKET),
  437. GEN_MP_IOCTL_SUBCODE(SET_RX_PKT_TYPE),
  438. GEN_MP_IOCTL_SUBCODE(RESET_PHY_RX_PKT_CNT),
  439. GEN_MP_IOCTL_SUBCODE(GET_PHY_RX_PKT_RECV), /*20*/
  440. GEN_MP_IOCTL_SUBCODE(GET_PHY_RX_PKT_ERROR),
  441. GEN_MP_IOCTL_SUBCODE(READ16_EEPROM),
  442. GEN_MP_IOCTL_SUBCODE(WRITE16_EEPROM),
  443. GEN_MP_IOCTL_SUBCODE(EFUSE),
  444. GEN_MP_IOCTL_SUBCODE(EFUSE_MAP), /*25*/
  445. GEN_MP_IOCTL_SUBCODE(GET_EFUSE_MAX_SIZE),
  446. GEN_MP_IOCTL_SUBCODE(GET_EFUSE_CURRENT_SIZE),
  447. GEN_MP_IOCTL_SUBCODE(GET_THERMAL_METER),
  448. GEN_MP_IOCTL_SUBCODE(SET_PTM),
  449. GEN_MP_IOCTL_SUBCODE(SET_POWER_DOWN), /*30*/
  450. GEN_MP_IOCTL_SUBCODE(TRIGGER_GPIO),
  451. GEN_MP_IOCTL_SUBCODE(SET_DM_BT), /*35*/
  452. GEN_MP_IOCTL_SUBCODE(DEL_BA), /*36*/
  453. GEN_MP_IOCTL_SUBCODE(GET_WIFI_STATUS), /*37*/
  454. MAX_MP_IOCTL_SUBCODE,
  455. };
  456. u32 mp_ioctl_xmit_packet_hdl(struct oid_par_priv* poid_par_priv);
  457. #ifdef _RTW_MP_IOCTL_C_
  458. #define GEN_MP_IOCTL_HANDLER(sz, hdl, oid) {sz, hdl, oid},
  459. #define EXT_MP_IOCTL_HANDLER(sz, subcode, oid) {sz, mp_ioctl_ ## subcode ## _hdl, oid},
  460. struct mp_ioctl_handler mp_ioctl_hdl[] = {
  461. /*0*/ GEN_MP_IOCTL_HANDLER(sizeof(u32), oid_rt_pro_start_test_hdl, OID_RT_PRO_START_TEST)
  462. GEN_MP_IOCTL_HANDLER(sizeof(u32), oid_rt_pro_stop_test_hdl, OID_RT_PRO_STOP_TEST)
  463. GEN_MP_IOCTL_HANDLER(sizeof(struct rwreg_param), oid_rt_pro_read_register_hdl, OID_RT_PRO_READ_REGISTER)
  464. GEN_MP_IOCTL_HANDLER(sizeof(struct rwreg_param), oid_rt_pro_write_register_hdl, OID_RT_PRO_WRITE_REGISTER)
  465. GEN_MP_IOCTL_HANDLER(sizeof(struct bb_reg_param), oid_rt_pro_read_bb_reg_hdl, OID_RT_PRO_READ_BB_REG)
  466. /*5*/ GEN_MP_IOCTL_HANDLER(sizeof(struct bb_reg_param), oid_rt_pro_write_bb_reg_hdl, OID_RT_PRO_WRITE_BB_REG)
  467. GEN_MP_IOCTL_HANDLER(sizeof(struct rf_reg_param), oid_rt_pro_read_rf_reg_hdl, OID_RT_PRO_RF_READ_REGISTRY)
  468. GEN_MP_IOCTL_HANDLER(sizeof(struct rf_reg_param), oid_rt_pro_write_rf_reg_hdl, OID_RT_PRO_RF_WRITE_REGISTRY)
  469. GEN_MP_IOCTL_HANDLER(sizeof(u32), oid_rt_pro_set_channel_direct_call_hdl, OID_RT_PRO_SET_CHANNEL_DIRECT_CALL)
  470. GEN_MP_IOCTL_HANDLER(sizeof(struct txpower_param), oid_rt_pro_set_tx_power_control_hdl, OID_RT_PRO_SET_TX_POWER_CONTROL)
  471. /*10*/ GEN_MP_IOCTL_HANDLER(sizeof(u32), oid_rt_pro_set_data_rate_hdl, OID_RT_PRO_SET_DATA_RATE)
  472. GEN_MP_IOCTL_HANDLER(sizeof(u32), oid_rt_set_bandwidth_hdl, OID_RT_SET_BANDWIDTH)
  473. GEN_MP_IOCTL_HANDLER(sizeof(u32), oid_rt_pro_set_antenna_bb_hdl, OID_RT_PRO_SET_ANTENNA_BB)
  474. GEN_MP_IOCTL_HANDLER(sizeof(u32), oid_rt_pro_set_continuous_tx_hdl, OID_RT_PRO_SET_CONTINUOUS_TX)
  475. GEN_MP_IOCTL_HANDLER(sizeof(u32), oid_rt_pro_set_single_carrier_tx_hdl, OID_RT_PRO_SET_SINGLE_CARRIER_TX)
  476. /*15*/ GEN_MP_IOCTL_HANDLER(sizeof(u32), oid_rt_pro_set_carrier_suppression_tx_hdl, OID_RT_PRO_SET_CARRIER_SUPPRESSION_TX)
  477. GEN_MP_IOCTL_HANDLER(sizeof(u32), oid_rt_pro_set_single_tone_tx_hdl, OID_RT_PRO_SET_SINGLE_TONE_TX)
  478. EXT_MP_IOCTL_HANDLER(0, xmit_packet, 0)
  479. GEN_MP_IOCTL_HANDLER(sizeof(u32), oid_rt_set_rx_packet_type_hdl, OID_RT_SET_RX_PACKET_TYPE)
  480. GEN_MP_IOCTL_HANDLER(0, oid_rt_reset_phy_rx_packet_count_hdl, OID_RT_RESET_PHY_RX_PACKET_COUNT)
  481. /*20*/ GEN_MP_IOCTL_HANDLER(sizeof(u32), oid_rt_get_phy_rx_packet_received_hdl, OID_RT_GET_PHY_RX_PACKET_RECEIVED)
  482. GEN_MP_IOCTL_HANDLER(sizeof(u32), oid_rt_get_phy_rx_packet_crc32_error_hdl, OID_RT_GET_PHY_RX_PACKET_CRC32_ERROR)
  483. GEN_MP_IOCTL_HANDLER(sizeof(struct eeprom_rw_param), NULL, 0)
  484. GEN_MP_IOCTL_HANDLER(sizeof(struct eeprom_rw_param), NULL, 0)
  485. GEN_MP_IOCTL_HANDLER(sizeof(EFUSE_ACCESS_STRUCT), oid_rt_pro_efuse_hdl, OID_RT_PRO_EFUSE)
  486. /*25*/ GEN_MP_IOCTL_HANDLER(0, oid_rt_pro_efuse_map_hdl, OID_RT_PRO_EFUSE_MAP)
  487. GEN_MP_IOCTL_HANDLER(sizeof(u32), oid_rt_get_efuse_max_size_hdl, OID_RT_GET_EFUSE_MAX_SIZE)
  488. GEN_MP_IOCTL_HANDLER(sizeof(u32), oid_rt_get_efuse_current_size_hdl, OID_RT_GET_EFUSE_CURRENT_SIZE)
  489. GEN_MP_IOCTL_HANDLER(sizeof(u32), oid_rt_get_thermal_meter_hdl, OID_RT_PRO_GET_THERMAL_METER)
  490. GEN_MP_IOCTL_HANDLER(sizeof(u8), oid_rt_pro_set_power_tracking_hdl, OID_RT_PRO_SET_POWER_TRACKING)
  491. /*30*/ GEN_MP_IOCTL_HANDLER(sizeof(u8), oid_rt_set_power_down_hdl, OID_RT_SET_POWER_DOWN)
  492. /*31*/ GEN_MP_IOCTL_HANDLER(0, oid_rt_pro_trigger_gpio_hdl, 0)
  493. };
  494. #else /* _RTW_MP_IOCTL_C_ */
  495. extern struct mp_ioctl_handler mp_ioctl_hdl[];
  496. #endif /* _RTW_MP_IOCTL_C_ */
  497. #endif