aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-12-14 19:10:09 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-12-14 19:10:09 -0500
commite6b5be2be4e30037eb551e0ed09dd97bd00d85d3 (patch)
tree88801365987a0dc64d62d47e8a11f3b44691c37f /drivers/net/wireless
parent37da7bbbe84fe9e8862940d3f9194fd27dce59bb (diff)
parentf1c488a78d9f1a22cdb15648c15e70fd82ed229a (diff)
Merge tag 'driver-core-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
Pull driver core update from Greg KH: "Here's the set of driver core patches for 3.19-rc1. They are dominated by the removal of the .owner field in platform drivers. They touch a lot of files, but they are "simple" changes, just removing a line in a structure. Other than that, a few minor driver core and debugfs changes. There are some ath9k patches coming in through this tree that have been acked by the wireless maintainers as they relied on the debugfs changes. Everything has been in linux-next for a while" * tag 'driver-core-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (324 commits) Revert "ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries" fs: debugfs: add forward declaration for struct device type firmware class: Deletion of an unnecessary check before the function call "vunmap" firmware loader: fix hung task warning dump devcoredump: provide a one-way disable function device: Add dev_<level>_once variants ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries ath: use seq_file api for ath9k debugfs files debugfs: add helper function to create device related seq_file drivers/base: cacheinfo: remove noisy error boot message Revert "core: platform: add warning if driver has no owner" drivers: base: support cpu cache information interface to userspace via sysfs drivers: base: add cpu_device_create to support per-cpu devices topology: replace custom attribute macros with standard DEVICE_ATTR* cpumask: factor out show_cpumap into separate helper function driver core: Fix unbalanced device reference in drivers_probe driver core: fix race with userland in device_add() sysfs/kernfs: make read requests on pre-alloc files use the buffer. sysfs/kernfs: allow attributes to request write buffer be pre-allocated. fs: sysfs: return EGBIG on write if offset is larger than file size ...
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/ath/ath9k/ahb.c1
-rw-r--r--drivers/net/wireless/ath/ath9k/debug.c415
-rw-r--r--drivers/net/wireless/ath/ath9k/debug.h11
-rw-r--r--drivers/net/wireless/ath/wcn36xx/main.c1
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c1
-rw-r--r--drivers/net/wireless/mac80211_hwsim.c1
-rw-r--r--drivers/net/wireless/rt2x00/rt2800soc.c1
-rw-r--r--drivers/net/wireless/ti/wl12xx/main.c1
-rw-r--r--drivers/net/wireless/ti/wl18xx/main.c1
9 files changed, 176 insertions, 257 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ahb.c b/drivers/net/wireless/ath/ath9k/ahb.c
index 4173838f4684..e000c4c27881 100644
--- a/drivers/net/wireless/ath/ath9k/ahb.c
+++ b/drivers/net/wireless/ath/ath9k/ahb.c
@@ -175,7 +175,6 @@ static struct platform_driver ath_ahb_driver = {
175 .remove = ath_ahb_remove, 175 .remove = ath_ahb_remove,
176 .driver = { 176 .driver = {
177 .name = "ath9k", 177 .name = "ath9k",
178 .owner = THIS_MODULE,
179 }, 178 },
180 .id_table = ath9k_platform_id_table, 179 .id_table = ath9k_platform_id_table,
181}; 180};
diff --git a/drivers/net/wireless/ath/ath9k/debug.c b/drivers/net/wireless/ath/ath9k/debug.c
index 696e3d5309c6..871e969409bf 100644
--- a/drivers/net/wireless/ath/ath9k/debug.c
+++ b/drivers/net/wireless/ath/ath9k/debug.c
@@ -401,22 +401,14 @@ static const struct file_operations fops_antenna_diversity = {
401 .llseek = default_llseek, 401 .llseek = default_llseek,
402}; 402};
403 403
404static ssize_t read_file_dma(struct file *file, char __user *user_buf, 404static int read_file_dma(struct seq_file *file, void *data)
405 size_t count, loff_t *ppos)
406{ 405{
407 struct ath_softc *sc = file->private_data; 406 struct ath_softc *sc = file->private;
408 struct ath_hw *ah = sc->sc_ah; 407 struct ath_hw *ah = sc->sc_ah;
409 char *buf;
410 int retval;
411 unsigned int len = 0;
412 u32 val[ATH9K_NUM_DMA_DEBUG_REGS]; 408 u32 val[ATH9K_NUM_DMA_DEBUG_REGS];
413 int i, qcuOffset = 0, dcuOffset = 0; 409 int i, qcuOffset = 0, dcuOffset = 0;
414 u32 *qcuBase = &val[0], *dcuBase = &val[4]; 410 u32 *qcuBase = &val[0], *dcuBase = &val[4];
415 411
416 buf = kmalloc(DMA_BUF_LEN, GFP_KERNEL);
417 if (!buf)
418 return -ENOMEM;
419
420 ath9k_ps_wakeup(sc); 412 ath9k_ps_wakeup(sc);
421 413
422 REG_WRITE_D(ah, AR_MACMISC, 414 REG_WRITE_D(ah, AR_MACMISC,
@@ -424,21 +416,18 @@ static ssize_t read_file_dma(struct file *file, char __user *user_buf,
424 (AR_MACMISC_MISC_OBS_BUS_1 << 416 (AR_MACMISC_MISC_OBS_BUS_1 <<
425 AR_MACMISC_MISC_OBS_BUS_MSB_S))); 417 AR_MACMISC_MISC_OBS_BUS_MSB_S)));
426 418
427 len += scnprintf(buf + len, DMA_BUF_LEN - len, 419 seq_puts(file, "Raw DMA Debug values:\n");
428 "Raw DMA Debug values:\n");
429 420
430 for (i = 0; i < ATH9K_NUM_DMA_DEBUG_REGS; i++) { 421 for (i = 0; i < ATH9K_NUM_DMA_DEBUG_REGS; i++) {
431 if (i % 4 == 0) 422 if (i % 4 == 0)
432 len += scnprintf(buf + len, DMA_BUF_LEN - len, "\n"); 423 seq_puts(file, "\n");
433 424
434 val[i] = REG_READ_D(ah, AR_DMADBG_0 + (i * sizeof(u32))); 425 val[i] = REG_READ_D(ah, AR_DMADBG_0 + (i * sizeof(u32)));
435 len += scnprintf(buf + len, DMA_BUF_LEN - len, "%d: %08x ", 426 seq_printf(file, "%d: %08x ", i, val[i]);
436 i, val[i]);
437 } 427 }
438 428
439 len += scnprintf(buf + len, DMA_BUF_LEN - len, "\n\n"); 429 seq_puts(file, "\n\n");
440 len += scnprintf(buf + len, DMA_BUF_LEN - len, 430 seq_puts(file, "Num QCU: chain_st fsp_ok fsp_st DCU: chain_st\n");
441 "Num QCU: chain_st fsp_ok fsp_st DCU: chain_st\n");
442 431
443 for (i = 0; i < ATH9K_NUM_QUEUES; i++, qcuOffset += 4, dcuOffset += 5) { 432 for (i = 0; i < ATH9K_NUM_QUEUES; i++, qcuOffset += 4, dcuOffset += 5) {
444 if (i == 8) { 433 if (i == 8) {
@@ -451,55 +440,47 @@ static ssize_t read_file_dma(struct file *file, char __user *user_buf,
451 dcuBase++; 440 dcuBase++;
452 } 441 }
453 442
454 len += scnprintf(buf + len, DMA_BUF_LEN - len, 443 seq_printf(file, "%2d %2x %1x %2x %2x\n",
455 "%2d %2x %1x %2x %2x\n", 444 i, (*qcuBase & (0x7 << qcuOffset)) >> qcuOffset,
456 i, (*qcuBase & (0x7 << qcuOffset)) >> qcuOffset, 445 (*qcuBase & (0x8 << qcuOffset)) >> (qcuOffset + 3),
457 (*qcuBase & (0x8 << qcuOffset)) >> (qcuOffset + 3), 446 (val[2] & (0x7 << (i * 3))) >> (i * 3),
458 (val[2] & (0x7 << (i * 3))) >> (i * 3), 447 (*dcuBase & (0x1f << dcuOffset)) >> dcuOffset);
459 (*dcuBase & (0x1f << dcuOffset)) >> dcuOffset);
460 } 448 }
461 449
462 len += scnprintf(buf + len, DMA_BUF_LEN - len, "\n"); 450 seq_puts(file, "\n");
463 451
464 len += scnprintf(buf + len, DMA_BUF_LEN - len, 452 seq_printf(file, "qcu_stitch state: %2x qcu_fetch state: %2x\n",
465 "qcu_stitch state: %2x qcu_fetch state: %2x\n", 453 (val[3] & 0x003c0000) >> 18, (val[3] & 0x03c00000) >> 22);
466 (val[3] & 0x003c0000) >> 18, (val[3] & 0x03c00000) >> 22); 454 seq_printf(file, "qcu_complete state: %2x dcu_complete state: %2x\n",
467 len += scnprintf(buf + len, DMA_BUF_LEN - len, 455 (val[3] & 0x1c000000) >> 26, (val[6] & 0x3));
468 "qcu_complete state: %2x dcu_complete state: %2x\n", 456 seq_printf(file, "dcu_arb state: %2x dcu_fp state: %2x\n",
469 (val[3] & 0x1c000000) >> 26, (val[6] & 0x3)); 457 (val[5] & 0x06000000) >> 25, (val[5] & 0x38000000) >> 27);
470 len += scnprintf(buf + len, DMA_BUF_LEN - len, 458 seq_printf(file, "chan_idle_dur: %3d chan_idle_dur_valid: %1d\n",
471 "dcu_arb state: %2x dcu_fp state: %2x\n", 459 (val[6] & 0x000003fc) >> 2, (val[6] & 0x00000400) >> 10);
472 (val[5] & 0x06000000) >> 25, (val[5] & 0x38000000) >> 27); 460 seq_printf(file, "txfifo_valid_0: %1d txfifo_valid_1: %1d\n",
473 len += scnprintf(buf + len, DMA_BUF_LEN - len, 461 (val[6] & 0x00000800) >> 11, (val[6] & 0x00001000) >> 12);
474 "chan_idle_dur: %3d chan_idle_dur_valid: %1d\n", 462 seq_printf(file, "txfifo_dcu_num_0: %2d txfifo_dcu_num_1: %2d\n",
475 (val[6] & 0x000003fc) >> 2, (val[6] & 0x00000400) >> 10); 463 (val[6] & 0x0001e000) >> 13, (val[6] & 0x001e0000) >> 17);
476 len += scnprintf(buf + len, DMA_BUF_LEN - len, 464
477 "txfifo_valid_0: %1d txfifo_valid_1: %1d\n", 465 seq_printf(file, "pcu observe: 0x%x\n", REG_READ_D(ah, AR_OBS_BUS_1));
478 (val[6] & 0x00000800) >> 11, (val[6] & 0x00001000) >> 12); 466 seq_printf(file, "AR_CR: 0x%x\n", REG_READ_D(ah, AR_CR));
479 len += scnprintf(buf + len, DMA_BUF_LEN - len,
480 "txfifo_dcu_num_0: %2d txfifo_dcu_num_1: %2d\n",
481 (val[6] & 0x0001e000) >> 13, (val[6] & 0x001e0000) >> 17);
482
483 len += scnprintf(buf + len, DMA_BUF_LEN - len, "pcu observe: 0x%x\n",
484 REG_READ_D(ah, AR_OBS_BUS_1));
485 len += scnprintf(buf + len, DMA_BUF_LEN - len,
486 "AR_CR: 0x%x\n", REG_READ_D(ah, AR_CR));
487 467
488 ath9k_ps_restore(sc); 468 ath9k_ps_restore(sc);
489 469
490 if (len > DMA_BUF_LEN) 470 return 0;
491 len = DMA_BUF_LEN; 471}
492 472
493 retval = simple_read_from_buffer(user_buf, count, ppos, buf, len); 473static int open_file_dma(struct inode *inode, struct file *f)
494 kfree(buf); 474{
495 return retval; 475 return single_open(f, read_file_dma, inode->i_private);
496} 476}
497 477
498static const struct file_operations fops_dma = { 478static const struct file_operations fops_dma = {
499 .read = read_file_dma, 479 .open = open_file_dma,
500 .open = simple_open, 480 .read = seq_read,
501 .owner = THIS_MODULE, 481 .owner = THIS_MODULE,
502 .llseek = default_llseek, 482 .llseek = seq_lseek,
483 .release = single_release,
503}; 484};
504 485
505 486
@@ -556,22 +537,14 @@ void ath_debug_stat_interrupt(struct ath_softc *sc, enum ath9k_int status)
556 sc->debug.stats.istats.gen_timer++; 537 sc->debug.stats.istats.gen_timer++;
557} 538}
558 539
559static ssize_t read_file_interrupt(struct file *file, char __user *user_buf, 540static int read_file_interrupt(struct seq_file *file, void *data)
560 size_t count, loff_t *ppos)
561{ 541{
562 struct ath_softc *sc = file->private_data; 542 struct ath_softc *sc = file->private;
563 unsigned int len = 0;
564 int rv;
565 int mxlen = 4000;
566 char *buf = kmalloc(mxlen, GFP_KERNEL);
567 if (!buf)
568 return -ENOMEM;
569 543
570#define PR_IS(a, s) \ 544#define PR_IS(a, s) \
571 do { \ 545 do { \
572 len += scnprintf(buf + len, mxlen - len, \ 546 seq_printf(file, "%21s: %10u\n", a, \
573 "%21s: %10u\n", a, \ 547 sc->debug.stats.istats.s); \
574 sc->debug.stats.istats.s); \
575 } while (0) 548 } while (0)
576 549
577 if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA) { 550 if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA) {
@@ -602,8 +575,7 @@ static ssize_t read_file_interrupt(struct file *file, char __user *user_buf,
602 PR_IS("GENTIMER", gen_timer); 575 PR_IS("GENTIMER", gen_timer);
603 PR_IS("TOTAL", total); 576 PR_IS("TOTAL", total);
604 577
605 len += scnprintf(buf + len, mxlen - len, 578 seq_puts(file, "SYNC_CAUSE stats:\n");
606 "SYNC_CAUSE stats:\n");
607 579
608 PR_IS("Sync-All", sync_cause_all); 580 PR_IS("Sync-All", sync_cause_all);
609 PR_IS("RTC-IRQ", sync_rtc_irq); 581 PR_IS("RTC-IRQ", sync_rtc_irq);
@@ -625,35 +597,27 @@ static ssize_t read_file_interrupt(struct file *file, char __user *user_buf,
625 PR_IS("MAC-Asleep", mac_asleep); 597 PR_IS("MAC-Asleep", mac_asleep);
626 PR_IS("MAC-Sleep-Access", mac_sleep_access); 598 PR_IS("MAC-Sleep-Access", mac_sleep_access);
627 599
628 if (len > mxlen) 600 return 0;
629 len = mxlen; 601}
630 602
631 rv = simple_read_from_buffer(user_buf, count, ppos, buf, len); 603static int open_file_interrupt(struct inode *inode, struct file *f)
632 kfree(buf); 604{
633 return rv; 605 return single_open(f, read_file_interrupt, inode->i_private);
634} 606}
635 607
636static const struct file_operations fops_interrupt = { 608static const struct file_operations fops_interrupt = {
637 .read = read_file_interrupt, 609 .read = seq_read,
638 .open = simple_open, 610 .open = open_file_interrupt,
639 .owner = THIS_MODULE, 611 .owner = THIS_MODULE,
640 .llseek = default_llseek, 612 .llseek = seq_lseek,
613 .release = single_release,
641}; 614};
642 615
643static ssize_t read_file_xmit(struct file *file, char __user *user_buf, 616static int read_file_xmit(struct seq_file *file, void *data)
644 size_t count, loff_t *ppos)
645{ 617{
646 struct ath_softc *sc = file->private_data; 618 struct ath_softc *sc = file->private;
647 char *buf;
648 unsigned int len = 0, size = 2048;
649 ssize_t retval = 0;
650
651 buf = kzalloc(size, GFP_KERNEL);
652 if (buf == NULL)
653 return -ENOMEM;
654 619
655 len += sprintf(buf, "%30s %10s%10s%10s\n\n", 620 seq_printf(file, "%30s %10s%10s%10s\n\n", "BE", "BK", "VI", "VO");
656 "BE", "BK", "VI", "VO");
657 621
658 PR("MPDUs Queued: ", queued); 622 PR("MPDUs Queued: ", queued);
659 PR("MPDUs Completed: ", completed); 623 PR("MPDUs Completed: ", completed);
@@ -678,153 +642,115 @@ static ssize_t read_file_xmit(struct file *file, char __user *user_buf,
678 PR("HW-tx-proc-desc: ", txprocdesc); 642 PR("HW-tx-proc-desc: ", txprocdesc);
679 PR("TX-Failed: ", txfailed); 643 PR("TX-Failed: ", txfailed);
680 644
681 if (len > size) 645 return 0;
682 len = size;
683
684 retval = simple_read_from_buffer(user_buf, count, ppos, buf, len);
685 kfree(buf);
686
687 return retval;
688} 646}
689 647
690static ssize_t print_queue(struct ath_softc *sc, struct ath_txq *txq, 648static void print_queue(struct ath_softc *sc, struct ath_txq *txq,
691 char *buf, ssize_t size) 649 struct seq_file *file)
692{ 650{
693 ssize_t len = 0;
694
695 ath_txq_lock(sc, txq); 651 ath_txq_lock(sc, txq);
696 652
697 len += scnprintf(buf + len, size - len, "%s: %d ", 653 seq_printf(file, "%s: %d ", "qnum", txq->axq_qnum);
698 "qnum", txq->axq_qnum); 654 seq_printf(file, "%s: %2d ", "qdepth", txq->axq_depth);
699 len += scnprintf(buf + len, size - len, "%s: %2d ", 655 seq_printf(file, "%s: %2d ", "ampdu-depth", txq->axq_ampdu_depth);
700 "qdepth", txq->axq_depth); 656 seq_printf(file, "%s: %3d ", "pending", txq->pending_frames);
701 len += scnprintf(buf + len, size - len, "%s: %2d ", 657 seq_printf(file, "%s: %d\n", "stopped", txq->stopped);
702 "ampdu-depth", txq->axq_ampdu_depth);
703 len += scnprintf(buf + len, size - len, "%s: %3d ",
704 "pending", txq->pending_frames);
705 len += scnprintf(buf + len, size - len, "%s: %d\n",
706 "stopped", txq->stopped);
707 658
708 ath_txq_unlock(sc, txq); 659 ath_txq_unlock(sc, txq);
709 return len;
710} 660}
711 661
712static ssize_t read_file_queues(struct file *file, char __user *user_buf, 662static int read_file_queues(struct seq_file *file, void *data)
713 size_t count, loff_t *ppos)
714{ 663{
715 struct ath_softc *sc = file->private_data; 664 struct ath_softc *sc = file->private;
716 struct ath_txq *txq; 665 struct ath_txq *txq;
717 char *buf;
718 unsigned int len = 0;
719 const unsigned int size = 1024;
720 ssize_t retval = 0;
721 int i; 666 int i;
722 static const char *qname[4] = { 667 static const char *qname[4] = {
723 "VO", "VI", "BE", "BK" 668 "VO", "VI", "BE", "BK"
724 }; 669 };
725 670
726 buf = kzalloc(size, GFP_KERNEL);
727 if (buf == NULL)
728 return -ENOMEM;
729
730 for (i = 0; i < IEEE80211_NUM_ACS; i++) { 671 for (i = 0; i < IEEE80211_NUM_ACS; i++) {
731 txq = sc->tx.txq_map[i]; 672 txq = sc->tx.txq_map[i];
732 len += scnprintf(buf + len, size - len, "(%s): ", qname[i]); 673 seq_printf(file, "(%s): ", qname[i]);
733 len += print_queue(sc, txq, buf + len, size - len); 674 print_queue(sc, txq, file);
734 } 675 }
735 676
736 len += scnprintf(buf + len, size - len, "(CAB): "); 677 seq_puts(file, "(CAB): ");
737 len += print_queue(sc, sc->beacon.cabq, buf + len, size - len); 678 print_queue(sc, sc->beacon.cabq, file);
738
739 if (len > size)
740 len = size;
741
742 retval = simple_read_from_buffer(user_buf, count, ppos, buf, len);
743 kfree(buf);
744 679
745 return retval; 680 return 0;
746} 681}
747 682
748static ssize_t read_file_misc(struct file *file, char __user *user_buf, 683static int read_file_misc(struct seq_file *file, void *data)
749 size_t count, loff_t *ppos)
750{ 684{
751 struct ath_softc *sc = file->private_data; 685 struct ath_softc *sc = file->private;
752 struct ath_common *common = ath9k_hw_common(sc->sc_ah); 686 struct ath_common *common = ath9k_hw_common(sc->sc_ah);
753 struct ath9k_vif_iter_data iter_data; 687 struct ath9k_vif_iter_data iter_data;
754 struct ath_chanctx *ctx; 688 struct ath_chanctx *ctx;
755 char buf[512];
756 unsigned int len = 0;
757 ssize_t retval = 0;
758 unsigned int reg; 689 unsigned int reg;
759 u32 rxfilter, i; 690 u32 rxfilter, i;
760 691
761 len += scnprintf(buf + len, sizeof(buf) - len, 692 seq_printf(file, "BSSID: %pM\n", common->curbssid);
762 "BSSID: %pM\n", common->curbssid); 693 seq_printf(file, "BSSID-MASK: %pM\n", common->bssidmask);
763 len += scnprintf(buf + len, sizeof(buf) - len, 694 seq_printf(file, "OPMODE: %s\n",
764 "BSSID-MASK: %pM\n", common->bssidmask); 695 ath_opmode_to_string(sc->sc_ah->opmode));
765 len += scnprintf(buf + len, sizeof(buf) - len,
766 "OPMODE: %s\n",
767 ath_opmode_to_string(sc->sc_ah->opmode));
768 696
769 ath9k_ps_wakeup(sc); 697 ath9k_ps_wakeup(sc);
770 rxfilter = ath9k_hw_getrxfilter(sc->sc_ah); 698 rxfilter = ath9k_hw_getrxfilter(sc->sc_ah);
771 ath9k_ps_restore(sc); 699 ath9k_ps_restore(sc);
772 700
773 len += scnprintf(buf + len, sizeof(buf) - len, 701 seq_printf(file, "RXFILTER: 0x%x", rxfilter);
774 "RXFILTER: 0x%x", rxfilter);
775 702
776 if (rxfilter & ATH9K_RX_FILTER_UCAST) 703 if (rxfilter & ATH9K_RX_FILTER_UCAST)
777 len += scnprintf(buf + len, sizeof(buf) - len, " UCAST"); 704 seq_puts(file, " UCAST");
778 if (rxfilter & ATH9K_RX_FILTER_MCAST) 705 if (rxfilter & ATH9K_RX_FILTER_MCAST)
779 len += scnprintf(buf + len, sizeof(buf) - len, " MCAST"); 706 seq_puts(file, " MCAST");
780 if (rxfilter & ATH9K_RX_FILTER_BCAST) 707 if (rxfilter & ATH9K_RX_FILTER_BCAST)
781 len += scnprintf(buf + len, sizeof(buf) - len, " BCAST"); 708 seq_puts(file, " BCAST");
782 if (rxfilter & ATH9K_RX_FILTER_CONTROL) 709 if (rxfilter & ATH9K_RX_FILTER_CONTROL)
783 len += scnprintf(buf + len, sizeof(buf) - len, " CONTROL"); 710 seq_puts(file, " CONTROL");
784 if (rxfilter & ATH9K_RX_FILTER_BEACON) 711 if (rxfilter & ATH9K_RX_FILTER_BEACON)
785 len += scnprintf(buf + len, sizeof(buf) - len, " BEACON"); 712 seq_puts(file, " BEACON");
786 if (rxfilter & ATH9K_RX_FILTER_PROM) 713 if (rxfilter & ATH9K_RX_FILTER_PROM)
787 len += scnprintf(buf + len, sizeof(buf) - len, " PROM"); 714 seq_puts(file, " PROM");
788 if (rxfilter & ATH9K_RX_FILTER_PROBEREQ) 715 if (rxfilter & ATH9K_RX_FILTER_PROBEREQ)
789 len += scnprintf(buf + len, sizeof(buf) - len, " PROBEREQ"); 716 seq_puts(file, " PROBEREQ");
790 if (rxfilter & ATH9K_RX_FILTER_PHYERR) 717 if (rxfilter & ATH9K_RX_FILTER_PHYERR)
791 len += scnprintf(buf + len, sizeof(buf) - len, " PHYERR"); 718 seq_puts(file, " PHYERR");
792 if (rxfilter & ATH9K_RX_FILTER_MYBEACON) 719 if (rxfilter & ATH9K_RX_FILTER_MYBEACON)
793 len += scnprintf(buf + len, sizeof(buf) - len, " MYBEACON"); 720 seq_puts(file, " MYBEACON");
794 if (rxfilter & ATH9K_RX_FILTER_COMP_BAR) 721 if (rxfilter & ATH9K_RX_FILTER_COMP_BAR)
795 len += scnprintf(buf + len, sizeof(buf) - len, " COMP_BAR"); 722 seq_puts(file, " COMP_BAR");
796 if (rxfilter & ATH9K_RX_FILTER_PSPOLL) 723 if (rxfilter & ATH9K_RX_FILTER_PSPOLL)
797 len += scnprintf(buf + len, sizeof(buf) - len, " PSPOLL"); 724 seq_puts(file, " PSPOLL");
798 if (rxfilter & ATH9K_RX_FILTER_PHYRADAR) 725 if (rxfilter & ATH9K_RX_FILTER_PHYRADAR)
799 len += scnprintf(buf + len, sizeof(buf) - len, " PHYRADAR"); 726 seq_puts(file, " PHYRADAR");
800 if (rxfilter & ATH9K_RX_FILTER_MCAST_BCAST_ALL) 727 if (rxfilter & ATH9K_RX_FILTER_MCAST_BCAST_ALL)
801 len += scnprintf(buf + len, sizeof(buf) - len, " MCAST_BCAST_ALL"); 728 seq_puts(file, " MCAST_BCAST_ALL");
802 if (rxfilter & ATH9K_RX_FILTER_CONTROL_WRAPPER) 729 if (rxfilter & ATH9K_RX_FILTER_CONTROL_WRAPPER)
803 len += scnprintf(buf + len, sizeof(buf) - len, " CONTROL_WRAPPER"); 730 seq_puts(file, " CONTROL_WRAPPER");
804 731
805 len += scnprintf(buf + len, sizeof(buf) - len, "\n"); 732 seq_puts(file, "\n");
806 733
807 reg = sc->sc_ah->imask; 734 reg = sc->sc_ah->imask;
808 735
809 len += scnprintf(buf + len, sizeof(buf) - len, 736 seq_printf(file, "INTERRUPT-MASK: 0x%x", reg);
810 "INTERRUPT-MASK: 0x%x", reg);
811 737
812 if (reg & ATH9K_INT_SWBA) 738 if (reg & ATH9K_INT_SWBA)
813 len += scnprintf(buf + len, sizeof(buf) - len, " SWBA"); 739 seq_puts(file, " SWBA");
814 if (reg & ATH9K_INT_BMISS) 740 if (reg & ATH9K_INT_BMISS)
815 len += scnprintf(buf + len, sizeof(buf) - len, " BMISS"); 741 seq_puts(file, " BMISS");
816 if (reg & ATH9K_INT_CST) 742 if (reg & ATH9K_INT_CST)
817 len += scnprintf(buf + len, sizeof(buf) - len, " CST"); 743 seq_puts(file, " CST");
818 if (reg & ATH9K_INT_RX) 744 if (reg & ATH9K_INT_RX)
819 len += scnprintf(buf + len, sizeof(buf) - len, " RX"); 745 seq_puts(file, " RX");
820 if (reg & ATH9K_INT_RXHP) 746 if (reg & ATH9K_INT_RXHP)
821 len += scnprintf(buf + len, sizeof(buf) - len, " RXHP"); 747 seq_puts(file, " RXHP");
822 if (reg & ATH9K_INT_RXLP) 748 if (reg & ATH9K_INT_RXLP)
823 len += scnprintf(buf + len, sizeof(buf) - len, " RXLP"); 749 seq_puts(file, " RXLP");
824 if (reg & ATH9K_INT_BB_WATCHDOG) 750 if (reg & ATH9K_INT_BB_WATCHDOG)
825 len += scnprintf(buf + len, sizeof(buf) - len, " BB_WATCHDOG"); 751 seq_puts(file, " BB_WATCHDOG");
826 752
827 len += scnprintf(buf + len, sizeof(buf) - len, "\n"); 753 seq_puts(file, "\n");
828 754
829 i = 0; 755 i = 0;
830 ath_for_each_chanctx(sc, ctx) { 756 ath_for_each_chanctx(sc, ctx) {
@@ -832,27 +758,22 @@ static ssize_t read_file_misc(struct file *file, char __user *user_buf,
832 continue; 758 continue;
833 ath9k_calculate_iter_data(sc, ctx, &iter_data); 759 ath9k_calculate_iter_data(sc, ctx, &iter_data);
834 760
835 len += scnprintf(buf + len, sizeof(buf) - len, 761 seq_printf(file,
836 "VIFS: CTX %i(%i) AP: %i STA: %i MESH: %i WDS: %i", 762 "VIFS: CTX %i(%i) AP: %i STA: %i MESH: %i WDS: %i",
837 i++, (int)(ctx->assigned), iter_data.naps, 763 i++, (int)(ctx->assigned), iter_data.naps,
838 iter_data.nstations, 764 iter_data.nstations,
839 iter_data.nmeshes, iter_data.nwds); 765 iter_data.nmeshes, iter_data.nwds);
840 len += scnprintf(buf + len, sizeof(buf) - len, 766 seq_printf(file, " ADHOC: %i TOTAL: %hi BEACON-VIF: %hi\n",
841 " ADHOC: %i TOTAL: %hi BEACON-VIF: %hi\n", 767 iter_data.nadhocs, sc->cur_chan->nvifs,
842 iter_data.nadhocs, sc->cur_chan->nvifs, sc->nbcnvifs); 768 sc->nbcnvifs);
843 } 769 }
844 770
845 if (len > sizeof(buf)) 771 return 0;
846 len = sizeof(buf);
847
848 retval = simple_read_from_buffer(user_buf, count, ppos, buf, len);
849 return retval;
850} 772}
851 773
852static ssize_t read_file_reset(struct file *file, char __user *user_buf, 774static int read_file_reset(struct seq_file *file, void *data)
853 size_t count, loff_t *ppos)
854{ 775{
855 struct ath_softc *sc = file->private_data; 776 struct ath_softc *sc = file->private;
856 static const char * const reset_cause[__RESET_TYPE_MAX] = { 777 static const char * const reset_cause[__RESET_TYPE_MAX] = {
857 [RESET_TYPE_BB_HANG] = "Baseband Hang", 778 [RESET_TYPE_BB_HANG] = "Baseband Hang",
858 [RESET_TYPE_BB_WATCHDOG] = "Baseband Watchdog", 779 [RESET_TYPE_BB_WATCHDOG] = "Baseband Watchdog",
@@ -866,23 +787,17 @@ static ssize_t read_file_reset(struct file *file, char __user *user_buf,
866 [RESET_TYPE_MCI] = "MCI Reset", 787 [RESET_TYPE_MCI] = "MCI Reset",
867 [RESET_TYPE_CALIBRATION] = "Calibration error", 788 [RESET_TYPE_CALIBRATION] = "Calibration error",
868 }; 789 };
869 char buf[512];
870 unsigned int len = 0;
871 int i; 790 int i;
872 791
873 for (i = 0; i < ARRAY_SIZE(reset_cause); i++) { 792 for (i = 0; i < ARRAY_SIZE(reset_cause); i++) {
874 if (!reset_cause[i]) 793 if (!reset_cause[i])
875 continue; 794 continue;
876 795
877 len += scnprintf(buf + len, sizeof(buf) - len, 796 seq_printf(file, "%17s: %2d\n", reset_cause[i],
878 "%17s: %2d\n", reset_cause[i], 797 sc->debug.stats.reset[i]);
879 sc->debug.stats.reset[i]);
880 } 798 }
881 799
882 if (len > sizeof(buf)) 800 return 0;
883 len = sizeof(buf);
884
885 return simple_read_from_buffer(user_buf, count, ppos, buf, len);
886} 801}
887 802
888void ath_debug_stat_tx(struct ath_softc *sc, struct ath_buf *bf, 803void ath_debug_stat_tx(struct ath_softc *sc, struct ath_buf *bf,
@@ -922,32 +837,56 @@ void ath_debug_stat_tx(struct ath_softc *sc, struct ath_buf *bf,
922 TX_STAT_INC(qnum, delim_underrun); 837 TX_STAT_INC(qnum, delim_underrun);
923} 838}
924 839
840static int open_file_xmit(struct inode *inode, struct file *f)
841{
842 return single_open(f, read_file_xmit, inode->i_private);
843}
844
925static const struct file_operations fops_xmit = { 845static const struct file_operations fops_xmit = {
926 .read = read_file_xmit, 846 .read = seq_read,
927 .open = simple_open, 847 .open = open_file_xmit,
928 .owner = THIS_MODULE, 848 .owner = THIS_MODULE,
929 .llseek = default_llseek, 849 .llseek = seq_lseek,
850 .release = single_release,
930}; 851};
931 852
853static int open_file_queues(struct inode *inode, struct file *f)
854{
855 return single_open(f, read_file_queues, inode->i_private);
856}
857
932static const struct file_operations fops_queues = { 858static const struct file_operations fops_queues = {
933 .read = read_file_queues, 859 .read = seq_read,
934 .open = simple_open, 860 .open = open_file_queues,
935 .owner = THIS_MODULE, 861 .owner = THIS_MODULE,
936 .llseek = default_llseek, 862 .llseek = seq_lseek,
863 .release = single_release,
937}; 864};
938 865
866static int open_file_misc(struct inode *inode, struct file *f)
867{
868 return single_open(f, read_file_misc, inode->i_private);
869}
870
939static const struct file_operations fops_misc = { 871static const struct file_operations fops_misc = {
940 .read = read_file_misc, 872 .read = seq_read,
941 .open = simple_open, 873 .open = open_file_misc,
942 .owner = THIS_MODULE, 874 .owner = THIS_MODULE,
943 .llseek = default_llseek, 875 .llseek = seq_lseek,
876 .release = single_release,
944}; 877};
945 878
879static int open_file_reset(struct inode *inode, struct file *f)
880{
881 return single_open(f, read_file_reset, inode->i_private);
882}
883
946static const struct file_operations fops_reset = { 884static const struct file_operations fops_reset = {
947 .read = read_file_reset, 885 .read = seq_read,
948 .open = simple_open, 886 .open = open_file_reset,
949 .owner = THIS_MODULE, 887 .owner = THIS_MODULE,
950 .llseek = default_llseek, 888 .llseek = seq_lseek,
889 .release = single_release,
951}; 890};
952 891
953void ath_debug_stat_rx(struct ath_softc *sc, struct ath_rx_status *rs) 892void ath_debug_stat_rx(struct ath_softc *sc, struct ath_rx_status *rs)
@@ -956,7 +895,7 @@ void ath_debug_stat_rx(struct ath_softc *sc, struct ath_rx_status *rs)
956} 895}
957 896
958static ssize_t read_file_regidx(struct file *file, char __user *user_buf, 897static ssize_t read_file_regidx(struct file *file, char __user *user_buf,
959 size_t count, loff_t *ppos) 898 size_t count, loff_t *ppos)
960{ 899{
961 struct ath_softc *sc = file->private_data; 900 struct ath_softc *sc = file->private_data;
962 char buf[32]; 901 char buf[32];
@@ -967,7 +906,7 @@ static ssize_t read_file_regidx(struct file *file, char __user *user_buf,
967} 906}
968 907
969static ssize_t write_file_regidx(struct file *file, const char __user *user_buf, 908static ssize_t write_file_regidx(struct file *file, const char __user *user_buf,
970 size_t count, loff_t *ppos) 909 size_t count, loff_t *ppos)
971{ 910{
972 struct ath_softc *sc = file->private_data; 911 struct ath_softc *sc = file->private_data;
973 unsigned long regidx; 912 unsigned long regidx;
@@ -995,7 +934,7 @@ static const struct file_operations fops_regidx = {
995}; 934};
996 935
997static ssize_t read_file_regval(struct file *file, char __user *user_buf, 936static ssize_t read_file_regval(struct file *file, char __user *user_buf,
998 size_t count, loff_t *ppos) 937 size_t count, loff_t *ppos)
999{ 938{
1000 struct ath_softc *sc = file->private_data; 939 struct ath_softc *sc = file->private_data;
1001 struct ath_hw *ah = sc->sc_ah; 940 struct ath_hw *ah = sc->sc_ah;
@@ -1011,7 +950,7 @@ static ssize_t read_file_regval(struct file *file, char __user *user_buf,
1011} 950}
1012 951
1013static ssize_t write_file_regval(struct file *file, const char __user *user_buf, 952static ssize_t write_file_regval(struct file *file, const char __user *user_buf,
1014 size_t count, loff_t *ppos) 953 size_t count, loff_t *ppos)
1015{ 954{
1016 struct ath_softc *sc = file->private_data; 955 struct ath_softc *sc = file->private_data;
1017 struct ath_hw *ah = sc->sc_ah; 956 struct ath_hw *ah = sc->sc_ah;
@@ -1077,57 +1016,45 @@ static const struct file_operations fops_regdump = {
1077 .llseek = default_llseek,/* read accesses f_pos */ 1016 .llseek = default_llseek,/* read accesses f_pos */
1078}; 1017};
1079 1018
1080static ssize_t read_file_dump_nfcal(struct file *file, char __user *user_buf, 1019static int read_file_dump_nfcal(struct seq_file *file, void *data)
1081 size_t count, loff_t *ppos)
1082{ 1020{
1083 struct ath_softc *sc = file->private_data; 1021 struct ath_softc *sc = file->private;
1084 struct ath_hw *ah = sc->sc_ah; 1022 struct ath_hw *ah = sc->sc_ah;
1085 struct ath9k_nfcal_hist *h = sc->cur_chan->caldata.nfCalHist; 1023 struct ath9k_nfcal_hist *h = sc->cur_chan->caldata.nfCalHist;
1086 struct ath_common *common = ath9k_hw_common(ah); 1024 struct ath_common *common = ath9k_hw_common(ah);
1087 struct ieee80211_conf *conf = &common->hw->conf; 1025 struct ieee80211_conf *conf = &common->hw->conf;
1088 u32 len = 0, size = 1500;
1089 u32 i, j; 1026 u32 i, j;
1090 ssize_t retval = 0;
1091 char *buf;
1092 u8 chainmask = (ah->rxchainmask << 3) | ah->rxchainmask; 1027 u8 chainmask = (ah->rxchainmask << 3) | ah->rxchainmask;
1093 u8 nread; 1028 u8 nread;
1094 1029
1095 buf = kzalloc(size, GFP_KERNEL); 1030 seq_printf(file, "Channel Noise Floor : %d\n", ah->noise);
1096 if (!buf) 1031 seq_puts(file, "Chain | privNF | # Readings | NF Readings\n");
1097 return -ENOMEM;
1098
1099 len += scnprintf(buf + len, size - len,
1100 "Channel Noise Floor : %d\n", ah->noise);
1101 len += scnprintf(buf + len, size - len,
1102 "Chain | privNF | # Readings | NF Readings\n");
1103 for (i = 0; i < NUM_NF_READINGS; i++) { 1032 for (i = 0; i < NUM_NF_READINGS; i++) {
1104 if (!(chainmask & (1 << i)) || 1033 if (!(chainmask & (1 << i)) ||
1105 ((i >= AR5416_MAX_CHAINS) && !conf_is_ht40(conf))) 1034 ((i >= AR5416_MAX_CHAINS) && !conf_is_ht40(conf)))
1106 continue; 1035 continue;
1107 1036
1108 nread = AR_PHY_CCA_FILTERWINDOW_LENGTH - h[i].invalidNFcount; 1037 nread = AR_PHY_CCA_FILTERWINDOW_LENGTH - h[i].invalidNFcount;
1109 len += scnprintf(buf + len, size - len, " %d\t %d\t %d\t\t", 1038 seq_printf(file, " %d\t %d\t %d\t\t", i, h[i].privNF, nread);
1110 i, h[i].privNF, nread);
1111 for (j = 0; j < nread; j++) 1039 for (j = 0; j < nread; j++)
1112 len += scnprintf(buf + len, size - len, 1040 seq_printf(file, " %d", h[i].nfCalBuffer[j]);
1113 " %d", h[i].nfCalBuffer[j]); 1041 seq_puts(file, "\n");
1114 len += scnprintf(buf + len, size - len, "\n");
1115 } 1042 }
1116 1043
1117 if (len > size) 1044 return 0;
1118 len = size; 1045}
1119
1120 retval = simple_read_from_buffer(user_buf, count, ppos, buf, len);
1121 kfree(buf);
1122 1046
1123 return retval; 1047static int open_file_dump_nfcal(struct inode *inode, struct file *f)
1048{
1049 return single_open(f, read_file_dump_nfcal, inode->i_private);
1124} 1050}
1125 1051
1126static const struct file_operations fops_dump_nfcal = { 1052static const struct file_operations fops_dump_nfcal = {
1127 .read = read_file_dump_nfcal, 1053 .read = seq_read,
1128 .open = simple_open, 1054 .open = open_file_dump_nfcal,
1129 .owner = THIS_MODULE, 1055 .owner = THIS_MODULE,
1130 .llseek = default_llseek, 1056 .llseek = seq_lseek,
1057 .release = single_release,
1131}; 1058};
1132 1059
1133#ifdef CONFIG_ATH9K_BTCOEX_SUPPORT 1060#ifdef CONFIG_ATH9K_BTCOEX_SUPPORT
diff --git a/drivers/net/wireless/ath/ath9k/debug.h b/drivers/net/wireless/ath/ath9k/debug.h
index bd75b1f716db..a8e9319958e6 100644
--- a/drivers/net/wireless/ath/ath9k/debug.h
+++ b/drivers/net/wireless/ath/ath9k/debug.h
@@ -196,12 +196,11 @@ struct ath_tx_stats {
196#define TXSTATS sc->debug.stats.txstats 196#define TXSTATS sc->debug.stats.txstats
197#define PR(str, elem) \ 197#define PR(str, elem) \
198 do { \ 198 do { \
199 len += scnprintf(buf + len, size - len, \ 199 seq_printf(file, "%s%13u%11u%10u%10u\n", str, \
200 "%s%13u%11u%10u%10u\n", str, \ 200 TXSTATS[PR_QNUM(IEEE80211_AC_BE)].elem,\
201 TXSTATS[PR_QNUM(IEEE80211_AC_BE)].elem,\ 201 TXSTATS[PR_QNUM(IEEE80211_AC_BK)].elem,\
202 TXSTATS[PR_QNUM(IEEE80211_AC_BK)].elem,\ 202 TXSTATS[PR_QNUM(IEEE80211_AC_VI)].elem,\
203 TXSTATS[PR_QNUM(IEEE80211_AC_VI)].elem,\ 203 TXSTATS[PR_QNUM(IEEE80211_AC_VO)].elem); \
204 TXSTATS[PR_QNUM(IEEE80211_AC_VO)].elem); \
205 } while(0) 204 } while(0)
206 205
207struct ath_rx_rate_stats { 206struct ath_rx_rate_stats {
diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c
index 267c35d1f699..7dd8873f757e 100644
--- a/drivers/net/wireless/ath/wcn36xx/main.c
+++ b/drivers/net/wireless/ath/wcn36xx/main.c
@@ -1078,7 +1078,6 @@ static struct platform_driver wcn36xx_driver = {
1078 .remove = wcn36xx_remove, 1078 .remove = wcn36xx_remove,
1079 .driver = { 1079 .driver = {
1080 .name = "wcn36xx", 1080 .name = "wcn36xx",
1081 .owner = THIS_MODULE,
1082 }, 1081 },
1083 .id_table = wcn36xx_platform_id_table, 1082 .id_table = wcn36xx_platform_id_table,
1084}; 1083};
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
index f754ffcd0308..3c06e9365949 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
@@ -1221,7 +1221,6 @@ static struct platform_driver brcmf_sdio_pd = {
1221 .remove = brcmf_sdio_pd_remove, 1221 .remove = brcmf_sdio_pd_remove,
1222 .driver = { 1222 .driver = {
1223 .name = BRCMFMAC_SDIO_PDATA_NAME, 1223 .name = BRCMFMAC_SDIO_PDATA_NAME,
1224 .owner = THIS_MODULE,
1225 } 1224 }
1226}; 1225};
1227 1226
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index a71b9d5e353d..ef58a8862d91 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -395,7 +395,6 @@ static int hwsim_radio_idx;
395static struct platform_driver mac80211_hwsim_driver = { 395static struct platform_driver mac80211_hwsim_driver = {
396 .driver = { 396 .driver = {
397 .name = "mac80211_hwsim", 397 .name = "mac80211_hwsim",
398 .owner = THIS_MODULE,
399 }, 398 },
400}; 399};
401 400
diff --git a/drivers/net/wireless/rt2x00/rt2800soc.c b/drivers/net/wireless/rt2x00/rt2800soc.c
index f6d1bf5be006..aaa7aa4cad9d 100644
--- a/drivers/net/wireless/rt2x00/rt2800soc.c
+++ b/drivers/net/wireless/rt2x00/rt2800soc.c
@@ -244,7 +244,6 @@ static int rt2800soc_probe(struct platform_device *pdev)
244static struct platform_driver rt2800soc_driver = { 244static struct platform_driver rt2800soc_driver = {
245 .driver = { 245 .driver = {
246 .name = "rt2800_wmac", 246 .name = "rt2800_wmac",
247 .owner = THIS_MODULE,
248 .mod_name = KBUILD_MODNAME, 247 .mod_name = KBUILD_MODNAME,
249 }, 248 },
250 .probe = rt2800soc_probe, 249 .probe = rt2800soc_probe,
diff --git a/drivers/net/wireless/ti/wl12xx/main.c b/drivers/net/wireless/ti/wl12xx/main.c
index 0bccf123831e..d6d0d6d9c7a8 100644
--- a/drivers/net/wireless/ti/wl12xx/main.c
+++ b/drivers/net/wireless/ti/wl12xx/main.c
@@ -1900,7 +1900,6 @@ static struct platform_driver wl12xx_driver = {
1900 .id_table = wl12xx_id_table, 1900 .id_table = wl12xx_id_table,
1901 .driver = { 1901 .driver = {
1902 .name = "wl12xx_driver", 1902 .name = "wl12xx_driver",
1903 .owner = THIS_MODULE,
1904 } 1903 }
1905}; 1904};
1906 1905
diff --git a/drivers/net/wireless/ti/wl18xx/main.c b/drivers/net/wireless/ti/wl18xx/main.c
index 7af1936719eb..8e562610bf16 100644
--- a/drivers/net/wireless/ti/wl18xx/main.c
+++ b/drivers/net/wireless/ti/wl18xx/main.c
@@ -1968,7 +1968,6 @@ static struct platform_driver wl18xx_driver = {
1968 .id_table = wl18xx_id_table, 1968 .id_table = wl18xx_id_table,
1969 .driver = { 1969 .driver = {
1970 .name = "wl18xx_driver", 1970 .name = "wl18xx_driver",
1971 .owner = THIS_MODULE,
1972 } 1971 }
1973}; 1972};
1974 1973