net: wireless: rockchip: add rtl8822be pcie wifi driver
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / rockchip_wlan / rtl8822be / include / sdio_ops.h
1 /******************************************************************************
2  *
3  * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
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  * You should have received a copy of the GNU General Public License along with
15  * this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
17  *
18  *
19  ******************************************************************************/
20 #ifndef __SDIO_OPS_H__
21 #define __SDIO_OPS_H__
22
23
24 /* Follow mac team suggestion, default I/O fail return value is 0xFF */
25 #define SDIO_ERR_VAL8   0xFF
26 #define SDIO_ERR_VAL16  0xFFFF
27 #define SDIO_ERR_VAL32  0xFFFFFFFF
28
29 #ifdef PLATFORM_LINUX
30         #include <sdio_ops_linux.h>
31 #endif
32
33 #ifdef PLATFORM_WINDOWS
34
35 #ifdef PLATFORM_OS_XP
36 #include <sdio_ops_xp.h>
37 struct async_context {
38         PMDL pmdl;
39         PSDBUS_REQUEST_PACKET sdrp;
40         unsigned char *r_buf;
41         unsigned char *padapter;
42 };
43 #endif
44
45 #ifdef PLATFORM_OS_CE
46         #include <sdio_ops_ce.h>
47 #endif
48
49 #endif /* PLATFORM_WINDOWS */
50
51
52 extern void sdio_set_intf_ops(_adapter *padapter, struct _io_ops *pops);
53
54 /* extern void sdio_func1cmd52_read(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *rmem);
55  * extern void sdio_func1cmd52_write(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *wmem); */
56 extern u8 SdioLocalCmd52Read1Byte(PADAPTER padapter, u32 addr);
57 extern void SdioLocalCmd52Write1Byte(PADAPTER padapter, u32 addr, u8 v);
58 extern s32 _sdio_local_read(PADAPTER padapter, u32 addr, u32 cnt, u8 *pbuf);
59 extern s32 sdio_local_read(PADAPTER padapter, u32 addr, u32 cnt, u8 *pbuf);
60 extern s32 _sdio_local_write(PADAPTER padapter, u32 addr, u32 cnt, u8 *pbuf);
61 extern s32 sdio_local_write(PADAPTER padapter, u32 addr, u32 cnt, u8 *pbuf);
62
63 u32 _sdio_read32(PADAPTER padapter, u32 addr);
64 s32 _sdio_write32(PADAPTER padapter, u32 addr, u32 val);
65
66 extern void sd_int_hdl(PADAPTER padapter);
67 extern u8 CheckIPSStatus(PADAPTER padapter);
68
69 #ifdef CONFIG_RTL8188E
70         extern void InitInterrupt8188ESdio(PADAPTER padapter);
71         extern void EnableInterrupt8188ESdio(PADAPTER padapter);
72         extern void DisableInterrupt8188ESdio(PADAPTER padapter);
73         extern void UpdateInterruptMask8188ESdio(PADAPTER padapter, u32 AddMSR, u32 RemoveMSR);
74         extern u8 HalQueryTxBufferStatus8189ESdio(PADAPTER padapter);
75         extern u8 HalQueryTxOQTBufferStatus8189ESdio(PADAPTER padapter);
76         extern void ClearInterrupt8188ESdio(PADAPTER padapter);
77 #endif /* CONFIG_RTL8188E */
78
79 #ifdef CONFIG_RTL8821A
80         extern void InitInterrupt8821AS(PADAPTER padapter);
81         extern void EnableInterrupt8821AS(PADAPTER padapter);
82         extern void DisableInterrupt8821AS(PADAPTER padapter);
83         extern u8 HalQueryTxBufferStatus8821AS(PADAPTER padapter);
84         extern u8 HalQueryTxOQTBufferStatus8821ASdio(PADAPTER padapter);
85         #if defined(CONFIG_WOWLAN) || defined(CONFIG_AP_WOWLAN)
86                 void ClearInterrupt8821AS(PADAPTER padapter);
87         #endif /* defined(CONFIG_WOWLAN) || defined(CONFIG_AP_WOWLAN) */
88 #endif /* CONFIG_RTL8821A */
89
90 #if defined(CONFIG_WOWLAN) || defined(CONFIG_AP_WOWLAN)
91         extern u8 RecvOnePkt(PADAPTER padapter, u32 size);
92 #endif /* CONFIG_WOWLAN */
93 #ifdef CONFIG_RTL8723B
94         extern void InitInterrupt8723BSdio(PADAPTER padapter);
95         extern void InitSysInterrupt8723BSdio(PADAPTER padapter);
96         extern void EnableInterrupt8723BSdio(PADAPTER padapter);
97         extern void DisableInterrupt8723BSdio(PADAPTER padapter);
98         extern u8 HalQueryTxBufferStatus8723BSdio(PADAPTER padapter);
99         extern u8 HalQueryTxOQTBufferStatus8723BSdio(PADAPTER padapter);
100         #if defined(CONFIG_WOWLAN) || defined(CONFIG_AP_WOWLAN)
101                 extern void DisableInterruptButCpwm28723BSdio(PADAPTER padapter);
102                 extern void ClearInterrupt8723BSdio(PADAPTER padapter);
103         #endif /* CONFIG_WOWLAN */
104 #endif
105
106
107 #ifdef CONFIG_RTL8192E
108         extern void InitInterrupt8192ESdio(PADAPTER padapter);
109         extern void EnableInterrupt8192ESdio(PADAPTER padapter);
110         extern void DisableInterrupt8192ESdio(PADAPTER padapter);
111         extern void UpdateInterruptMask8192ESdio(PADAPTER padapter, u32 AddMSR, u32 RemoveMSR);
112         extern u8 HalQueryTxBufferStatus8192ESdio(PADAPTER padapter);
113         extern u8 HalQueryTxOQTBufferStatus8192ESdio(PADAPTER padapter);
114         extern void ClearInterrupt8192ESdio(PADAPTER padapter);
115 #endif /* CONFIG_RTL8192E */
116
117 #ifdef CONFIG_RTL8703B
118         extern void InitInterrupt8703BSdio(PADAPTER padapter);
119         extern void InitSysInterrupt8703BSdio(PADAPTER padapter);
120         extern void EnableInterrupt8703BSdio(PADAPTER padapter);
121         extern void DisableInterrupt8703BSdio(PADAPTER padapter);
122         extern u8 HalQueryTxBufferStatus8703BSdio(PADAPTER padapter);
123         extern u8 HalQueryTxOQTBufferStatus8703BSdio(PADAPTER padapter);
124         #if defined(CONFIG_WOWLAN) || defined(CONFIG_AP_WOWLAN)
125                 extern void DisableInterruptButCpwm28703BSdio(PADAPTER padapter);
126                 extern void ClearInterrupt8703BSdio(PADAPTER padapter);
127         #endif /* CONFIG_WOWLAN */
128 #endif
129
130 #ifdef CONFIG_RTL8723D
131         extern void InitInterrupt8723DSdio(PADAPTER padapter);
132         extern void InitSysInterrupt8723DSdio(PADAPTER padapter);
133         extern void EnableInterrupt8723DSdio(PADAPTER padapter);
134         extern void DisableInterrupt8723DSdio(PADAPTER padapter);
135         extern u8 HalQueryTxBufferStatus8723DSdio(PADAPTER padapter);
136         extern u8 HalQueryTxOQTBufferStatus8723DSdio(PADAPTER padapter);
137         #if defined(CONFIG_WOWLAN) || defined(CONFIG_AP_WOWLAN)
138                 extern void DisableInterruptButCpwm28723dSdio(PADAPTER padapter);
139                 extern void ClearInterrupt8723DSdio(PADAPTER padapter);
140         #endif /* CONFIG_WOWLAN */
141 #endif
142
143 #ifdef CONFIG_RTL8188F
144         extern void InitInterrupt8188FSdio(PADAPTER padapter);
145         extern void InitSysInterrupt8188FSdio(PADAPTER padapter);
146         extern void EnableInterrupt8188FSdio(PADAPTER padapter);
147         extern void DisableInterrupt8188FSdio(PADAPTER padapter);
148         extern u8 HalQueryTxBufferStatus8188FSdio(PADAPTER padapter);
149         extern u8 HalQueryTxOQTBufferStatus8188FSdio(PADAPTER padapter);
150         #if defined(CONFIG_WOWLAN) || defined(CONFIG_AP_WOWLAN)
151                 extern void DisableInterruptButCpwm28188FSdio(PADAPTER padapter);
152                 extern void ClearInterrupt8188FSdio(PADAPTER padapter);
153         #endif /* defined(CONFIG_WOWLAN) || defined(CONFIG_AP_WOWLAN) */
154 #endif
155
156 #endif /* !__SDIO_OPS_H__ */