mac80211: remove sta_remove_debugfs driver callback
[cascardo/linux.git] / net / mac80211 / debugfs_sta.c
index fd33413..a2fcdb4 100644 (file)
@@ -133,6 +133,55 @@ static ssize_t sta_last_seq_ctrl_read(struct file *file, char __user *userbuf,
 }
 STA_OPS(last_seq_ctrl);
 
+#define AQM_TXQ_ENTRY_LEN 130
+
+static ssize_t sta_aqm_read(struct file *file, char __user *userbuf,
+                       size_t count, loff_t *ppos)
+{
+       struct sta_info *sta = file->private_data;
+       struct ieee80211_local *local = sta->local;
+       size_t bufsz = AQM_TXQ_ENTRY_LEN*(IEEE80211_NUM_TIDS+1);
+       char *buf = kzalloc(bufsz, GFP_KERNEL), *p = buf;
+       struct txq_info *txqi;
+       ssize_t rv;
+       int i;
+
+       if (!buf)
+               return -ENOMEM;
+
+       spin_lock_bh(&local->fq.lock);
+       rcu_read_lock();
+
+       p += scnprintf(p,
+                      bufsz+buf-p,
+                      "tid ac backlog-bytes backlog-packets new-flows drops marks overlimit collisions tx-bytes tx-packets\n");
+
+       for (i = 0; i < IEEE80211_NUM_TIDS; i++) {
+               txqi = to_txq_info(sta->sta.txq[i]);
+               p += scnprintf(p, bufsz+buf-p,
+                              "%d %d %u %u %u %u %u %u %u %u %u\n",
+                              txqi->txq.tid,
+                              txqi->txq.ac,
+                              txqi->tin.backlog_bytes,
+                              txqi->tin.backlog_packets,
+                              txqi->tin.flows,
+                              txqi->cstats.drop_count,
+                              txqi->cstats.ecn_mark,
+                              txqi->tin.overlimit,
+                              txqi->tin.collisions,
+                              txqi->tin.tx_bytes,
+                              txqi->tin.tx_packets);
+       }
+
+       rcu_read_unlock();
+       spin_unlock_bh(&local->fq.lock);
+
+       rv = simple_read_from_buffer(userbuf, count, ppos, buf, p - buf);
+       kfree(buf);
+       return rv;
+}
+STA_OPS(aqm);
+
 static ssize_t sta_agg_status_read(struct file *file, char __user *userbuf,
                                        size_t count, loff_t *ppos)
 {
@@ -478,6 +527,9 @@ void ieee80211_sta_debugfs_add(struct sta_info *sta)
        DEBUGFS_ADD_COUNTER(rx_fragments, rx_stats.fragments);
        DEBUGFS_ADD_COUNTER(tx_filtered, status_stats.filtered);
 
+       if (local->ops->wake_tx_queue)
+               DEBUGFS_ADD(aqm);
+
        if (sizeof(sta->driver_buffered_tids) == sizeof(u32))
                debugfs_create_x32("driver_buffered_tids", 0400,
                                   sta->debugfs_dir,
@@ -492,10 +544,6 @@ void ieee80211_sta_debugfs_add(struct sta_info *sta)
 
 void ieee80211_sta_debugfs_remove(struct sta_info *sta)
 {
-       struct ieee80211_local *local = sta->local;
-       struct ieee80211_sub_if_data *sdata = sta->sdata;
-
-       drv_sta_remove_debugfs(local, sdata, &sta->sta, sta->debugfs_dir);
        debugfs_remove_recursive(sta->debugfs_dir);
        sta->debugfs_dir = NULL;
 }