net: wireless: rockchip_wlan: add rtl8723cs support
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / rockchip_wlan / rtl8723cs / include / drv_types_sdio.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 __DRV_TYPES_SDIO_H__
21 #define __DRV_TYPES_SDIO_H__
22
23 /* SDIO Header Files */
24 #ifdef PLATFORM_LINUX
25         #include <linux/mmc/sdio_func.h>
26         #include <linux/mmc/sdio_ids.h>
27         #include <linux/mmc/host.h>
28         #include <linux/mmc/card.h>
29
30         #ifdef CONFIG_PLATFORM_SPRD
31                 #include <linux/gpio.h>
32                 #include <custom_gpio.h>
33         #endif /* CONFIG_PLATFORM_SPRD */
34 #endif
35
36 #ifdef PLATFORM_OS_XP
37         #include <wdm.h>
38         #include <ntddsd.h>
39 #endif
40
41 #ifdef PLATFORM_OS_CE
42         #include <sdcardddk.h>
43 #endif
44
45
46 typedef struct sdio_data {
47         u8  func_number;
48
49         u8  tx_block_mode;
50         u8  rx_block_mode;
51         u32 block_transfer_len;
52
53 #ifdef PLATFORM_LINUX
54         struct sdio_func        *func;
55         _thread_hdl_ sys_sdio_irq_thd;
56         unsigned int clock;
57         unsigned int timing;
58         u8      sd3_bus_mode;
59 #endif
60
61 #ifdef PLATFORM_OS_XP
62         PDEVICE_OBJECT                          pphysdevobj;
63         PDEVICE_OBJECT                          pfuncdevobj;
64         PDEVICE_OBJECT                          pnextdevobj;
65         SDBUS_INTERFACE_STANDARD        sdbusinft;
66         u8                                                      nextdevstacksz;
67 #endif
68
69 #ifdef PLATFORM_OS_CE
70         SD_DEVICE_HANDLE                        hDevice;
71         SD_CARD_RCA                                     sd_rca;
72         SD_CARD_INTERFACE                       card_intf;
73         BOOLEAN                                         enableIsarWithStatus;
74         WCHAR                                           active_path[MAX_ACTIVE_REG_PATH];
75         SD_HOST_BLOCK_CAPABILITY        sd_host_blk_cap;
76 #endif
77 } SDIO_DATA, *PSDIO_DATA;
78
79 #define dvobj_to_sdio_func(d)   ((d)->intf_data.func)
80
81 #define RTW_SDIO_ADDR_CMD52_BIT         (1<<17)
82 #define RTW_SDIO_ADDR_CMD52_GEN(a)      (a | RTW_SDIO_ADDR_CMD52_BIT)
83 #define RTW_SDIO_ADDR_CMD52_CLR(a)      (a&~RTW_SDIO_ADDR_CMD52_BIT)
84 #define RTW_SDIO_ADDR_CMD52_CHK(a)      (a&RTW_SDIO_ADDR_CMD52_BIT ? 1 : 0)
85
86 #define RTW_SDIO_ADDR_F0_BIT            (1<<18)
87 #define RTW_SDIO_ADDR_F0_GEN(a)         (a | RTW_SDIO_ADDR_F0_BIT)
88 #define RTW_SDIO_ADDR_F0_CLR(a)         (a&~RTW_SDIO_ADDR_F0_BIT)
89 #define RTW_SDIO_ADDR_F0_CHK(a)         (a&RTW_SDIO_ADDR_F0_BIT ? 1 : 0)
90
91 #endif