aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-3945-commands.h
diff options
context:
space:
mode:
authorBen Cahill <ben.m.cahill@intel.com>2007-11-28 22:10:08 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:05:32 -0500
commit075416cd18cb4a7ed057d9a96b388bc23b43c4b1 (patch)
treed790e709ef6295befdf47b7004cebd02dd784742 /drivers/net/wireless/iwlwifi/iwl-3945-commands.h
parente3851447664113bccf9b23af0308e266872a735c (diff)
iwlwifi: document command header and "alive" responses
Document command header and "alive" responses Signed-off-by: Ben Cahill <ben.m.cahill@intel.com> Signed-off-by: Zhu Yi <yi.zhu@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-3945-commands.h')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945-commands.h85
1 files changed, 66 insertions, 19 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945-commands.h b/drivers/net/wireless/iwlwifi/iwl-3945-commands.h
index 794db78c932e..3d3c7e3d37ea 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945-commands.h
+++ b/drivers/net/wireless/iwlwifi/iwl-3945-commands.h
@@ -121,7 +121,7 @@ enum {
121 REPLY_TX_PWR_TABLE_CMD = 0x97, 121 REPLY_TX_PWR_TABLE_CMD = 0x97,
122 MEASURE_ABORT_NOTIFICATION = 0x99, /* not used */ 122 MEASURE_ABORT_NOTIFICATION = 0x99, /* not used */
123 123
124 /* BT config command */ 124 /* Bluetooth device coexistance config command */
125 REPLY_BT_CONFIG = 0x9b, 125 REPLY_BT_CONFIG = 0x9b,
126 126
127 /* 4965 Statistics */ 127 /* 4965 Statistics */
@@ -144,25 +144,42 @@ enum {
144 * 144 *
145 *****************************************************************************/ 145 *****************************************************************************/
146 146
147/* iwl3945_cmd_header flags value */
147#define IWL_CMD_FAILED_MSK 0x40 148#define IWL_CMD_FAILED_MSK 0x40
148 149
150/**
151 * struct iwl3945_cmd_header
152 *
153 * This header format appears in the beginning of each command sent from the
154 * driver, and each response/notification received from uCode.
155 */
149struct iwl3945_cmd_header { 156struct iwl3945_cmd_header {
150 u8 cmd; 157 u8 cmd; /* Command ID: REPLY_RXON, etc. */
151 u8 flags; 158 u8 flags; /* IWL_CMD_* */
152 /* We have 15 LSB to use as we please (MSB indicates 159 /*
153 * a frame Rx'd from the HW). We encode the following 160 * The driver sets up the sequence number to values of its chosing.
154 * information into the sequence field: 161 * uCode does not use this value, but passes it back to the driver
162 * when sending the response to each driver-originated command, so
163 * the driver can match the response to the command. Since the values
164 * don't get used by uCode, the driver may set up an arbitrary format.
165 *
166 * There is one exception: uCode sets bit 15 when it originates
167 * the response/notification, i.e. when the response/notification
168 * is not a direct response to a command sent by the driver. For
169 * example, uCode issues REPLY_3945_RX when it sends a received frame
170 * to the driver; it is not a direct response to any driver command.
155 * 171 *
156 * 0:7 index in fifo 172 * The Linux driver uses the following format:
157 * 8:13 fifo selection
158 * 14:14 bit indicating if this packet references the 'extra'
159 * storage at the end of the memory queue
160 * 15:15 (Rx indication)
161 * 173 *
174 * 0:7 index/position within Tx queue
175 * 8:13 Tx queue selection
176 * 14:14 driver sets this to indicate command is in the 'huge'
177 * storage at the end of the command buffers, i.e. scan cmd
178 * 15:15 uCode sets this in uCode-originated response/notification
162 */ 179 */
163 __le16 sequence; 180 __le16 sequence;
164 181
165 /* command data follows immediately */ 182 /* command or response/notification data follows immediately */
166 u8 data[0]; 183 u8 data[0];
167} __attribute__ ((packed)); 184} __attribute__ ((packed));
168 185
@@ -176,15 +193,22 @@ struct iwl3945_cmd_header {
176#define INITIALIZE_SUBTYPE (9) 193#define INITIALIZE_SUBTYPE (9)
177 194
178/* 195/*
179 * REPLY_ALIVE = 0x1 (response only, not a command) 196 * ("Initialize") REPLY_ALIVE = 0x1 (response only, not a command)
197 *
198 * uCode issues this "initialize alive" notification once the initialization
199 * uCode image has completed its work, and is ready to load the runtime image.
200 * This is the *first* "alive" notification that the driver will receive after
201 * rebooting uCode; the "initialize" alive is indicated by subtype field == 9.
202 *
203 * See comments documenting "BSM" (bootstrap state machine).
180 */ 204 */
181struct iwl3945_alive_resp { 205struct iwl3945_init_alive_resp {
182 u8 ucode_minor; 206 u8 ucode_minor;
183 u8 ucode_major; 207 u8 ucode_major;
184 __le16 reserved1; 208 __le16 reserved1;
185 u8 sw_rev[8]; 209 u8 sw_rev[8];
186 u8 ver_type; 210 u8 ver_type;
187 u8 ver_subtype; 211 u8 ver_subtype; /* "9" for initialize alive */
188 __le16 reserved2; 212 __le16 reserved2;
189 __le32 log_event_table_ptr; 213 __le32 log_event_table_ptr;
190 __le32 error_event_table_ptr; 214 __le32 error_event_table_ptr;
@@ -192,16 +216,39 @@ struct iwl3945_alive_resp {
192 __le32 is_valid; 216 __le32 is_valid;
193} __attribute__ ((packed)); 217} __attribute__ ((packed));
194 218
195struct iwl3945_init_alive_resp { 219
220/**
221 * REPLY_ALIVE = 0x1 (response only, not a command)
222 *
223 * uCode issues this "alive" notification once the runtime image is ready
224 * to receive commands from the driver. This is the *second* "alive"
225 * notification that the driver will receive after rebooting uCode;
226 * this "alive" is indicated by subtype field != 9.
227 *
228 * See comments documenting "BSM" (bootstrap state machine).
229 *
230 * This response includes two pointers to structures within the device's
231 * data SRAM (access via HBUS_TARG_MEM_* regs) that are useful for debugging:
232 *
233 * 1) log_event_table_ptr indicates base of the event log. This traces
234 * a 256-entry history of uCode execution within a circular buffer.
235 *
236 * 2) error_event_table_ptr indicates base of the error log. This contains
237 * information about any uCode error that occurs.
238 *
239 * The Linux driver can print both logs to the system log when a uCode error
240 * occurs.
241 */
242struct iwl3945_alive_resp {
196 u8 ucode_minor; 243 u8 ucode_minor;
197 u8 ucode_major; 244 u8 ucode_major;
198 __le16 reserved1; 245 __le16 reserved1;
199 u8 sw_rev[8]; 246 u8 sw_rev[8];
200 u8 ver_type; 247 u8 ver_type;
201 u8 ver_subtype; 248 u8 ver_subtype; /* not "9" for runtime alive */
202 __le16 reserved2; 249 __le16 reserved2;
203 __le32 log_event_table_ptr; 250 __le32 log_event_table_ptr; /* SRAM address for event log */
204 __le32 error_event_table_ptr; 251 __le32 error_event_table_ptr; /* SRAM address for error log */
205 __le32 timestamp; 252 __le32 timestamp;
206 __le32 is_valid; 253 __le32 is_valid;
207} __attribute__ ((packed)); 254} __attribute__ ((packed));