wmt_stp_exp.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596
  1. /*
  2. * Copyright (C) 2011-2014 MediaTek Inc.
  3. *
  4. * This program is free software: you can redistribute it and/or modify it under the terms of the
  5. * GNU General Public License version 2 as published by the Free Software Foundation.
  6. *
  7. * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
  8. * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  9. * See the GNU General Public License for more details.
  10. *
  11. * You should have received a copy of the GNU General Public License along with this program.
  12. * If not, see <http://www.gnu.org/licenses/>.
  13. */
  14. #ifndef _WMT_STP_EXP_H_
  15. #define _WMT_STP_EXP_H_
  16. #include <linux/version.h>
  17. #include <linux/init.h>
  18. #include <linux/module.h>
  19. #include <linux/types.h>
  20. #include <linux/kernel.h>
  21. #include <linux/fs.h>
  22. #include <linux/cdev.h>
  23. #include <linux/sched.h>
  24. #include <linux/poll.h>
  25. #include <asm/current.h>
  26. #include <asm/uaccess.h>
  27. #include <linux/proc_fs.h>
  28. #include <linux/workqueue.h>
  29. #include <linux/wait.h>
  30. #include <linux/time.h>
  31. #include <linux/delay.h>
  32. #include <linux/interrupt.h>
  33. #include <linux/vmalloc.h>
  34. #include <linux/firmware.h>
  35. #include <linux/kthread.h>
  36. #include <linux/jiffies.h>
  37. #include <linux/slab.h>
  38. #include <mtk_wcn_cmb_stub.h>
  39. #include "osal_typedef.h"
  40. /*******************************************************************************
  41. * M A C R O S
  42. ********************************************************************************
  43. */
  44. #ifndef MTK_WCN_CMB_FOR_SDIO_1V_AUTOK
  45. #define MTK_WCN_CMB_FOR_SDIO_1V_AUTOK 0
  46. #endif
  47. #ifdef MTK_WCN_WMT_STP_EXP_SYMBOL_ABSTRACT
  48. #if (WMT_IDC_SUPPORT)
  49. #define CFG_WMT_LTE_COEX_HANDLING 1
  50. #define CFG_WMT_LTE_ENABLE_MSGID_MAPPING 0
  51. #else
  52. #define CFG_WMT_LTE_COEX_HANDLING 0
  53. #endif
  54. /*from stp_exp.h*/
  55. #define BT_TASK_INDX (0)
  56. #define FM_TASK_INDX (1)
  57. #define GPS_TASK_INDX (2)
  58. #define WIFI_TASK_INDX (3)
  59. #define WMT_TASK_INDX (4)
  60. #define STP_TASK_INDX (5)
  61. #define INFO_TASK_INDX (6)
  62. #define ANT_TASK_INDX (7)
  63. #if CFG_WMT_LTE_COEX_HANDLING
  64. #define COEX_TASK_INDX (8)
  65. #define MTKSTP_MAX_TASK_NUM (9)
  66. #else
  67. #define MTKSTP_MAX_TASK_NUM (8)
  68. #endif
  69. #define MTKSTP_BUFFER_SIZE (16384) /* Size of RX Queue */
  70. /*end from stp_exp.h*/
  71. /*******************************************************************************
  72. * D A T A T Y P E S
  73. ********************************************************************************/
  74. /*moved from stp_exp.h*/
  75. typedef void (*MTK_WCN_STP_EVENT_CB) (void);
  76. typedef INT32(*MTK_WCN_STP_IF_TX) (const PUINT8 data, const UINT32 size, PUINT32 written_size);
  77. /* export for HIF driver */
  78. typedef void (*MTK_WCN_STP_IF_RX) (const PUINT8 data, INT32 size);
  79. typedef enum {
  80. STP_UART_IF_TX = 0,
  81. STP_SDIO_IF_TX = 1,
  82. STP_BTIF_IF_TX = 2,
  83. STP_MAX_IF_TX
  84. } ENUM_STP_TX_IF_TYPE;
  85. /*end moved from stp_exp.h*/
  86. typedef INT32(*MTK_WCN_STP_SEND_DATA) (const PUINT8 buffer, const UINT32 length, const UINT8 type);
  87. typedef INT32(*MTK_WCN_STP_PARSER_DATA) (PUINT8 buffer, UINT32 length);
  88. typedef INT32(*MTK_WCN_STP_RECV_DATA) (PUINT8 buffer, UINT32 length, UINT8 type);
  89. typedef MTK_WCN_BOOL(*MTK_WCN_STP_IS_RXQ_EMPTY) (UINT8 type);
  90. typedef MTK_WCN_BOOL(*MTK_WCN_STP_IS_RDY) (VOID);
  91. typedef VOID(*MTK_WCN_STP_SET_BLUEZ) (MTK_WCN_BOOL flags);
  92. typedef INT32(*MTK_WCN_STP_REG_IF_TX) (ENUM_STP_TX_IF_TYPE stp_if, MTK_WCN_STP_IF_TX func);
  93. typedef INT32(*MTK_WCN_STP_REG_IF_RX) (MTK_WCN_STP_IF_RX func);
  94. typedef INT32(*MTK_WCN_STP_REG_EVENT_CB) (INT32 type, MTK_WCN_STP_EVENT_CB func);
  95. typedef INT32(*MTK_WCN_STP_RGE_TX_EVENT_CB) (INT32 type, MTK_WCN_STP_EVENT_CB func);
  96. typedef INT32(*MTK_WCN_STP_COREDUMP_START_GET)(VOID);
  97. typedef struct _MTK_WCN_STP_EXP_CB_INFO_ {
  98. MTK_WCN_STP_SEND_DATA stp_send_data_cb;
  99. MTK_WCN_STP_SEND_DATA stp_send_data_raw_cb;
  100. MTK_WCN_STP_PARSER_DATA stp_parser_data_cb;
  101. MTK_WCN_STP_RECV_DATA stp_receive_data_cb;
  102. MTK_WCN_STP_IS_RXQ_EMPTY stp_is_rxqueue_empty_cb;
  103. MTK_WCN_STP_IS_RDY stp_is_ready_cb;
  104. MTK_WCN_STP_SET_BLUEZ stp_set_bluez_cb;
  105. MTK_WCN_STP_REG_IF_TX stp_if_tx_cb;
  106. MTK_WCN_STP_REG_IF_RX stp_if_rx_cb;
  107. MTK_WCN_STP_REG_EVENT_CB stp_reg_event_cb;
  108. MTK_WCN_STP_RGE_TX_EVENT_CB stp_reg_tx_event_cb;
  109. MTK_WCN_STP_COREDUMP_START_GET stp_coredump_start_get_cb;
  110. } MTK_WCN_STP_EXP_CB_INFO, *P_MTK_WCN_STP_EXP_CB_INFO;
  111. /*moved from wmt_exp.h*/
  112. typedef enum _ENUM_WMTDRV_TYPE_T {
  113. WMTDRV_TYPE_BT = 0,
  114. WMTDRV_TYPE_FM = 1,
  115. WMTDRV_TYPE_GPS = 2,
  116. WMTDRV_TYPE_WIFI = 3,
  117. WMTDRV_TYPE_WMT = 4,
  118. WMTDRV_TYPE_ANT = 5,
  119. WMTDRV_TYPE_STP = 6,
  120. WMTDRV_TYPE_SDIO1 = 7,
  121. WMTDRV_TYPE_SDIO2 = 8,
  122. WMTDRV_TYPE_LPBK = 9,
  123. WMTDRV_TYPE_COREDUMP = 10,
  124. #if MTK_WCN_CMB_FOR_SDIO_1V_AUTOK
  125. WMTDRV_TYPE_AUTOK = 11,
  126. #endif
  127. WMTDRV_TYPE_MAX
  128. } ENUM_WMTDRV_TYPE_T, *P_ENUM_WMTDRV_TYPE_T;
  129. typedef enum _ENUM_WMTDSNS_TYPE_T {
  130. WMTDSNS_FM_DISABLE = 0,
  131. WMTDSNS_FM_ENABLE = 1,
  132. WMTDSNS_FM_GPS_DISABLE = 2,
  133. WMTDSNS_FM_GPS_ENABLE = 3,
  134. WMTDSNS_MAX
  135. } ENUM_WMTDSNS_TYPE_T, *P_ENUM_WMTDSNS_TYPE_T;
  136. typedef enum _ENUM_WMTHWVER_TYPE_T {
  137. WMTHWVER_E1 = 0x0,
  138. WMTHWVER_E2 = 0x1,
  139. WMTHWVER_E3 = 0x2,
  140. WMTHWVER_E4 = 0x3,
  141. WMTHWVER_E5 = 0x4,
  142. WMTHWVER_E6 = 0x5,
  143. WMTHWVER_E7 = 0x6,
  144. WMTHWVER_MAX,
  145. WMTHWVER_INVALID = 0xff
  146. } ENUM_WMTHWVER_TYPE_T, *P_ENUM_WMTHWVER_TYPE_T;
  147. typedef enum _ENUM_WMTTHERM_TYPE_T {
  148. WMTTHERM_ZERO = 0,
  149. WMTTHERM_ENABLE = WMTTHERM_ZERO + 1,
  150. WMTTHERM_READ = WMTTHERM_ENABLE + 1,
  151. WMTTHERM_DISABLE = WMTTHERM_READ + 1,
  152. WMTTHERM_MAX
  153. } ENUM_WMTTHERM_TYPE_T, *P_ENUM_WMTTHERM_TYPE_T;
  154. typedef enum _ENUM_WMTMSG_TYPE_T {
  155. WMTMSG_TYPE_POWER_ON = 0,
  156. WMTMSG_TYPE_POWER_OFF = 1,
  157. WMTMSG_TYPE_RESET = 2,
  158. WMTMSG_TYPE_STP_RDY = 3,
  159. WMTMSG_TYPE_HW_FUNC_ON = 4,
  160. WMTMSG_TYPE_MAX
  161. } ENUM_WMTMSG_TYPE_T, *P_ENUM_WMTMSG_TYPE_T;
  162. typedef void (*PF_WMT_CB) (ENUM_WMTDRV_TYPE_T, /* Source driver type */
  163. ENUM_WMTDRV_TYPE_T, /* Destination driver type */
  164. ENUM_WMTMSG_TYPE_T, /* Message type */
  165. VOID *, /* READ-ONLY buffer. Buffer is allocated and freed by WMT_drv. Client
  166. can't touch this buffer after this function return. */
  167. UINT32 /* Buffer size in unit of byte */
  168. );
  169. typedef enum _SDIO_PS_OP {
  170. OWN_SET = 0,
  171. OWN_CLR = 1,
  172. OWN_STATE = 2,
  173. } SDIO_PS_OP;
  174. typedef INT32(*PF_WMT_SDIO_PSOP) (SDIO_PS_OP);
  175. typedef enum _ENUM_WMTCHIN_TYPE_T {
  176. WMTCHIN_CHIPID = 0x0,
  177. WMTCHIN_HWVER = WMTCHIN_CHIPID + 1,
  178. WMTCHIN_MAPPINGHWVER = WMTCHIN_HWVER + 1,
  179. WMTCHIN_FWVER = WMTCHIN_MAPPINGHWVER + 1,
  180. WMTCHIN_MAX,
  181. } ENUM_WMT_CHIPINFO_TYPE_T, *P_ENUM_WMT_CHIPINFO_TYPE_T;
  182. /*end moved from wmt_exp.h*/
  183. typedef MTK_WCN_BOOL(*MTK_WCN_WMT_FUNC_CTRL) (ENUM_WMTDRV_TYPE_T type);
  184. typedef INT8(*MTK_WCN_WMT_THERM_CTRL) (ENUM_WMTTHERM_TYPE_T eType);
  185. typedef ENUM_WMTHWVER_TYPE_T(*MTK_WCN_WMT_HWVER_GET) (VOID);
  186. typedef MTK_WCN_BOOL(*MTK_WCN_WMT_DSNS_CTRL) (ENUM_WMTDSNS_TYPE_T eType);
  187. typedef INT32(*MTK_WCN_WMT_MSGCB_REG) (ENUM_WMTDRV_TYPE_T eType, PF_WMT_CB pCb);
  188. typedef INT32(*MTK_WCN_WMT_MSGCB_UNREG) (ENUM_WMTDRV_TYPE_T eType);
  189. typedef INT32(*MTK_WCN_WMT_SDIO_OP_REG) (PF_WMT_SDIO_PSOP own_cb);
  190. typedef INT32(*MTK_WCN_WMT_SDIO_HOST_AWAKE) (VOID);
  191. typedef MTK_WCN_BOOL(*MTK_WCN_WMT_ASSERT) (ENUM_WMTDRV_TYPE_T type, UINT32 reason);
  192. typedef MTK_WCN_BOOL(*MTK_WCN_WMT_ASSERT_TIMEOUT)(ENUM_WMTDRV_TYPE_T type,
  193. UINT32 reason, INT32 timeout);
  194. typedef UINT32(*MTK_WCN_WMT_IC_INFO_GET) (ENUM_WMT_CHIPINFO_TYPE_T type);
  195. typedef struct _MTK_WCN_WMT_EXP_CB_INFO_ {
  196. MTK_WCN_WMT_FUNC_CTRL wmt_func_on_cb;
  197. MTK_WCN_WMT_FUNC_CTRL wmt_func_off_cb;
  198. MTK_WCN_WMT_THERM_CTRL wmt_therm_ctrl_cb;
  199. MTK_WCN_WMT_HWVER_GET wmt_hwver_get_cb;
  200. MTK_WCN_WMT_DSNS_CTRL wmt_dsns_ctrl_cb;
  201. MTK_WCN_WMT_MSGCB_REG wmt_msgcb_reg_cb;
  202. MTK_WCN_WMT_MSGCB_UNREG wmt_msgcb_unreg_cb;
  203. MTK_WCN_WMT_SDIO_OP_REG wmt_sdio_op_reg_cb;
  204. MTK_WCN_WMT_SDIO_HOST_AWAKE wmt_sdio_host_awake_cb;
  205. MTK_WCN_WMT_ASSERT wmt_assert_cb;
  206. MTK_WCN_WMT_ASSERT_TIMEOUT wmt_assert_timeout_cb;
  207. MTK_WCN_WMT_IC_INFO_GET wmt_ic_info_get_cb;
  208. } MTK_WCN_WMT_EXP_CB_INFO, *P_MTK_WCN_WMT_EXP_CB_INFO;
  209. /*******************************************************************************
  210. * F U N C T I O N D E C L A R A T I O N S
  211. ********************************************************************************
  212. */
  213. /*exp for WMT/STP register callback*/
  214. /*****************************************************************************
  215. * FUNCTION
  216. * mtk_wcn_stp_exp_cb_reg
  217. * DESCRIPTION
  218. * stp driver reigster exp symbols
  219. * PARAMETERS
  220. * pStpExpCb [IN] stp callback structure pointer
  221. * RETURNS
  222. * UINT32 = 0: OK
  223. *****************************************************************************/
  224. UINT32 mtk_wcn_stp_exp_cb_reg(P_MTK_WCN_STP_EXP_CB_INFO pStpExpCb);
  225. /*****************************************************************************
  226. * FUNCTION
  227. * mtk_wcn_stp_exp_cb_unreg
  228. * DESCRIPTION
  229. * stp driver unreigster exp symbols
  230. * PARAMETERS
  231. * VOID
  232. * RETURNS
  233. * UINT32 = 0: OK
  234. *****************************************************************************/
  235. UINT32 mtk_wcn_stp_exp_cb_unreg(VOID);
  236. /*****************************************************************************
  237. * FUNCTION
  238. * mtk_wcn_wmt_exp_cb_reg
  239. * DESCRIPTION
  240. * WMT driver reigster exp symbols
  241. * PARAMETERS
  242. * pStpExpCb [IN] wmt callback structure pointer
  243. * RETURNS
  244. * UINT32 = 0: OK
  245. *****************************************************************************/
  246. UINT32 mtk_wcn_wmt_exp_cb_reg(P_MTK_WCN_WMT_EXP_CB_INFO pWmtExpCb);
  247. /*****************************************************************************
  248. * FUNCTION
  249. * mtk_wcn_stp_exp_cb_unreg
  250. * DESCRIPTION
  251. * wmt driver unreigster exp symbols
  252. * PARAMETERS
  253. * VOID
  254. * RETURNS
  255. * UINT32 = 0: OK
  256. *****************************************************************************/
  257. UINT32 mtk_wcn_wmt_exp_cb_unreg(VOID);
  258. /*stp exp symbols*/
  259. /*****************************************************************************
  260. * FUNCTION
  261. * mtk_wcn_stp_send_data
  262. * DESCRIPTION
  263. * subfunction send data through STP
  264. * PARAMETERS
  265. * buffer [IN] data buffer
  266. * length [IN] data buffer length
  267. * type [IN] subfunction type
  268. * RETURNS
  269. * INT32 >= 0: length transmitted; < 0: error
  270. *****************************************************************************/
  271. extern INT32 mtk_wcn_stp_send_data(const PUINT8 buffer, const UINT32 length, const UINT8 type);
  272. /*****************************************************************************
  273. * FUNCTION
  274. * mtk_wcn_stp_send_data_raw
  275. * DESCRIPTION
  276. * subfunction send data through STP without seq/ack
  277. * PARAMETERS
  278. * buffer [IN] data buffer
  279. * length [IN] data buffer length
  280. * type [IN] subfunction type
  281. * RETURNS
  282. * INT32 >= 0: length transmitted; < 0: error
  283. *****************************************************************************/
  284. extern INT32 mtk_wcn_stp_send_data_raw(const PUINT8 buffer, const UINT32 length, const UINT8 type);
  285. /*****************************************************************************
  286. * FUNCTION
  287. * mtk_wcn_stp_parser_data
  288. * DESCRIPTION
  289. * push data to serial transport protocol parser engine
  290. * PARAMETERS
  291. * buffer [IN] data buffer
  292. * length [IN] data buffer length
  293. * RETURNS
  294. * void
  295. *****************************************************************************/
  296. extern INT32 mtk_wcn_stp_parser_data(PUINT8 buffer, UINT32 length);
  297. /*****************************************************************************
  298. * FUNCTION
  299. * mtk_wcn_stp_receive_data
  300. * DESCRIPTION
  301. * receive data from serial protocol engine
  302. * PARAMETERS
  303. * buffer [IN] data buffer
  304. * length [IN] data buffer length
  305. * RETURNS
  306. * INT32 >= 0: size of data received; < 0: error
  307. *****************************************************************************/
  308. extern INT32 mtk_wcn_stp_receive_data(PUINT8 buffer, UINT32 length, UINT8 type);
  309. /*****************************************************************************
  310. * FUNCTION
  311. * mtk_wcn_stp_is_rxqueue_empty
  312. * DESCRIPTION
  313. * Is certain rx queue empty?
  314. * PARAMETERS
  315. * type [IN] subfunction type
  316. * RETURNS
  317. * INT32 0: queue is NOT empyt; !0: queue is empty
  318. *****************************************************************************/
  319. extern MTK_WCN_BOOL mtk_wcn_stp_is_rxqueue_empty(UINT8 type);
  320. /*****************************************************************************
  321. * FUNCTION
  322. * mtk_wcn_stp_is_enable
  323. * DESCRIPTION
  324. * Is STP ready?
  325. * PARAMETERS
  326. * none.
  327. * RETURNS
  328. * MTK_WCN_BOOL TRUE:ready, FALSE:not ready
  329. *****************************************************************************/
  330. extern MTK_WCN_BOOL mtk_wcn_stp_is_ready(void);
  331. /*****************************************************************************
  332. * FUNCTION
  333. * set_bluetooth_rx_interface
  334. * DESCRIPTION
  335. * Set bluetooth rx interface
  336. * PARAMETERS
  337. * rx interface type
  338. * RETURNS
  339. * void
  340. *****************************************************************************/
  341. extern void mtk_wcn_stp_set_bluez(MTK_WCN_BOOL flags);
  342. /*****************************************************************************
  343. * FUNCTION
  344. * mtk_wcn_stp_register_if_tx
  345. * DESCRIPTION
  346. * regiter Tx event callback function
  347. * PARAMETERS
  348. * stp_if: SDIO or UART, fnnc: Call back function
  349. * RETURNS
  350. * INT32: 0:successful , -1: fail
  351. *****************************************************************************/
  352. extern INT32 mtk_wcn_stp_register_if_tx(ENUM_STP_TX_IF_TYPE stp_if, MTK_WCN_STP_IF_TX func);
  353. /*****************************************************************************
  354. * FUNCTION
  355. * mtk_wcn_stp_register_if_rx
  356. * DESCRIPTION
  357. * regiter Rx event callback function
  358. * PARAMETERS
  359. * stp_if: SDIO or UART, fnnc: Call back function
  360. * RETURNS
  361. * INT32: 0:successful , -1: fail
  362. *****************************************************************************/
  363. extern INT32 mtk_wcn_stp_register_if_rx(MTK_WCN_STP_IF_RX func);
  364. /*****************************************************************************
  365. * FUNCTION
  366. * mtk_wcn_stp_register_event_cb
  367. * DESCRIPTION
  368. * regiter Rx event callback function
  369. * PARAMETERS
  370. * func
  371. * RETURNS
  372. * INT32: 0:successful , -1: fail
  373. *****************************************************************************/
  374. extern INT32 mtk_wcn_stp_register_event_cb(INT32 type, MTK_WCN_STP_EVENT_CB func);
  375. /*****************************************************************************
  376. * FUNCTION
  377. * mtk_wcn_stp_register_tx_event_cb
  378. * DESCRIPTION
  379. * regiter Tx event callback function
  380. * PARAMETERS
  381. * func
  382. * RETURNS
  383. * INT32: 0:successful , -1: fail
  384. *****************************************************************************/
  385. extern INT32 mtk_wcn_stp_register_tx_event_cb(INT32 type, MTK_WCN_STP_EVENT_CB func);
  386. /*****************************************************************************
  387. * FUNCTION
  388. * mtk_wcn_stp_coredump_start_get
  389. * DESCRIPTION
  390. * get coredump flag is set or not
  391. * PARAMETERS
  392. * VOID
  393. * RETURNS
  394. * INT32: 0:coredump flag is not set , 1: coredump flag is set
  395. *****************************************************************************/
  396. extern INT32 mtk_wcn_stp_coredump_start_get(VOID);
  397. /*wmt exp symbols*/
  398. /*****************************************************************************
  399. * FUNCTION
  400. * mtk_wcn_wmt_func_off
  401. * DESCRIPTION
  402. * wmt turn off subsystem
  403. * PARAMETERS
  404. * type [IN] subsystem type
  405. * RETURNS
  406. * MTK_WCN_BOOL_TRUE: OK; MTK_WCN_BOOL_FALSE:error
  407. *****************************************************************************/
  408. extern MTK_WCN_BOOL mtk_wcn_wmt_func_off(ENUM_WMTDRV_TYPE_T type);
  409. /*****************************************************************************
  410. * FUNCTION
  411. * mtk_wcn_wmt_func_on
  412. * DESCRIPTION
  413. * wmt turn on subsystem
  414. * PARAMETERS
  415. * type [IN] subsystem type
  416. * RETURNS
  417. * MTK_WCN_BOOL_TRUE: OK; MTK_WCN_BOOL_FALSE:error
  418. *****************************************************************************/
  419. extern MTK_WCN_BOOL mtk_wcn_wmt_func_on(ENUM_WMTDRV_TYPE_T type);
  420. /*****************************************************************************
  421. * FUNCTION
  422. * mtk_wcn_wmt_therm_ctrl
  423. * DESCRIPTION
  424. * query chip temperature by WMT CMD
  425. * PARAMETERS
  426. * eType [IN] thermal ctrl type
  427. * RETURNS
  428. * >=0: chip temperature; 0xff:error
  429. *****************************************************************************/
  430. extern INT8 mtk_wcn_wmt_therm_ctrl(ENUM_WMTTHERM_TYPE_T eType);
  431. /*****************************************************************************
  432. * FUNCTION
  433. * mtk_wcn_wmt_hwver_get
  434. * DESCRIPTION
  435. * get chip hardware version
  436. * PARAMETERS
  437. * VOID
  438. * RETURNS
  439. * >=0: chip hw version; 0xff:error
  440. *****************************************************************************/
  441. extern ENUM_WMTHWVER_TYPE_T mtk_wcn_wmt_hwver_get(VOID);
  442. /*****************************************************************************
  443. * FUNCTION
  444. * mtk_wcn_wmt_ic_info_get
  445. * DESCRIPTION
  446. * get chip hardware version or f/w version
  447. * PARAMETERS
  448. * type : which kind of information is needed
  449. * RETURNS
  450. * f/w version or hw version information
  451. *****************************************************************************/
  452. extern UINT32 mtk_wcn_wmt_ic_info_get(ENUM_WMT_CHIPINFO_TYPE_T type);
  453. /*****************************************************************************
  454. * FUNCTION
  455. * mtk_wcn_wmt_dsns_ctrl
  456. * DESCRIPTION
  457. * fm dsns cmd ctrl
  458. * PARAMETERS
  459. * eType [IN] fm dsns ctrl type
  460. * RETURNS
  461. * MTK_WCN_BOOL_TRUE: OK; MTK_WCN_BOOL_FALSE:error
  462. *****************************************************************************/
  463. extern MTK_WCN_BOOL mtk_wcn_wmt_dsns_ctrl(ENUM_WMTDSNS_TYPE_T eType);
  464. /*****************************************************************************
  465. * FUNCTION
  466. * mtk_wcn_wmt_msgcb_reg
  467. * DESCRIPTION
  468. * used for subsystem register chip reset callback for received wmt reset msg.
  469. * PARAMETERS
  470. * eType [IN] subsystem type
  471. * pCb [IN] rst callback
  472. * RETURNS
  473. * 1: OK; 0:error
  474. *****************************************************************************/
  475. extern INT32 mtk_wcn_wmt_msgcb_reg(ENUM_WMTDRV_TYPE_T eType, PF_WMT_CB pCb);
  476. /*****************************************************************************
  477. * FUNCTION
  478. * mtk_wcn_wmt_msgcb_unreg
  479. * DESCRIPTION
  480. * used for subsystem unregister chip reset callback for received wmt reset msg.
  481. * PARAMETERS
  482. * eType [IN] subsystem type
  483. * RETURNS
  484. * 1: OK; 0:error
  485. *****************************************************************************/
  486. extern INT32 mtk_wcn_wmt_msgcb_unreg(ENUM_WMTDRV_TYPE_T eType);
  487. /*****************************************************************************
  488. * FUNCTION
  489. * mtk_wcn_stp_wmt_sdio_op_reg
  490. * DESCRIPTION
  491. * used to register callback for set sdio ownership.
  492. * PARAMETERS
  493. * own_cb [IN] set owner ship callback
  494. * RETURNS
  495. * always return 0;
  496. *****************************************************************************/
  497. extern INT32 mtk_wcn_stp_wmt_sdio_op_reg(PF_WMT_SDIO_PSOP own_cb);
  498. /*****************************************************************************
  499. * FUNCTION
  500. * mtk_wcn_stp_wmt_sdio_host_awake
  501. * DESCRIPTION
  502. * handing host awake when link is stp sdio?
  503. * PARAMETERS
  504. * VOID
  505. * RETURNS
  506. * always return 0;
  507. *****************************************************************************/
  508. extern INT32 mtk_wcn_stp_wmt_sdio_host_awake(VOID);
  509. /*****************************************************************************
  510. * FUNCTION
  511. * mtk_wcn_wmt_assert
  512. * DESCRIPTION
  513. * host trigger firmware assert
  514. * PARAMETERS
  515. * type [IN] subsystem driver type
  516. * reason [IN] trigger assert reason
  517. * RETURNS
  518. * MTK_WCN_BOOL_TRUE: OK; MTK_WCN_BOOL_FALSE:error
  519. *****************************************************************************/
  520. extern MTK_WCN_BOOL mtk_wcn_wmt_assert(ENUM_WMTDRV_TYPE_T type, UINT32 reason);
  521. /*****************************************************************************
  522. * * FUNCTION
  523. * * mtk_wcn_wmt_assert_timeout
  524. * * DESCRIPTION
  525. * * host trigger firmware assert
  526. * * PARAMETERS
  527. * * type [IN] subsystem driver type
  528. * * reason [IN] trigger assert reason
  529. * * timeout [IN] trigger assert timeout data
  530. * * RETURNS
  531. * * MTK_WCN_BOOL_TRUE: OK; MTK_WCN_BOOL_FALSE:error
  532. * *****************************************************************************/
  533. extern MTK_WCN_BOOL mtk_wcn_wmt_assert_timeout(ENUM_WMTDRV_TYPE_T type,
  534. UINT32 reason, INT32 timeout);
  535. #endif
  536. #endif