Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/kaber/nf-next-2.6
[pandora-kernel.git] / drivers / net / wireless / ath / ath5k / debug.c
index 0f06e84..42ea5b1 100644 (file)
@@ -60,6 +60,7 @@
 
 #include "base.h"
 #include "debug.h"
+#include "../debug.h"
 
 static unsigned int ath5k_debug;
 module_param_named(debug, ath5k_debug, uint, 0);
@@ -71,8 +72,6 @@ module_param_named(debug, ath5k_debug, uint, 0);
 #include "reg.h"
 #include "ani.h"
 
-static struct dentry *ath5k_global_debugfs;
-
 static int ath5k_debugfs_open(struct inode *inode, struct file *file)
 {
        file->private_data = inode->i_private;
@@ -520,9 +519,10 @@ static ssize_t read_file_misc(struct file *file, char __user *user_buf,
        if (filt & AR5K_RX_FILTER_PHYERR_5211)
                snprintf(buf+len, sizeof(buf)-len, " PHYERR-5211");
        if (filt & AR5K_RX_FILTER_RADARERR_5211)
-               len += snprintf(buf+len, sizeof(buf)-len, " RADARERR-5211\n");
-       else
-               len += snprintf(buf+len, sizeof(buf)-len, "\n");
+               len += snprintf(buf+len, sizeof(buf)-len, " RADARERR-5211");
+
+       len += snprintf(buf+len, sizeof(buf)-len, "\nopmode: %s (%d)\n",
+                       ath_opmode_to_string(sc->opmode), sc->opmode);
 
        if (len > sizeof(buf))
                len = sizeof(buf);
@@ -587,6 +587,8 @@ static ssize_t read_file_frameerrors(struct file *file, char __user *user_buf,
                                st->rxerr_jumbo*100/st->rx_all_count : 0);
        len += snprintf(buf+len, sizeof(buf)-len, "[RX all\t%d]\n",
                        st->rx_all_count);
+       len += snprintf(buf+len, sizeof(buf)-len, "RX-all-bytes\t%d\n",
+                       st->rx_bytes_count);
 
        len += snprintf(buf+len, sizeof(buf)-len,
                        "\nTX\n---------------------\n");
@@ -604,6 +606,8 @@ static ssize_t read_file_frameerrors(struct file *file, char __user *user_buf,
                                st->txerr_filt*100/st->tx_all_count : 0);
        len += snprintf(buf+len, sizeof(buf)-len, "[TX all\t%d]\n",
                        st->tx_all_count);
+       len += snprintf(buf+len, sizeof(buf)-len, "TX-all-bytes\t%d\n",
+                       st->tx_bytes_count);
 
        if (len > sizeof(buf))
                len = sizeof(buf);
@@ -711,20 +715,21 @@ static ssize_t read_file_ani(struct file *file, char __user *user_buf,
        len += snprintf(buf+len, sizeof(buf)-len,
                        "beacon RSSI average:\t%d\n",
                        sc->ah->ah_beacon_rssi_avg.avg);
+
+#define CC_PRINT(_struct, _field) \
+       _struct._field, \
+       _struct.cycles > 0 ? \
+       _struct._field*100/_struct.cycles : 0
+
        len += snprintf(buf+len, sizeof(buf)-len, "profcnt tx\t\t%u\t(%d%%)\n",
-                       as->pfc_tx,
-                       as->pfc_cycles > 0 ?
-                       as->pfc_tx*100/as->pfc_cycles : 0);
+                       CC_PRINT(as->last_cc, tx_frame));
        len += snprintf(buf+len, sizeof(buf)-len, "profcnt rx\t\t%u\t(%d%%)\n",
-                       as->pfc_rx,
-                       as->pfc_cycles > 0 ?
-                       as->pfc_rx*100/as->pfc_cycles : 0);
+                       CC_PRINT(as->last_cc, rx_frame));
        len += snprintf(buf+len, sizeof(buf)-len, "profcnt busy\t\t%u\t(%d%%)\n",
-                       as->pfc_busy,
-                       as->pfc_cycles > 0 ?
-                       as->pfc_busy*100/as->pfc_cycles : 0);
+                       CC_PRINT(as->last_cc, rx_busy));
+#undef CC_PRINT
        len += snprintf(buf+len, sizeof(buf)-len, "profcnt cycles\t\t%u\n",
-                       as->pfc_cycles);
+                       as->last_cc.cycles);
        len += snprintf(buf+len, sizeof(buf)-len,
                        "listen time\t\t%d\tlast: %d\n",
                        as->listen_time, as->last_listen);
@@ -875,21 +880,13 @@ static const struct file_operations fops_queue = {
 };
 
 
-/* init */
-
-void
-ath5k_debug_init(void)
-{
-       ath5k_global_debugfs = debugfs_create_dir("ath5k", NULL);
-}
-
 void
 ath5k_debug_init_device(struct ath5k_softc *sc)
 {
        sc->debug.level = ath5k_debug;
 
-       sc->debug.debugfs_phydir = debugfs_create_dir(wiphy_name(sc->hw->wiphy),
-                               ath5k_global_debugfs);
+       sc->debug.debugfs_phydir = debugfs_create_dir("ath5k",
+                               sc->hw->wiphy->debugfsdir);
 
        sc->debug.debugfs_debug = debugfs_create_file("debug",
                                S_IWUSR | S_IRUSR,
@@ -929,12 +926,6 @@ ath5k_debug_init_device(struct ath5k_softc *sc)
                                &fops_queue);
 }
 
-void
-ath5k_debug_finish(void)
-{
-       debugfs_remove(ath5k_global_debugfs);
-}
-
 void
 ath5k_debug_finish_device(struct ath5k_softc *sc)
 {