diff options
author | Johannes Berg <johannes.berg@intel.com> | 2011-04-13 06:14:43 -0400 |
---|---|---|
committer | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2011-04-22 13:02:19 -0400 |
commit | e46f6538c24f01bb68dc374358ce85a0af666682 (patch) | |
tree | 6d579e24d715096e9553557abcb1f90ffc7d8365 /drivers/net/wireless/iwlwifi/iwl-commands.h | |
parent | 73b48099cc265f88fa1255f3f43e52fe6a94fd5c (diff) |
iwlagn: simplify error table reading
The current code to read the error table header
just hardcodes all the offsets, which is a bit
hard to understand. We can read in the entire
header (as much as we need) into a structure,
and then take the data from there, which makes
it easier to understand. To read a bigger blob
we also don't need to grab NIC access for each
word read, making the code more efficient.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-commands.h')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-commands.h | 90 |
1 files changed, 51 insertions, 39 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-commands.h b/drivers/net/wireless/iwlwifi/iwl-commands.h index 0edba8a6419b..7aea7b34f36c 100644 --- a/drivers/net/wireless/iwlwifi/iwl-commands.h +++ b/drivers/net/wireless/iwlwifi/iwl-commands.h | |||
@@ -422,49 +422,61 @@ struct iwl_tx_ant_config_cmd { | |||
422 | * | 422 | * |
423 | * 2) error_event_table_ptr indicates base of the error log. This contains | 423 | * 2) error_event_table_ptr indicates base of the error log. This contains |
424 | * information about any uCode error that occurs. For agn, the format | 424 | * information about any uCode error that occurs. For agn, the format |
425 | * of the error log is: | 425 | * of the error log is defined by struct iwl_error_event_table. |
426 | * | ||
427 | * __le32 valid; (nonzero) valid, (0) log is empty | ||
428 | * __le32 error_id; type of error | ||
429 | * __le32 pc; program counter | ||
430 | * __le32 blink1; branch link | ||
431 | * __le32 blink2; branch link | ||
432 | * __le32 ilink1; interrupt link | ||
433 | * __le32 ilink2; interrupt link | ||
434 | * __le32 data1; error-specific data | ||
435 | * __le32 data2; error-specific data | ||
436 | * __le32 line; source code line of error | ||
437 | * __le32 bcon_time; beacon timer | ||
438 | * __le32 tsf_low; network timestamp function timer | ||
439 | * __le32 tsf_hi; network timestamp function timer | ||
440 | * __le32 gp1; GP1 timer register | ||
441 | * __le32 gp2; GP2 timer register | ||
442 | * __le32 gp3; GP3 timer register | ||
443 | * __le32 ucode_ver; uCode version | ||
444 | * __le32 hw_ver; HW Silicon version | ||
445 | * __le32 brd_ver; HW board version | ||
446 | * __le32 log_pc; log program counter | ||
447 | * __le32 frame_ptr; frame pointer | ||
448 | * __le32 stack_ptr; stack pointer | ||
449 | * __le32 hcmd; last host command | ||
450 | * __le32 isr0; isr status register LMPM_NIC_ISR0: rxtx_flag | ||
451 | * __le32 isr1; isr status register LMPM_NIC_ISR1: host_flag | ||
452 | * __le32 isr2; isr status register LMPM_NIC_ISR2: enc_flag | ||
453 | * __le32 isr3; isr status register LMPM_NIC_ISR3: time_flag | ||
454 | * __le32 isr4; isr status register LMPM_NIC_ISR4: wico interrupt | ||
455 | * __le32 isr_pref; isr status register LMPM_NIC_PREF_STAT | ||
456 | * __le32 wait_event; wait event() caller address | ||
457 | * __le32 l2p_control; L2pControlField | ||
458 | * __le32 l2p_duration; L2pDurationField | ||
459 | * __le32 l2p_mhvalid; L2pMhValidBits | ||
460 | * __le32 l2p_addr_match; L2pAddrMatchStat | ||
461 | * __le32 lmpm_pmg_sel; indicate which clocks are turned on (LMPM_PMG_SEL) | ||
462 | * __le32 u_timestamp; indicate when the date and time of the compilation | ||
463 | * __le32 reserved; | ||
464 | * | 426 | * |
465 | * The Linux driver can print both logs to the system log when a uCode error | 427 | * The Linux driver can print both logs to the system log when a uCode error |
466 | * occurs. | 428 | * occurs. |
467 | */ | 429 | */ |
430 | |||
431 | /* | ||
432 | * Note: This structure is read from the device with IO accesses, | ||
433 | * and the reading already does the endian conversion. As it is | ||
434 | * read with u32-sized accesses, any members with a different size | ||
435 | * need to be ordered correctly though! | ||
436 | */ | ||
437 | struct iwl_error_event_table { | ||
438 | u32 valid; /* (nonzero) valid, (0) log is empty */ | ||
439 | u32 error_id; /* type of error */ | ||
440 | u32 pc; /* program counter */ | ||
441 | u32 blink1; /* branch link */ | ||
442 | u32 blink2; /* branch link */ | ||
443 | u32 ilink1; /* interrupt link */ | ||
444 | u32 ilink2; /* interrupt link */ | ||
445 | u32 data1; /* error-specific data */ | ||
446 | u32 data2; /* error-specific data */ | ||
447 | u32 line; /* source code line of error */ | ||
448 | u32 bcon_time; /* beacon timer */ | ||
449 | u32 tsf_low; /* network timestamp function timer */ | ||
450 | u32 tsf_hi; /* network timestamp function timer */ | ||
451 | u32 gp1; /* GP1 timer register */ | ||
452 | u32 gp2; /* GP2 timer register */ | ||
453 | u32 gp3; /* GP3 timer register */ | ||
454 | u32 ucode_ver; /* uCode version */ | ||
455 | u32 hw_ver; /* HW Silicon version */ | ||
456 | u32 brd_ver; /* HW board version */ | ||
457 | u32 log_pc; /* log program counter */ | ||
458 | u32 frame_ptr; /* frame pointer */ | ||
459 | u32 stack_ptr; /* stack pointer */ | ||
460 | u32 hcmd; /* last host command header */ | ||
461 | #if 0 | ||
462 | /* no need to read the remainder, we don't use the values */ | ||
463 | u32 isr0; /* isr status register LMPM_NIC_ISR0: rxtx_flag */ | ||
464 | u32 isr1; /* isr status register LMPM_NIC_ISR1: host_flag */ | ||
465 | u32 isr2; /* isr status register LMPM_NIC_ISR2: enc_flag */ | ||
466 | u32 isr3; /* isr status register LMPM_NIC_ISR3: time_flag */ | ||
467 | u32 isr4; /* isr status register LMPM_NIC_ISR4: wico interrupt */ | ||
468 | u32 isr_pref; /* isr status register LMPM_NIC_PREF_STAT */ | ||
469 | u32 wait_event; /* wait event() caller address */ | ||
470 | u32 l2p_control; /* L2pControlField */ | ||
471 | u32 l2p_duration; /* L2pDurationField */ | ||
472 | u32 l2p_mhvalid; /* L2pMhValidBits */ | ||
473 | u32 l2p_addr_match; /* L2pAddrMatchStat */ | ||
474 | u32 lmpm_pmg_sel; /* indicate which clocks are turned on (LMPM_PMG_SEL) */ | ||
475 | u32 u_timestamp; /* indicate when the date and time of the compilation */ | ||
476 | u32 flow_handler; /* FH read/write pointers, RX credit */ | ||
477 | #endif | ||
478 | } __packed; | ||
479 | |||
468 | struct iwl_alive_resp { | 480 | struct iwl_alive_resp { |
469 | u8 ucode_minor; | 481 | u8 ucode_minor; |
470 | u8 ucode_major; | 482 | u8 ucode_major; |