staging: brcm80211: use linux native ethertype iso ETH_P_BRCM
[deliverable/linux.git] / drivers / staging / brcm80211 / brcmfmac / bcmsdbus.h
CommitLineData
a9533e7e
HP
1/*
2 * Copyright (c) 2010 Broadcom Corporation
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
11 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
13 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
14 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */
16
17#ifndef _sdio_api_h_
18#define _sdio_api_h_
19
c55a1223
RV
20#include "sdio_host.h"
21
a9533e7e
HP
22#define SDIOH_API_RC_SUCCESS (0x00)
23#define SDIOH_API_RC_FAIL (0x01)
24#define SDIOH_API_SUCCESS(status) (status == 0)
25
26#define SDIOH_READ 0 /* Read request */
27#define SDIOH_WRITE 1 /* Write request */
28
29#define SDIOH_DATA_FIX 0 /* Fixed addressing */
30#define SDIOH_DATA_INC 1 /* Incremental addressing */
31
32#define SDIOH_CMD_TYPE_NORMAL 0 /* Normal command */
33#define SDIOH_CMD_TYPE_APPEND 1 /* Append command */
34#define SDIOH_CMD_TYPE_CUTTHRU 2 /* Cut-through command */
35
36#define SDIOH_DATA_PIO 0 /* PIO mode */
37#define SDIOH_DATA_DMA 1 /* DMA mode */
38
a9533e7e
HP
39/* callback function, taking one arg */
40typedef void (*sdioh_cb_fn_t) (void *);
41
42/* attach, return handler on success, NULL if failed.
43 * The handler shall be provided by all subsequent calls. No local cache
44 * cfghdl points to the starting address of pci device mapped memory
45 */
294f2439 46extern struct sdioh_info *brcmf_sdioh_attach(void *cfghdl, uint irq);
3c793822
RV
47extern int brcmf_sdioh_detach(struct sdioh_info *si);
48extern int brcmf_sdioh_interrupt_register(struct sdioh_info *si,
a9533e7e 49 sdioh_cb_fn_t fn, void *argh);
3c793822 50extern int brcmf_sdioh_interrupt_deregister(struct sdioh_info *si);
a9533e7e
HP
51
52/* query whether SD interrupt is enabled or not */
3c793822 53extern int
294f2439 54brcmf_sdioh_interrupt_query(struct sdioh_info *si, bool *onoff);
a9533e7e
HP
55
56/* enable or disable SD interrupt */
3c793822 57extern int
294f2439 58brcmf_sdioh_interrupt_set(struct sdioh_info *si, bool enable_disable);
a9533e7e 59
762c2a36 60#if defined(BCMDBG)
294f2439 61extern bool brcmf_sdioh_interrupt_pending(struct sdioh_info *si);
a9533e7e
HP
62#endif
63
294f2439
RV
64extern int brcmf_sdioh_claim_host_and_lock(struct sdioh_info *si);
65extern int brcmf_sdioh_release_host_and_unlock(struct sdioh_info *si);
a9533e7e
HP
66
67/* read or write one byte using cmd52 */
3c793822 68extern int
294f2439 69brcmf_sdioh_request_byte(struct sdioh_info *si, uint rw, uint fnc, uint addr,
54ca2969 70 u8 *byte);
a9533e7e
HP
71
72/* read or write 2/4 bytes using cmd53 */
3c793822 73extern int
294f2439
RV
74brcmf_sdioh_request_word(struct sdioh_info *si, uint cmd_type,
75 uint rw, uint fnc, uint addr,
76 u32 *word, uint nbyte);
a9533e7e
HP
77
78/* read or write any buffer using cmd53 */
3c793822 79extern int
294f2439
RV
80brcmf_sdioh_request_buffer(struct sdioh_info *si, uint pio_dma,
81 uint fix_inc, uint rw, uint fnc_num,
82 u32 addr, uint regwidth,
83 u32 buflen, u8 *buffer, struct sk_buff *pkt);
a9533e7e
HP
84
85/* get cis data */
3c793822 86extern int
294f2439 87brcmf_sdioh_cis_read(struct sdioh_info *si, uint fuc, u8 *cis, u32 length);
a9533e7e 88
3c793822 89extern int
294f2439 90brcmf_sdioh_cfg_read(struct sdioh_info *si, uint fuc, u32 addr, u8 *data);
3c793822 91extern int
294f2439 92brcmf_sdioh_cfg_write(struct sdioh_info *si, uint fuc, u32 addr, u8 *data);
a9533e7e
HP
93
94/* query number of io functions */
294f2439 95extern uint brcmf_sdioh_query_iofnum(struct sdioh_info *si);
a9533e7e
HP
96
97/* handle iovars */
294f2439 98extern int brcmf_sdioh_iovar_op(struct sdioh_info *si, const char *name,
a9533e7e
HP
99 void *params, int plen, void *arg, int len, bool set);
100
101/* Issue abort to the specified function and clear controller as needed */
294f2439 102extern int brcmf_sdioh_abort(struct sdioh_info *si, uint fnc);
a9533e7e
HP
103
104/* Start and Stop SDIO without re-enumerating the SD card. */
294f2439
RV
105extern int brcmf_sdioh_start(struct sdioh_info *si, int stage);
106extern int brcmf_sdioh_stop(struct sdioh_info *si);
a9533e7e
HP
107
108/* Reset and re-initialize the device */
294f2439 109extern int brcmf_sdioh_reset(struct sdioh_info *si);
a9533e7e
HP
110
111/* Helper function */
677226aa 112void *brcmf_sdcard_get_sdioh(struct brcmf_sdio *sdh);
a9533e7e
HP
113
114#endif /* _sdio_api_h_ */
This page took 0.133823 seconds and 5 git commands to generate.