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 /* 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 */
31 /* per-driver magic numbers */
32 #define DHD_IOCTL_MAGIC 0x00444944
34 /* bump this number if you change the ioctl interface */
35 #define DHD_IOCTL_VERSION 1
37 #define DHD_IOCTL_MAXLEN 8192 /* max length ioctl buffer required */
38 #define DHD_IOCTL_SMLEN 256 /* "small" length ioctl buffer required */
40 /* common ioctl definitions */
41 #define DHD_GET_MAGIC 0
42 #define DHD_GET_VERSION 1
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
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 */
79 /* Version in case structure changes */
80 #define DHD_PKTGEN_VERSION 2
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
90 /* Enter idle immediately (no timeout) */
91 #define DHD_IDLE_IMMEDIATE (-1)
93 /* Values for idleclock iovar: other values are the sd_divisor to use
95 #define DHD_IDLE_ACTIVE 0 /* Do not request any SD clock change
97 #define DHD_IDLE_STOP (-1) /* Request SD clock be stopped
100 #endif /* _dhdioctl_h_ */