diff options
| author | Johannes Berg <johannes.berg@intel.com> | 2010-05-12 06:33:13 -0400 |
|---|---|---|
| committer | Reinette Chatre <reinette.chatre@intel.com> | 2010-06-06 02:14:46 -0400 |
| commit | 86cc652dfe57f365533cf2e64e08ff37a510d42e (patch) | |
| tree | 134f1e67bff8e46b862c1166d176880149175952 /drivers | |
| parent | 3a0b9aad0a8166e9fb23d420fdc08ee2820d4c39 (diff) | |
iwlwifi: remove debug frame dumping
This can now be much better achieved using
tracing and post-processing of the trace,
rather than doing the processing in place
in the driver, so remove a lot of code.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-3945.c | 154 | ||||
| -rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn-lib.c | 131 |
2 files changed, 0 insertions, 285 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c index 7d7e37e1148f..7a34ef66c7ff 100644 --- a/drivers/net/wireless/iwlwifi/iwl-3945.c +++ b/drivers/net/wireless/iwlwifi/iwl-3945.c | |||
| @@ -494,158 +494,6 @@ void iwl3945_reply_statistics(struct iwl_priv *priv, | |||
| 494 | * Misc. internal state and helper functions | 494 | * Misc. internal state and helper functions |
| 495 | * | 495 | * |
| 496 | ******************************************************************************/ | 496 | ******************************************************************************/ |
| 497 | #ifdef CONFIG_IWLWIFI_DEBUG | ||
| 498 | |||
| 499 | /** | ||
| 500 | * iwl3945_report_frame - dump frame to syslog during debug sessions | ||
| 501 | * | ||
| 502 | * You may hack this function to show different aspects of received frames, | ||
| 503 | * including selective frame dumps. | ||
| 504 | * group100 parameter selects whether to show 1 out of 100 good frames. | ||
| 505 | */ | ||
| 506 | static void _iwl3945_dbg_report_frame(struct iwl_priv *priv, | ||
| 507 | struct iwl_rx_packet *pkt, | ||
| 508 | struct ieee80211_hdr *header, int group100) | ||
| 509 | { | ||
| 510 | u32 to_us; | ||
| 511 | u32 print_summary = 0; | ||
| 512 | u32 print_dump = 0; /* set to 1 to dump all frames' contents */ | ||
| 513 | u32 hundred = 0; | ||
| 514 | u32 dataframe = 0; | ||
| 515 | __le16 fc; | ||
| 516 | u16 seq_ctl; | ||
| 517 | u16 channel; | ||
| 518 | u16 phy_flags; | ||
| 519 | u16 length; | ||
| 520 | u16 status; | ||
| 521 | u16 bcn_tmr; | ||
| 522 | u32 tsf_low; | ||
| 523 | u64 tsf; | ||
| 524 | u8 rssi; | ||
| 525 | u8 agc; | ||
| 526 | u16 sig_avg; | ||
| 527 | u16 noise_diff; | ||
| 528 | struct iwl3945_rx_frame_stats *rx_stats = IWL_RX_STATS(pkt); | ||
| 529 | struct iwl3945_rx_frame_hdr *rx_hdr = IWL_RX_HDR(pkt); | ||
| 530 | struct iwl3945_rx_frame_end *rx_end = IWL_RX_END(pkt); | ||
| 531 | u8 *data = IWL_RX_DATA(pkt); | ||
| 532 | |||
| 533 | /* MAC header */ | ||
| 534 | fc = header->frame_control; | ||
| 535 | seq_ctl = le16_to_cpu(header->seq_ctrl); | ||
| 536 | |||
| 537 | /* metadata */ | ||
| 538 | channel = le16_to_cpu(rx_hdr->channel); | ||
| 539 | phy_flags = le16_to_cpu(rx_hdr->phy_flags); | ||
| 540 | length = le16_to_cpu(rx_hdr->len); | ||
| 541 | |||
| 542 | /* end-of-frame status and timestamp */ | ||
| 543 | status = le32_to_cpu(rx_end->status); | ||
| 544 | bcn_tmr = le32_to_cpu(rx_end->beacon_timestamp); | ||
| 545 | tsf_low = le64_to_cpu(rx_end->timestamp) & 0x0ffffffff; | ||
| 546 | tsf = le64_to_cpu(rx_end->timestamp); | ||
| 547 | |||
| 548 | /* signal statistics */ | ||
| 549 | rssi = rx_stats->rssi; | ||
| 550 | agc = rx_stats->agc; | ||
| 551 | sig_avg = le16_to_cpu(rx_stats->sig_avg); | ||
| 552 | noise_diff = le16_to_cpu(rx_stats->noise_diff); | ||
| 553 | |||
| 554 | to_us = !compare_ether_addr(header->addr1, priv->mac_addr); | ||
| 555 | |||
| 556 | /* if data frame is to us and all is good, | ||
| 557 | * (optionally) print summary for only 1 out of every 100 */ | ||
| 558 | if (to_us && (fc & ~cpu_to_le16(IEEE80211_FCTL_PROTECTED)) == | ||
| 559 | cpu_to_le16(IEEE80211_FCTL_FROMDS | IEEE80211_FTYPE_DATA)) { | ||
| 560 | dataframe = 1; | ||
| 561 | if (!group100) | ||
| 562 | print_summary = 1; /* print each frame */ | ||
| 563 | else if (priv->framecnt_to_us < 100) { | ||
| 564 | priv->framecnt_to_us++; | ||
| 565 | print_summary = 0; | ||
| 566 | } else { | ||
| 567 | priv->framecnt_to_us = 0; | ||
| 568 | print_summary = 1; | ||
| 569 | hundred = 1; | ||
| 570 | } | ||
| 571 | } else { | ||
| 572 | /* print summary for all other frames */ | ||
| 573 | print_summary = 1; | ||
| 574 | } | ||
| 575 | |||
| 576 | if (print_summary) { | ||
| 577 | char *title; | ||
| 578 | int rate; | ||
| 579 | |||
| 580 | if (hundred) | ||
| 581 | title = "100Frames"; | ||
| 582 | else if (ieee80211_has_retry(fc)) | ||
| 583 | title = "Retry"; | ||
| 584 | else if (ieee80211_is_assoc_resp(fc)) | ||
| 585 | title = "AscRsp"; | ||
| 586 | else if (ieee80211_is_reassoc_resp(fc)) | ||
| 587 | title = "RasRsp"; | ||
| 588 | else if (ieee80211_is_probe_resp(fc)) { | ||
| 589 | title = "PrbRsp"; | ||
| 590 | print_dump = 1; /* dump frame contents */ | ||
| 591 | } else if (ieee80211_is_beacon(fc)) { | ||
| 592 | title = "Beacon"; | ||
| 593 | print_dump = 1; /* dump frame contents */ | ||
| 594 | } else if (ieee80211_is_atim(fc)) | ||
| 595 | title = "ATIM"; | ||
| 596 | else if (ieee80211_is_auth(fc)) | ||
| 597 | title = "Auth"; | ||
| 598 | else if (ieee80211_is_deauth(fc)) | ||
| 599 | title = "DeAuth"; | ||
| 600 | else if (ieee80211_is_disassoc(fc)) | ||
| 601 | title = "DisAssoc"; | ||
| 602 | else | ||
| 603 | title = "Frame"; | ||
| 604 | |||
| 605 | rate = iwl3945_hwrate_to_plcp_idx(rx_hdr->rate); | ||
| 606 | if (rate == -1) | ||
| 607 | rate = 0; | ||
| 608 | else | ||
| 609 | rate = iwl3945_rates[rate].ieee / 2; | ||
| 610 | |||
| 611 | /* print frame summary. | ||
| 612 | * MAC addresses show just the last byte (for brevity), | ||
| 613 | * but you can hack it to show more, if you'd like to. */ | ||
| 614 | if (dataframe) | ||
| 615 | IWL_DEBUG_RX(priv, "%s: mhd=0x%04x, dst=0x%02x, " | ||
| 616 | "len=%u, rssi=%d, chnl=%d, rate=%d,\n", | ||
| 617 | title, le16_to_cpu(fc), header->addr1[5], | ||
| 618 | length, rssi, channel, rate); | ||
| 619 | else { | ||
| 620 | /* src/dst addresses assume managed mode */ | ||
| 621 | IWL_DEBUG_RX(priv, "%s: 0x%04x, dst=0x%02x, " | ||
| 622 | "src=0x%02x, rssi=%u, tim=%lu usec, " | ||
| 623 | "phy=0x%02x, chnl=%d\n", | ||
| 624 | title, le16_to_cpu(fc), header->addr1[5], | ||
| 625 | header->addr3[5], rssi, | ||
| 626 | tsf_low - priv->scan_start_tsf, | ||
| 627 | phy_flags, channel); | ||
| 628 | } | ||
| 629 | } | ||
| 630 | if (print_dump) | ||
| 631 | iwl_print_hex_dump(priv, IWL_DL_RX, data, length); | ||
| 632 | } | ||
| 633 | |||
| 634 | static void iwl3945_dbg_report_frame(struct iwl_priv *priv, | ||
| 635 | struct iwl_rx_packet *pkt, | ||
| 636 | struct ieee80211_hdr *header, int group100) | ||
| 637 | { | ||
| 638 | if (iwl_get_debug_level(priv) & IWL_DL_RX) | ||
| 639 | _iwl3945_dbg_report_frame(priv, pkt, header, group100); | ||
| 640 | } | ||
| 641 | |||
| 642 | #else | ||
| 643 | static inline void iwl3945_dbg_report_frame(struct iwl_priv *priv, | ||
| 644 | struct iwl_rx_packet *pkt, | ||
| 645 | struct ieee80211_hdr *header, int group100) | ||
| 646 | { | ||
| 647 | } | ||
| 648 | #endif | ||
| 649 | 497 | ||
| 650 | /* This is necessary only for a number of statistics, see the caller. */ | 498 | /* This is necessary only for a number of statistics, see the caller. */ |
| 651 | static int iwl3945_is_network_packet(struct iwl_priv *priv, | 499 | static int iwl3945_is_network_packet(struct iwl_priv *priv, |
| @@ -777,8 +625,6 @@ static void iwl3945_rx_reply_rx(struct iwl_priv *priv, | |||
| 777 | rx_status.signal, rx_status.signal, | 625 | rx_status.signal, rx_status.signal, |
| 778 | rx_status.rate_idx); | 626 | rx_status.rate_idx); |
| 779 | 627 | ||
| 780 | /* Set "1" to report good data frames in groups of 100 */ | ||
| 781 | iwl3945_dbg_report_frame(priv, pkt, header, 1); | ||
| 782 | iwl_dbg_log_rx_data_frame(priv, le16_to_cpu(rx_hdr->len), header); | 628 | iwl_dbg_log_rx_data_frame(priv, le16_to_cpu(rx_hdr->len), header); |
| 783 | 629 | ||
| 784 | if (network_packet) { | 630 | if (network_packet) { |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c index 42e62191f9f6..848cb3bb5c71 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c | |||
| @@ -758,132 +758,6 @@ static inline int iwlagn_calc_rssi(struct iwl_priv *priv, | |||
| 758 | return priv->cfg->ops->utils->calc_rssi(priv, rx_resp); | 758 | return priv->cfg->ops->utils->calc_rssi(priv, rx_resp); |
| 759 | } | 759 | } |
| 760 | 760 | ||
| 761 | #ifdef CONFIG_IWLWIFI_DEBUG | ||
| 762 | /** | ||
| 763 | * iwlagn_dbg_report_frame - dump frame to syslog during debug sessions | ||
| 764 | * | ||
| 765 | * You may hack this function to show different aspects of received frames, | ||
| 766 | * including selective frame dumps. | ||
| 767 | * group100 parameter selects whether to show 1 out of 100 good data frames. | ||
| 768 | * All beacon and probe response frames are printed. | ||
| 769 | */ | ||
| 770 | static void iwlagn_dbg_report_frame(struct iwl_priv *priv, | ||
| 771 | struct iwl_rx_phy_res *phy_res, u16 length, | ||
| 772 | struct ieee80211_hdr *header, int group100) | ||
| 773 | { | ||
| 774 | u32 to_us; | ||
| 775 | u32 print_summary = 0; | ||
| 776 | u32 print_dump = 0; /* set to 1 to dump all frames' contents */ | ||
| 777 | u32 hundred = 0; | ||
| 778 | u32 dataframe = 0; | ||
| 779 | __le16 fc; | ||
| 780 | u16 seq_ctl; | ||
| 781 | u16 channel; | ||
| 782 | u16 phy_flags; | ||
| 783 | u32 rate_n_flags; | ||
| 784 | u32 tsf_low; | ||
| 785 | int rssi; | ||
| 786 | |||
| 787 | if (likely(!(iwl_get_debug_level(priv) & IWL_DL_RX))) | ||
| 788 | return; | ||
| 789 | |||
| 790 | /* MAC header */ | ||
| 791 | fc = header->frame_control; | ||
| 792 | seq_ctl = le16_to_cpu(header->seq_ctrl); | ||
| 793 | |||
| 794 | /* metadata */ | ||
| 795 | channel = le16_to_cpu(phy_res->channel); | ||
| 796 | phy_flags = le16_to_cpu(phy_res->phy_flags); | ||
| 797 | rate_n_flags = le32_to_cpu(phy_res->rate_n_flags); | ||
| 798 | |||
| 799 | /* signal statistics */ | ||
| 800 | rssi = iwlagn_calc_rssi(priv, phy_res); | ||
| 801 | tsf_low = le64_to_cpu(phy_res->timestamp) & 0x0ffffffff; | ||
| 802 | |||
| 803 | to_us = !compare_ether_addr(header->addr1, priv->mac_addr); | ||
| 804 | |||
| 805 | /* if data frame is to us and all is good, | ||
| 806 | * (optionally) print summary for only 1 out of every 100 */ | ||
| 807 | if (to_us && (fc & ~cpu_to_le16(IEEE80211_FCTL_PROTECTED)) == | ||
| 808 | cpu_to_le16(IEEE80211_FCTL_FROMDS | IEEE80211_FTYPE_DATA)) { | ||
| 809 | dataframe = 1; | ||
| 810 | if (!group100) | ||
| 811 | print_summary = 1; /* print each frame */ | ||
| 812 | else if (priv->framecnt_to_us < 100) { | ||
| 813 | priv->framecnt_to_us++; | ||
| 814 | print_summary = 0; | ||
| 815 | } else { | ||
| 816 | priv->framecnt_to_us = 0; | ||
| 817 | print_summary = 1; | ||
| 818 | hundred = 1; | ||
| 819 | } | ||
| 820 | } else { | ||
| 821 | /* print summary for all other frames */ | ||
| 822 | print_summary = 1; | ||
| 823 | } | ||
| 824 | |||
| 825 | if (print_summary) { | ||
| 826 | char *title; | ||
| 827 | int rate_idx; | ||
| 828 | u32 bitrate; | ||
| 829 | |||
| 830 | if (hundred) | ||
| 831 | title = "100Frames"; | ||
| 832 | else if (ieee80211_has_retry(fc)) | ||
| 833 | title = "Retry"; | ||
| 834 | else if (ieee80211_is_assoc_resp(fc)) | ||
| 835 | title = "AscRsp"; | ||
| 836 | else if (ieee80211_is_reassoc_resp(fc)) | ||
| 837 | title = "RasRsp"; | ||
| 838 | else if (ieee80211_is_probe_resp(fc)) { | ||
| 839 | title = "PrbRsp"; | ||
| 840 | print_dump = 1; /* dump frame contents */ | ||
| 841 | } else if (ieee80211_is_beacon(fc)) { | ||
| 842 | title = "Beacon"; | ||
| 843 | print_dump = 1; /* dump frame contents */ | ||
| 844 | } else if (ieee80211_is_atim(fc)) | ||
| 845 | title = "ATIM"; | ||
| 846 | else if (ieee80211_is_auth(fc)) | ||
| 847 | title = "Auth"; | ||
| 848 | else if (ieee80211_is_deauth(fc)) | ||
| 849 | title = "DeAuth"; | ||
| 850 | else if (ieee80211_is_disassoc(fc)) | ||
| 851 | title = "DisAssoc"; | ||
| 852 | else | ||
| 853 | title = "Frame"; | ||
| 854 | |||
| 855 | rate_idx = iwl_hwrate_to_plcp_idx(rate_n_flags); | ||
| 856 | if (unlikely((rate_idx < 0) || (rate_idx >= IWL_RATE_COUNT))) { | ||
| 857 | bitrate = 0; | ||
| 858 | WARN_ON_ONCE(1); | ||
| 859 | } else { | ||
| 860 | bitrate = iwl_rates[rate_idx].ieee / 2; | ||
| 861 | } | ||
| 862 | |||
| 863 | /* print frame summary. | ||
| 864 | * MAC addresses show just the last byte (for brevity), | ||
| 865 | * but you can hack it to show more, if you'd like to. */ | ||
| 866 | if (dataframe) | ||
| 867 | IWL_DEBUG_RX(priv, "%s: mhd=0x%04x, dst=0x%02x, " | ||
| 868 | "len=%u, rssi=%d, chnl=%d, rate=%u,\n", | ||
| 869 | title, le16_to_cpu(fc), header->addr1[5], | ||
| 870 | length, rssi, channel, bitrate); | ||
| 871 | else { | ||
| 872 | /* src/dst addresses assume managed mode */ | ||
| 873 | IWL_DEBUG_RX(priv, "%s: 0x%04x, dst=0x%02x, src=0x%02x, " | ||
| 874 | "len=%u, rssi=%d, tim=%lu usec, " | ||
| 875 | "phy=0x%02x, chnl=%d\n", | ||
| 876 | title, le16_to_cpu(fc), header->addr1[5], | ||
| 877 | header->addr3[5], length, rssi, | ||
| 878 | tsf_low - priv->scan_start_tsf, | ||
| 879 | phy_flags, channel); | ||
| 880 | } | ||
| 881 | } | ||
| 882 | if (print_dump) | ||
| 883 | iwl_print_hex_dump(priv, IWL_DL_RX, header, length); | ||
| 884 | } | ||
| 885 | #endif | ||
| 886 | |||
| 887 | static u32 iwlagn_translate_rx_status(struct iwl_priv *priv, u32 decrypt_in) | 761 | static u32 iwlagn_translate_rx_status(struct iwl_priv *priv, u32 decrypt_in) |
| 888 | { | 762 | { |
| 889 | u32 decrypt_out = 0; | 763 | u32 decrypt_out = 0; |
| @@ -1063,11 +937,6 @@ void iwlagn_rx_reply_rx(struct iwl_priv *priv, | |||
| 1063 | /* Find max signal strength (dBm) among 3 antenna/receiver chains */ | 937 | /* Find max signal strength (dBm) among 3 antenna/receiver chains */ |
| 1064 | rx_status.signal = iwlagn_calc_rssi(priv, phy_res); | 938 | rx_status.signal = iwlagn_calc_rssi(priv, phy_res); |
| 1065 | 939 | ||
| 1066 | #ifdef CONFIG_IWLWIFI_DEBUG | ||
| 1067 | /* Set "1" to report good data frames in groups of 100 */ | ||
| 1068 | if (unlikely(iwl_get_debug_level(priv) & IWL_DL_RX)) | ||
| 1069 | iwlagn_dbg_report_frame(priv, phy_res, len, header, 1); | ||
| 1070 | #endif | ||
| 1071 | iwl_dbg_log_rx_data_frame(priv, len, header); | 940 | iwl_dbg_log_rx_data_frame(priv, len, header); |
| 1072 | IWL_DEBUG_STATS_LIMIT(priv, "Rssi %d, TSF %llu\n", | 941 | IWL_DEBUG_STATS_LIMIT(priv, "Rssi %d, TSF %llu\n", |
| 1073 | rx_status.signal, (unsigned long long)rx_status.mactime); | 942 | rx_status.signal, (unsigned long long)rx_status.mactime); |
