Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
btmrvl_sdio.h
Go to the documentation of this file.
1 
22 #define SDIO_HEADER_LEN 4
23 
24 /* SD block size can not bigger than 64 due to buf size limit in firmware */
25 /* define SD block size for data Tx/Rx */
26 #define SDIO_BLOCK_SIZE 64
27 
28 /* Number of blocks for firmware transfer */
29 #define FIRMWARE_TRANSFER_NBLOCK 2
30 
31 /* This is for firmware specific length */
32 #define FW_EXTRA_LEN 36
33 
34 #define MRVDRV_SIZE_OF_CMD_BUFFER (2 * 1024)
35 
36 #define MRVDRV_BT_RX_PACKET_BUFFER_SIZE \
37  (HCI_MAX_FRAME_SIZE + FW_EXTRA_LEN)
38 
39 #define ALLOC_BUF_SIZE (((max_t (int, MRVDRV_BT_RX_PACKET_BUFFER_SIZE, \
40  MRVDRV_SIZE_OF_CMD_BUFFER) + SDIO_HEADER_LEN \
41  + SDIO_BLOCK_SIZE - 1) / SDIO_BLOCK_SIZE) \
42  * SDIO_BLOCK_SIZE)
43 
44 /* The number of times to try when polling for status */
45 #define MAX_POLL_TRIES 100
46 
47 /* Max retry number of CMD53 write */
48 #define MAX_WRITE_IOMEM_RETRY 2
49 
50 /* register bitmasks */
51 #define HOST_POWER_UP BIT(1)
52 #define HOST_CMD53_FIN BIT(2)
53 
54 #define HIM_DISABLE 0xff
55 #define HIM_ENABLE (BIT(0) | BIT(1))
56 
57 #define UP_LD_HOST_INT_STATUS BIT(0)
58 #define DN_LD_HOST_INT_STATUS BIT(1)
59 
60 #define DN_LD_CARD_RDY BIT(0)
61 #define CARD_IO_READY BIT(3)
62 
63 #define FIRMWARE_READY 0xfedc
64 
65 
81 };
82 
84  struct sdio_func *func;
86  const char *helper;
87  const char *firmware;
88  const struct btmrvl_sdio_card_reg *reg;
92 };
93 
95  const char *helper;
96  const char *firmware;
97  const struct btmrvl_sdio_card_reg *reg;
99 };
100 
101 
102 /* Platform specific DMA alignment */
103 #define BTSDIO_DMA_ALIGN 8
104 
105 /* Macros for Data Alignment : size */
106 #define ALIGN_SZ(p, a) \
107  (((p) + ((a) - 1)) & ~((a) - 1))
108 
109 /* Macros for Data Alignment : address */
110 #define ALIGN_ADDR(p, a) \
111  ((((unsigned long)(p)) + (((unsigned long)(a)) - 1)) & \
112  ~(((unsigned long)(a)) - 1))