MT6620: add the new driver JB2 V1.0
[firefly-linux-kernel-4.4.55.git] / drivers / mtk_wcn_combo / common / core / include / btm_core.h
1 /*! \file
2     \brief  Declaration of library functions
3
4     Any definitions in this file will be shared among GLUE Layer and internal Driver Stack.
5 */
6
7
8
9 #ifndef _BTM_CORE_H
10 #define _BTM_CORE_H
11
12 #include "osal_typedef.h"
13 #include "osal.h"
14 #include "stp_wmt.h"
15
16 /*******************************************************************************
17 *                         C O M P I L E R   F L A G S
18 ********************************************************************************
19 */
20
21 /*******************************************************************************
22 *                                 M A C R O S
23 ********************************************************************************
24 */
25 #define STP_BTM_OPERATION_FAIL    (-1)
26 #define STP_BTM_OPERATION_SUCCESS (0) 
27
28 #define STP_BTM_OP_BUF_SIZE (64)
29
30 #define BTM_THREAD_NAME "mtk_stp_btm"
31 /*******************************************************************************
32 *                    E X T E R N A L   R E F E R E N C E S
33 ********************************************************************************
34 */
35
36
37
38 /*******************************************************************************
39 *                              C O N S T A N T S
40 ********************************************************************************
41 */
42
43 /*******************************************************************************
44 *                             D A T A   T Y P E S
45 ********************************************************************************
46 */
47 typedef enum _ENUM_STP_BTM_OPID_T {
48     STP_OPID_BTM_RETRY = 0x0,
49     STP_OPID_BTM_RST = 0x1,
50     STP_OPID_BTM_DBG_DUMP = 0x2,
51     STP_OPID_BTM_DUMP_TIMEOUT = 0x3,
52     STP_OPID_BTM_EXIT,
53     STP_OPID_BTM_NUM
54 } ENUM_STP_BTM_OPID_T, *P_ENUM_STP_BTM_OPID_T;
55
56 typedef OSAL_OP_DAT STP_BTM_OP;
57 typedef P_OSAL_OP_DAT P_STP_BTM_OP;
58
59 typedef struct mtk_stp_btm
60 {
61     OSAL_THREAD           BTMd;   /* main thread (wmtd) handle */
62     OSAL_EVENT            STPd_event;
63     OSAL_UNSLEEPABLE_LOCK wq_spinlock;
64
65     OSAL_OP_Q    rFreeOpQ; /* free op queue */
66     OSAL_OP_Q    rActiveOpQ; /* active op queue */
67     OSAL_OP      arQue[STP_BTM_OP_BUF_SIZE]; /* real op instances */
68     
69     /*wmt_notify*/
70     INT32 (*wmt_notify)(MTKSTP_BTM_WMT_OP_T);
71 }MTKSTP_BTM_T;
72
73
74 /*******************************************************************************
75 *                            P U B L I C   D A T A
76 ********************************************************************************
77 */
78
79 /*******************************************************************************
80 *                           P R I V A T E   D A T A
81 ********************************************************************************
82 */
83
84
85 /*******************************************************************************
86 *                  F U N C T I O N   D E C L A R A T I O N S
87 ********************************************************************************
88 */
89
90 INT32 stp_btm_notify_wmt_rst_wq(MTKSTP_BTM_T *stp_btm);
91 INT32 stp_btm_notify_stp_retry_wq(MTKSTP_BTM_T *stp_btm);
92 INT32 stp_btm_notify_coredump_timeout_wq(MTKSTP_BTM_T *stp_btm);
93 INT32 stp_btm_notify_wmt_dmp_wq(MTKSTP_BTM_T *stp_btm);
94 INT32 stp_btm_deinit(MTKSTP_BTM_T *stp_btm);
95 INT32 stp_btm_reset_btm_wq(MTKSTP_BTM_T *stp_btm);
96 INT32 stp_notify_btm_dump(MTKSTP_BTM_T *stp_btm);
97
98
99
100 MTKSTP_BTM_T *stp_btm_init(void);
101
102 /*******************************************************************************
103 *                              F U N C T I O N S
104 ********************************************************************************
105 */
106
107 #endif