forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/drivers/net/wireless/ath/ath9k/debug_sta.c
....@@ -116,7 +116,7 @@
116116 if (rxs->rate_idx >= ARRAY_SIZE(rstats->ht_stats))
117117 goto exit;
118118
119
- if ((rxs->bw == RATE_INFO_BW_40))
119
+ if (rxs->bw == RATE_INFO_BW_40)
120120 rstats->ht_stats[rxs->rate_idx].ht40_cnt++;
121121 else
122122 rstats->ht_stats[rxs->rate_idx].ht20_cnt++;
....@@ -242,59 +242,6 @@
242242 .llseek = default_llseek,
243243 };
244244
245
-void ath_debug_airtime(struct ath_softc *sc,
246
- struct ath_node *an,
247
- u32 rx,
248
- u32 tx)
249
-{
250
- struct ath_airtime_stats *astats = &an->airtime_stats;
251
-
252
- astats->rx_airtime += rx;
253
- astats->tx_airtime += tx;
254
-}
255
-
256
-static ssize_t read_airtime(struct file *file, char __user *user_buf,
257
- size_t count, loff_t *ppos)
258
-{
259
- struct ath_node *an = file->private_data;
260
- struct ath_airtime_stats *astats;
261
- static const char *qname[4] = {
262
- "VO", "VI", "BE", "BK"
263
- };
264
- u32 len = 0, size = 256;
265
- char *buf;
266
- size_t retval;
267
- int i;
268
-
269
- buf = kzalloc(size, GFP_KERNEL);
270
- if (buf == NULL)
271
- return -ENOMEM;
272
-
273
- astats = &an->airtime_stats;
274
-
275
- len += scnprintf(buf + len, size - len, "RX: %u us\n", astats->rx_airtime);
276
- len += scnprintf(buf + len, size - len, "TX: %u us\n", astats->tx_airtime);
277
- len += scnprintf(buf + len, size - len, "Deficit: ");
278
- for (i = 0; i < 4; i++)
279
- len += scnprintf(buf+len, size - len, "%s: %lld us ", qname[i], an->airtime_deficit[i]);
280
- if (len < size)
281
- buf[len++] = '\n';
282
-
283
- retval = simple_read_from_buffer(user_buf, count, ppos, buf, len);
284
- kfree(buf);
285
-
286
- return retval;
287
-}
288
-
289
-
290
-static const struct file_operations fops_airtime = {
291
- .read = read_airtime,
292
- .open = simple_open,
293
- .owner = THIS_MODULE,
294
- .llseek = default_llseek,
295
-};
296
-
297
-
298245 void ath9k_sta_add_debugfs(struct ieee80211_hw *hw,
299246 struct ieee80211_vif *vif,
300247 struct ieee80211_sta *sta,
....@@ -304,5 +251,4 @@
304251
305252 debugfs_create_file("node_aggr", 0444, dir, an, &fops_node_aggr);
306253 debugfs_create_file("node_recv", 0444, dir, an, &fops_node_recv);
307
- debugfs_create_file("airtime", 0444, dir, an, &fops_airtime);
308254 }