Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
sdio.h File Reference
#include <linux/mmc/sdio.h>
#include <linux/mmc/sdio_ids.h>
#include <linux/mmc/sdio_func.h>
#include <linux/mmc/card.h>
#include "main.h"

Go to the source code of this file.

Data Structures

struct  mwifiex_sdio_mpa_tx
 
struct  mwifiex_sdio_mpa_rx
 
struct  sdio_mmc_card
 

Macros

#define SD8786_DEFAULT_FW_NAME   "mrvl/sd8786_uapsta.bin"
 
#define SD8787_DEFAULT_FW_NAME   "mrvl/sd8787_uapsta.bin"
 
#define SD8797_DEFAULT_FW_NAME   "mrvl/sd8797_uapsta.bin"
 
#define BLOCK_MODE   1
 
#define BYTE_MODE   0
 
#define REG_PORT   0
 
#define RD_BITMAP_L   0x04
 
#define RD_BITMAP_U   0x05
 
#define WR_BITMAP_L   0x06
 
#define WR_BITMAP_U   0x07
 
#define RD_LEN_P0_L   0x08
 
#define RD_LEN_P0_U   0x09
 
#define MWIFIEX_SDIO_IO_PORT_MASK   0xfffff
 
#define MWIFIEX_SDIO_BYTE_MODE_MASK   0x80000000
 
#define CTRL_PORT   0
 
#define CTRL_PORT_MASK   0x0001
 
#define DATA_PORT_MASK   0xfffe
 
#define MAX_MP_REGS   64
 
#define MAX_PORT   16
 
#define SDIO_MP_AGGR_DEF_PKT_LIMIT   8
 
#define SDIO_MP_TX_AGGR_DEF_BUF_SIZE   (8192) /* 8K */
 
#define SDIO_MP_RX_AGGR_DEF_BUF_SIZE   (16384) /* 16K */
 
#define AUTO_RE_ENABLE_INT   BIT(4)
 
#define IO_PORT_0_REG   0x78
 
#define IO_PORT_1_REG   0x79
 
#define IO_PORT_2_REG   0x7A
 
#define CONFIGURATION_REG   0x00
 
#define HOST_TO_CARD_EVENT   (0x1U << 3)
 
#define HOST_WO_CMD53_FINISH_HOST   (0x1U << 2)
 
#define HOST_POWER_UP   (0x1U << 1)
 
#define HOST_POWER_DOWN   (0x1U << 0)
 
#define HOST_INT_MASK_REG   0x02
 
#define UP_LD_HOST_INT_MASK   (0x1U)
 
#define DN_LD_HOST_INT_MASK   (0x2U)
 
#define HOST_INT_ENABLE   (UP_LD_HOST_INT_MASK | DN_LD_HOST_INT_MASK)
 
#define HOST_INT_DISABLE   0xff
 
#define HOST_INTSTATUS_REG   0x03
 
#define UP_LD_HOST_INT_STATUS   (0x1U)
 
#define DN_LD_HOST_INT_STATUS   (0x2U)
 
#define HOST_INT_RSR_REG   0x01
 
#define UP_LD_HOST_INT_RSR   (0x1U)
 
#define SDIO_INT_MASK   0x3F
 
#define HOST_INT_STATUS_REG   0x28
 
#define UP_LD_CRC_ERR   (0x1U << 2)
 
#define UP_LD_RESTART   (0x1U << 1)
 
#define DN_LD_RESTART   (0x1U << 0)
 
#define CARD_STATUS_REG   0x30
 
#define CARD_IO_READY   (0x1U << 3)
 
#define CIS_CARD_RDY   (0x1U << 2)
 
#define UP_LD_CARD_RDY   (0x1U << 1)
 
#define DN_LD_CARD_RDY   (0x1U << 0)
 
#define HOST_INTERRUPT_MASK_REG   0x34
 
#define HOST_POWER_INT_MASK   (0x1U << 3)
 
#define ABORT_CARD_INT_MASK   (0x1U << 2)
 
#define UP_LD_CARD_INT_MASK   (0x1U << 1)
 
#define DN_LD_CARD_INT_MASK   (0x1U << 0)
 
#define CARD_INTERRUPT_STATUS_REG   0x38
 
#define POWER_UP_INT   (0x1U << 4)
 
#define POWER_DOWN_INT   (0x1U << 3)
 
#define CARD_INTERRUPT_RSR_REG   0x3c
 
#define POWER_UP_RSR   (0x1U << 4)
 
#define POWER_DOWN_RSR   (0x1U << 3)
 
#define CARD_MISC_CFG_REG   0x6C
 
#define HOST_F1_RD_BASE_0   0x0040
 
#define HOST_F1_RD_BASE_1   0x0041
 
#define HOST_F1_CARD_RDY   0x0020
 
#define CARD_FW_STATUS0_REG   0x60
 
#define CARD_FW_STATUS1_REG   0x61
 
#define CARD_RX_LEN_REG   0x62
 
#define CARD_RX_UNIT_REG   0x63
 
#define MAX_WRITE_IOMEM_RETRY   2
 
#define MP_TX_AGGR_IN_PROGRESS(a)   (a->mpa_tx.pkt_cnt > 0)
 
#define MP_TX_AGGR_BUF_HAS_ROOM(a, len)
 
#define MP_TX_AGGR_BUF_PUT(a, payload, pkt_len, port)
 
#define MP_TX_AGGR_PKT_LIMIT_REACHED(a)   (a->mpa_tx.pkt_cnt == a->mpa_tx.pkt_aggr_limit)
 
#define MP_TX_AGGR_PORT_LIMIT_REACHED(a)
 
#define MP_TX_AGGR_BUF_RESET(a)
 
#define MP_RX_AGGR_PKT_LIMIT_REACHED(a)   (a->mpa_rx.pkt_cnt == a->mpa_rx.pkt_aggr_limit)
 
#define MP_RX_AGGR_PORT_LIMIT_REACHED(a)
 
#define MP_RX_AGGR_IN_PROGRESS(a)   (a->mpa_rx.pkt_cnt > 0)
 
#define MP_RX_AGGR_BUF_HAS_ROOM(a, rx_len)   ((a->mpa_rx.buf_len+rx_len) <= a->mpa_rx.buf_size)
 
#define MP_RX_AGGR_SETUP(a, skb, port)
 
#define MP_RX_AGGR_BUF_RESET(a)
 

Functions

int mwifiex_bus_register (void)
 
void mwifiex_bus_unregister (void)
 

Macro Definition Documentation

#define ABORT_CARD_INT_MASK   (0x1U << 2)

Definition at line 135 of file sdio.h.

#define AUTO_RE_ENABLE_INT   BIT(4)

Definition at line 65 of file sdio.h.

#define BLOCK_MODE   1

Definition at line 35 of file sdio.h.

#define BYTE_MODE   0

Definition at line 36 of file sdio.h.

#define CARD_FW_STATUS0_REG   0x60

Definition at line 166 of file sdio.h.

#define CARD_FW_STATUS1_REG   0x61

Definition at line 168 of file sdio.h.

#define CARD_INTERRUPT_RSR_REG   0x3c

Definition at line 149 of file sdio.h.

#define CARD_INTERRUPT_STATUS_REG   0x38

Definition at line 142 of file sdio.h.

#define CARD_IO_READY   (0x1U << 3)

Definition at line 122 of file sdio.h.

#define CARD_MISC_CFG_REG   0x6C

Definition at line 156 of file sdio.h.

#define CARD_RX_LEN_REG   0x62

Definition at line 170 of file sdio.h.

#define CARD_RX_UNIT_REG   0x63

Definition at line 172 of file sdio.h.

#define CARD_STATUS_REG   0x30

Definition at line 120 of file sdio.h.

#define CIS_CARD_RDY   (0x1U << 2)

Definition at line 124 of file sdio.h.

#define CONFIGURATION_REG   0x00

Definition at line 76 of file sdio.h.

#define CTRL_PORT   0

Definition at line 50 of file sdio.h.

#define CTRL_PORT_MASK   0x0001

Definition at line 51 of file sdio.h.

#define DATA_PORT_MASK   0xfffe

Definition at line 52 of file sdio.h.

#define DN_LD_CARD_INT_MASK   (0x1U << 0)

Definition at line 139 of file sdio.h.

#define DN_LD_CARD_RDY   (0x1U << 0)

Definition at line 128 of file sdio.h.

#define DN_LD_HOST_INT_MASK   (0x2U)

Definition at line 91 of file sdio.h.

#define DN_LD_HOST_INT_STATUS   (0x2U)

Definition at line 102 of file sdio.h.

#define DN_LD_RESTART   (0x1U << 0)

Definition at line 117 of file sdio.h.

#define HOST_F1_CARD_RDY   0x0020

Definition at line 163 of file sdio.h.

#define HOST_F1_RD_BASE_0   0x0040

Definition at line 159 of file sdio.h.

#define HOST_F1_RD_BASE_1   0x0041

Definition at line 161 of file sdio.h.

#define HOST_INT_DISABLE   0xff

Definition at line 95 of file sdio.h.

#define HOST_INT_ENABLE   (UP_LD_HOST_INT_MASK | DN_LD_HOST_INT_MASK)

Definition at line 93 of file sdio.h.

#define HOST_INT_MASK_REG   0x02

Definition at line 87 of file sdio.h.

#define HOST_INT_RSR_REG   0x01

Definition at line 105 of file sdio.h.

#define HOST_INT_STATUS_REG   0x28

Definition at line 111 of file sdio.h.

#define HOST_INTERRUPT_MASK_REG   0x34

Definition at line 131 of file sdio.h.

#define HOST_INTSTATUS_REG   0x03

Definition at line 98 of file sdio.h.

#define HOST_POWER_DOWN   (0x1U << 0)

Definition at line 84 of file sdio.h.

#define HOST_POWER_INT_MASK   (0x1U << 3)

Definition at line 133 of file sdio.h.

#define HOST_POWER_UP   (0x1U << 1)

Definition at line 82 of file sdio.h.

#define HOST_TO_CARD_EVENT   (0x1U << 3)

Definition at line 78 of file sdio.h.

#define HOST_WO_CMD53_FINISH_HOST   (0x1U << 2)

Definition at line 80 of file sdio.h.

#define IO_PORT_0_REG   0x78

Definition at line 69 of file sdio.h.

#define IO_PORT_1_REG   0x79

Definition at line 71 of file sdio.h.

#define IO_PORT_2_REG   0x7A

Definition at line 73 of file sdio.h.

#define MAX_MP_REGS   64

Definition at line 54 of file sdio.h.

#define MAX_PORT   16

Definition at line 55 of file sdio.h.

#define MAX_WRITE_IOMEM_RETRY   2

Definition at line 175 of file sdio.h.

#define MP_RX_AGGR_BUF_HAS_ROOM (   a,
  rx_len 
)    ((a->mpa_rx.buf_len+rx_len) <= a->mpa_rx.buf_size)

Definition at line 231 of file sdio.h.

#define MP_RX_AGGR_BUF_RESET (   a)
Value:
do { \
a->mpa_rx.pkt_cnt = 0; \
a->mpa_rx.buf_len = 0; \
a->mpa_rx.ports = 0; \
a->mpa_rx.start_port = 0; \
} while (0)

Definition at line 249 of file sdio.h.

#define MP_RX_AGGR_IN_PROGRESS (   a)    (a->mpa_rx.pkt_cnt > 0)

Definition at line 228 of file sdio.h.

#define MP_RX_AGGR_PKT_LIMIT_REACHED (   a)    (a->mpa_rx.pkt_cnt == a->mpa_rx.pkt_aggr_limit)

Definition at line 218 of file sdio.h.

#define MP_RX_AGGR_PORT_LIMIT_REACHED (   a)
Value:
((a->curr_rd_port < \
a->mpa_rx.start_port) && (((MAX_PORT - \
a->mpa_rx.start_port) + a->curr_rd_port) >= \
SDIO_MP_AGGR_DEF_PKT_LIMIT))

Definition at line 222 of file sdio.h.

#define MP_RX_AGGR_SETUP (   a,
  skb,
  port 
)
Value:
do { \
a->mpa_rx.buf_len += skb->len; \
if (!a->mpa_rx.pkt_cnt) \
a->mpa_rx.start_port = port; \
if (a->mpa_rx.start_port <= port) \
a->mpa_rx.ports |= (1<<(a->mpa_rx.pkt_cnt)); \
else \
a->mpa_rx.ports |= (1<<(a->mpa_rx.pkt_cnt+1)); \
a->mpa_rx.skb_arr[a->mpa_rx.pkt_cnt] = skb; \
a->mpa_rx.len_arr[a->mpa_rx.pkt_cnt] = skb->len; \
a->mpa_rx.pkt_cnt++; \
} while (0)

Definition at line 235 of file sdio.h.

#define MP_TX_AGGR_BUF_HAS_ROOM (   a,
  len 
)
Value:
((a->mpa_tx.buf_len+len) \
<= a->mpa_tx.buf_size)

Definition at line 181 of file sdio.h.

#define MP_TX_AGGR_BUF_PUT (   a,
  payload,
  pkt_len,
  port 
)
Value:
do { \
memmove(&a->mpa_tx.buf[a->mpa_tx.buf_len], \
a->mpa_tx.buf_len += pkt_len; \
if (!a->mpa_tx.pkt_cnt) \
a->mpa_tx.start_port = port; \
if (a->mpa_tx.start_port <= port) \
a->mpa_tx.ports |= (1<<(a->mpa_tx.pkt_cnt)); \
else \
a->mpa_tx.ports |= (1<<(a->mpa_tx.pkt_cnt+1+(MAX_PORT - \
a->mp_end_port))); \
a->mpa_tx.pkt_cnt++; \
} while (0)

Definition at line 185 of file sdio.h.

#define MP_TX_AGGR_BUF_RESET (   a)
Value:
do { \
a->mpa_tx.pkt_cnt = 0; \
a->mpa_tx.buf_len = 0; \
a->mpa_tx.ports = 0; \
a->mpa_tx.start_port = 0; \
} while (0)

Definition at line 210 of file sdio.h.

#define MP_TX_AGGR_IN_PROGRESS (   a)    (a->mpa_tx.pkt_cnt > 0)

Definition at line 178 of file sdio.h.

#define MP_TX_AGGR_PKT_LIMIT_REACHED (   a)    (a->mpa_tx.pkt_cnt == a->mpa_tx.pkt_aggr_limit)

Definition at line 200 of file sdio.h.

#define MP_TX_AGGR_PORT_LIMIT_REACHED (   a)
Value:
((a->curr_wr_port < \
a->mpa_tx.start_port) && (((MAX_PORT - \
a->mpa_tx.start_port) + a->curr_wr_port) >= \
SDIO_MP_AGGR_DEF_PKT_LIMIT))

Definition at line 204 of file sdio.h.

#define MWIFIEX_SDIO_BYTE_MODE_MASK   0x80000000

Definition at line 48 of file sdio.h.

#define MWIFIEX_SDIO_IO_PORT_MASK   0xfffff

Definition at line 46 of file sdio.h.

#define POWER_DOWN_INT   (0x1U << 3)

Definition at line 146 of file sdio.h.

#define POWER_DOWN_RSR   (0x1U << 3)

Definition at line 153 of file sdio.h.

#define POWER_UP_INT   (0x1U << 4)

Definition at line 144 of file sdio.h.

#define POWER_UP_RSR   (0x1U << 4)

Definition at line 151 of file sdio.h.

#define RD_BITMAP_L   0x04

Definition at line 39 of file sdio.h.

#define RD_BITMAP_U   0x05

Definition at line 40 of file sdio.h.

#define RD_LEN_P0_L   0x08

Definition at line 43 of file sdio.h.

#define RD_LEN_P0_U   0x09

Definition at line 44 of file sdio.h.

#define REG_PORT   0

Definition at line 38 of file sdio.h.

#define SD8786_DEFAULT_FW_NAME   "mrvl/sd8786_uapsta.bin"

Definition at line 31 of file sdio.h.

#define SD8787_DEFAULT_FW_NAME   "mrvl/sd8787_uapsta.bin"

Definition at line 32 of file sdio.h.

#define SD8797_DEFAULT_FW_NAME   "mrvl/sd8797_uapsta.bin"

Definition at line 33 of file sdio.h.

#define SDIO_INT_MASK   0x3F

Definition at line 108 of file sdio.h.

#define SDIO_MP_AGGR_DEF_PKT_LIMIT   8

Definition at line 57 of file sdio.h.

#define SDIO_MP_RX_AGGR_DEF_BUF_SIZE   (16384) /* 16K */

Definition at line 62 of file sdio.h.

#define SDIO_MP_TX_AGGR_DEF_BUF_SIZE   (8192) /* 8K */

Definition at line 59 of file sdio.h.

#define UP_LD_CARD_INT_MASK   (0x1U << 1)

Definition at line 137 of file sdio.h.

#define UP_LD_CARD_RDY   (0x1U << 1)

Definition at line 126 of file sdio.h.

#define UP_LD_CRC_ERR   (0x1U << 2)

Definition at line 113 of file sdio.h.

#define UP_LD_HOST_INT_MASK   (0x1U)

Definition at line 89 of file sdio.h.

#define UP_LD_HOST_INT_RSR   (0x1U)

Definition at line 107 of file sdio.h.

#define UP_LD_HOST_INT_STATUS   (0x1U)

Definition at line 100 of file sdio.h.

#define UP_LD_RESTART   (0x1U << 1)

Definition at line 115 of file sdio.h.

#define WR_BITMAP_L   0x06

Definition at line 41 of file sdio.h.

#define WR_BITMAP_U   0x07

Definition at line 42 of file sdio.h.

Function Documentation

int mwifiex_bus_register ( void  )
void mwifiex_bus_unregister ( void  )