aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-3945.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2010-05-12 06:33:13 -0400
committerReinette Chatre <reinette.chatre@intel.com>2010-06-06 02:14:46 -0400
commit86cc652dfe57f365533cf2e64e08ff37a510d42e (patch)
tree134f1e67bff8e46b862c1166d176880149175952 /drivers/net/wireless/iwlwifi/iwl-3945.c
parent3a0b9aad0a8166e9fb23d420fdc08ee2820d4c39 (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/net/wireless/iwlwifi/iwl-3945.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945.c154
1 files changed, 0 insertions, 154 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 */
506static 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
634static 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
643static 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. */
651static int iwl3945_is_network_packet(struct iwl_priv *priv, 499static 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) {