upload tizen1.0 source
[kernel/linux-2.6.36.git] / drivers / net / wireless / bcm4330 / src / dhd / sys / 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 (C) 1999-2011, 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.8.10.6 2010-12-22 23:47:24 $
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  20000 /* 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 /* Add any protocol-specific data header.
59  * Caller must reserve prot_hdrlen prepend space.
60  */
61 extern void dhd_prot_hdrpush(dhd_pub_t *, int ifidx, void *txp);
62
63 /* Remove any protocol-specific data header. */
64 extern int dhd_prot_hdrpull(dhd_pub_t *, int *ifidx, void *rxp);
65
66 /* Use protocol to issue ioctl to dongle */
67 extern int dhd_prot_ioctl(dhd_pub_t *dhd, int ifidx, wl_ioctl_t * ioc, void * buf, int len);
68
69 /* Handles a protocol control response asynchronously */
70 extern int dhd_prot_ctl_complete(dhd_pub_t *dhd);
71
72 /* Check for and handle local prot-specific iovar commands */
73 extern int dhd_prot_iovar_op(dhd_pub_t *dhdp, const char *name,
74                              void *params, int plen, void *arg, int len, bool set);
75
76 /* Add prot dump output to a buffer */
77 extern void dhd_prot_dump(dhd_pub_t *dhdp, struct bcmstrbuf *strbuf);
78
79 /* Update local copy of dongle statistics */
80 extern void dhd_prot_dstats(dhd_pub_t *dhdp);
81
82 extern int dhd_ioctl(dhd_pub_t * dhd_pub, dhd_ioctl_t *ioc, void * buf, uint buflen);
83
84 extern int dhd_preinit_ioctls(dhd_pub_t *dhd);
85
86
87 /********************************
88  * For version-string expansion *
89  */
90 #if defined(BDC)
91 #define DHD_PROTOCOL "bdc"
92 #elif defined(CDC)
93 #define DHD_PROTOCOL "cdc"
94 #elif defined(RNDIS)
95 #define DHD_PROTOCOL "rndis"
96 #else
97 #define DHD_PROTOCOL "unknown"
98 #endif /* proto */
99
100 #endif /* _dhd_proto_h_ */