net: wireless: rockchip_wlan: add rtl8723ds support
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / rockchip_wlan / rtl8723ds / 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 #endif
58
59 #ifdef PLATFORM_OS_XP
60         PDEVICE_OBJECT                          pphysdevobj;
61         PDEVICE_OBJECT                          pfuncdevobj;
62         PDEVICE_OBJECT                          pnextdevobj;
63         SDBUS_INTERFACE_STANDARD        sdbusinft;
64         u8                                                      nextdevstacksz;
65 #endif
66
67 #ifdef PLATFORM_OS_CE
68         SD_DEVICE_HANDLE                        hDevice;
69         SD_CARD_RCA                                     sd_rca;
70         SD_CARD_INTERFACE                       card_intf;
71         BOOLEAN                                         enableIsarWithStatus;
72         WCHAR                                           active_path[MAX_ACTIVE_REG_PATH];
73         SD_HOST_BLOCK_CAPABILITY        sd_host_blk_cap;
74 #endif
75 } SDIO_DATA, *PSDIO_DATA;
76
77 #define dvobj_to_sdio_func(d)   ((d)->intf_data.func)
78
79 #define RTW_SDIO_ADDR_CMD52_BIT         (1<<17)
80 #define RTW_SDIO_ADDR_CMD52_GEN(a)      (a | RTW_SDIO_ADDR_CMD52_BIT)
81 #define RTW_SDIO_ADDR_CMD52_CLR(a)      (a&~RTW_SDIO_ADDR_CMD52_BIT)
82 #define RTW_SDIO_ADDR_CMD52_CHK(a)      (a&RTW_SDIO_ADDR_CMD52_BIT ? 1 : 0)
83
84 #define RTW_SDIO_ADDR_F0_BIT            (1<<18)
85 #define RTW_SDIO_ADDR_F0_GEN(a)         (a | RTW_SDIO_ADDR_F0_BIT)
86 #define RTW_SDIO_ADDR_F0_CLR(a)         (a&~RTW_SDIO_ADDR_F0_BIT)
87 #define RTW_SDIO_ADDR_F0_CHK(a)         (a&RTW_SDIO_ADDR_F0_BIT ? 1 : 0)
88
89 #define RTW_SDIO_CLK_40M        40000000
90
91 #endif