2 ** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/os/linux/hif/sdio/include/hif.h#1 $
6 \brief Functions for the driver to register bus and setup the IRQ
8 Functions for the driver to register bus and setup the IRQ
16 * 11 01 2010 yarco.yang
17 * [WCXRP00000149] [MT6620 WI-Fi][Driver]Fine tune performance on MT6516 platform
18 * Add GPIO debug function
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
24 * 08 18 2010 jeffrey.chang
26 * support multi-function sdio
30 * add ENE SDIO host workaround for x86 linux platform.
34 * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
36 * 06 06 2010 kevin.huang
37 * [WPD00003832][MT6620 5931] Create driver base
38 * [MT6620 5931] Create driver base
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
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
69 /*******************************************************************************
70 * C O M P I L E R F L A G S
71 ********************************************************************************
75 /*******************************************************************************
76 * E X T E R N A L R E F E R E N C E S
77 ********************************************************************************
80 /*******************************************************************************
82 ********************************************************************************
84 #define SDIO_X86_WORKAROUND_WRITE_MCR 0x00C4
86 /*******************************************************************************
88 ********************************************************************************
91 /* host interface's private data structure, which is attached to os glue
92 ** layer info structure.
94 typedef struct _GL_HIF_INFO_T
{
96 MTK_WCN_HIF_SDIO_CLTCTX cltCtx
;
97 const MTK_WCN_HIF_SDIO_FUNCINFO
*prFuncInfo
;
99 struct sdio_func
*func
;
101 BOOLEAN fgIntReadClear
;
102 BOOLEAN fgMbxReadClear
;
103 } GL_HIF_INFO_T
, *P_GL_HIF_INFO_T
;
106 #if CFG_DBG_GPIO_PINS
108 extern void mtk_wcn_stp_debug_gpio_assert(UINT_32 dwIndex
, UINT_32 dwMethod
);
111 /* Platform DEPENDENT configurations: MT6516 GPIO pin name */
112 #define GPIO_6516(x) (GPIO##x)
113 #define GPIO_PLATFORM(x) GPIO_6516(x)
115 /* Platform independent configurations */
116 #define DBG_TIE_DIR 0x40000000UL
117 #define DBG_LOW 0x0UL
118 #define DBG_HIGH 0x1UL
119 #define DBG_TIE_LOW (DBG_TIE_DIR | DBG_LOW)
120 #define DBG_TIE_HIGH (DBG_TIE_DIR | DBG_HIGH)
122 #define DBG_TOGGLE(x) (0x80000000UL | x)
123 #define DBG_TOGGLE_NUM(x) (x & 0xFFF)
124 #define GPIO_INVALID 0xFFFF
132 IDX_STP_MTX_FM
, /* 5 */
147 #define DBG_MTX_OFFSET (IDX_STP_MTX_BT) /* index of mutex0 */
149 /*******************************************************************************
150 * P U B L I C D A T A
151 ********************************************************************************
154 /*******************************************************************************
155 * P R I V A T E D A T A
156 ********************************************************************************
159 /*******************************************************************************
161 ********************************************************************************
164 /*******************************************************************************
165 * F U N C T I O N D E C L A R A T I O N S
166 ********************************************************************************
169 WLAN_STATUS
glRegisterBus(probe_card pfProbe
, remove_card pfRemove
);
171 VOID
glUnregisterBus(remove_card pfRemove
);
173 VOID
glSetHifInfo(P_GLUE_INFO_T prGlueInfo
, UINT_32 u4Cookie
);
175 VOID
glClearHifInfo(P_GLUE_INFO_T prGlueInfo
);
177 BOOL
glBusInit(PVOID pvData
);
179 VOID
glBusRelease(PVOID pData
);
181 INT_32
glBusSetIrq(PVOID pvData
, PVOID pfnIsr
, PVOID pvCookie
);
183 VOID
glBusFreeIrq(PVOID pvData
, PVOID pvCookie
);
185 VOID
glSetPowerState(IN P_GLUE_INFO_T prGlueInfo
, IN UINT_32 ePowerMode
);
187 /*******************************************************************************
189 ********************************************************************************