drv_types_sdio.h 2.7 KB

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