OLD | NEW |
(Empty) | |
| 1 //------------------------------------------------------------------------------ |
| 2 // <copyright file="wmix.h" company="Atheros"> |
| 3 // Copyright (c) 2004-2007 Atheros Corporation. All rights reserved. |
| 4 // |
| 5 // This program is free software; you can redistribute it and/or modify |
| 6 // it under the terms of the GNU General Public License version 2 as |
| 7 // published by the Free Software Foundation; |
| 8 // |
| 9 // Software distributed under the License is distributed on an "AS |
| 10 // IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or |
| 11 // implied. See the License for the specific language governing |
| 12 // rights and limitations under the License. |
| 13 // |
| 14 // |
| 15 //------------------------------------------------------------------------------ |
| 16 //============================================================================== |
| 17 // Author(s): ="Atheros" |
| 18 //============================================================================== |
| 19 |
| 20 /* |
| 21 * This file contains extensions of the WMI protocol specified in the |
| 22 * Wireless Module Interface (WMI). It includes definitions of all |
| 23 * extended commands and events. Extensions include useful commands |
| 24 * that are not directly related to wireless activities. They may |
| 25 * be hardware-specific, and they might not be supported on all |
| 26 * implementations. |
| 27 * |
| 28 * Extended WMIX commands are encapsulated in a WMI message with |
| 29 * cmd=WMI_EXTENSION_CMD. |
| 30 */ |
| 31 |
| 32 #ifndef _WMIX_H_ |
| 33 #define _WMIX_H_ |
| 34 |
| 35 #ifdef __cplusplus |
| 36 extern "C" { |
| 37 #endif |
| 38 |
| 39 #ifndef ATH_TARGET |
| 40 #include "athstartpack.h" |
| 41 #endif |
| 42 |
| 43 #include "dbglog.h" |
| 44 |
| 45 /* |
| 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. |
| 52 */ |
| 53 typedef PREPACK struct { |
| 54 A_UINT32 commandId; |
| 55 } POSTPACK WMIX_CMD_HDR; |
| 56 |
| 57 typedef enum { |
| 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, |
| 70 WMIX_PROF_STOP_CMDID, |
| 71 WMIX_PROF_COUNT_GET_CMDID, |
| 72 } WMIX_COMMAND_ID; |
| 73 |
| 74 typedef enum { |
| 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, |
| 82 WMIX_DBGLOG_EVENTID, |
| 83 WMIX_PROF_COUNT_EVENTID, |
| 84 } WMIX_EVENT_ID; |
| 85 |
| 86 /* |
| 87 * =============DataSet support================= |
| 88 */ |
| 89 |
| 90 /* |
| 91 * WMIX_DSETOPENREQ_EVENTID |
| 92 * DataSet Open Request Event |
| 93 */ |
| 94 typedef PREPACK struct { |
| 95 A_UINT32 dset_id; |
| 96 A_UINT32 targ_dset_handle; /* echo'ed, not used by Host, */ |
| 97 A_UINT32 targ_reply_fn; /* echo'ed, not used by Host, */ |
| 98 A_UINT32 targ_reply_arg; /* echo'ed, not used by Host, */ |
| 99 } POSTPACK WMIX_DSETOPENREQ_EVENT; |
| 100 |
| 101 /* |
| 102 * WMIX_DSETCLOSE_EVENTID |
| 103 * DataSet Close Event |
| 104 */ |
| 105 typedef PREPACK struct { |
| 106 A_UINT32 access_cookie; |
| 107 } POSTPACK WMIX_DSETCLOSE_EVENT; |
| 108 |
| 109 /* |
| 110 * WMIX_DSETDATAREQ_EVENTID |
| 111 * DataSet Data Request Event |
| 112 */ |
| 113 typedef PREPACK struct { |
| 114 A_UINT32 access_cookie; |
| 115 A_UINT32 offset; |
| 116 A_UINT32 length; |
| 117 A_UINT32 targ_buf; /* echo'ed, not used by Host, */ |
| 118 A_UINT32 targ_reply_fn; /* echo'ed, not used by Host, */ |
| 119 A_UINT32 targ_reply_arg; /* echo'ed, not used by Host, */ |
| 120 } POSTPACK WMIX_DSETDATAREQ_EVENT; |
| 121 |
| 122 typedef PREPACK struct { |
| 123 A_UINT32 status; |
| 124 A_UINT32 targ_dset_handle; |
| 125 A_UINT32 targ_reply_fn; |
| 126 A_UINT32 targ_reply_arg; |
| 127 A_UINT32 access_cookie; |
| 128 A_UINT32 size; |
| 129 A_UINT32 version; |
| 130 } POSTPACK WMIX_DSETOPEN_REPLY_CMD; |
| 131 |
| 132 typedef PREPACK struct { |
| 133 A_UINT32 status; |
| 134 A_UINT32 targ_buf; |
| 135 A_UINT32 targ_reply_fn; |
| 136 A_UINT32 targ_reply_arg; |
| 137 A_UINT32 length; |
| 138 A_UINT8 buf[1]; |
| 139 } POSTPACK WMIX_DSETDATA_REPLY_CMD; |
| 140 |
| 141 |
| 142 /* |
| 143 * =============GPIO support================= |
| 144 * All masks are 18-bit masks with bit N operating on GPIO pin N. |
| 145 */ |
| 146 |
| 147 #include "gpio.h" |
| 148 |
| 149 /* |
| 150 * Set GPIO pin output state. |
| 151 * In order for output to be driven, a pin must be enabled for output. |
| 152 * This can be done during initialization through the GPIO Configuration |
| 153 * DataSet, or during operation with the enable_mask. |
| 154 * |
| 155 * If a request is made to simultaneously set/clear or set/disable or |
| 156 * clear/disable or disable/enable, results are undefined. |
| 157 */ |
| 158 typedef PREPACK struct { |
| 159 A_UINT32 set_mask; /* pins to set */ |
| 160 A_UINT32 clear_mask; /* pins to clear */ |
| 161 A_UINT32 enable_mask; /* pins to enable for output */ |
| 162 A_UINT32 disable_mask; /* pins to disable/tristate */ |
| 163 } POSTPACK WMIX_GPIO_OUTPUT_SET_CMD; |
| 164 |
| 165 /* |
| 166 * Set a GPIO register. For debug/exceptional cases. |
| 167 * Values for gpioreg_id are GPIO_REGISTER_IDs, defined in a |
| 168 * platform-dependent header. |
| 169 */ |
| 170 typedef PREPACK struct { |
| 171 A_UINT32 gpioreg_id; /* GPIO register ID */ |
| 172 A_UINT32 value; /* value to write */ |
| 173 } POSTPACK WMIX_GPIO_REGISTER_SET_CMD; |
| 174 |
| 175 /* Get a GPIO register. For debug/exceptional cases. */ |
| 176 typedef PREPACK struct { |
| 177 A_UINT32 gpioreg_id; /* GPIO register to read */ |
| 178 } POSTPACK WMIX_GPIO_REGISTER_GET_CMD; |
| 179 |
| 180 /* |
| 181 * Host acknowledges and re-arms GPIO interrupts. A single |
| 182 * message should be used to acknowledge all interrupts that |
| 183 * were delivered in an earlier WMIX_GPIO_INTR_EVENT message. |
| 184 */ |
| 185 typedef PREPACK struct { |
| 186 A_UINT32 ack_mask; /* interrupts to acknowledge */ |
| 187 } POSTPACK WMIX_GPIO_INTR_ACK_CMD; |
| 188 |
| 189 /* |
| 190 * Target informs Host of GPIO interrupts that have ocurred since the |
| 191 * last WMIX_GIPO_INTR_ACK_CMD was received. Additional information -- |
| 192 * the current GPIO input values is provided -- in order to support |
| 193 * use of a GPIO interrupt as a Data Valid signal for other GPIO pins. |
| 194 */ |
| 195 typedef PREPACK struct { |
| 196 A_UINT32 intr_mask; /* pending GPIO interrupts */ |
| 197 A_UINT32 input_values; /* recent GPIO input values */ |
| 198 } POSTPACK WMIX_GPIO_INTR_EVENT; |
| 199 |
| 200 /* |
| 201 * Target responds to Host's earlier WMIX_GPIO_INPUT_GET_CMDID request |
| 202 * using a GPIO_DATA_EVENT with |
| 203 * value set to the mask of GPIO pin inputs and |
| 204 * reg_id set to GPIO_ID_NONE |
| 205 * |
| 206 * |
| 207 * Target responds to Hosts's earlier WMIX_GPIO_REGISTER_GET_CMDID request |
| 208 * using a GPIO_DATA_EVENT with |
| 209 * value set to the value of the requested register and |
| 210 * reg_id identifying the register (reflects the original request) |
| 211 * NB: reg_id supports the future possibility of unsolicited |
| 212 * WMIX_GPIO_DATA_EVENTs (for polling GPIO input), and it may |
| 213 * simplify Host GPIO support. |
| 214 */ |
| 215 typedef PREPACK struct { |
| 216 A_UINT32 value; |
| 217 A_UINT32 reg_id; |
| 218 } POSTPACK WMIX_GPIO_DATA_EVENT; |
| 219 |
| 220 /* |
| 221 * =============Error Detection support================= |
| 222 */ |
| 223 |
| 224 /* |
| 225 * WMIX_HB_CHALLENGE_RESP_CMDID |
| 226 * Heartbeat Challenge Response command |
| 227 */ |
| 228 typedef PREPACK struct { |
| 229 A_UINT32 cookie; |
| 230 A_UINT32 source; |
| 231 } POSTPACK WMIX_HB_CHALLENGE_RESP_CMD; |
| 232 |
| 233 /* |
| 234 * WMIX_HB_CHALLENGE_RESP_EVENTID |
| 235 * Heartbeat Challenge Response Event |
| 236 */ |
| 237 #define WMIX_HB_CHALLENGE_RESP_EVENT WMIX_HB_CHALLENGE_RESP_CMD |
| 238 |
| 239 typedef PREPACK struct { |
| 240 struct dbglog_config_s config; |
| 241 } POSTPACK WMIX_DBGLOG_CFG_MODULE_CMD; |
| 242 |
| 243 /* |
| 244 * =============Target Profiling support================= |
| 245 */ |
| 246 |
| 247 typedef PREPACK struct { |
| 248 A_UINT32 period; /* Time (in 30.5us ticks) between samples */ |
| 249 A_UINT32 nbins; |
| 250 } POSTPACK WMIX_PROF_CFG_CMD; |
| 251 |
| 252 typedef PREPACK struct { |
| 253 A_UINT32 addr; |
| 254 } POSTPACK WMIX_PROF_ADDR_SET_CMD; |
| 255 |
| 256 /* |
| 257 * Target responds to Hosts's earlier WMIX_PROF_COUNT_GET_CMDID request |
| 258 * using a WMIX_PROF_COUNT_EVENT with |
| 259 * addr set to the next address |
| 260 * count set to the corresponding count |
| 261 */ |
| 262 typedef PREPACK struct { |
| 263 A_UINT32 addr; |
| 264 A_UINT32 count; |
| 265 } POSTPACK WMIX_PROF_COUNT_EVENT; |
| 266 |
| 267 #ifndef ATH_TARGET |
| 268 #include "athendpack.h" |
| 269 #endif |
| 270 |
| 271 #ifdef __cplusplus |
| 272 } |
| 273 #endif |
| 274 |
| 275 #endif /* _WMIX_H_ */ |
OLD | NEW |