2 \brief Declaration of library functions
4 Any definitions in this file will be shared among GLUE Layer and internal Driver Stack.
12 #include "osal_typedef.h"
16 /*******************************************************************************
17 * C O M P I L E R F L A G S
18 ********************************************************************************
21 /*******************************************************************************
23 ********************************************************************************
25 #define STP_BTM_OPERATION_FAIL (-1)
26 #define STP_BTM_OPERATION_SUCCESS (0)
28 #define STP_BTM_OP_BUF_SIZE (64)
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 ********************************************************************************
38 /*******************************************************************************
40 ********************************************************************************
43 /*******************************************************************************
45 ********************************************************************************
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,
54 } ENUM_STP_BTM_OPID_T, *P_ENUM_STP_BTM_OPID_T;
56 typedef OSAL_OP_DAT STP_BTM_OP;
57 typedef P_OSAL_OP_DAT P_STP_BTM_OP;
59 typedef struct mtk_stp_btm
61 OSAL_THREAD BTMd; /* main thread (wmtd) handle */
62 OSAL_EVENT STPd_event;
63 OSAL_UNSLEEPABLE_LOCK wq_spinlock;
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 */
70 INT32 (*wmt_notify)(MTKSTP_BTM_WMT_OP_T);
74 /*******************************************************************************
76 ********************************************************************************
79 /*******************************************************************************
80 * P R I V A T E D A T A
81 ********************************************************************************
85 /*******************************************************************************
86 * F U N C T I O N D E C L A R A T I O N S
87 ********************************************************************************
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);
100 MTKSTP_BTM_T *stp_btm_init(void);
102 /*******************************************************************************
104 ********************************************************************************