Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Enumerations | Functions
csr_wifi_hip_card_sdio.h File Reference
#include "csr_wifi_hip_unifi.h"
#include "csr_wifi_hip_unifi_udi.h"
#include "csr_wifi_hip_unifihw.h"
#include "csr_wifi_hip_unifiversion.h"
#include "csr_wifi_hip_ta_sampling.h"
#include "csr_wifi_hip_xbv.h"
#include "csr_wifi_hip_chiphelper.h"

Go to the source code of this file.

Data Structures

struct  sdio_config_data_t
 
struct  bulk_data_cmd_t
 
struct  card_signal
 
struct  q_t
 
struct  card_dynamic_slot_t
 
struct  slot_desc_t
 
struct  card
 
struct  card::sigbuf
 

Macros

#define RESUME_XMIT_THRESHOLD   4
 
#define TO_HOST_FLUSH_THRESHOLD   (500 * 5)
 
#define SDIO_CCCR_SDIO_REVISION   (0x00)
 
#define SDIO_SD_SPEC_REVISION   (0x01)
 
#define SDIO_IO_ENABLE   (0x02)
 
#define SDIO_IO_READY   (0x03)
 
#define SDIO_INT_ENABLE   (0x04)
 
#define SDIO_INT_PENDING   (0x05)
 
#define SDIO_IO_ABORT   (0x06)
 
#define SDIO_BUS_IFACE_CONTROL   (0x07)
 
#define SDIO_CARD_CAPABILOTY   (0x08)
 
#define SDIO_COMMON_CIS_POINTER   (0x09)
 
#define SDIO_BUS_SUSPEND   (0x0C)
 
#define SDIO_FUNCTION_SELECT   (0x0D)
 
#define SDIO_EXEC_FLAGS   (0x0E)
 
#define SDIO_READY_FLAGS   (0x0F)
 
#define SDIO_FN0_BLOCK_SIZE   (0x10)
 
#define SDIO_POWER_CONTROL   (0x12)
 
#define SDIO_VENDOR_START   (0xF0)
 
#define SDIO_CSR_HOST_WAKEUP   (0xf0)
 
#define SDIO_CSR_HOST_INT_CLEAR   (0xf1)
 
#define SDIO_CSR_FROM_HOST_SCRATCH0   (0xf2)
 
#define SDIO_CSR_FROM_HOST_SCRATCH1   (0xf3)
 
#define SDIO_CSR_TO_HOST_SCRATCH0   (0xf4)
 
#define SDIO_CSR_TO_HOST_SCRATCH1   (0xf5)
 
#define SDIO_CSR_FUNC_EN   (0xf6)
 
#define SDIO_CSR_CSPI_MODE   (0xf7)
 
#define SDIO_CSR_CSPI_STATUS   (0xf8)
 
#define SDIO_CSR_CSPI_PADDING   (0xf9)
 
#define UNIFI_SD_INT_ENABLE_IENM   0x0001 /* Master INT Enable */
 
#define SDIO_CONFIG_DATA_SIZE   30
 
#define SDIO_INIT_FLAG_OFFSET   0x12
 
#define SDIO_TO_HOST_SIG_PADDING_OFFSET   0x1C
 
#define SDIO_CMD_SIGNAL   0x00
 
#define SDIO_CMD_TO_HOST_TRANSFER   0x01
 
#define SDIO_CMD_TO_HOST_TRANSFER_ACK   0x02 /*deprecated*/
 
#define SDIO_CMD_FROM_HOST_TRANSFER   0x03
 
#define SDIO_CMD_FROM_HOST_TRANSFER_ACK   0x04 /*deprecated*/
 
#define SDIO_CMD_CLEAR_SLOT   0x05
 
#define SDIO_CMD_OVERLAY_TRANSFER   0x06
 
#define SDIO_CMD_OVERLAY_TRANSFER_ACK   0x07 /*deprecated*/
 
#define SDIO_CMD_FROM_HOST_AND_CLEAR   0x08
 
#define SDIO_CMD_PADDING   0x0f
 
#define SLOT_DIR_TO_HOST   0x8000
 
#define UNIFI_INIT_BULK_DATA(bulk_data_slot)
 
#define UNIFI_QUEUE_NAME_MAX_LENGTH   16
 
#define UNIFI_RESERVED_COMMAND_SLOTS   2
 
#define UNIFI_PACKETS_INTERVAL   1000
 
#define CSR_WIFI_HIP_Q_SLOTS_USED(q)
 
#define CSR_WIFI_HIP_Q_SLOTS_FREE(q)   ((q)->q_length - CSR_WIFI_HIP_Q_SLOTS_USED((q)) - 1)
 
#define CSR_WIFI_HIP_Q_SLOT_DATA(q, slot)   ((q)->q_body + slot)
 
#define CSR_WIFI_HIP_Q_NEXT_R_SLOT(q)   ((q)->q_rd_ptr)
 
#define CSR_WIFI_HIP_Q_NEXT_W_SLOT(q)   ((q)->q_wr_ptr)
 
#define CSR_WIFI_HIP_Q_WRAP(q, x)   ((((x) >= (q)->q_length)?((x) % (q)->q_length) : (x)))
 
#define CSR_WIFI_HIP_Q_INC_R(q)   ((q)->q_rd_ptr = CSR_WIFI_HIP_Q_WRAP((q), (q)->q_rd_ptr + 1))
 
#define CSR_WIFI_HIP_Q_INC_W(q)   ((q)->q_wr_ptr = CSR_WIFI_HIP_Q_WRAP((q), (q)->q_wr_ptr + 1))
 
#define card_is_tx_q_paused(card, q)   (card->tx_q_paused_flag[q])
 
#define card_tx_q_unpause(card, q)   (card->tx_q_paused_flag[q] = 0)
 
#define card_tx_q_pause(card, q)   (card->tx_q_paused_flag[q] = 1)
 
#define UNIFI_FH_BUF_SIZE   1024
 
#define UNIFI_SDIO_READ   0
 
#define UNIFI_SDIO_WRITE   1
 

Typedefs

typedef struct card_signal card_signal_t
 

Enumerations

enum  unifi_host_state { UNIFI_HOST_STATE_AWAKE = 0, UNIFI_HOST_STATE_DROWSY = 1, UNIFI_HOST_STATE_TORPID = 2 }
 
enum  unifi_reset_type { UNIFI_COLD_RESET = 1, UNIFI_WARM_RESET = 2 }
 

Functions

CsrResult unifi_set_host_state (card_t *card, enum unifi_host_state state)
 
CsrResult unifi_set_proc_select (card_t *card, enum unifi_dbg_processors_select select)
 
s32 card_read_signal_counts (card_t *card)
 
bulk_data_desc_tcard_find_data_slot (card_t *card, s16 slot)
 
CsrResult unifi_read32 (card_t *card, u32 unifi_addr, u32 *pdata)
 
CsrResult unifi_readnz (card_t *card, u32 unifi_addr, void *pdata, u16 len)
 
s32 unifi_read_shared_count (card_t *card, u32 addr)
 
CsrResult unifi_writen (card_t *card, u32 unifi_addr, void *pdata, u16 len)
 
CsrResult unifi_bulk_rw (card_t *card, u32 handle, void *pdata, u32 len, s16 direction)
 
CsrResult unifi_bulk_rw_noretry (card_t *card, u32 handle, void *pdata, u32 len, s16 direction)
 
CsrResult unifi_read_8_or_16 (card_t *card, u32 unifi_addr, u8 *pdata)
 
CsrResult unifi_write_8_or_16 (card_t *card, u32 unifi_addr, u8 data)
 
CsrResult unifi_read_direct_8_or_16 (card_t *card, u32 addr, u8 *pdata)
 
CsrResult unifi_write_direct_8_or_16 (card_t *card, u32 addr, u8 data)
 
CsrResult unifi_read_direct16 (card_t *card, u32 addr, u16 *pdata)
 
CsrResult unifi_read_direct32 (card_t *card, u32 addr, u32 *pdata)
 
CsrResult unifi_read_directn (card_t *card, u32 addr, void *pdata, u16 len)
 
CsrResult unifi_write_direct16 (card_t *card, u32 addr, u16 data)
 
CsrResult unifi_write_directn (card_t *card, u32 addr, void *pdata, u16 len)
 
CsrResult sdio_read_f0 (card_t *card, u32 addr, u8 *pdata)
 
CsrResult sdio_write_f0 (card_t *card, u32 addr, u8 data)
 
void unifi_read_panic (card_t *card)
 
void dump (void *mem, u16 len)
 
void dump16 (void *mem, u16 len)
 

Macro Definition Documentation

#define card_is_tx_q_paused (   card,
  q 
)    (card->tx_q_paused_flag[q])

Definition at line 442 of file csr_wifi_hip_card_sdio.h.

#define card_tx_q_pause (   card,
  q 
)    (card->tx_q_paused_flag[q] = 1)

Definition at line 444 of file csr_wifi_hip_card_sdio.h.

#define card_tx_q_unpause (   card,
  q 
)    (card->tx_q_paused_flag[q] = 0)

Definition at line 443 of file csr_wifi_hip_card_sdio.h.

#define CSR_WIFI_HIP_Q_INC_R (   q)    ((q)->q_rd_ptr = CSR_WIFI_HIP_Q_WRAP((q), (q)->q_rd_ptr + 1))

Definition at line 371 of file csr_wifi_hip_card_sdio.h.

#define CSR_WIFI_HIP_Q_INC_W (   q)    ((q)->q_wr_ptr = CSR_WIFI_HIP_Q_WRAP((q), (q)->q_wr_ptr + 1))

Definition at line 378 of file csr_wifi_hip_card_sdio.h.

#define CSR_WIFI_HIP_Q_NEXT_R_SLOT (   q)    ((q)->q_rd_ptr)

Definition at line 345 of file csr_wifi_hip_card_sdio.h.

#define CSR_WIFI_HIP_Q_NEXT_W_SLOT (   q)    ((q)->q_wr_ptr)

Definition at line 354 of file csr_wifi_hip_card_sdio.h.

#define CSR_WIFI_HIP_Q_SLOT_DATA (   q,
  slot 
)    ((q)->q_body + slot)

Definition at line 336 of file csr_wifi_hip_card_sdio.h.

#define CSR_WIFI_HIP_Q_SLOTS_FREE (   q)    ((q)->q_length - CSR_WIFI_HIP_Q_SLOTS_USED((q)) - 1)

Definition at line 326 of file csr_wifi_hip_card_sdio.h.

#define CSR_WIFI_HIP_Q_SLOTS_USED (   q)
Value:
(((q)->q_wr_ptr - (q)->q_rd_ptr < 0)? \
((q)->q_wr_ptr - (q)->q_rd_ptr + (q)->q_length) : ((q)->q_wr_ptr - (q)->q_rd_ptr))

Definition at line 316 of file csr_wifi_hip_card_sdio.h.

#define CSR_WIFI_HIP_Q_WRAP (   q,
  x 
)    ((((x) >= (q)->q_length)?((x) % (q)->q_length) : (x)))

Definition at line 364 of file csr_wifi_hip_card_sdio.h.

#define RESUME_XMIT_THRESHOLD   4

Definition at line 52 of file csr_wifi_hip_card_sdio.h.

#define SDIO_BUS_IFACE_CONTROL   (0x07)

Definition at line 78 of file csr_wifi_hip_card_sdio.h.

#define SDIO_BUS_SUSPEND   (0x0C)

Definition at line 81 of file csr_wifi_hip_card_sdio.h.

#define SDIO_CARD_CAPABILOTY   (0x08)

Definition at line 79 of file csr_wifi_hip_card_sdio.h.

#define SDIO_CCCR_SDIO_REVISION   (0x00)

Definition at line 71 of file csr_wifi_hip_card_sdio.h.

#define SDIO_CMD_CLEAR_SLOT   0x05

Definition at line 216 of file csr_wifi_hip_card_sdio.h.

#define SDIO_CMD_FROM_HOST_AND_CLEAR   0x08

Definition at line 219 of file csr_wifi_hip_card_sdio.h.

#define SDIO_CMD_FROM_HOST_TRANSFER   0x03

Definition at line 214 of file csr_wifi_hip_card_sdio.h.

#define SDIO_CMD_FROM_HOST_TRANSFER_ACK   0x04 /*deprecated*/

Definition at line 215 of file csr_wifi_hip_card_sdio.h.

#define SDIO_CMD_OVERLAY_TRANSFER   0x06

Definition at line 217 of file csr_wifi_hip_card_sdio.h.

#define SDIO_CMD_OVERLAY_TRANSFER_ACK   0x07 /*deprecated*/

Definition at line 218 of file csr_wifi_hip_card_sdio.h.

#define SDIO_CMD_PADDING   0x0f

Definition at line 220 of file csr_wifi_hip_card_sdio.h.

#define SDIO_CMD_SIGNAL   0x00

Definition at line 211 of file csr_wifi_hip_card_sdio.h.

#define SDIO_CMD_TO_HOST_TRANSFER   0x01

Definition at line 212 of file csr_wifi_hip_card_sdio.h.

#define SDIO_CMD_TO_HOST_TRANSFER_ACK   0x02 /*deprecated*/

Definition at line 213 of file csr_wifi_hip_card_sdio.h.

#define SDIO_COMMON_CIS_POINTER   (0x09)

Definition at line 80 of file csr_wifi_hip_card_sdio.h.

#define SDIO_CONFIG_DATA_SIZE   30

Definition at line 193 of file csr_wifi_hip_card_sdio.h.

#define SDIO_CSR_CSPI_MODE   (0xf7)

Definition at line 96 of file csr_wifi_hip_card_sdio.h.

#define SDIO_CSR_CSPI_PADDING   (0xf9)

Definition at line 98 of file csr_wifi_hip_card_sdio.h.

#define SDIO_CSR_CSPI_STATUS   (0xf8)

Definition at line 97 of file csr_wifi_hip_card_sdio.h.

#define SDIO_CSR_FROM_HOST_SCRATCH0   (0xf2)

Definition at line 91 of file csr_wifi_hip_card_sdio.h.

#define SDIO_CSR_FROM_HOST_SCRATCH1   (0xf3)

Definition at line 92 of file csr_wifi_hip_card_sdio.h.

#define SDIO_CSR_FUNC_EN   (0xf6)

Definition at line 95 of file csr_wifi_hip_card_sdio.h.

#define SDIO_CSR_HOST_INT_CLEAR   (0xf1)

Definition at line 90 of file csr_wifi_hip_card_sdio.h.

#define SDIO_CSR_HOST_WAKEUP   (0xf0)

Definition at line 89 of file csr_wifi_hip_card_sdio.h.

#define SDIO_CSR_TO_HOST_SCRATCH0   (0xf4)

Definition at line 93 of file csr_wifi_hip_card_sdio.h.

#define SDIO_CSR_TO_HOST_SCRATCH1   (0xf5)

Definition at line 94 of file csr_wifi_hip_card_sdio.h.

#define SDIO_EXEC_FLAGS   (0x0E)

Definition at line 83 of file csr_wifi_hip_card_sdio.h.

#define SDIO_FN0_BLOCK_SIZE   (0x10)

Definition at line 85 of file csr_wifi_hip_card_sdio.h.

#define SDIO_FUNCTION_SELECT   (0x0D)

Definition at line 82 of file csr_wifi_hip_card_sdio.h.

#define SDIO_INIT_FLAG_OFFSET   0x12

Definition at line 196 of file csr_wifi_hip_card_sdio.h.

#define SDIO_INT_ENABLE   (0x04)

Definition at line 75 of file csr_wifi_hip_card_sdio.h.

#define SDIO_INT_PENDING   (0x05)

Definition at line 76 of file csr_wifi_hip_card_sdio.h.

#define SDIO_IO_ABORT   (0x06)

Definition at line 77 of file csr_wifi_hip_card_sdio.h.

#define SDIO_IO_ENABLE   (0x02)

Definition at line 73 of file csr_wifi_hip_card_sdio.h.

#define SDIO_IO_READY   (0x03)

Definition at line 74 of file csr_wifi_hip_card_sdio.h.

#define SDIO_POWER_CONTROL   (0x12)

Definition at line 86 of file csr_wifi_hip_card_sdio.h.

#define SDIO_READY_FLAGS   (0x0F)

Definition at line 84 of file csr_wifi_hip_card_sdio.h.

#define SDIO_SD_SPEC_REVISION   (0x01)

Definition at line 72 of file csr_wifi_hip_card_sdio.h.

#define SDIO_TO_HOST_SIG_PADDING_OFFSET   0x1C

Definition at line 197 of file csr_wifi_hip_card_sdio.h.

#define SDIO_VENDOR_START   (0xF0)

Definition at line 87 of file csr_wifi_hip_card_sdio.h.

#define SLOT_DIR_TO_HOST   0x8000

Definition at line 222 of file csr_wifi_hip_card_sdio.h.

#define TO_HOST_FLUSH_THRESHOLD   (500 * 5)

Definition at line 67 of file csr_wifi_hip_card_sdio.h.

#define UNIFI_FH_BUF_SIZE   1024

Definition at line 505 of file csr_wifi_hip_card_sdio.h.

#define UNIFI_INIT_BULK_DATA (   bulk_data_slot)
Value:
{ \
(bulk_data_slot)->os_data_ptr = NULL; \
(bulk_data_slot)->data_length = 0; \
(bulk_data_slot)->os_net_buf_ptr = NULL; \
(bulk_data_slot)->net_buf_length = 0; \
}

Definition at line 229 of file csr_wifi_hip_card_sdio.h.

#define UNIFI_PACKETS_INTERVAL   1000

Definition at line 279 of file csr_wifi_hip_card_sdio.h.

#define UNIFI_QUEUE_NAME_MAX_LENGTH   16

Definition at line 261 of file csr_wifi_hip_card_sdio.h.

#define UNIFI_RESERVED_COMMAND_SLOTS   2

Definition at line 276 of file csr_wifi_hip_card_sdio.h.

#define UNIFI_SD_INT_ENABLE_IENM   0x0001 /* Master INT Enable */

Definition at line 101 of file csr_wifi_hip_card_sdio.h.

#define UNIFI_SDIO_READ   0

Definition at line 671 of file csr_wifi_hip_card_sdio.h.

#define UNIFI_SDIO_WRITE   1

Definition at line 672 of file csr_wifi_hip_card_sdio.h.

Typedef Documentation

Enumeration Type Documentation

Enumerator:
UNIFI_HOST_STATE_AWAKE 
UNIFI_HOST_STATE_DROWSY 
UNIFI_HOST_STATE_TORPID 

Definition at line 381 of file csr_wifi_hip_card_sdio.h.

Enumerator:
UNIFI_COLD_RESET 
UNIFI_WARM_RESET 

Definition at line 637 of file csr_wifi_hip_card_sdio.h.

Function Documentation

bulk_data_desc_t* card_find_data_slot ( card_t card,
s16  slot 
)

Definition at line 3546 of file csr_wifi_hip_card_sdio.c.

s32 card_read_signal_counts ( card_t card)
void dump ( void mem,
u16  len 
)
void dump16 ( void mem,
u16  len 
)
CsrResult sdio_read_f0 ( card_t card,
u32  addr,
u8 pdata 
)

Definition at line 341 of file csr_wifi_hip_card_sdio_mem.c.

CsrResult sdio_write_f0 ( card_t card,
u32  addr,
u8  data 
)

Definition at line 367 of file csr_wifi_hip_card_sdio_mem.c.

CsrResult unifi_bulk_rw ( card_t card,
u32  handle,
void pdata,
u32  len,
s16  direction 
)

Definition at line 1475 of file csr_wifi_hip_card_sdio_mem.c.

CsrResult unifi_bulk_rw_noretry ( card_t card,
u32  handle,
void pdata,
u32  len,
s16  direction 
)

Definition at line 1696 of file csr_wifi_hip_card_sdio_mem.c.

CsrResult unifi_read32 ( card_t card,
u32  unifi_addr,
u32 pdata 
)

Definition at line 1239 of file csr_wifi_hip_card_sdio_mem.c.

CsrResult unifi_read_8_or_16 ( card_t card,
u32  unifi_addr,
u8 pdata 
)

Definition at line 1062 of file csr_wifi_hip_card_sdio_mem.c.

CsrResult unifi_read_direct16 ( card_t card,
u32  addr,
u16 pdata 
)

Definition at line 465 of file csr_wifi_hip_card_sdio_mem.c.

CsrResult unifi_read_direct32 ( card_t card,
u32  addr,
u32 pdata 
)

Definition at line 516 of file csr_wifi_hip_card_sdio_mem.c.

CsrResult unifi_read_direct_8_or_16 ( card_t card,
u32  addr,
u8 pdata 
)

Definition at line 391 of file csr_wifi_hip_card_sdio_mem.c.

CsrResult unifi_read_directn ( card_t card,
u32  addr,
void pdata,
u16  len 
)

Definition at line 634 of file csr_wifi_hip_card_sdio_mem.c.

void unifi_read_panic ( card_t card)

Definition at line 1534 of file csr_wifi_hip_card_sdio.c.

s32 unifi_read_shared_count ( card_t card,
u32  addr 
)

Definition at line 1326 of file csr_wifi_hip_card_sdio_mem.c.

CsrResult unifi_readnz ( card_t card,
u32  unifi_addr,
void pdata,
u16  len 
)

Definition at line 1304 of file csr_wifi_hip_card_sdio_mem.c.

CsrResult unifi_set_host_state ( card_t card,
enum unifi_host_state  state 
)

Definition at line 3880 of file csr_wifi_hip_card_sdio.c.

CsrResult unifi_set_proc_select ( card_t card,
enum unifi_dbg_processors_select  select 
)

Definition at line 1004 of file csr_wifi_hip_card_sdio_mem.c.

CsrResult unifi_write_8_or_16 ( card_t card,
u32  unifi_addr,
u8  data 
)

Definition at line 1113 of file csr_wifi_hip_card_sdio_mem.c.

CsrResult unifi_write_direct16 ( card_t card,
u32  addr,
u16  data 
)

Definition at line 493 of file csr_wifi_hip_card_sdio_mem.c.

CsrResult unifi_write_direct_8_or_16 ( card_t card,
u32  addr,
u8  data 
)

Definition at line 426 of file csr_wifi_hip_card_sdio_mem.c.

CsrResult unifi_write_directn ( card_t card,
u32  addr,
void pdata,
u16  len 
)

Definition at line 667 of file csr_wifi_hip_card_sdio_mem.c.

CsrResult unifi_writen ( card_t card,
u32  unifi_addr,
void pdata,
u16  len 
)

Definition at line 1387 of file csr_wifi_hip_card_sdio_mem.c.