drv_types_sdio.h 2.5 KB

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