add rk3288 pinctrl dts code
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / combo_mt66xx / mt6628 / wlan / os / linux / hif / sdio / include / hif.h
1 /*
2 ** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/os/linux/hif/sdio/include/hif.h#1 $
3 */
4
5 /*! \file   "hif.h"
6     \brief  Functions for the driver to register bus and setup the IRQ
7
8     Functions for the driver to register bus and setup the IRQ
9 */
10
11
12
13 /*
14 ** $Log: hif.h $
15  *
16  * 11 01 2010 yarco.yang
17  * [WCXRP00000149] [MT6620 WI-Fi][Driver]Fine tune performance on MT6516 platform
18  * Add GPIO debug function
19  *
20  * 10 19 2010 jeffrey.chang
21  * [WCXRP00000120] [MT6620 Wi-Fi][Driver] Refine linux kernel module to the license of MTK propietary and enable MTK HIF by default
22  * Refine linux kernel module to the license of MTK and enable MTK HIF
23  *
24  * 08 18 2010 jeffrey.chang
25  * NULL
26  * support multi-function sdio
27  *
28  * 08 17 2010 cp.wu
29  * NULL
30  * add ENE SDIO host workaround for x86 linux platform.
31  *
32  * 07 08 2010 cp.wu
33  * 
34  * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
35  *
36  * 06 06 2010 kevin.huang
37  * [WPD00003832][MT6620 5931] Create driver base 
38  * [MT6620 5931] Create driver base
39  *
40  * 03 24 2010 jeffrey.chang
41  * [WPD00003826]Initial import for Linux port 
42  * initial import for Linux port
43 **  \main\maintrunk.MT5921\4 2009-10-20 17:38:28 GMT mtk01090
44 **  Refine driver unloading and clean up procedure. Block requests, stop main thread and clean up queued requests, and then stop hw.
45 **  \main\maintrunk.MT5921\3 2009-09-28 20:19:20 GMT mtk01090
46 **  Add private ioctl to carry OID structures. Restructure public/private ioctl interfaces to Linux kernel.
47 **  \main\maintrunk.MT5921\2 2009-08-18 22:57:05 GMT mtk01090
48 **  Add Linux SDIO (with mmc core) support.
49 **  Add Linux 2.6.21, 2.6.25, 2.6.26.
50 **  Fix compile warning in Linux.
51 **  \main\maintrunk.MT5921\2 2008-09-22 23:18:17 GMT mtk01461
52 **  Update driver for code review
53 ** Revision 1.1  2007/07/05 07:25:33  MTK01461
54 ** Add Linux initial code, modify doc, add 11BB, RF init code
55 **
56 ** Revision 1.3  2007/06/27 02:18:51  MTK01461
57 ** Update SCAN_FSM, Initial(Can Load Module), Proc(Can do Reg R/W), TX API
58 **
59 */
60
61 #ifndef _HIF_H
62 #define _HIF_H
63
64
65 #if MTK_WCN_HIF_SDIO
66 #include "hif_sdio.h"
67 #endif
68
69 /*******************************************************************************
70 *                         C O M P I L E R   F L A G S
71 ********************************************************************************
72 */
73
74
75 /*******************************************************************************
76 *                    E X T E R N A L   R E F E R E N C E S
77 ********************************************************************************
78 */
79
80 /*******************************************************************************
81 *                              C O N S T A N T S
82 ********************************************************************************
83 */
84 #define SDIO_X86_WORKAROUND_WRITE_MCR   0x00C4
85
86 /*******************************************************************************
87 *                             D A T A   T Y P E S
88 ********************************************************************************
89 */
90
91 /* host interface's private data structure, which is attached to os glue
92 ** layer info structure.
93  */
94 typedef struct _GL_HIF_INFO_T {
95 #if MTK_WCN_HIF_SDIO 
96     MTK_WCN_HIF_SDIO_CLTCTX cltCtx;
97     const MTK_WCN_HIF_SDIO_FUNCINFO *prFuncInfo;
98 #else
99     struct sdio_func        *func;
100 #endif
101     BOOLEAN                 fgIntReadClear;
102     BOOLEAN                 fgMbxReadClear;
103 } GL_HIF_INFO_T, *P_GL_HIF_INFO_T;
104
105
106 #if CFG_DBG_GPIO_PINS
107
108 extern void
109 mtk_wcn_stp_debug_gpio_assert(UINT_32 dwIndex, UINT_32 dwMethod);
110
111
112 /* Platform DEPENDENT configurations: MT6516 GPIO pin name */
113 #define GPIO_6516(x) (GPIO##x)
114 #define GPIO_PLATFORM(x) GPIO_6516(x)
115
116 /* Platform independent configurations */
117 #define DBG_TIE_DIR 0x40000000UL
118 #define DBG_LOW 0x0UL
119 #define DBG_HIGH 0x1UL
120 #define DBG_TIE_LOW (DBG_TIE_DIR | DBG_LOW)
121 #define DBG_TIE_HIGH (DBG_TIE_DIR | DBG_HIGH)
122
123 #define DBG_TOGGLE(x) (0x80000000UL | x)
124 #define DBG_TOGGLE_NUM(x) (x & 0xFFF)
125 #define GPIO_INVALID 0xFFFF
126
127 typedef enum {
128     IDX_ERR = 0,
129     IDX_TX_THREAD,
130     IDX_TX_REQ,
131     IDX_TX_PORT_WRITE,
132     IDX_STP_MTX_BT,
133     IDX_STP_MTX_FM, /* 5 */
134     IDX_STP_MTX_GPS,
135     IDX_STP_MTX_WIFI,
136     IDX_STP_MTX_WMT,
137     IDX_LOOP_CNT,
138     IDX_NO_BUF, /*10 */
139     IDX_BT_TX,
140     IDX_BT_RX,
141     IDX_GPS_RX,
142     IDX_GPS_2,
143     IDX_GPS_3,
144     IDX_GPS_TX,
145     IDX_STP_MAX
146 } DBG_PIN;
147
148 #define DBG_MTX_OFFSET (IDX_STP_MTX_BT) /* index of mutex0 */
149 #endif
150 /*******************************************************************************
151 *                            P U B L I C   D A T A
152 ********************************************************************************
153 */
154
155 /*******************************************************************************
156 *                           P R I V A T E   D A T A
157 ********************************************************************************
158 */
159
160 /*******************************************************************************
161 *                                 M A C R O S
162 ********************************************************************************
163 */
164
165 /*******************************************************************************
166 *                   F U N C T I O N   D E C L A R A T I O N S
167 ********************************************************************************
168 */
169
170 WLAN_STATUS
171 glRegisterBus(
172     probe_card pfProbe,
173     remove_card pfRemove
174     );
175
176 VOID
177 glUnregisterBus(
178     remove_card pfRemove
179     );
180
181 VOID
182 glSetHifInfo (
183     P_GLUE_INFO_T prGlueInfo,
184     UINT_32 u4Cookie
185     );
186
187 VOID
188 glClearHifInfo (
189     P_GLUE_INFO_T prGlueInfo
190     );
191
192 BOOL
193 glBusInit (
194     PVOID pvData
195     );
196
197 VOID
198 glBusRelease (
199     PVOID pData
200     );
201
202 INT_32
203 glBusSetIrq (
204     PVOID pvData,
205     PVOID pfnIsr,
206     PVOID pvCookie
207     );
208
209 VOID
210 glBusFreeIrq (
211     PVOID pvData,
212     PVOID pvCookie
213     );
214
215 VOID
216 glSetPowerState (
217     IN P_GLUE_INFO_T  prGlueInfo,
218     IN UINT_32 ePowerMode
219     );
220
221 /*******************************************************************************
222 *                              F U N C T I O N S
223 ********************************************************************************
224 */
225 #endif /* _HIF_H */