blob: 4d06e506f154f03126b6bf4bea7f1778272cc812 [file] [log] [blame]
Henry Ptasinskicf2b4482010-09-20 22:33:12 -07001/*
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
Henry Ptasinskicf2b4482010-09-20 22:33:12 -070020/* require default structure packing */
21#define BWL_DEFAULT_PACKING
22#include <packed_section_start.h>
23
24/* Linux network driver ioctl encoding */
25typedef struct dhd_ioctl {
26 uint cmd; /* common ioctl definition */
27 void *buf; /* pointer to user buffer */
28 uint len; /* length of user buffer */
29 bool set; /* get or set request (optional) */
30 uint used; /* bytes read or written (optional) */
31 uint needed; /* bytes needed (optional) */
32 uint driver; /* to identify target driver */
33} dhd_ioctl_t;
34
35/* per-driver magic numbers */
36#define DHD_IOCTL_MAGIC 0x00444944
37
38/* bump this number if you change the ioctl interface */
39#define DHD_IOCTL_VERSION 1
40
41#define DHD_IOCTL_MAXLEN 8192 /* max length ioctl buffer required */
42#define DHD_IOCTL_SMLEN 256 /* "small" length ioctl buffer required */
43
44/* common ioctl definitions */
45#define DHD_GET_MAGIC 0
46#define DHD_GET_VERSION 1
47#define DHD_GET_VAR 2
48#define DHD_SET_VAR 3
49
50/* message levels */
51#define DHD_ERROR_VAL 0x0001
52#define DHD_TRACE_VAL 0x0002
53#define DHD_INFO_VAL 0x0004
54#define DHD_DATA_VAL 0x0008
55#define DHD_CTL_VAL 0x0010
56#define DHD_TIMER_VAL 0x0020
57#define DHD_HDRS_VAL 0x0040
58#define DHD_BYTES_VAL 0x0080
59#define DHD_INTR_VAL 0x0100
60#define DHD_LOG_VAL 0x0200
61#define DHD_GLOM_VAL 0x0400
62#define DHD_EVENT_VAL 0x0800
63#define DHD_BTA_VAL 0x1000
64#define DHD_ISCAN_VAL 0x2000
65
66#ifdef SDTEST
67/* For pktgen iovar */
68typedef struct dhd_pktgen {
69 uint version; /* To allow structure change tracking */
70 uint freq; /* Max ticks between tx/rx attempts */
71 uint count; /* Test packets to send/rcv each attempt */
72 uint print; /* Print counts every <print> attempts */
73 uint total; /* Total packets (or bursts) */
74 uint minlen; /* Minimum length of packets to send */
75 uint maxlen; /* Maximum length of packets to send */
76 uint numsent; /* Count of test packets sent */
77 uint numrcvd; /* Count of test packets received */
78 uint numfail; /* Count of test send failures */
79 uint mode; /* Test mode (type of test packets) */
80 uint stop; /* Stop after this many tx failures */
81} dhd_pktgen_t;
82
83/* Version in case structure changes */
84#define DHD_PKTGEN_VERSION 2
85
86/* Type of test packets to use */
87#define DHD_PKTGEN_ECHO 1 /* Send echo requests */
88#define DHD_PKTGEN_SEND 2 /* Send discard packets */
89#define DHD_PKTGEN_RXBURST 3 /* Request dongle send N packets */
90#define DHD_PKTGEN_RECV 4 /* Continuous rx from continuous
91 tx dongle */
92#endif /* SDTEST */
93
94/* Enter idle immediately (no timeout) */
95#define DHD_IDLE_IMMEDIATE (-1)
96
97/* Values for idleclock iovar: other values are the sd_divisor to use
98 when idle */
99#define DHD_IDLE_ACTIVE 0 /* Do not request any SD clock change
100 when idle */
101#define DHD_IDLE_STOP (-1) /* Request SD clock be stopped
102 (and use SD1 mode) */
103
104/* require default structure packing */
105#include <packed_section_end.h>
106
107#endif /* _dhdioctl_h_ */