aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-06-05 05:47:43 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-06-10 13:27:54 -0400
commit2543a0c4c0fde46f9f206cec1e1cf951a2a63a66 (patch)
treea210cc5e152cb432acabf40efffe6344d9ccdb0b /drivers
parentdacb6f1d8fa5200efc4e609fe63a750b960993b6 (diff)
ar9170: interpret firmware debug commands
This adds new commands that the original firmware will not send but we can use them to debug firmware. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/ath/ar9170/main.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ar9170/main.c b/drivers/net/wireless/ath/ar9170/main.c
index b104d7efd676..de57aa92a284 100644
--- a/drivers/net/wireless/ath/ar9170/main.c
+++ b/drivers/net/wireless/ath/ar9170/main.c
@@ -442,6 +442,38 @@ void ar9170_handle_command_response(struct ar9170 *ar, void *buf, u32 len)
442 /* retransmission issue / SIFS/EIFS collision ?! */ 442 /* retransmission issue / SIFS/EIFS collision ?! */
443 break; 443 break;
444 444
445 /* firmware debug */
446 case 0xca:
447 printk(KERN_DEBUG "ar9170 FW: %.*s\n", len - 4, (char *)buf + 4);
448 break;
449 case 0xcb:
450 len -= 4;
451
452 switch (len) {
453 case 1:
454 printk(KERN_DEBUG "ar9170 FW: u8: %#.2x\n",
455 *((char *)buf + 4));
456 break;
457 case 2:
458 printk(KERN_DEBUG "ar9170 FW: u8: %#.4x\n",
459 le16_to_cpup((__le16 *)((char *)buf + 4)));
460 break;
461 case 4:
462 printk(KERN_DEBUG "ar9170 FW: u8: %#.8x\n",
463 le32_to_cpup((__le32 *)((char *)buf + 4)));
464 break;
465 case 8:
466 printk(KERN_DEBUG "ar9170 FW: u8: %#.16lx\n",
467 (unsigned long)le64_to_cpup(
468 (__le64 *)((char *)buf + 4)));
469 break;
470 }
471 break;
472 case 0xcc:
473 print_hex_dump_bytes("ar9170 FW:", DUMP_PREFIX_NONE,
474 (char *)buf + 4, len - 4);
475 break;
476
445 default: 477 default:
446 printk(KERN_INFO "received unhandled event %x\n", cmd->type); 478 printk(KERN_INFO "received unhandled event %x\n", cmd->type);
447 print_hex_dump_bytes("dump:", DUMP_PREFIX_NONE, buf, len); 479 print_hex_dump_bytes("dump:", DUMP_PREFIX_NONE, buf, len);