Merge branches 'stable/backend.base.v3' and 'stable/gntalloc.v7' of git://git.kernel...
[pandora-kernel.git] / drivers / staging / brcm80211 / brcmfmac / dhdioctl.h
1 /*
2  * Copyright (c) 2010 Broadcom Corporation
3  *
4  * Permission to use, copy, modify, and/or distribute this software for any
5  * purpose with or without fee is hereby granted, provided that the above
6  * copyright notice and this permission notice appear in all copies.
7  *
8  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
11  * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
13  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
14  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15  */
16
17 #ifndef _dhdioctl_h_
18 #define _dhdioctl_h_
19
20 /* Linux network driver ioctl encoding */
21 typedef struct dhd_ioctl {
22         uint cmd;               /* common ioctl definition */
23         void *buf;              /* pointer to user buffer */
24         uint len;               /* length of user buffer */
25         bool set;               /* get or set request (optional) */
26         uint used;              /* bytes read or written (optional) */
27         uint needed;            /* bytes needed (optional) */
28         uint driver;            /* to identify target driver */
29 } dhd_ioctl_t;
30
31 /* per-driver magic numbers */
32 #define DHD_IOCTL_MAGIC         0x00444944
33
34 /* bump this number if you change the ioctl interface */
35 #define DHD_IOCTL_VERSION       1
36
37 #define DHD_IOCTL_MAXLEN        8192    /* max length ioctl buffer required */
38 #define DHD_IOCTL_SMLEN 256     /* "small" length ioctl buffer required */
39
40 /* common ioctl definitions */
41 #define DHD_GET_MAGIC                           0
42 #define DHD_GET_VERSION                         1
43 #define DHD_GET_VAR                             2
44 #define DHD_SET_VAR                             3
45
46 /* message levels */
47 #define DHD_ERROR_VAL   0x0001
48 #define DHD_TRACE_VAL   0x0002
49 #define DHD_INFO_VAL    0x0004
50 #define DHD_DATA_VAL    0x0008
51 #define DHD_CTL_VAL     0x0010
52 #define DHD_TIMER_VAL   0x0020
53 #define DHD_HDRS_VAL    0x0040
54 #define DHD_BYTES_VAL   0x0080
55 #define DHD_INTR_VAL    0x0100
56 #define DHD_LOG_VAL     0x0200
57 #define DHD_GLOM_VAL    0x0400
58 #define DHD_EVENT_VAL   0x0800
59 #define DHD_BTA_VAL     0x1000
60 #define DHD_ISCAN_VAL 0x2000
61
62 #ifdef SDTEST
63 /* For pktgen iovar */
64 typedef struct dhd_pktgen {
65         uint version;           /* To allow structure change tracking */
66         uint freq;              /* Max ticks between tx/rx attempts */
67         uint count;             /* Test packets to send/rcv each attempt */
68         uint print;             /* Print counts every <print> attempts */
69         uint total;             /* Total packets (or bursts) */
70         uint minlen;            /* Minimum length of packets to send */
71         uint maxlen;            /* Maximum length of packets to send */
72         uint numsent;           /* Count of test packets sent */
73         uint numrcvd;           /* Count of test packets received */
74         uint numfail;           /* Count of test send failures */
75         uint mode;              /* Test mode (type of test packets) */
76         uint stop;              /* Stop after this many tx failures */
77 } dhd_pktgen_t;
78
79 /* Version in case structure changes */
80 #define DHD_PKTGEN_VERSION 2
81
82 /* Type of test packets to use */
83 #define DHD_PKTGEN_ECHO         1       /* Send echo requests */
84 #define DHD_PKTGEN_SEND         2       /* Send discard packets */
85 #define DHD_PKTGEN_RXBURST      3       /* Request dongle send N packets */
86 #define DHD_PKTGEN_RECV         4       /* Continuous rx from continuous
87                                          tx dongle */
88 #endif                          /* SDTEST */
89
90 /* Enter idle immediately (no timeout) */
91 #define DHD_IDLE_IMMEDIATE      (-1)
92
93 /* Values for idleclock iovar: other values are the sd_divisor to use
94          when idle */
95 #define DHD_IDLE_ACTIVE 0       /* Do not request any SD clock change
96                                  when idle */
97 #define DHD_IDLE_STOP   (-1)    /* Request SD clock be stopped
98                                  (and use SD1 mode) */
99
100 #endif                          /* _dhdioctl_h_ */