• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
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.)
5  *
6  * Definitions subject to change without notice.
7  *
8  * Copyright (C) 1999-2012, Broadcom Corporation
9  *
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.
13  *
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.
21  *
22  * $Id: dhdioctl.h 350488 2012-08-14 04:36:26Z $
23  */
24 
25 #ifndef _dhdioctl_h_
26 #define	_dhdioctl_h_
27 
28 #include <typedefs.h>
29 
30 
31 /* require default structure packing */
32 #define BWL_DEFAULT_PACKING
33 #include <packed_section_start.h>
34 
35 
36 /* Linux network driver ioctl encoding */
37 typedef struct dhd_ioctl {
38 	uint cmd;	/* common ioctl definition */
39 	void *buf;	/* pointer to user buffer */
40 	uint len;	/* length of user buffer */
41 	bool set;	/* get or set request (optional) */
42 	uint used;	/* bytes read or written (optional) */
43 	uint needed;	/* bytes needed (optional) */
44 	uint driver;	/* to identify target driver */
45 } dhd_ioctl_t;
46 
47 /* Underlying BUS definition */
48 enum {
49 	BUS_TYPE_USB = 0, /* for USB dongles */
50 	BUS_TYPE_SDIO /* for SDIO dongles */
51 };
52 
53 /* per-driver magic numbers */
54 #define DHD_IOCTL_MAGIC		0x00444944
55 
56 /* bump this number if you change the ioctl interface */
57 #define DHD_IOCTL_VERSION	1
58 
59 #define	DHD_IOCTL_MAXLEN	8192		/* max length ioctl buffer required */
60 #define	DHD_IOCTL_SMLEN		256		/* "small" length ioctl buffer required */
61 
62 /* common ioctl definitions */
63 #define DHD_GET_MAGIC				0
64 #define DHD_GET_VERSION				1
65 #define DHD_GET_VAR				2
66 #define DHD_SET_VAR				3
67 
68 /* message levels */
69 #define DHD_ERROR_VAL	0x0001
70 #define DHD_TRACE_VAL	0x0002
71 #define DHD_INFO_VAL	0x0004
72 #define DHD_DATA_VAL	0x0008
73 #define DHD_CTL_VAL	0x0010
74 #define DHD_TIMER_VAL	0x0020
75 #define DHD_HDRS_VAL	0x0040
76 #define DHD_BYTES_VAL	0x0080
77 #define DHD_INTR_VAL	0x0100
78 #define DHD_LOG_VAL	0x0200
79 #define DHD_GLOM_VAL	0x0400
80 #define DHD_EVENT_VAL	0x0800
81 #define DHD_BTA_VAL	0x1000
82 #define DHD_ISCAN_VAL	0x2000
83 #define DHD_ARPOE_VAL	0x4000
84 #define DHD_REORDER_VAL	0x8000
85 #define DHD_WL_VAL		0x10000
86 #define DHD_TRACE2_VAL	0x20000
87 
88 #ifdef SDTEST
89 /* For pktgen iovar */
90 typedef struct dhd_pktgen {
91 	uint version;		/* To allow structure change tracking */
92 	uint freq;		/* Max ticks between tx/rx attempts */
93 	uint count;		/* Test packets to send/rcv each attempt */
94 	uint print;		/* Print counts every <print> attempts */
95 	uint total;		/* Total packets (or bursts) */
96 	uint minlen;		/* Minimum length of packets to send */
97 	uint maxlen;		/* Maximum length of packets to send */
98 	uint numsent;		/* Count of test packets sent */
99 	uint numrcvd;		/* Count of test packets received */
100 	uint numfail;		/* Count of test send failures */
101 	uint mode;		/* Test mode (type of test packets) */
102 	uint stop;		/* Stop after this many tx failures */
103 } dhd_pktgen_t;
104 
105 /* Version in case structure changes */
106 #define DHD_PKTGEN_VERSION 2
107 
108 /* Type of test packets to use */
109 #define DHD_PKTGEN_ECHO		1 /* Send echo requests */
110 #define DHD_PKTGEN_SEND 	2 /* Send discard packets */
111 #define DHD_PKTGEN_RXBURST	3 /* Request dongle send N packets */
112 #define DHD_PKTGEN_RECV		4 /* Continuous rx from continuous tx dongle */
113 #endif /* SDTEST */
114 
115 /* Enter idle immediately (no timeout) */
116 #define DHD_IDLE_IMMEDIATE	(-1)
117 
118 /* Values for idleclock iovar: other values are the sd_divisor to use when idle */
119 #define DHD_IDLE_ACTIVE	0	/* Do not request any SD clock change when idle */
120 #define DHD_IDLE_STOP   (-1)	/* Request SD clock be stopped (and use SD1 mode) */
121 
122 
123 /* require default structure packing */
124 #include <packed_section_end.h>
125 
126 #endif /* _dhdioctl_h_ */
127