2 * Copyright (c) 2010 Broadcom Corporation
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.
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.
20 /* require default structure packing */
21 #define BWL_DEFAULT_PACKING
22 #include <packed_section_start.h>
24 /* Linux network driver ioctl encoding */
25 typedef 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 */
35 /* per-driver magic numbers */
36 #define DHD_IOCTL_MAGIC 0x00444944
38 /* bump this number if you change the ioctl interface */
39 #define DHD_IOCTL_VERSION 1
41 #define DHD_IOCTL_MAXLEN 8192 /* max length ioctl buffer required */
42 #define DHD_IOCTL_SMLEN 256 /* "small" length ioctl buffer required */
44 /* common ioctl definitions */
45 #define DHD_GET_MAGIC 0
46 #define DHD_GET_VERSION 1
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
67 /* For pktgen iovar */
68 typedef 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 */
83 /* Version in case structure changes */
84 #define DHD_PKTGEN_VERSION 2
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
94 /* Enter idle immediately (no timeout) */
95 #define DHD_IDLE_IMMEDIATE (-1)
97 /* Values for idleclock iovar: other values are the sd_divisor to use
99 #define DHD_IDLE_ACTIVE 0 /* Do not request any SD clock change
101 #define DHD_IDLE_STOP (-1) /* Request SD clock be stopped
102 (and use SD1 mode) */
104 /* require default structure packing */
105 #include <packed_section_end.h>
107 #endif /* _dhdioctl_h_ */