staging: brcm80211: move debug console related code to dhd_sdio.c
[deliverable/linux.git] / drivers / staging / brcm80211 / brcmfmac / dhd_bus.h
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 _dhd_bus_h_
18 #define _dhd_bus_h_
19
20 /* Packet alignment for most efficient SDIO (can change based on platform) */
21 #ifndef BRCMF_SDALIGN
22 #define BRCMF_SDALIGN 32
23 #endif
24 #if !ISPOWEROF2(BRCMF_SDALIGN)
25 #error BRCMF_SDALIGN is not a power of 2!
26 #endif
27
28 /*
29 * Exported from dhd bus module (dhd_usb, dhd_sdio)
30 */
31
32 /* Watchdog timer interval */
33 extern uint brcmf_watchdog_ms;
34
35 /* Indicate (dis)interest in finding dongles. */
36 extern int dhd_bus_register(void);
37 extern void dhd_bus_unregister(void);
38
39 /* Download firmware image and nvram image */
40 extern bool dhd_bus_download_firmware(struct dhd_bus *bus,
41 char *fw_path, char *nv_path);
42
43 /* Stop bus module: clear pending frames, disable data flow */
44 extern void brcmf_sdbrcm_bus_stop(struct dhd_bus *bus, bool enforce_mutex);
45
46 /* Initialize bus module: prepare for communication w/dongle */
47 extern int brcmf_sdbrcm_bus_init(dhd_pub_t *dhdp, bool enforce_mutex);
48
49 /* Send a data frame to the dongle. Callee disposes of txp. */
50 extern int brcmf_sdbrcm_bus_txdata(struct dhd_bus *bus, struct sk_buff *txp);
51
52 /* Send/receive a control message to/from the dongle.
53 * Expects caller to enforce a single outstanding transaction.
54 */
55 extern int
56 brcmf_sdbrcm_bus_txctl(struct dhd_bus *bus, unsigned char *msg, uint msglen);
57
58 extern int
59 brcmf_sdbrcm_bus_rxctl(struct dhd_bus *bus, unsigned char *msg, uint msglen);
60
61 /* Deferred processing for the bus, return true requests reschedule */
62 extern bool dhd_bus_dpc(struct dhd_bus *bus);
63 extern void dhd_bus_isr(bool *InterruptRecognized,
64 bool *QueueMiniportHandleInterrupt, void *arg);
65
66 /* Check for and handle local prot-specific iovar commands */
67 extern int brcmf_sdbrcm_bus_iovar_op(dhd_pub_t *dhdp, const char *name,
68 void *params, int plen, void *arg, int len,
69 bool set);
70
71 /* Add bus dump output to a buffer */
72 extern void brcmf_sdbrcm_bus_dump(dhd_pub_t *dhdp, struct brcmu_strbuf *strbuf);
73
74 /* Clear any bus counters */
75 extern void dhd_bus_clearcounts(dhd_pub_t *dhdp);
76
77 /* return the dongle chipid */
78 extern uint dhd_bus_chip(struct dhd_bus *bus);
79
80 /* Set user-specified nvram parameters. */
81 extern void dhd_bus_set_nvram_params(struct dhd_bus *bus,
82 const char *nvram_params);
83
84 extern void *dhd_bus_pub(struct dhd_bus *bus);
85 extern void *dhd_bus_txq(struct dhd_bus *bus);
86 extern uint dhd_bus_hdrlen(struct dhd_bus *bus);
87
88 extern void brcmf_sdbrcm_wd_timer(struct dhd_bus *bus, uint wdtick);
89
90 #endif /* _dhd_bus_h_ */
This page took 0.036703 seconds and 6 git commands to generate.