2 * Definitions for ioctls to access DHD iovars.
3 * Based on wlioctl.h (for Broadcom 802.11abg driver).
4 * (Moves towards generic ioctls for BCM drivers/iovars.)
6 * Definitions subject to change without notice.
8 * Copyright (C) 2012, Broadcom Corporation. All Rights Reserved.
10 * Permission to use, copy, modify, and/or distribute this software for any
11 * purpose with or without fee is hereby granted, provided that the above
12 * copyright notice and this permission notice appear in all copies.
14 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
15 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
16 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
17 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
18 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
19 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
20 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22 * $Id: dhdioctl.h 327775 2012-04-16 18:54:32Z $
31 /* NetBSD 2.0 does not have SIOCDEVPRIVATE. This is NetBSD 2.0 specific */
32 #define SIOCDEVPRIVATE _IOWR('i', 139, struct ifreq)
35 /* require default structure packing */
36 #define BWL_DEFAULT_PACKING
37 #include <packed_section_start.h>
40 /* Linux network driver ioctl encoding */
41 typedef struct dhd_ioctl
{
42 uint cmd
; /* common ioctl definition */
43 void *buf
; /* pointer to user buffer */
44 uint len
; /* length of user buffer */
45 bool set
; /* get or set request (optional) */
46 uint used
; /* bytes read or written (optional) */
47 uint needed
; /* bytes needed (optional) */
48 uint driver
; /* to identify target driver */
51 /* Underlying BUS definition */
53 BUS_TYPE_USB
= 0, /* for USB dongles */
54 BUS_TYPE_SDIO
/* for SDIO dongles */
57 /* per-driver magic numbers */
58 #define DHD_IOCTL_MAGIC 0x00444944
60 /* bump this number if you change the ioctl interface */
61 #define DHD_IOCTL_VERSION 1
63 #define DHD_IOCTL_MAXLEN 8192 /* max length ioctl buffer required */
64 #define DHD_IOCTL_SMLEN 256 /* "small" length ioctl buffer required */
66 /* common ioctl definitions */
67 #define DHD_GET_MAGIC 0
68 #define DHD_GET_VERSION 1
73 #define DHD_ERROR_VAL 0x0001
74 #define DHD_TRACE_VAL 0x0002
75 #define DHD_INFO_VAL 0x0004
76 #define DHD_DATA_VAL 0x0008
77 #define DHD_CTL_VAL 0x0010
78 #define DHD_TIMER_VAL 0x0020
79 #define DHD_HDRS_VAL 0x0040
80 #define DHD_BYTES_VAL 0x0080
81 #define DHD_INTR_VAL 0x0100
82 #define DHD_LOG_VAL 0x0200
83 #define DHD_GLOM_VAL 0x0400
84 #define DHD_EVENT_VAL 0x0800
85 #define DHD_BTA_VAL 0x1000
86 #if defined(NDIS) && (NDISVER >= 0x0630) && 0
87 #define DHD_SCAN_VAL 0x2000
89 #define DHD_ISCAN_VAL 0x2000
91 #define DHD_ARPOE_VAL 0x4000
94 /* For pktgen iovar */
95 typedef struct dhd_pktgen
{
96 uint version
; /* To allow structure change tracking */
97 uint freq
; /* Max ticks between tx/rx attempts */
98 uint count
; /* Test packets to send/rcv each attempt */
99 uint print
; /* Print counts every <print> attempts */
100 uint total
; /* Total packets (or bursts) */
101 uint minlen
; /* Minimum length of packets to send */
102 uint maxlen
; /* Maximum length of packets to send */
103 uint numsent
; /* Count of test packets sent */
104 uint numrcvd
; /* Count of test packets received */
105 uint numfail
; /* Count of test send failures */
106 uint mode
; /* Test mode (type of test packets) */
107 uint stop
; /* Stop after this many tx failures */
110 /* Version in case structure changes */
111 #define DHD_PKTGEN_VERSION 2
113 /* Type of test packets to use */
114 #define DHD_PKTGEN_ECHO 1 /* Send echo requests */
115 #define DHD_PKTGEN_SEND 2 /* Send discard packets */
116 #define DHD_PKTGEN_RXBURST 3 /* Request dongle send N packets */
117 #define DHD_PKTGEN_RECV 4 /* Continuous rx from continuous tx dongle */
120 /* Enter idle immediately (no timeout) */
121 #define DHD_IDLE_IMMEDIATE (-1)
123 /* Values for idleclock iovar: other values are the sd_divisor to use when idle */
124 #define DHD_IDLE_ACTIVE 0 /* Do not request any SD clock change when idle */
125 #define DHD_IDLE_STOP (-1) /* Request SD clock be stopped (and use SD1 mode) */
128 /* require default structure packing */
129 #include <packed_section_end.h>
131 #endif /* _dhdioctl_h_ */