add rk3288 pinctrl dts code
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / rkwifi / bcmdhd / dhd_bus.h
1 /*
2  * Header file describing the internal (inter-module) DHD interfaces.
3  *
4  * Provides type definitions and function prototypes used to link the
5  * DHD OS, bus, and protocol modules.
6  *
7  * $Copyright Open Broadcom Corporation$
8  *
9  * $Id: dhd_bus.h 335569 2012-05-29 12:04:43Z $
10  */
11
12 #ifndef _dhd_bus_h_
13 #define _dhd_bus_h_
14
15 /*
16  * Exported from dhd bus module (dhd_usb, dhd_sdio)
17  */
18
19 /* Indicate (dis)interest in finding dongles. */
20 extern int dhd_bus_register(void);
21 extern void dhd_bus_unregister(void);
22
23 /* Download firmware image and nvram image */
24 extern bool dhd_bus_download_firmware(struct dhd_bus *bus, osl_t *osh,
25         char *fw_path, char *nv_path, char *conf_path);
26
27 /* Stop bus module: clear pending frames, disable data flow */
28 extern void dhd_bus_stop(struct dhd_bus *bus, bool enforce_mutex);
29
30 /* Initialize bus module: prepare for communication w/dongle */
31 extern int dhd_bus_init(dhd_pub_t *dhdp, bool enforce_mutex);
32
33 /* Get the Bus Idle Time */
34 extern void dhd_bus_getidletime(dhd_pub_t *dhdp, int *idletime);
35
36 /* Set the Bus Idle Time */
37 extern void dhd_bus_setidletime(dhd_pub_t *dhdp, int idle_time);
38
39 /* Send a data frame to the dongle.  Callee disposes of txp. */
40 extern int dhd_bus_txdata(struct dhd_bus *bus, void *txp);
41
42 /* Send/receive a control message to/from the dongle.
43  * Expects caller to enforce a single outstanding transaction.
44  */
45 extern int dhd_bus_txctl(struct dhd_bus *bus, uchar *msg, uint msglen);
46 extern int dhd_bus_rxctl(struct dhd_bus *bus, uchar *msg, uint msglen);
47
48 /* Watchdog timer function */
49 extern bool dhd_bus_watchdog(dhd_pub_t *dhd);
50 extern void dhd_disable_intr(dhd_pub_t *dhd);
51
52 #if defined(DHD_DEBUG)
53 /* Device console input function */
54 extern int dhd_bus_console_in(dhd_pub_t *dhd, uchar *msg, uint msglen);
55 #endif /* defined(DHD_DEBUG) */
56
57 /* Deferred processing for the bus, return TRUE requests reschedule */
58 extern bool dhd_bus_dpc(struct dhd_bus *bus);
59 extern void dhd_bus_isr(bool * InterruptRecognized, bool * QueueMiniportHandleInterrupt, void *arg);
60
61
62 /* Check for and handle local prot-specific iovar commands */
63 extern int dhd_bus_iovar_op(dhd_pub_t *dhdp, const char *name,
64                             void *params, int plen, void *arg, int len, bool set);
65
66 /* Add bus dump output to a buffer */
67 extern void dhd_bus_dump(dhd_pub_t *dhdp, struct bcmstrbuf *strbuf);
68
69 /* Clear any bus counters */
70 extern void dhd_bus_clearcounts(dhd_pub_t *dhdp);
71
72 /* return the dongle chipid */
73 extern uint dhd_bus_chip(struct dhd_bus *bus);
74
75 /* Set user-specified nvram parameters. */
76 extern void dhd_bus_set_nvram_params(struct dhd_bus * bus, const char *nvram_params);
77
78 extern void *dhd_bus_pub(struct dhd_bus *bus);
79 extern void *dhd_bus_txq(struct dhd_bus *bus);
80 extern uint dhd_bus_hdrlen(struct dhd_bus *bus);
81
82
83 #define DHD_SET_BUS_STATE_DOWN(_bus)  do { \
84         (_bus)->dhd->busstate = DHD_BUS_DOWN; \
85 } while (0)
86
87 /* Register a dummy SDIO client driver in order to be notified of new SDIO device */
88 extern int dhd_bus_reg_sdio_notify(void* semaphore);
89 extern void dhd_bus_unreg_sdio_notify(void);
90
91 extern void dhd_txglom_enable(dhd_pub_t *dhdp, bool enable);
92
93 #endif /* _dhd_bus_h_ */