wifi: renew patch drivers/net/wireless
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / rkwifi / bcmdhd / dhd_proto.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_proto.h 390836 2013-03-13 23:43:53Z $
10  */
11
12 #ifndef _dhd_proto_h_
13 #define _dhd_proto_h_
14
15 #include <dhdioctl.h>
16 #include <wlioctl.h>
17
18 #ifndef IOCTL_RESP_TIMEOUT
19 #define IOCTL_RESP_TIMEOUT  2000  /* In milli second default value for Production FW */
20 #endif /* IOCTL_RESP_TIMEOUT */
21
22 /*
23  * Exported from the dhd protocol module (dhd_cdc, dhd_rndis)
24  */
25
26 /* Linkage, sets prot link and updates hdrlen in pub */
27 extern int dhd_prot_attach(dhd_pub_t *dhdp);
28
29 /* Unlink, frees allocated protocol memory (including dhd_prot) */
30 extern void dhd_prot_detach(dhd_pub_t *dhdp);
31
32 /* Initialize protocol: sync w/dongle state.
33  * Sets dongle media info (iswl, drv_version, mac address).
34  */
35 extern int dhd_prot_init(dhd_pub_t *dhdp);
36
37 /* Stop protocol: sync w/dongle state. */
38 extern void dhd_prot_stop(dhd_pub_t *dhdp);
39
40 /* Add any protocol-specific data header.
41  * Caller must reserve prot_hdrlen prepend space.
42  */
43 extern void dhd_prot_hdrpush(dhd_pub_t *, int ifidx, void *txp);
44
45 /* Remove any protocol-specific data header. */
46 extern int dhd_prot_hdrpull(dhd_pub_t *, int *ifidx, void *rxp, uchar *buf, uint *len);
47
48 /* Use protocol to issue ioctl to dongle */
49 extern int dhd_prot_ioctl(dhd_pub_t *dhd, int ifidx, wl_ioctl_t * ioc, void * buf, int len);
50
51 /* Handles a protocol control response asynchronously */
52 extern int dhd_prot_ctl_complete(dhd_pub_t *dhd);
53
54 /* Check for and handle local prot-specific iovar commands */
55 extern int dhd_prot_iovar_op(dhd_pub_t *dhdp, const char *name,
56                              void *params, int plen, void *arg, int len, bool set);
57
58 /* Add prot dump output to a buffer */
59 extern void dhd_prot_dump(dhd_pub_t *dhdp, struct bcmstrbuf *strbuf);
60
61 /* Update local copy of dongle statistics */
62 extern void dhd_prot_dstats(dhd_pub_t *dhdp);
63
64 extern int dhd_ioctl(dhd_pub_t * dhd_pub, dhd_ioctl_t *ioc, void * buf, uint buflen);
65
66 extern int dhd_preinit_ioctls(dhd_pub_t *dhd);
67
68 extern int dhd_process_pkt_reorder_info(dhd_pub_t *dhd, uchar *reorder_info_buf,
69         uint reorder_info_len, void **pkt, uint32 *free_buf_count);
70
71
72 /********************************
73  * For version-string expansion *
74  */
75 #if defined(BDC)
76 #define DHD_PROTOCOL "bdc"
77 #elif defined(CDC)
78 #define DHD_PROTOCOL "cdc"
79 #else
80 #define DHD_PROTOCOL "unknown"
81 #endif /* proto */
82
83 #endif /* _dhd_proto_h_ */