xref: /OK3568_Linux_fs/kernel/drivers/net/wireless/rockchip_wlan/rtl8723bs/include/sdio_ops.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /******************************************************************************
2  *
3  * Copyright(c) 2007 - 2017 Realtek Corporation.
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms of version 2 of the GNU General Public License as
7  * published by the Free Software Foundation.
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12  * more details.
13  *
14  *****************************************************************************/
15 #ifndef __SDIO_OPS_H__
16 #define __SDIO_OPS_H__
17 
18 
19 /* Follow mac team suggestion, default I/O fail return value is 0xFF */
20 #define SDIO_ERR_VAL8	0xFF
21 #define SDIO_ERR_VAL16	0xFFFF
22 #define SDIO_ERR_VAL32	0xFFFFFFFF
23 
24 #ifdef PLATFORM_LINUX
25 #include <sdio_ops_linux.h>
26 #endif
27 
28 #ifdef PLATFORM_WINDOWS
29 
30 #ifdef PLATFORM_OS_XP
31 #include <sdio_ops_xp.h>
32 struct async_context {
33 	PMDL pmdl;
34 	PSDBUS_REQUEST_PACKET sdrp;
35 	unsigned char *r_buf;
36 	unsigned char *padapter;
37 };
38 #endif
39 
40 #ifdef PLATFORM_OS_CE
41 #include <sdio_ops_ce.h>
42 #endif
43 
44 #endif /* PLATFORM_WINDOWS */
45 
46 
47 extern void sdio_set_intf_ops(_adapter *padapter, struct _io_ops *pops);
48 void dump_sdio_card_info(void *sel, struct dvobj_priv *dvobj);
49 
50 #if 0
51 extern void sdio_func1cmd52_read(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *rmem);
52 extern void sdio_func1cmd52_write(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *wmem);
53 #endif
54 extern u8 SdioLocalCmd52Read1Byte(PADAPTER padapter, u32 addr);
55 extern void SdioLocalCmd52Write1Byte(PADAPTER padapter, u32 addr, u8 v);
56 extern s32 _sdio_local_read(PADAPTER padapter, u32 addr, u32 cnt, u8 *pbuf);
57 extern s32 sdio_local_read(PADAPTER padapter, u32 addr, u32 cnt, u8 *pbuf);
58 extern s32 _sdio_local_write(PADAPTER padapter, u32 addr, u32 cnt, u8 *pbuf);
59 extern s32 sdio_local_write(PADAPTER padapter, u32 addr, u32 cnt, u8 *pbuf);
60 
61 u32 _sdio_read32(PADAPTER padapter, u32 addr);
62 s32 _sdio_write32(PADAPTER padapter, u32 addr, u32 val);
63 
64 extern void sd_int_hdl(PADAPTER padapter);
65 extern u8 CheckIPSStatus(PADAPTER padapter);
66 
67 #ifdef CONFIG_RTL8188E
68 extern void InitInterrupt8188ESdio(PADAPTER padapter);
69 extern void EnableInterrupt8188ESdio(PADAPTER padapter);
70 extern void DisableInterrupt8188ESdio(PADAPTER padapter);
71 extern void UpdateInterruptMask8188ESdio(PADAPTER padapter, u32 AddMSR, u32 RemoveMSR);
72 extern u8 HalQueryTxBufferStatus8189ESdio(PADAPTER padapter);
73 extern u8 HalQueryTxOQTBufferStatus8189ESdio(PADAPTER padapter);
74 extern void ClearInterrupt8188ESdio(PADAPTER padapter);
75 #endif /* CONFIG_RTL8188E */
76 
77 #ifdef CONFIG_RTL8821A
78 extern void InitInterrupt8821AS(PADAPTER padapter);
79 extern void EnableInterrupt8821AS(PADAPTER padapter);
80 extern void DisableInterrupt8821AS(PADAPTER padapter);
81 extern u8 HalQueryTxBufferStatus8821AS(PADAPTER padapter);
82 extern u8 HalQueryTxOQTBufferStatus8821ASdio(PADAPTER padapter);
83 #if defined(CONFIG_WOWLAN) || defined(CONFIG_AP_WOWLAN)
84 void ClearInterrupt8821AS(PADAPTER padapter);
85 #endif /* defined(CONFIG_WOWLAN) || defined(CONFIG_AP_WOWLAN) */
86 #endif /* CONFIG_RTL8821A */
87 
88 #if defined(CONFIG_WOWLAN) || defined(CONFIG_AP_WOWLAN)
89 #if defined(CONFIG_RTL8821C) || defined(CONFIG_RTL8822B)
90 u8 rtw_hal_enable_cpwm2(_adapter *adapter);
91 #endif
92 extern u8 RecvOnePkt(PADAPTER padapter);
93 #endif /* CONFIG_WOWLAN */
94 #ifdef CONFIG_RTL8723B
95 extern void InitInterrupt8723BSdio(PADAPTER padapter);
96 extern void InitSysInterrupt8723BSdio(PADAPTER padapter);
97 extern void EnableInterrupt8723BSdio(PADAPTER padapter);
98 extern void DisableInterrupt8723BSdio(PADAPTER padapter);
99 extern u8 HalQueryTxBufferStatus8723BSdio(PADAPTER padapter);
100 extern u8 HalQueryTxOQTBufferStatus8723BSdio(PADAPTER padapter);
101 #if defined(CONFIG_WOWLAN) || defined(CONFIG_AP_WOWLAN)
102 extern void DisableInterruptButCpwm28723BSdio(PADAPTER padapter);
103 extern void ClearInterrupt8723BSdio(PADAPTER padapter);
104 #endif /* CONFIG_WOWLAN */
105 #endif
106 
107 
108 #ifdef CONFIG_RTL8192E
109 extern void InitInterrupt8192ESdio(PADAPTER padapter);
110 extern void EnableInterrupt8192ESdio(PADAPTER padapter);
111 extern void DisableInterrupt8192ESdio(PADAPTER padapter);
112 extern void UpdateInterruptMask8192ESdio(PADAPTER padapter, u32 AddMSR, u32 RemoveMSR);
113 extern u8 HalQueryTxBufferStatus8192ESdio(PADAPTER padapter);
114 extern u8 HalQueryTxOQTBufferStatus8192ESdio(PADAPTER padapter);
115 extern void ClearInterrupt8192ESdio(PADAPTER padapter);
116 #endif /* CONFIG_RTL8192E */
117 
118 #ifdef CONFIG_RTL8703B
119 extern void InitInterrupt8703BSdio(PADAPTER padapter);
120 extern void InitSysInterrupt8703BSdio(PADAPTER padapter);
121 extern void EnableInterrupt8703BSdio(PADAPTER padapter);
122 extern void DisableInterrupt8703BSdio(PADAPTER padapter);
123 extern u8 HalQueryTxBufferStatus8703BSdio(PADAPTER padapter);
124 extern u8 HalQueryTxOQTBufferStatus8703BSdio(PADAPTER padapter);
125 #if defined(CONFIG_WOWLAN) || defined(CONFIG_AP_WOWLAN)
126 extern void DisableInterruptButCpwm28703BSdio(PADAPTER padapter);
127 extern void ClearInterrupt8703BSdio(PADAPTER padapter);
128 #endif /* CONFIG_WOWLAN */
129 #endif
130 
131 #ifdef CONFIG_RTL8723D
132 extern void InitInterrupt8723DSdio(PADAPTER padapter);
133 extern void InitSysInterrupt8723DSdio(PADAPTER padapter);
134 extern void EnableInterrupt8723DSdio(PADAPTER padapter);
135 extern void DisableInterrupt8723DSdio(PADAPTER padapter);
136 extern u8 HalQueryTxBufferStatus8723DSdio(PADAPTER padapter);
137 extern u8 HalQueryTxOQTBufferStatus8723DSdio(PADAPTER padapter);
138 #if defined(CONFIG_WOWLAN) || defined(CONFIG_AP_WOWLAN)
139 extern void DisableInterruptButCpwm28723dSdio(PADAPTER padapter);
140 extern void ClearInterrupt8723DSdio(PADAPTER padapter);
141 #endif /* CONFIG_WOWLAN */
142 #endif
143 
144 #ifdef CONFIG_RTL8188F
145 extern void InitInterrupt8188FSdio(PADAPTER padapter);
146 extern void InitSysInterrupt8188FSdio(PADAPTER padapter);
147 extern void EnableInterrupt8188FSdio(PADAPTER padapter);
148 extern void DisableInterrupt8188FSdio(PADAPTER padapter);
149 extern u8 HalQueryTxBufferStatus8188FSdio(PADAPTER padapter);
150 extern u8 HalQueryTxOQTBufferStatus8188FSdio(PADAPTER padapter);
151 #if defined(CONFIG_WOWLAN) || defined(CONFIG_AP_WOWLAN)
152 extern void DisableInterruptButCpwm28188FSdio(PADAPTER padapter);
153 extern void ClearInterrupt8188FSdio(PADAPTER padapter);
154 #endif /* defined(CONFIG_WOWLAN) || defined(CONFIG_AP_WOWLAN) */
155 #endif
156 
157 #endif /* !__SDIO_OPS_H__ */
158