2 * Header file describing the internal (inter-module) DHD interfaces.
4 * Provides type definitions and function prototypes used to link the
5 * DHD OS, bus, and protocol modules.
7 * $Copyright Open Broadcom Corporation$
9 * $Id: dhd_bus.h 335569 2012-05-29 12:04:43Z $
16 * Exported from dhd bus module (dhd_usb, dhd_sdio)
19 /* Indicate (dis)interest in finding dongles. */
20 extern int dhd_bus_register(void);
21 extern void dhd_bus_unregister(void);
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);
27 /* Stop bus module: clear pending frames, disable data flow */
28 extern void dhd_bus_stop(struct dhd_bus *bus, bool enforce_mutex);
30 /* Initialize bus module: prepare for communication w/dongle */
31 extern int dhd_bus_init(dhd_pub_t *dhdp, bool enforce_mutex);
33 /* Get the Bus Idle Time */
34 extern void dhd_bus_getidletime(dhd_pub_t *dhdp, int *idletime);
36 /* Set the Bus Idle Time */
37 extern void dhd_bus_setidletime(dhd_pub_t *dhdp, int idle_time);
39 /* Send a data frame to the dongle. Callee disposes of txp. */
40 extern int dhd_bus_txdata(struct dhd_bus *bus, void *txp);
42 /* Send/receive a control message to/from the dongle.
43 * Expects caller to enforce a single outstanding transaction.
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);
48 /* Watchdog timer function */
49 extern bool dhd_bus_watchdog(dhd_pub_t *dhd);
50 extern void dhd_disable_intr(dhd_pub_t *dhd);
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) */
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);
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);
66 /* Add bus dump output to a buffer */
67 extern void dhd_bus_dump(dhd_pub_t *dhdp, struct bcmstrbuf *strbuf);
69 /* Clear any bus counters */
70 extern void dhd_bus_clearcounts(dhd_pub_t *dhdp);
72 /* return the dongle chipid */
73 extern uint dhd_bus_chip(struct dhd_bus *bus);
75 /* Set user-specified nvram parameters. */
76 extern void dhd_bus_set_nvram_params(struct dhd_bus * bus, const char *nvram_params);
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);
83 #define DHD_SET_BUS_STATE_DOWN(_bus) do { \
84 (_bus)->dhd->busstate = DHD_BUS_DOWN; \
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);
91 extern void dhd_txglom_enable(dhd_pub_t *dhdp, bool enable);
93 #endif /* _dhd_bus_h_ */