rtw_mp.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719
  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_H_
  21. #define _RTW_MP_H_
  22. #if 0
  23. #define MPT_NOOP 0
  24. #define MPT_READ_MAC_1BYTE 1
  25. #define MPT_READ_MAC_2BYTE 2
  26. #define MPT_READ_MAC_4BYTE 3
  27. #define MPT_WRITE_MAC_1BYTE 4
  28. #define MPT_WRITE_MAC_2BYTE 5
  29. #define MPT_WRITE_MAC_4BYTE 6
  30. #define MPT_READ_BB_CCK 7
  31. #define MPT_WRITE_BB_CCK 8
  32. #define MPT_READ_BB_OFDM 9
  33. #define MPT_WRITE_BB_OFDM 10
  34. #define MPT_READ_RF 11
  35. #define MPT_WRITE_RF 12
  36. #define MPT_READ_EEPROM_1BYTE 13
  37. #define MPT_WRITE_EEPROM_1BYTE 14
  38. #define MPT_READ_EEPROM_2BYTE 15
  39. #define MPT_WRITE_EEPROM_2BYTE 16
  40. #define MPT_SET_CSTHRESHOLD 21
  41. #define MPT_SET_INITGAIN 22
  42. #define MPT_SWITCH_BAND 23
  43. #define MPT_SWITCH_CHANNEL 24
  44. #define MPT_SET_DATARATE 25
  45. #define MPT_SWITCH_ANTENNA 26
  46. #define MPT_SET_TX_POWER 27
  47. #define MPT_SET_CONT_TX 28
  48. #define MPT_SET_SINGLE_CARRIER 29
  49. #define MPT_SET_CARRIER_SUPPRESSION 30
  50. #define MPT_GET_RATE_TABLE 31
  51. #define MPT_READ_TSSI 32
  52. #define MPT_GET_THERMAL_METER 33
  53. #endif
  54. #define MAX_MP_XMITBUF_SZ 2048
  55. #define NR_MP_XMITFRAME 8
  56. struct mp_xmit_frame
  57. {
  58. _list list;
  59. struct pkt_attrib attrib;
  60. _pkt *pkt;
  61. int frame_tag;
  62. _adapter *padapter;
  63. #ifdef CONFIG_USB_HCI
  64. //insert urb, irp, and irpcnt info below...
  65. //max frag_cnt = 8
  66. u8 *mem_addr;
  67. u32 sz[8];
  68. #if defined(PLATFORM_OS_XP) || defined(PLATFORM_LINUX)
  69. PURB pxmit_urb[8];
  70. #endif
  71. #ifdef PLATFORM_OS_XP
  72. PIRP pxmit_irp[8];
  73. #endif
  74. u8 bpending[8];
  75. sint ac_tag[8];
  76. sint last[8];
  77. uint irpcnt;
  78. uint fragcnt;
  79. #endif /* CONFIG_USB_HCI */
  80. uint mem[(MAX_MP_XMITBUF_SZ >> 2)];
  81. };
  82. struct mp_wiparam
  83. {
  84. u32 bcompleted;
  85. u32 act_type;
  86. u32 io_offset;
  87. u32 io_value;
  88. };
  89. typedef void(*wi_act_func)(void* padapter);
  90. #ifdef PLATFORM_WINDOWS
  91. struct mp_wi_cntx
  92. {
  93. u8 bmpdrv_unload;
  94. // Work Item
  95. NDIS_WORK_ITEM mp_wi;
  96. NDIS_EVENT mp_wi_evt;
  97. _lock mp_wi_lock;
  98. u8 bmp_wi_progress;
  99. wi_act_func curractfunc;
  100. // Variable needed in each implementation of CurrActFunc.
  101. struct mp_wiparam param;
  102. };
  103. #endif
  104. struct mp_tx
  105. {
  106. u8 stop;
  107. u32 count, sended;
  108. u8 payload;
  109. struct pkt_attrib attrib;
  110. struct tx_desc desc;
  111. u8 resvdtx[7];
  112. u8 *pallocated_buf;
  113. u8 *buf;
  114. u32 buf_size, write_size;
  115. _thread_hdl_ PktTxThread;
  116. };
  117. #if defined(CONFIG_RTL8192C) || defined(CONFIG_RTL8192D) || defined(CONFIG_RTL8723A) || defined(CONFIG_RTL8188E) || defined(CONFIG_RTL8812A) || defined(CONFIG_RTL8821A) ||defined(CONFIG_RTL8192E) || defined(CONFIG_RTL8723B)
  118. #define MP_MAX_LINES 1000
  119. #define MP_MAX_LINES_BYTES 256
  120. #define u1Byte u8
  121. #define s1Byte s8
  122. #define u4Byte u32
  123. #define s4Byte s32
  124. #define u1Byte u8
  125. #define pu1Byte u8*
  126. #define u2Byte u16
  127. #define pu2Byte u16*
  128. #define u4Byte u32
  129. #define pu4Byte u32*
  130. #define u8Byte u64
  131. #define pu8Byte u64*
  132. #define s1Byte s8
  133. #define ps1Byte s8*
  134. #define s2Byte s16
  135. #define ps2Byte s16*
  136. #define s4Byte s32
  137. #define ps4Byte s32*
  138. #define s8Byte s64
  139. #define ps8Byte s64*
  140. #define UCHAR u8
  141. #define USHORT u16
  142. #define UINT u32
  143. #define ULONG u32
  144. #define PULONG u32*
  145. typedef VOID (*MPT_WORK_ITEM_HANDLER)(IN PVOID Adapter);
  146. typedef struct _MPT_CONTEXT
  147. {
  148. // Indicate if we have started Mass Production Test.
  149. BOOLEAN bMassProdTest;
  150. // Indicate if the driver is unloading or unloaded.
  151. BOOLEAN bMptDrvUnload;
  152. _sema MPh2c_Sema;
  153. _timer MPh2c_timeout_timer;
  154. // Event used to sync H2c for BT control
  155. BOOLEAN MptH2cRspEvent;
  156. BOOLEAN MptBtC2hEvent;
  157. BOOLEAN bMPh2c_timeout;
  158. /* 8190 PCI does not support NDIS_WORK_ITEM. */
  159. // Work Item for Mass Production Test.
  160. //NDIS_WORK_ITEM MptWorkItem;
  161. // RT_WORK_ITEM MptWorkItem;
  162. // Event used to sync the case unloading driver and MptWorkItem is still in progress.
  163. // NDIS_EVENT MptWorkItemEvent;
  164. // To protect the following variables.
  165. // NDIS_SPIN_LOCK MptWorkItemSpinLock;
  166. // Indicate a MptWorkItem is scheduled and not yet finished.
  167. BOOLEAN bMptWorkItemInProgress;
  168. // An instance which implements function and context of MptWorkItem.
  169. MPT_WORK_ITEM_HANDLER CurrMptAct;
  170. // 1=Start, 0=Stop from UI.
  171. ULONG MptTestStart;
  172. // _TEST_MODE, defined in MPT_Req2.h
  173. ULONG MptTestItem;
  174. // Variable needed in each implementation of CurrMptAct.
  175. ULONG MptActType; // Type of action performed in CurrMptAct.
  176. // The Offset of IO operation is depend of MptActType.
  177. ULONG MptIoOffset;
  178. // The Value of IO operation is depend of MptActType.
  179. ULONG MptIoValue;
  180. // The RfPath of IO operation is depend of MptActType.
  181. ULONG MptRfPath;
  182. WIRELESS_MODE MptWirelessModeToSw; // Wireless mode to switch.
  183. u8 MptChannelToSw; // Channel to switch.
  184. u8 MptInitGainToSet; // Initial gain to set.
  185. //ULONG bMptAntennaA; // TRUE if we want to use antenna A.
  186. ULONG MptBandWidth; // bandwidth to switch.
  187. ULONG MptRateIndex; // rate index.
  188. // Register value kept for Single Carrier Tx test.
  189. u8 btMpCckTxPower;
  190. // Register value kept for Single Carrier Tx test.
  191. u8 btMpOfdmTxPower;
  192. // For MP Tx Power index
  193. u8 TxPwrLevel[2]; // rf-A, rf-B
  194. u32 RegTxPwrLimit;
  195. // Content of RCR Regsiter for Mass Production Test.
  196. ULONG MptRCR;
  197. // TRUE if we only receive packets with specific pattern.
  198. BOOLEAN bMptFilterPattern;
  199. // Rx OK count, statistics used in Mass Production Test.
  200. ULONG MptRxOkCnt;
  201. // Rx CRC32 error count, statistics used in Mass Production Test.
  202. ULONG MptRxCrcErrCnt;
  203. BOOLEAN bCckContTx; // TRUE if we are in CCK Continuous Tx test.
  204. BOOLEAN bOfdmContTx; // TRUE if we are in OFDM Continuous Tx test.
  205. BOOLEAN bStartContTx; // TRUE if we have start Continuous Tx test.
  206. // TRUE if we are in Single Carrier Tx test.
  207. BOOLEAN bSingleCarrier;
  208. // TRUE if we are in Carrier Suppression Tx Test.
  209. BOOLEAN bCarrierSuppression;
  210. //TRUE if we are in Single Tone Tx test.
  211. BOOLEAN bSingleTone;
  212. // ACK counter asked by K.Y..
  213. BOOLEAN bMptEnableAckCounter;
  214. ULONG MptAckCounter;
  215. // SD3 Willis For 8192S to save 1T/2T RF table for ACUT Only fro ACUT delete later ~~~!
  216. //s1Byte BufOfLines[2][MAX_LINES_HWCONFIG_TXT][MAX_BYTES_LINE_HWCONFIG_TXT];
  217. //s1Byte BufOfLines[2][MP_MAX_LINES][MP_MAX_LINES_BYTES];
  218. //s4Byte RfReadLine[2];
  219. u8 APK_bound[2]; //for APK path A/path B
  220. BOOLEAN bMptIndexEven;
  221. u8 backup0xc50;
  222. u8 backup0xc58;
  223. u8 backup0xc30;
  224. u8 backup0x52_RF_A;
  225. u8 backup0x52_RF_B;
  226. u1Byte h2cReqNum;
  227. u1Byte c2hBuf[20];
  228. u1Byte btInBuf[100];
  229. ULONG mptOutLen;
  230. u1Byte mptOutBuf[100];
  231. }MPT_CONTEXT, *PMPT_CONTEXT;
  232. #endif
  233. //#endif
  234. /* E-Fuse */
  235. #ifdef CONFIG_RTL8192D
  236. #define EFUSE_MAP_SIZE 256
  237. #endif
  238. #ifdef CONFIG_RTL8192C
  239. #define EFUSE_MAP_SIZE 128
  240. #endif
  241. #ifdef CONFIG_RTL8723A
  242. #define EFUSE_MAP_SIZE 256
  243. #endif
  244. #ifdef CONFIG_RTL8188E
  245. #define EFUSE_MAP_SIZE 512
  246. #endif
  247. #if defined(CONFIG_RTL8812A) || defined(CONFIG_RTL8821A)
  248. #define EFUSE_MAP_SIZE 512
  249. #endif
  250. #ifdef CONFIG_RTL8192E
  251. #define EFUSE_MAP_SIZE 512
  252. #endif
  253. #ifdef CONFIG_RTL8723B
  254. #define EFUSE_MAP_SIZE 512
  255. #endif
  256. #if defined(CONFIG_RTL8812A) || defined(CONFIG_RTL8821A)
  257. #define EFUSE_MAX_SIZE 1024
  258. #elif defined(CONFIG_RTL8188E)
  259. #define EFUSE_MAX_SIZE 256
  260. #else
  261. #define EFUSE_MAX_SIZE 512
  262. #endif
  263. /* end of E-Fuse */
  264. //#define RTPRIV_IOCTL_MP ( SIOCIWFIRSTPRIV + 0x17)
  265. enum {
  266. WRITE_REG = 1,
  267. READ_REG,
  268. WRITE_RF,
  269. READ_RF,
  270. MP_START,
  271. MP_STOP,
  272. MP_RATE,
  273. MP_CHANNEL,
  274. MP_BANDWIDTH,
  275. MP_TXPOWER,
  276. MP_ANT_TX,
  277. MP_ANT_RX,
  278. MP_CTX,
  279. MP_QUERY,
  280. MP_ARX,
  281. MP_PSD,
  282. MP_PWRTRK,
  283. MP_THER,
  284. MP_IOCTL,
  285. EFUSE_GET,
  286. EFUSE_SET,
  287. MP_RESET_STATS,
  288. MP_DUMP,
  289. MP_PHYPARA,
  290. MP_SetRFPathSwh,
  291. MP_QueryDrvStats,
  292. MP_SetBT,
  293. CTA_TEST,
  294. MP_NULL,
  295. MP_GET_TXPOWER_INX,
  296. };
  297. struct mp_priv
  298. {
  299. _adapter *papdater;
  300. //Testing Flag
  301. u32 mode;//0 for normal type packet, 1 for loopback packet (16bytes TXCMD)
  302. u32 prev_fw_state;
  303. //OID cmd handler
  304. struct mp_wiparam workparam;
  305. // u8 act_in_progress;
  306. //Tx Section
  307. u8 TID;
  308. u32 tx_pktcount;
  309. struct mp_tx tx;
  310. //Rx Section
  311. u32 rx_pktcount;
  312. u32 rx_crcerrpktcount;
  313. u32 rx_pktloss;
  314. struct recv_stat rxstat;
  315. //RF/BB relative
  316. u8 channel;
  317. u8 bandwidth;
  318. u8 prime_channel_offset;
  319. u8 txpoweridx;
  320. u8 txpoweridx_b;
  321. u8 rateidx;
  322. u32 preamble;
  323. // u8 modem;
  324. u32 CrystalCap;
  325. // u32 curr_crystalcap;
  326. u16 antenna_tx;
  327. u16 antenna_rx;
  328. // u8 curr_rfpath;
  329. u8 check_mp_pkt;
  330. u8 bSetTxPower;
  331. // uint ForcedDataRate;
  332. struct wlan_network mp_network;
  333. NDIS_802_11_MAC_ADDRESS network_macaddr;
  334. #ifdef PLATFORM_WINDOWS
  335. u32 rx_testcnt;
  336. u32 rx_testcnt1;
  337. u32 rx_testcnt2;
  338. u32 tx_testcnt;
  339. u32 tx_testcnt1;
  340. struct mp_wi_cntx wi_cntx;
  341. u8 h2c_result;
  342. u8 h2c_seqnum;
  343. u16 h2c_cmdcode;
  344. u8 h2c_resp_parambuf[512];
  345. _lock h2c_lock;
  346. _lock wkitm_lock;
  347. u32 h2c_cmdcnt;
  348. NDIS_EVENT h2c_cmd_evt;
  349. NDIS_EVENT c2h_set;
  350. NDIS_EVENT h2c_clr;
  351. NDIS_EVENT cpwm_int;
  352. NDIS_EVENT scsir_full_evt;
  353. NDIS_EVENT scsiw_empty_evt;
  354. #endif
  355. u8 *pallocated_mp_xmitframe_buf;
  356. u8 *pmp_xmtframe_buf;
  357. _queue free_mp_xmitqueue;
  358. u32 free_mp_xmitframe_cnt;
  359. MPT_CONTEXT MptCtx;
  360. };
  361. typedef struct _IOCMD_STRUCT_ {
  362. u8 cmdclass;
  363. u16 value;
  364. u8 index;
  365. }IOCMD_STRUCT;
  366. struct rf_reg_param {
  367. u32 path;
  368. u32 offset;
  369. u32 value;
  370. };
  371. struct bb_reg_param {
  372. u32 offset;
  373. u32 value;
  374. };
  375. //=======================================================================
  376. #define LOWER _TRUE
  377. #define RAISE _FALSE
  378. /* Hardware Registers */
  379. #if 0
  380. #if 0
  381. #define IOCMD_CTRL_REG 0x102502C0
  382. #define IOCMD_DATA_REG 0x102502C4
  383. #else
  384. #define IOCMD_CTRL_REG 0x10250370
  385. #define IOCMD_DATA_REG 0x10250374
  386. #endif
  387. #define IOCMD_GET_THERMAL_METER 0xFD000028
  388. #define IOCMD_CLASS_BB_RF 0xF0
  389. #define IOCMD_BB_READ_IDX 0x00
  390. #define IOCMD_BB_WRITE_IDX 0x01
  391. #define IOCMD_RF_READ_IDX 0x02
  392. #define IOCMD_RF_WRIT_IDX 0x03
  393. #endif
  394. #define BB_REG_BASE_ADDR 0x800
  395. /* MP variables */
  396. #if 0
  397. #define _2MAC_MODE_ 0
  398. #define _LOOPBOOK_MODE_ 1
  399. #endif
  400. typedef enum _MP_MODE_ {
  401. MP_OFF,
  402. MP_ON,
  403. MP_ERR,
  404. MP_CONTINUOUS_TX,
  405. MP_SINGLE_CARRIER_TX,
  406. MP_CARRIER_SUPPRISSION_TX,
  407. MP_SINGLE_TONE_TX,
  408. MP_PACKET_TX,
  409. MP_PACKET_RX
  410. } MP_MODE;
  411. #define MAX_RF_PATH_NUMS RF_PATH_MAX
  412. extern u8 mpdatarate[NumRates];
  413. /* MP set force data rate base on the definition. */
  414. typedef enum _MPT_RATE_INDEX
  415. {
  416. /* CCK rate. */
  417. MPT_RATE_1M =1 , /* 0 */
  418. MPT_RATE_2M,
  419. MPT_RATE_55M,
  420. MPT_RATE_11M, /* 3 */
  421. /* OFDM rate. */
  422. MPT_RATE_6M, /* 4 */
  423. MPT_RATE_9M,
  424. MPT_RATE_12M,
  425. MPT_RATE_18M,
  426. MPT_RATE_24M,
  427. MPT_RATE_36M,
  428. MPT_RATE_48M,
  429. MPT_RATE_54M, /* 11 */
  430. /* HT rate. */
  431. MPT_RATE_MCS0, /* 12 */
  432. MPT_RATE_MCS1,
  433. MPT_RATE_MCS2,
  434. MPT_RATE_MCS3,
  435. MPT_RATE_MCS4,
  436. MPT_RATE_MCS5,
  437. MPT_RATE_MCS6,
  438. MPT_RATE_MCS7, /* 19 */
  439. MPT_RATE_MCS8,
  440. MPT_RATE_MCS9,
  441. MPT_RATE_MCS10,
  442. MPT_RATE_MCS11,
  443. MPT_RATE_MCS12,
  444. MPT_RATE_MCS13,
  445. MPT_RATE_MCS14,
  446. MPT_RATE_MCS15, /* 27 */
  447. /* VHT rate. Total: 20*/
  448. MPT_RATE_VHT1SS_MCS0 = 100,// To reserve MCS16~MCS31, the index starts from #100.
  449. MPT_RATE_VHT1SS_MCS1, // #101
  450. MPT_RATE_VHT1SS_MCS2,
  451. MPT_RATE_VHT1SS_MCS3,
  452. MPT_RATE_VHT1SS_MCS4,
  453. MPT_RATE_VHT1SS_MCS5,
  454. MPT_RATE_VHT1SS_MCS6, // #106
  455. MPT_RATE_VHT1SS_MCS7,
  456. MPT_RATE_VHT1SS_MCS8,
  457. MPT_RATE_VHT1SS_MCS9,
  458. MPT_RATE_VHT2SS_MCS0,
  459. MPT_RATE_VHT2SS_MCS1, // #111
  460. MPT_RATE_VHT2SS_MCS2,
  461. MPT_RATE_VHT2SS_MCS3,
  462. MPT_RATE_VHT2SS_MCS4,
  463. MPT_RATE_VHT2SS_MCS5,
  464. MPT_RATE_VHT2SS_MCS6, // #116
  465. MPT_RATE_VHT2SS_MCS7,
  466. MPT_RATE_VHT2SS_MCS8,
  467. MPT_RATE_VHT2SS_MCS9,
  468. MPT_RATE_LAST
  469. }MPT_RATE_E, *PMPT_RATE_E;
  470. #define MAX_TX_PWR_INDEX_N_MODE 64 // 0x3F
  471. typedef enum _POWER_MODE_ {
  472. POWER_LOW = 0,
  473. POWER_NORMAL
  474. }POWER_MODE;
  475. // The following enumeration is used to define the value of Reg0xD00[30:28] or JaguarReg0x914[18:16].
  476. typedef enum _OFDM_TX_MODE {
  477. OFDM_ALL_OFF = 0,
  478. OFDM_ContinuousTx = 1,
  479. OFDM_SingleCarrier = 2,
  480. OFDM_SingleTone = 4,
  481. } OFDM_TX_MODE;
  482. #define RX_PKT_BROADCAST 1
  483. #define RX_PKT_DEST_ADDR 2
  484. #define RX_PKT_PHY_MATCH 3
  485. #if 0
  486. #define RPTMaxCount 0x000FFFFF;
  487. // parameter 1 : BitMask
  488. // bit 0 : OFDM PPDU
  489. // bit 1 : OFDM False Alarm
  490. // bit 2 : OFDM MPDU OK
  491. // bit 3 : OFDM MPDU Fail
  492. // bit 4 : CCK PPDU
  493. // bit 5 : CCK False Alarm
  494. // bit 6 : CCK MPDU ok
  495. // bit 7 : CCK MPDU fail
  496. // bit 8 : HT PPDU counter
  497. // bit 9 : HT false alarm
  498. // bit 10 : HT MPDU total
  499. // bit 11 : HT MPDU OK
  500. // bit 12 : HT MPDU fail
  501. // bit 15 : RX full drop
  502. typedef enum _RXPHY_BITMASK_
  503. {
  504. OFDM_PPDU_BIT = 0,
  505. OFDM_FALSE_BIT,
  506. OFDM_MPDU_OK_BIT,
  507. OFDM_MPDU_FAIL_BIT,
  508. CCK_PPDU_BIT,
  509. CCK_FALSE_BIT,
  510. CCK_MPDU_OK_BIT,
  511. CCK_MPDU_FAIL_BIT,
  512. HT_PPDU_BIT,
  513. HT_FALSE_BIT,
  514. HT_MPDU_BIT,
  515. HT_MPDU_OK_BIT,
  516. HT_MPDU_FAIL_BIT,
  517. } RXPHY_BITMASK;
  518. #endif
  519. typedef enum _ENCRY_CTRL_STATE_ {
  520. HW_CONTROL, //hw encryption& decryption
  521. SW_CONTROL, //sw encryption& decryption
  522. HW_ENCRY_SW_DECRY, //hw encryption & sw decryption
  523. SW_ENCRY_HW_DECRY //sw encryption & hw decryption
  524. }ENCRY_CTRL_STATE;
  525. //=======================================================================
  526. //extern struct mp_xmit_frame *alloc_mp_xmitframe(struct mp_priv *pmp_priv);
  527. //extern int free_mp_xmitframe(struct xmit_priv *pxmitpriv, struct mp_xmit_frame *pmp_xmitframe);
  528. extern s32 init_mp_priv(PADAPTER padapter);
  529. extern void free_mp_priv(struct mp_priv *pmp_priv);
  530. extern s32 MPT_InitializeAdapter(PADAPTER padapter, u8 Channel);
  531. extern void MPT_DeInitAdapter(PADAPTER padapter);
  532. extern s32 mp_start_test(PADAPTER padapter);
  533. extern void mp_stop_test(PADAPTER padapter);
  534. //=======================================================================
  535. //extern void IQCalibrateBcut(PADAPTER pAdapter);
  536. //extern u32 bb_reg_read(PADAPTER Adapter, u16 offset);
  537. //extern u8 bb_reg_write(PADAPTER Adapter, u16 offset, u32 value);
  538. //extern u32 rf_reg_read(PADAPTER Adapter, u8 path, u8 offset);
  539. //extern u8 rf_reg_write(PADAPTER Adapter, u8 path, u8 offset, u32 value);
  540. //extern u32 get_bb_reg(PADAPTER Adapter, u16 offset, u32 bitmask);
  541. //extern u8 set_bb_reg(PADAPTER Adapter, u16 offset, u32 bitmask, u32 value);
  542. //extern u32 get_rf_reg(PADAPTER Adapter, u8 path, u8 offset, u32 bitmask);
  543. //extern u8 set_rf_reg(PADAPTER Adapter, u8 path, u8 offset, u32 bitmask, u32 value);
  544. extern u32 _read_rfreg(PADAPTER padapter, u8 rfpath, u32 addr, u32 bitmask);
  545. extern void _write_rfreg(PADAPTER padapter, u8 rfpath, u32 addr, u32 bitmask, u32 val);
  546. extern u32 read_macreg(_adapter *padapter, u32 addr, u32 sz);
  547. extern void write_macreg(_adapter *padapter, u32 addr, u32 val, u32 sz);
  548. extern u32 read_bbreg(_adapter *padapter, u32 addr, u32 bitmask);
  549. extern void write_bbreg(_adapter *padapter, u32 addr, u32 bitmask, u32 val);
  550. extern u32 read_rfreg(PADAPTER padapter, u8 rfpath, u32 addr);
  551. extern void write_rfreg(PADAPTER padapter, u8 rfpath, u32 addr, u32 val);
  552. extern void SetChannel(PADAPTER pAdapter);
  553. extern void SetBandwidth(PADAPTER pAdapter);
  554. extern int SetTxPower(PADAPTER pAdapter);
  555. extern void SetAntennaPathPower(PADAPTER pAdapter);
  556. //extern void SetTxAGCOffset(PADAPTER pAdapter, u32 ulTxAGCOffset);
  557. extern void SetDataRate(PADAPTER pAdapter);
  558. extern void SetAntenna(PADAPTER pAdapter);
  559. //extern void SetCrystalCap(PADAPTER pAdapter);
  560. extern s32 SetThermalMeter(PADAPTER pAdapter, u8 target_ther);
  561. extern void GetThermalMeter(PADAPTER pAdapter, u8 *value);
  562. extern void SetContinuousTx(PADAPTER pAdapter, u8 bStart);
  563. extern void SetSingleCarrierTx(PADAPTER pAdapter, u8 bStart);
  564. extern void SetSingleToneTx(PADAPTER pAdapter, u8 bStart);
  565. extern void SetCarrierSuppressionTx(PADAPTER pAdapter, u8 bStart);
  566. extern void PhySetTxPowerLevel(PADAPTER pAdapter);
  567. extern void fill_txdesc_for_mp(PADAPTER padapter, struct tx_desc *ptxdesc);
  568. extern void SetPacketTx(PADAPTER padapter);
  569. extern void SetPacketRx(PADAPTER pAdapter, u8 bStartRx);
  570. extern void ResetPhyRxPktCount(PADAPTER pAdapter);
  571. extern u32 GetPhyRxPktReceived(PADAPTER pAdapter);
  572. extern u32 GetPhyRxPktCRC32Error(PADAPTER pAdapter);
  573. extern s32 SetPowerTracking(PADAPTER padapter, u8 enable);
  574. extern void GetPowerTracking(PADAPTER padapter, u8 *enable);
  575. extern u32 mp_query_psd(PADAPTER pAdapter, u8 *data);
  576. extern void Hal_SetAntenna(PADAPTER pAdapter);
  577. extern void Hal_SetBandwidth(PADAPTER pAdapter);
  578. extern void Hal_SetTxPower(PADAPTER pAdapter);
  579. extern void Hal_SetCarrierSuppressionTx(PADAPTER pAdapter, u8 bStart);
  580. extern void Hal_SetSingleToneTx ( PADAPTER pAdapter , u8 bStart );
  581. extern void Hal_SetSingleCarrierTx (PADAPTER pAdapter, u8 bStart);
  582. extern void Hal_SetContinuousTx (PADAPTER pAdapter, u8 bStart);
  583. extern void Hal_SetBandwidth(PADAPTER pAdapter);
  584. extern void Hal_SetDataRate(PADAPTER pAdapter);
  585. extern void Hal_SetChannel(PADAPTER pAdapter);
  586. extern void Hal_SetAntennaPathPower(PADAPTER pAdapter);
  587. extern s32 Hal_SetThermalMeter(PADAPTER pAdapter, u8 target_ther);
  588. extern s32 Hal_SetPowerTracking(PADAPTER padapter, u8 enable);
  589. extern void Hal_GetPowerTracking(PADAPTER padapter, u8 * enable);
  590. extern void Hal_GetThermalMeter(PADAPTER pAdapter, u8 *value);
  591. extern void Hal_mpt_SwitchRfSetting(PADAPTER pAdapter);
  592. extern void Hal_MPT_CCKTxPowerAdjust(PADAPTER Adapter, BOOLEAN bInCH14);
  593. extern void Hal_MPT_CCKTxPowerAdjustbyIndex(PADAPTER pAdapter, BOOLEAN beven);
  594. extern void Hal_SetCCKTxPower(PADAPTER pAdapter, u8 * TxPower);
  595. extern void Hal_SetOFDMTxPower(PADAPTER pAdapter, u8 * TxPower);
  596. extern void Hal_TriggerRFThermalMeter(PADAPTER pAdapter);
  597. extern u8 Hal_ReadRFThermalMeter(PADAPTER pAdapter);
  598. extern void Hal_SetCCKContinuousTx(PADAPTER pAdapter, u8 bStart);
  599. extern void Hal_SetOFDMContinuousTx(PADAPTER pAdapter, u8 bStart);
  600. extern void Hal_ProSetCrystalCap (PADAPTER pAdapter , u32 CrystalCapVal);
  601. extern void _rtw_mp_xmit_priv(struct xmit_priv *pxmitpriv);
  602. extern void MP_PHY_SetRFPathSwitch(PADAPTER pAdapter ,BOOLEAN bMain);
  603. extern ULONG mpt_ProQueryCalTxPower(PADAPTER pAdapter,u8 RfPath);
  604. #endif //_RTW_MP_H_