• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 (C) 1999-2009, Broadcom Corporation
8  *
9  *      Unless you and Broadcom execute a separate written software license
10  * agreement governing use of this software, this software is licensed to you
11  * under the terms of the GNU General Public License version 2 (the "GPL"),
12  * available at http://www.broadcom.com/licenses/GPLv2.php, with the
13  * following added to such license:
14  *
15  *      As a special exception, the copyright holders of this software give you
16  * permission to link this software with independent modules, and to copy and
17  * distribute the resulting executable under terms of your choice, provided that
18  * you also meet, for each linked independent module, the terms and conditions of
19  * the license of that module.  An independent module is a module which is not
20  * derived from this software.  The special exception does not apply to any
21  * modifications of the software.
22  *
23  *      Notwithstanding the above, under no circumstances may you combine this
24  * software in any way with any other Broadcom software provided under a license
25  * other than the GPL, without Broadcom's express prior written consent.
26  *
27  * $Id: dhd_proto.h,v 1.2.82.1.4.1.16.6 2009/06/17 01:01:55 Exp $
28  */
29 
30 #ifndef _dhd_proto_h_
31 #define _dhd_proto_h_
32 
33 #include <dhdioctl.h>
34 #include <wlioctl.h>
35 
36 #ifndef IOCTL_RESP_TIMEOUT
37 #define IOCTL_RESP_TIMEOUT  2000 /* In milli second */
38 #endif
39 
40 /*
41  * Exported from the dhd protocol module (dhd_cdc, dhd_rndis)
42  */
43 
44 /* Linkage, sets prot link and updates hdrlen in pub */
45 extern int dhd_prot_attach(dhd_pub_t *dhdp);
46 
47 /* Unlink, frees allocated protocol memory (including dhd_prot) */
48 extern void dhd_prot_detach(dhd_pub_t *dhdp);
49 
50 /* Initialize protocol: sync w/dongle state.
51  * Sets dongle media info (iswl, drv_version, mac address).
52  */
53 extern int dhd_prot_init(dhd_pub_t *dhdp);
54 
55 /* Stop protocol: sync w/dongle state. */
56 extern void dhd_prot_stop(dhd_pub_t *dhdp);
57 
58 extern bool dhd_proto_fcinfo(dhd_pub_t *dhd, void *pktbuf, uint8 *fcbits);
59 
60 /* Add any protocol-specific data header.
61  * Caller must reserve prot_hdrlen prepend space.
62  */
63 extern void dhd_prot_hdrpush(dhd_pub_t *, int ifidx, void *txp);
64 
65 /* Remove any protocol-specific data header. */
66 extern int dhd_prot_hdrpull(dhd_pub_t *, int *ifidx, void *rxp);
67 
68 /* Use protocol to issue ioctl to dongle */
69 extern int dhd_prot_ioctl(dhd_pub_t *dhd, int ifidx, wl_ioctl_t * ioc, void * buf, int len);
70 
71 /* Check for and handle local prot-specific iovar commands */
72 extern int dhd_prot_iovar_op(dhd_pub_t *dhdp, const char *name,
73                              void *params, int plen, void *arg, int len, bool set);
74 
75 /* Add prot dump output to a buffer */
76 extern void dhd_prot_dump(dhd_pub_t *dhdp, struct bcmstrbuf *strbuf);
77 
78 /* Update local copy of dongle statistics */
79 extern void dhd_prot_dstats(dhd_pub_t *dhdp);
80 
81 extern int dhd_ioctl(dhd_pub_t * dhd_pub, dhd_ioctl_t *ioc, void * buf, uint buflen);
82 
83 extern int dhd_preinit_ioctls(dhd_pub_t *dhd);
84 
85 /********************************
86  * For version-string expansion *
87  */
88 #if defined(BDC)
89 #define DHD_PROTOCOL "bdc"
90 #elif defined(CDC)
91 #define DHD_PROTOCOL "cdc"
92 #elif defined(RNDIS)
93 #define DHD_PROTOCOL "rndis"
94 #else
95 #define DHD_PROTOCOL "unknown"
96 #endif /* proto */
97 
98 #endif /* _dhd_proto_h_ */
99