|
@@ -494,158 +494,6 @@ void iwl3945_reply_statistics(struct iwl_priv *priv,
|
|
* Misc. internal state and helper functions
|
|
* Misc. internal state and helper functions
|
|
*
|
|
*
|
|
******************************************************************************/
|
|
******************************************************************************/
|
|
-#ifdef CONFIG_IWLWIFI_DEBUG
|
|
|
|
-
|
|
|
|
-/**
|
|
|
|
- * iwl3945_report_frame - dump frame to syslog during debug sessions
|
|
|
|
- *
|
|
|
|
- * You may hack this function to show different aspects of received frames,
|
|
|
|
- * including selective frame dumps.
|
|
|
|
- * group100 parameter selects whether to show 1 out of 100 good frames.
|
|
|
|
- */
|
|
|
|
-static void _iwl3945_dbg_report_frame(struct iwl_priv *priv,
|
|
|
|
- struct iwl_rx_packet *pkt,
|
|
|
|
- struct ieee80211_hdr *header, int group100)
|
|
|
|
-{
|
|
|
|
- u32 to_us;
|
|
|
|
- u32 print_summary = 0;
|
|
|
|
- u32 print_dump = 0; /* set to 1 to dump all frames' contents */
|
|
|
|
- u32 hundred = 0;
|
|
|
|
- u32 dataframe = 0;
|
|
|
|
- __le16 fc;
|
|
|
|
- u16 seq_ctl;
|
|
|
|
- u16 channel;
|
|
|
|
- u16 phy_flags;
|
|
|
|
- u16 length;
|
|
|
|
- u16 status;
|
|
|
|
- u16 bcn_tmr;
|
|
|
|
- u32 tsf_low;
|
|
|
|
- u64 tsf;
|
|
|
|
- u8 rssi;
|
|
|
|
- u8 agc;
|
|
|
|
- u16 sig_avg;
|
|
|
|
- u16 noise_diff;
|
|
|
|
- struct iwl3945_rx_frame_stats *rx_stats = IWL_RX_STATS(pkt);
|
|
|
|
- struct iwl3945_rx_frame_hdr *rx_hdr = IWL_RX_HDR(pkt);
|
|
|
|
- struct iwl3945_rx_frame_end *rx_end = IWL_RX_END(pkt);
|
|
|
|
- u8 *data = IWL_RX_DATA(pkt);
|
|
|
|
-
|
|
|
|
- /* MAC header */
|
|
|
|
- fc = header->frame_control;
|
|
|
|
- seq_ctl = le16_to_cpu(header->seq_ctrl);
|
|
|
|
-
|
|
|
|
- /* metadata */
|
|
|
|
- channel = le16_to_cpu(rx_hdr->channel);
|
|
|
|
- phy_flags = le16_to_cpu(rx_hdr->phy_flags);
|
|
|
|
- length = le16_to_cpu(rx_hdr->len);
|
|
|
|
-
|
|
|
|
- /* end-of-frame status and timestamp */
|
|
|
|
- status = le32_to_cpu(rx_end->status);
|
|
|
|
- bcn_tmr = le32_to_cpu(rx_end->beacon_timestamp);
|
|
|
|
- tsf_low = le64_to_cpu(rx_end->timestamp) & 0x0ffffffff;
|
|
|
|
- tsf = le64_to_cpu(rx_end->timestamp);
|
|
|
|
-
|
|
|
|
- /* signal statistics */
|
|
|
|
- rssi = rx_stats->rssi;
|
|
|
|
- agc = rx_stats->agc;
|
|
|
|
- sig_avg = le16_to_cpu(rx_stats->sig_avg);
|
|
|
|
- noise_diff = le16_to_cpu(rx_stats->noise_diff);
|
|
|
|
-
|
|
|
|
- to_us = !compare_ether_addr(header->addr1, priv->mac_addr);
|
|
|
|
-
|
|
|
|
- /* if data frame is to us and all is good,
|
|
|
|
- * (optionally) print summary for only 1 out of every 100 */
|
|
|
|
- if (to_us && (fc & ~cpu_to_le16(IEEE80211_FCTL_PROTECTED)) ==
|
|
|
|
- cpu_to_le16(IEEE80211_FCTL_FROMDS | IEEE80211_FTYPE_DATA)) {
|
|
|
|
- dataframe = 1;
|
|
|
|
- if (!group100)
|
|
|
|
- print_summary = 1; /* print each frame */
|
|
|
|
- else if (priv->framecnt_to_us < 100) {
|
|
|
|
- priv->framecnt_to_us++;
|
|
|
|
- print_summary = 0;
|
|
|
|
- } else {
|
|
|
|
- priv->framecnt_to_us = 0;
|
|
|
|
- print_summary = 1;
|
|
|
|
- hundred = 1;
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- /* print summary for all other frames */
|
|
|
|
- print_summary = 1;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (print_summary) {
|
|
|
|
- char *title;
|
|
|
|
- int rate;
|
|
|
|
-
|
|
|
|
- if (hundred)
|
|
|
|
- title = "100Frames";
|
|
|
|
- else if (ieee80211_has_retry(fc))
|
|
|
|
- title = "Retry";
|
|
|
|
- else if (ieee80211_is_assoc_resp(fc))
|
|
|
|
- title = "AscRsp";
|
|
|
|
- else if (ieee80211_is_reassoc_resp(fc))
|
|
|
|
- title = "RasRsp";
|
|
|
|
- else if (ieee80211_is_probe_resp(fc)) {
|
|
|
|
- title = "PrbRsp";
|
|
|
|
- print_dump = 1; /* dump frame contents */
|
|
|
|
- } else if (ieee80211_is_beacon(fc)) {
|
|
|
|
- title = "Beacon";
|
|
|
|
- print_dump = 1; /* dump frame contents */
|
|
|
|
- } else if (ieee80211_is_atim(fc))
|
|
|
|
- title = "ATIM";
|
|
|
|
- else if (ieee80211_is_auth(fc))
|
|
|
|
- title = "Auth";
|
|
|
|
- else if (ieee80211_is_deauth(fc))
|
|
|
|
- title = "DeAuth";
|
|
|
|
- else if (ieee80211_is_disassoc(fc))
|
|
|
|
- title = "DisAssoc";
|
|
|
|
- else
|
|
|
|
- title = "Frame";
|
|
|
|
-
|
|
|
|
- rate = iwl3945_hwrate_to_plcp_idx(rx_hdr->rate);
|
|
|
|
- if (rate == -1)
|
|
|
|
- rate = 0;
|
|
|
|
- else
|
|
|
|
- rate = iwl3945_rates[rate].ieee / 2;
|
|
|
|
-
|
|
|
|
- /* print frame summary.
|
|
|
|
- * MAC addresses show just the last byte (for brevity),
|
|
|
|
- * but you can hack it to show more, if you'd like to. */
|
|
|
|
- if (dataframe)
|
|
|
|
- IWL_DEBUG_RX(priv, "%s: mhd=0x%04x, dst=0x%02x, "
|
|
|
|
- "len=%u, rssi=%d, chnl=%d, rate=%d,\n",
|
|
|
|
- title, le16_to_cpu(fc), header->addr1[5],
|
|
|
|
- length, rssi, channel, rate);
|
|
|
|
- else {
|
|
|
|
- /* src/dst addresses assume managed mode */
|
|
|
|
- IWL_DEBUG_RX(priv, "%s: 0x%04x, dst=0x%02x, "
|
|
|
|
- "src=0x%02x, rssi=%u, tim=%lu usec, "
|
|
|
|
- "phy=0x%02x, chnl=%d\n",
|
|
|
|
- title, le16_to_cpu(fc), header->addr1[5],
|
|
|
|
- header->addr3[5], rssi,
|
|
|
|
- tsf_low - priv->scan_start_tsf,
|
|
|
|
- phy_flags, channel);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if (print_dump)
|
|
|
|
- iwl_print_hex_dump(priv, IWL_DL_RX, data, length);
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-static void iwl3945_dbg_report_frame(struct iwl_priv *priv,
|
|
|
|
- struct iwl_rx_packet *pkt,
|
|
|
|
- struct ieee80211_hdr *header, int group100)
|
|
|
|
-{
|
|
|
|
- if (iwl_get_debug_level(priv) & IWL_DL_RX)
|
|
|
|
- _iwl3945_dbg_report_frame(priv, pkt, header, group100);
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-#else
|
|
|
|
-static inline void iwl3945_dbg_report_frame(struct iwl_priv *priv,
|
|
|
|
- struct iwl_rx_packet *pkt,
|
|
|
|
- struct ieee80211_hdr *header, int group100)
|
|
|
|
-{
|
|
|
|
-}
|
|
|
|
-#endif
|
|
|
|
|
|
|
|
/* This is necessary only for a number of statistics, see the caller. */
|
|
/* This is necessary only for a number of statistics, see the caller. */
|
|
static int iwl3945_is_network_packet(struct iwl_priv *priv,
|
|
static int iwl3945_is_network_packet(struct iwl_priv *priv,
|
|
@@ -777,8 +625,6 @@ static void iwl3945_rx_reply_rx(struct iwl_priv *priv,
|
|
rx_status.signal, rx_status.signal,
|
|
rx_status.signal, rx_status.signal,
|
|
rx_status.rate_idx);
|
|
rx_status.rate_idx);
|
|
|
|
|
|
- /* Set "1" to report good data frames in groups of 100 */
|
|
|
|
- iwl3945_dbg_report_frame(priv, pkt, header, 1);
|
|
|
|
iwl_dbg_log_rx_data_frame(priv, le16_to_cpu(rx_hdr->len), header);
|
|
iwl_dbg_log_rx_data_frame(priv, le16_to_cpu(rx_hdr->len), header);
|
|
|
|
|
|
if (network_packet) {
|
|
if (network_packet) {
|