mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-28 09:31:14 +00:00
ath9k: Add a debugfs file to dump queue statistics
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
parent
78ef731ce5
commit
c0b74876ee
1 changed files with 53 additions and 0 deletions
|
@ -558,6 +558,50 @@ static ssize_t read_file_xmit(struct file *file, char __user *user_buf,
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static ssize_t read_file_queues(struct file *file, char __user *user_buf,
|
||||||
|
size_t count, loff_t *ppos)
|
||||||
|
{
|
||||||
|
struct ath_softc *sc = file->private_data;
|
||||||
|
struct ath_txq *txq;
|
||||||
|
char *buf;
|
||||||
|
unsigned int len = 0, size = 1024;
|
||||||
|
ssize_t retval = 0;
|
||||||
|
int i;
|
||||||
|
char *qname[4] = {"VO", "VI", "BE", "BK"};
|
||||||
|
|
||||||
|
buf = kzalloc(size, GFP_KERNEL);
|
||||||
|
if (buf == NULL)
|
||||||
|
return -ENOMEM;
|
||||||
|
|
||||||
|
for (i = 0; i < IEEE80211_NUM_ACS; i++) {
|
||||||
|
txq = sc->tx.txq_map[i];
|
||||||
|
len += snprintf(buf + len, size - len, "(%s): ", qname[i]);
|
||||||
|
|
||||||
|
ath_txq_lock(sc, txq);
|
||||||
|
|
||||||
|
len += snprintf(buf + len, size - len, "%s: %d ",
|
||||||
|
"qnum", txq->axq_qnum);
|
||||||
|
len += snprintf(buf + len, size - len, "%s: %2d ",
|
||||||
|
"qdepth", txq->axq_depth);
|
||||||
|
len += snprintf(buf + len, size - len, "%s: %2d ",
|
||||||
|
"ampdu-depth", txq->axq_ampdu_depth);
|
||||||
|
len += snprintf(buf + len, size - len, "%s: %3d ",
|
||||||
|
"pending", txq->pending_frames);
|
||||||
|
len += snprintf(buf + len, size - len, "%s: %d\n",
|
||||||
|
"stopped", txq->stopped);
|
||||||
|
|
||||||
|
ath_txq_unlock(sc, txq);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (len > size)
|
||||||
|
len = size;
|
||||||
|
|
||||||
|
retval = simple_read_from_buffer(user_buf, count, ppos, buf, len);
|
||||||
|
kfree(buf);
|
||||||
|
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
static ssize_t read_file_stations(struct file *file, char __user *user_buf,
|
static ssize_t read_file_stations(struct file *file, char __user *user_buf,
|
||||||
size_t count, loff_t *ppos)
|
size_t count, loff_t *ppos)
|
||||||
{
|
{
|
||||||
|
@ -828,6 +872,13 @@ static const struct file_operations fops_xmit = {
|
||||||
.llseek = default_llseek,
|
.llseek = default_llseek,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static const struct file_operations fops_queues = {
|
||||||
|
.read = read_file_queues,
|
||||||
|
.open = simple_open,
|
||||||
|
.owner = THIS_MODULE,
|
||||||
|
.llseek = default_llseek,
|
||||||
|
};
|
||||||
|
|
||||||
static const struct file_operations fops_stations = {
|
static const struct file_operations fops_stations = {
|
||||||
.read = read_file_stations,
|
.read = read_file_stations,
|
||||||
.open = simple_open,
|
.open = simple_open,
|
||||||
|
@ -1553,6 +1604,8 @@ int ath9k_init_debug(struct ath_hw *ah)
|
||||||
&fops_interrupt);
|
&fops_interrupt);
|
||||||
debugfs_create_file("xmit", S_IRUSR, sc->debug.debugfs_phy, sc,
|
debugfs_create_file("xmit", S_IRUSR, sc->debug.debugfs_phy, sc,
|
||||||
&fops_xmit);
|
&fops_xmit);
|
||||||
|
debugfs_create_file("queues", S_IRUSR, sc->debug.debugfs_phy, sc,
|
||||||
|
&fops_queues);
|
||||||
debugfs_create_u32("qlen_bk", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy,
|
debugfs_create_u32("qlen_bk", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy,
|
||||||
&sc->tx.txq_max_pending[IEEE80211_AC_BK]);
|
&sc->tx.txq_max_pending[IEEE80211_AC_BK]);
|
||||||
debugfs_create_u32("qlen_be", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy,
|
debugfs_create_u32("qlen_be", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue