diff options
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/debug.c')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/debug.c | 93 |
1 files changed, 0 insertions, 93 deletions
diff --git a/drivers/net/wireless/ath/ath9k/debug.c b/drivers/net/wireless/ath/ath9k/debug.c index 74a4570dc87f..7f764e3d1c0a 100644 --- a/drivers/net/wireless/ath/ath9k/debug.c +++ b/drivers/net/wireless/ath/ath9k/debug.c | |||
@@ -378,95 +378,6 @@ static const struct file_operations fops_interrupt = { | |||
378 | .owner = THIS_MODULE | 378 | .owner = THIS_MODULE |
379 | }; | 379 | }; |
380 | 380 | ||
381 | void ath_debug_stat_rc(struct ath_softc *sc, int final_rate) | ||
382 | { | ||
383 | struct ath_rc_stats *stats; | ||
384 | |||
385 | stats = &sc->debug.stats.rcstats[final_rate]; | ||
386 | stats->success++; | ||
387 | } | ||
388 | |||
389 | void ath_debug_stat_retries(struct ath_softc *sc, int rix, | ||
390 | int xretries, int retries, u8 per) | ||
391 | { | ||
392 | struct ath_rc_stats *stats = &sc->debug.stats.rcstats[rix]; | ||
393 | |||
394 | stats->xretries += xretries; | ||
395 | stats->retries += retries; | ||
396 | stats->per = per; | ||
397 | } | ||
398 | |||
399 | static ssize_t read_file_rcstat(struct file *file, char __user *user_buf, | ||
400 | size_t count, loff_t *ppos) | ||
401 | { | ||
402 | struct ath_softc *sc = file->private_data; | ||
403 | char *buf; | ||
404 | unsigned int len = 0, max; | ||
405 | int i = 0; | ||
406 | ssize_t retval; | ||
407 | |||
408 | if (sc->cur_rate_table == NULL) | ||
409 | return 0; | ||
410 | |||
411 | max = 80 + sc->cur_rate_table->rate_cnt * 1024 + 1; | ||
412 | buf = kmalloc(max, GFP_KERNEL); | ||
413 | if (buf == NULL) | ||
414 | return -ENOMEM; | ||
415 | |||
416 | len += sprintf(buf, "%6s %6s %6s " | ||
417 | "%10s %10s %10s %10s\n", | ||
418 | "HT", "MCS", "Rate", | ||
419 | "Success", "Retries", "XRetries", "PER"); | ||
420 | |||
421 | for (i = 0; i < sc->cur_rate_table->rate_cnt; i++) { | ||
422 | u32 ratekbps = sc->cur_rate_table->info[i].ratekbps; | ||
423 | struct ath_rc_stats *stats = &sc->debug.stats.rcstats[i]; | ||
424 | char mcs[5]; | ||
425 | char htmode[5]; | ||
426 | int used_mcs = 0, used_htmode = 0; | ||
427 | |||
428 | if (WLAN_RC_PHY_HT(sc->cur_rate_table->info[i].phy)) { | ||
429 | used_mcs = snprintf(mcs, 5, "%d", | ||
430 | sc->cur_rate_table->info[i].ratecode); | ||
431 | |||
432 | if (WLAN_RC_PHY_40(sc->cur_rate_table->info[i].phy)) | ||
433 | used_htmode = snprintf(htmode, 5, "HT40"); | ||
434 | else if (WLAN_RC_PHY_20(sc->cur_rate_table->info[i].phy)) | ||
435 | used_htmode = snprintf(htmode, 5, "HT20"); | ||
436 | else | ||
437 | used_htmode = snprintf(htmode, 5, "????"); | ||
438 | } | ||
439 | |||
440 | mcs[used_mcs] = '\0'; | ||
441 | htmode[used_htmode] = '\0'; | ||
442 | |||
443 | len += snprintf(buf + len, max - len, | ||
444 | "%6s %6s %3u.%d: " | ||
445 | "%10u %10u %10u %10u\n", | ||
446 | htmode, | ||
447 | mcs, | ||
448 | ratekbps / 1000, | ||
449 | (ratekbps % 1000) / 100, | ||
450 | stats->success, | ||
451 | stats->retries, | ||
452 | stats->xretries, | ||
453 | stats->per); | ||
454 | } | ||
455 | |||
456 | if (len > max) | ||
457 | len = max; | ||
458 | |||
459 | retval = simple_read_from_buffer(user_buf, count, ppos, buf, len); | ||
460 | kfree(buf); | ||
461 | return retval; | ||
462 | } | ||
463 | |||
464 | static const struct file_operations fops_rcstat = { | ||
465 | .read = read_file_rcstat, | ||
466 | .open = ath9k_debugfs_open, | ||
467 | .owner = THIS_MODULE | ||
468 | }; | ||
469 | |||
470 | static const char * ath_wiphy_state_str(enum ath_wiphy_state state) | 381 | static const char * ath_wiphy_state_str(enum ath_wiphy_state state) |
471 | { | 382 | { |
472 | switch (state) { | 383 | switch (state) { |
@@ -977,10 +888,6 @@ int ath9k_init_debug(struct ath_hw *ah) | |||
977 | sc, &fops_interrupt)) | 888 | sc, &fops_interrupt)) |
978 | goto err; | 889 | goto err; |
979 | 890 | ||
980 | if (!debugfs_create_file("rcstat", S_IRUSR, sc->debug.debugfs_phy, | ||
981 | sc, &fops_rcstat)) | ||
982 | goto err; | ||
983 | |||
984 | if (!debugfs_create_file("wiphy", S_IRUSR | S_IWUSR, | 891 | if (!debugfs_create_file("wiphy", S_IRUSR | S_IWUSR, |
985 | sc->debug.debugfs_phy, sc, &fops_wiphy)) | 892 | sc->debug.debugfs_phy, sc, &fops_wiphy)) |
986 | goto err; | 893 | goto err; |