1 //------------------------------------------------------------------------------
2 // <copyright file="wmix.h" company="Atheros">
3 // Copyright (c) 2004-2010 Atheros Corporation. All rights reserved.
6 // Permission to use, copy, modify, and/or distribute this software for any
7 // purpose with or without fee is hereby granted, provided that the above
8 // copyright notice and this permission notice appear in all copies.
10 // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 // WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 // MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 // ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 // WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 // OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19 //------------------------------------------------------------------------------
20 //==============================================================================
21 // Author(s): ="Atheros"
22 //==============================================================================
25 * This file contains extensions of the WMI protocol specified in the
26 * Wireless Module Interface (WMI). It includes definitions of all
27 * extended commands and events. Extensions include useful commands
28 * that are not directly related to wireless activities. They may
29 * be hardware-specific, and they might not be supported on all
32 * Extended WMIX commands are encapsulated in a WMI message with
33 * cmd=WMI_EXTENSION_CMD.
46 * Extended WMI commands are those that are needed during wireless
47 * operation, but which are not really wireless commands. This allows,
48 * for instance, platform-specific commands. Extended WMI commands are
49 * embedded in a WMI command message with WMI_COMMAND_ID=WMI_EXTENSION_CMDID.
50 * Extended WMI events are similarly embedded in a WMI event message with
51 * WMI_EVENT_ID=WMI_EXTENSION_EVENTID.
53 typedef PREPACK struct {
55 } POSTPACK WMIX_CMD_HDR;
58 WMIX_DSETOPEN_REPLY_CMDID = 0x2001,
59 WMIX_DSETDATA_REPLY_CMDID,
60 WMIX_GPIO_OUTPUT_SET_CMDID,
61 WMIX_GPIO_INPUT_GET_CMDID,
62 WMIX_GPIO_REGISTER_SET_CMDID,
63 WMIX_GPIO_REGISTER_GET_CMDID,
64 WMIX_GPIO_INTR_ACK_CMDID,
65 WMIX_HB_CHALLENGE_RESP_CMDID,
66 WMIX_DBGLOG_CFG_MODULE_CMDID,
67 WMIX_PROF_CFG_CMDID, /* 0x200a */
68 WMIX_PROF_ADDR_SET_CMDID,
69 WMIX_PROF_START_CMDID,
71 WMIX_PROF_COUNT_GET_CMDID,
75 WMIX_DSETOPENREQ_EVENTID = 0x3001,
76 WMIX_DSETCLOSE_EVENTID,
77 WMIX_DSETDATAREQ_EVENTID,
78 WMIX_GPIO_INTR_EVENTID,
79 WMIX_GPIO_DATA_EVENTID,
80 WMIX_GPIO_ACK_EVENTID,
81 WMIX_HB_CHALLENGE_RESP_EVENTID,
83 WMIX_PROF_COUNT_EVENTID,
87 * =============DataSet support=================
91 * WMIX_DSETOPENREQ_EVENTID
92 * DataSet Open Request Event
94 typedef PREPACK struct {
96 u32 targ_dset_handle; /* echo'ed, not used by Host, */
97 u32 targ_reply_fn; /* echo'ed, not used by Host, */
98 u32 targ_reply_arg; /* echo'ed, not used by Host, */
99 } POSTPACK WMIX_DSETOPENREQ_EVENT;
102 * WMIX_DSETCLOSE_EVENTID
103 * DataSet Close Event
105 typedef PREPACK struct {
107 } POSTPACK WMIX_DSETCLOSE_EVENT;
110 * WMIX_DSETDATAREQ_EVENTID
111 * DataSet Data Request Event
113 typedef PREPACK struct {
117 u32 targ_buf; /* echo'ed, not used by Host, */
118 u32 targ_reply_fn; /* echo'ed, not used by Host, */
119 u32 targ_reply_arg; /* echo'ed, not used by Host, */
120 } POSTPACK WMIX_DSETDATAREQ_EVENT;
122 typedef PREPACK struct {
124 u32 targ_dset_handle;
130 } POSTPACK WMIX_DSETOPEN_REPLY_CMD;
132 typedef PREPACK struct {
139 } POSTPACK WMIX_DSETDATA_REPLY_CMD;
143 * =============GPIO support=================
144 * All masks are 18-bit masks with bit N operating on GPIO pin N.
149 * Set GPIO pin output state.
150 * In order for output to be driven, a pin must be enabled for output.
151 * This can be done during initialization through the GPIO Configuration
152 * DataSet, or during operation with the enable_mask.
154 * If a request is made to simultaneously set/clear or set/disable or
155 * clear/disable or disable/enable, results are undefined.
157 typedef PREPACK struct {
158 u32 set_mask; /* pins to set */
159 u32 clear_mask; /* pins to clear */
160 u32 enable_mask; /* pins to enable for output */
161 u32 disable_mask; /* pins to disable/tristate */
162 } POSTPACK WMIX_GPIO_OUTPUT_SET_CMD;
165 * Set a GPIO register. For debug/exceptional cases.
166 * Values for gpioreg_id are GPIO_REGISTER_IDs, defined in a
167 * platform-dependent header.
169 typedef PREPACK struct {
170 u32 gpioreg_id; /* GPIO register ID */
171 u32 value; /* value to write */
172 } POSTPACK WMIX_GPIO_REGISTER_SET_CMD;
174 /* Get a GPIO register. For debug/exceptional cases. */
175 typedef PREPACK struct {
176 u32 gpioreg_id; /* GPIO register to read */
177 } POSTPACK WMIX_GPIO_REGISTER_GET_CMD;
180 * Host acknowledges and re-arms GPIO interrupts. A single
181 * message should be used to acknowledge all interrupts that
182 * were delivered in an earlier WMIX_GPIO_INTR_EVENT message.
184 typedef PREPACK struct {
185 u32 ack_mask; /* interrupts to acknowledge */
186 } POSTPACK WMIX_GPIO_INTR_ACK_CMD;
189 * Target informs Host of GPIO interrupts that have occurred since the
190 * last WMIX_GIPO_INTR_ACK_CMD was received. Additional information --
191 * the current GPIO input values is provided -- in order to support
192 * use of a GPIO interrupt as a Data Valid signal for other GPIO pins.
194 typedef PREPACK struct {
195 u32 intr_mask; /* pending GPIO interrupts */
196 u32 input_values; /* recent GPIO input values */
197 } POSTPACK WMIX_GPIO_INTR_EVENT;
200 * Target responds to Host's earlier WMIX_GPIO_INPUT_GET_CMDID request
201 * using a GPIO_DATA_EVENT with
202 * value set to the mask of GPIO pin inputs and
203 * reg_id set to GPIO_ID_NONE
206 * Target responds to Hosts's earlier WMIX_GPIO_REGISTER_GET_CMDID request
207 * using a GPIO_DATA_EVENT with
208 * value set to the value of the requested register and
209 * reg_id identifying the register (reflects the original request)
210 * NB: reg_id supports the future possibility of unsolicited
211 * WMIX_GPIO_DATA_EVENTs (for polling GPIO input), and it may
212 * simplify Host GPIO support.
214 typedef PREPACK struct {
217 } POSTPACK WMIX_GPIO_DATA_EVENT;
220 * =============Error Detection support=================
224 * WMIX_HB_CHALLENGE_RESP_CMDID
225 * Heartbeat Challenge Response command
227 typedef PREPACK struct {
230 } POSTPACK WMIX_HB_CHALLENGE_RESP_CMD;
233 * WMIX_HB_CHALLENGE_RESP_EVENTID
234 * Heartbeat Challenge Response Event
236 #define WMIX_HB_CHALLENGE_RESP_EVENT WMIX_HB_CHALLENGE_RESP_CMD
238 typedef PREPACK struct {
239 struct dbglog_config_s config;
240 } POSTPACK WMIX_DBGLOG_CFG_MODULE_CMD;
243 * =============Target Profiling support=================
246 typedef PREPACK struct {
247 u32 period; /* Time (in 30.5us ticks) between samples */
249 } POSTPACK WMIX_PROF_CFG_CMD;
251 typedef PREPACK struct {
253 } POSTPACK WMIX_PROF_ADDR_SET_CMD;
256 * Target responds to Hosts's earlier WMIX_PROF_COUNT_GET_CMDID request
257 * using a WMIX_PROF_COUNT_EVENT with
258 * addr set to the next address
259 * count set to the corresponding count
261 typedef PREPACK struct {
264 } POSTPACK WMIX_PROF_COUNT_EVENT;
271 #endif /* _WMIX_H_ */