ath9k: Add RSSI information from control and extension chains
authorSenthil Balasubramanian <senthilkumar@atheros.com>
Fri, 8 Apr 2011 10:00:34 +0000 (15:30 +0530)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 12 Apr 2011 20:58:39 +0000 (16:58 -0400)
Export RSSI information from all the control and extension
channel chains to debugfs. Also add rx antenna information
to debugfs. This will be useful for debugging purpose.

Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/debug.c
drivers/net/wireless/ath/ath9k/debug.h

index a762cadb3ab754c4621b7973a8b3af1bc0535b2d..34f191ec8e8cab2b3a043dcf1640fb69984a35d7 100644 (file)
@@ -845,7 +845,7 @@ static ssize_t read_file_recv(struct file *file, char __user *user_buf,
 
        struct ath_softc *sc = file->private_data;
        char *buf;
-       unsigned int len = 0, size = 1152;
+       unsigned int len = 0, size = 1400;
        ssize_t retval = 0;
 
        buf = kzalloc(size, GFP_KERNEL);
@@ -874,6 +874,34 @@ static ssize_t read_file_recv(struct file *file, char __user *user_buf,
                        "%18s : %10u\n", "DECRYPT BUSY ERR",
                        sc->debug.stats.rxstats.decrypt_busy_err);
 
+       len += snprintf(buf + len, size - len,
+                       "%18s : %10d\n", "RSSI-CTL0",
+                       sc->debug.stats.rxstats.rs_rssi_ctl0);
+
+       len += snprintf(buf + len, size - len,
+                       "%18s : %10d\n", "RSSI-CTL1",
+                       sc->debug.stats.rxstats.rs_rssi_ctl1);
+
+       len += snprintf(buf + len, size - len,
+                       "%18s : %10d\n", "RSSI-CTL2",
+                       sc->debug.stats.rxstats.rs_rssi_ctl2);
+
+       len += snprintf(buf + len, size - len,
+                       "%18s : %10d\n", "RSSI-EXT0",
+                       sc->debug.stats.rxstats.rs_rssi_ext0);
+
+       len += snprintf(buf + len, size - len,
+                       "%18s : %10d\n", "RSSI-EXT1",
+                       sc->debug.stats.rxstats.rs_rssi_ext1);
+
+       len += snprintf(buf + len, size - len,
+                       "%18s : %10d\n", "RSSI-EXT2",
+                       sc->debug.stats.rxstats.rs_rssi_ext2);
+
+       len += snprintf(buf + len, size - len,
+                       "%18s : %10d\n", "Rx Antenna",
+                       sc->debug.stats.rxstats.rs_antenna);
+
        PHY_ERR("UNDERRUN", ATH9K_PHYERR_UNDERRUN);
        PHY_ERR("TIMING", ATH9K_PHYERR_TIMING);
        PHY_ERR("PARITY", ATH9K_PHYERR_PARITY);
@@ -948,6 +976,16 @@ void ath_debug_stat_rx(struct ath_softc *sc, struct ath_rx_status *rs)
                RX_PHY_ERR_INC(phyerr);
        }
 
+       sc->debug.stats.rxstats.rs_rssi_ctl0 = rs->rs_rssi_ctl0;
+       sc->debug.stats.rxstats.rs_rssi_ctl1 = rs->rs_rssi_ctl1;
+       sc->debug.stats.rxstats.rs_rssi_ctl2 = rs->rs_rssi_ctl2;
+
+       sc->debug.stats.rxstats.rs_rssi_ext0 = rs->rs_rssi_ext0;
+       sc->debug.stats.rxstats.rs_rssi_ext1 = rs->rs_rssi_ext1;
+       sc->debug.stats.rxstats.rs_rssi_ext2 = rs->rs_rssi_ext2;
+
+       sc->debug.stats.rxstats.rs_antenna = rs->rs_antenna;
+
 #undef RX_STAT_INC
 #undef RX_PHY_ERR_INC
 }
index 59338de0ce19bdaef71d4a0a4c5b1a7594628eb6..1f9f8eada465d88331e46a334aeaa31c7da05e55 100644 (file)
@@ -157,6 +157,13 @@ struct ath_rx_stats {
        u32 post_delim_crc_err;
        u32 decrypt_busy_err;
        u32 phy_err_stats[ATH9K_PHYERR_MAX];
+       int8_t rs_rssi_ctl0;
+       int8_t rs_rssi_ctl1;
+       int8_t rs_rssi_ctl2;
+       int8_t rs_rssi_ext0;
+       int8_t rs_rssi_ext1;
+       int8_t rs_rssi_ext2;
+       u8 rs_antenna;
 };
 
 struct ath_stats {