aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/ath/ath9k/ahb.c1
-rw-r--r--drivers/net/wireless/ath/ath9k/debug.c122
-rw-r--r--drivers/net/wireless/ath/ath9k/pci.c1
3 files changed, 24 insertions, 100 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ahb.c b/drivers/net/wireless/ath/ath9k/ahb.c
index e000c4c27881..750a13045458 100644
--- a/drivers/net/wireless/ath/ath9k/ahb.c
+++ b/drivers/net/wireless/ath/ath9k/ahb.c
@@ -126,6 +126,7 @@ static int ath_ahb_probe(struct platform_device *pdev)
126 sc = hw->priv; 126 sc = hw->priv;
127 sc->hw = hw; 127 sc->hw = hw;
128 sc->dev = &pdev->dev; 128 sc->dev = &pdev->dev;
129 dev_set_drvdata(sc->dev, sc);
129 sc->mem = mem; 130 sc->mem = mem;
130 sc->irq = irq; 131 sc->irq = irq;
131 132
diff --git a/drivers/net/wireless/ath/ath9k/debug.c b/drivers/net/wireless/ath/ath9k/debug.c
index e7b709f03b29..a1f1614a05c2 100644
--- a/drivers/net/wireless/ath/ath9k/debug.c
+++ b/drivers/net/wireless/ath/ath9k/debug.c
@@ -403,7 +403,7 @@ static const struct file_operations fops_antenna_diversity = {
403 403
404static int read_file_dma(struct seq_file *file, void *data) 404static int read_file_dma(struct seq_file *file, void *data)
405{ 405{
406 struct ath_softc *sc = file->private; 406 struct ath_softc *sc = dev_get_drvdata(file->private);
407 struct ath_hw *ah = sc->sc_ah; 407 struct ath_hw *ah = sc->sc_ah;
408 u32 val[ATH9K_NUM_DMA_DEBUG_REGS]; 408 u32 val[ATH9K_NUM_DMA_DEBUG_REGS];
409 int i, qcuOffset = 0, dcuOffset = 0; 409 int i, qcuOffset = 0, dcuOffset = 0;
@@ -470,20 +470,6 @@ static int read_file_dma(struct seq_file *file, void *data)
470 return 0; 470 return 0;
471} 471}
472 472
473static int open_file_dma(struct inode *inode, struct file *f)
474{
475 return single_open(f, read_file_dma, inode->i_private);
476}
477
478static const struct file_operations fops_dma = {
479 .open = open_file_dma,
480 .read = seq_read,
481 .owner = THIS_MODULE,
482 .llseek = seq_lseek,
483 .release = single_release,
484};
485
486
487void ath_debug_stat_interrupt(struct ath_softc *sc, enum ath9k_int status) 473void ath_debug_stat_interrupt(struct ath_softc *sc, enum ath9k_int status)
488{ 474{
489 if (status) 475 if (status)
@@ -539,7 +525,7 @@ void ath_debug_stat_interrupt(struct ath_softc *sc, enum ath9k_int status)
539 525
540static int read_file_interrupt(struct seq_file *file, void *data) 526static int read_file_interrupt(struct seq_file *file, void *data)
541{ 527{
542 struct ath_softc *sc = file->private; 528 struct ath_softc *sc = dev_get_drvdata(file->private);
543 529
544#define PR_IS(a, s) \ 530#define PR_IS(a, s) \
545 do { \ 531 do { \
@@ -600,22 +586,9 @@ static int read_file_interrupt(struct seq_file *file, void *data)
600 return 0; 586 return 0;
601} 587}
602 588
603static int open_file_interrupt(struct inode *inode, struct file *f)
604{
605 return single_open(f, read_file_interrupt, inode->i_private);
606}
607
608static const struct file_operations fops_interrupt = {
609 .read = seq_read,
610 .open = open_file_interrupt,
611 .owner = THIS_MODULE,
612 .llseek = seq_lseek,
613 .release = single_release,
614};
615
616static int read_file_xmit(struct seq_file *file, void *data) 589static int read_file_xmit(struct seq_file *file, void *data)
617{ 590{
618 struct ath_softc *sc = file->private; 591 struct ath_softc *sc = dev_get_drvdata(file->private);
619 592
620 seq_printf(file, "%30s %10s%10s%10s\n\n", "BE", "BK", "VI", "VO"); 593 seq_printf(file, "%30s %10s%10s%10s\n\n", "BE", "BK", "VI", "VO");
621 594
@@ -661,7 +634,7 @@ static void print_queue(struct ath_softc *sc, struct ath_txq *txq,
661 634
662static int read_file_queues(struct seq_file *file, void *data) 635static int read_file_queues(struct seq_file *file, void *data)
663{ 636{
664 struct ath_softc *sc = file->private; 637 struct ath_softc *sc = dev_get_drvdata(file->private);
665 struct ath_txq *txq; 638 struct ath_txq *txq;
666 int i; 639 int i;
667 static const char *qname[4] = { 640 static const char *qname[4] = {
@@ -682,7 +655,7 @@ static int read_file_queues(struct seq_file *file, void *data)
682 655
683static int read_file_misc(struct seq_file *file, void *data) 656static int read_file_misc(struct seq_file *file, void *data)
684{ 657{
685 struct ath_softc *sc = file->private; 658 struct ath_softc *sc = dev_get_drvdata(file->private);
686 struct ath_common *common = ath9k_hw_common(sc->sc_ah); 659 struct ath_common *common = ath9k_hw_common(sc->sc_ah);
687 struct ath9k_vif_iter_data iter_data; 660 struct ath9k_vif_iter_data iter_data;
688 struct ath_chanctx *ctx; 661 struct ath_chanctx *ctx;
@@ -772,7 +745,7 @@ static int read_file_misc(struct seq_file *file, void *data)
772 745
773static int read_file_reset(struct seq_file *file, void *data) 746static int read_file_reset(struct seq_file *file, void *data)
774{ 747{
775 struct ath_softc *sc = file->private; 748 struct ath_softc *sc = dev_get_drvdata(file->private);
776 749
777 seq_printf(file, "%17s: %2d\n", "Baseband Hang", 750 seq_printf(file, "%17s: %2d\n", "Baseband Hang",
778 sc->debug.stats.reset[RESET_TYPE_BB_HANG]); 751 sc->debug.stats.reset[RESET_TYPE_BB_HANG]);
@@ -833,58 +806,6 @@ void ath_debug_stat_tx(struct ath_softc *sc, struct ath_buf *bf,
833 TX_STAT_INC(qnum, delim_underrun); 806 TX_STAT_INC(qnum, delim_underrun);
834} 807}
835 808
836static int open_file_xmit(struct inode *inode, struct file *f)
837{
838 return single_open(f, read_file_xmit, inode->i_private);
839}
840
841static const struct file_operations fops_xmit = {
842 .read = seq_read,
843 .open = open_file_xmit,
844 .owner = THIS_MODULE,
845 .llseek = seq_lseek,
846 .release = single_release,
847};
848
849static int open_file_queues(struct inode *inode, struct file *f)
850{
851 return single_open(f, read_file_queues, inode->i_private);
852}
853
854static const struct file_operations fops_queues = {
855 .read = seq_read,
856 .open = open_file_queues,
857 .owner = THIS_MODULE,
858 .llseek = seq_lseek,
859 .release = single_release,
860};
861
862static int open_file_misc(struct inode *inode, struct file *f)
863{
864 return single_open(f, read_file_misc, inode->i_private);
865}
866
867static const struct file_operations fops_misc = {
868 .read = seq_read,
869 .open = open_file_misc,
870 .owner = THIS_MODULE,
871 .llseek = seq_lseek,
872 .release = single_release,
873};
874
875static int open_file_reset(struct inode *inode, struct file *f)
876{
877 return single_open(f, read_file_reset, inode->i_private);
878}
879
880static const struct file_operations fops_reset = {
881 .read = seq_read,
882 .open = open_file_reset,
883 .owner = THIS_MODULE,
884 .llseek = seq_lseek,
885 .release = single_release,
886};
887
888void ath_debug_stat_rx(struct ath_softc *sc, struct ath_rx_status *rs) 809void ath_debug_stat_rx(struct ath_softc *sc, struct ath_rx_status *rs)
889{ 810{
890 ath9k_cmn_debug_stat_rx(&sc->debug.stats.rxstats, rs); 811 ath9k_cmn_debug_stat_rx(&sc->debug.stats.rxstats, rs);
@@ -1014,7 +935,7 @@ static const struct file_operations fops_regdump = {
1014 935
1015static int read_file_dump_nfcal(struct seq_file *file, void *data) 936static int read_file_dump_nfcal(struct seq_file *file, void *data)
1016{ 937{
1017 struct ath_softc *sc = file->private; 938 struct ath_softc *sc = dev_get_drvdata(file->private);
1018 struct ath_hw *ah = sc->sc_ah; 939 struct ath_hw *ah = sc->sc_ah;
1019 struct ath9k_nfcal_hist *h = sc->cur_chan->caldata.nfCalHist; 940 struct ath9k_nfcal_hist *h = sc->cur_chan->caldata.nfCalHist;
1020 struct ath_common *common = ath9k_hw_common(ah); 941 struct ath_common *common = ath9k_hw_common(ah);
@@ -1256,14 +1177,14 @@ int ath9k_init_debug(struct ath_hw *ah)
1256 ath9k_tx99_init_debug(sc); 1177 ath9k_tx99_init_debug(sc);
1257 ath9k_spectral_init_debug(sc); 1178 ath9k_spectral_init_debug(sc);
1258 1179
1259 debugfs_create_file("dma", S_IRUSR, sc->debug.debugfs_phy, sc, 1180 debugfs_create_devm_seqfile(sc->dev, "dma", sc->debug.debugfs_phy,
1260 &fops_dma); 1181 read_file_dma);
1261 debugfs_create_file("interrupt", S_IRUSR, sc->debug.debugfs_phy, sc, 1182 debugfs_create_devm_seqfile(sc->dev, "interrupt", sc->debug.debugfs_phy,
1262 &fops_interrupt); 1183 read_file_interrupt);
1263 debugfs_create_file("xmit", S_IRUSR, sc->debug.debugfs_phy, sc, 1184 debugfs_create_devm_seqfile(sc->dev, "xmit", sc->debug.debugfs_phy,
1264 &fops_xmit); 1185 read_file_xmit);
1265 debugfs_create_file("queues", S_IRUSR, sc->debug.debugfs_phy, sc, 1186 debugfs_create_devm_seqfile(sc->dev, "queues", sc->debug.debugfs_phy,
1266 &fops_queues); 1187 read_file_queues);
1267 debugfs_create_u32("qlen_bk", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy, 1188 debugfs_create_u32("qlen_bk", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy,
1268 &sc->tx.txq_max_pending[IEEE80211_AC_BK]); 1189 &sc->tx.txq_max_pending[IEEE80211_AC_BK]);
1269 debugfs_create_u32("qlen_be", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy, 1190 debugfs_create_u32("qlen_be", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy,
@@ -1272,10 +1193,10 @@ int ath9k_init_debug(struct ath_hw *ah)
1272 &sc->tx.txq_max_pending[IEEE80211_AC_VI]); 1193 &sc->tx.txq_max_pending[IEEE80211_AC_VI]);
1273 debugfs_create_u32("qlen_vo", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy, 1194 debugfs_create_u32("qlen_vo", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy,
1274 &sc->tx.txq_max_pending[IEEE80211_AC_VO]); 1195 &sc->tx.txq_max_pending[IEEE80211_AC_VO]);
1275 debugfs_create_file("misc", S_IRUSR, sc->debug.debugfs_phy, sc, 1196 debugfs_create_devm_seqfile(sc->dev, "misc", sc->debug.debugfs_phy,
1276 &fops_misc); 1197 read_file_misc);
1277 debugfs_create_file("reset", S_IRUSR, sc->debug.debugfs_phy, sc, 1198 debugfs_create_devm_seqfile(sc->dev, "reset", sc->debug.debugfs_phy,
1278 &fops_reset); 1199 read_file_reset);
1279 1200
1280 ath9k_cmn_debug_recv(sc->debug.debugfs_phy, &sc->debug.stats.rxstats); 1201 ath9k_cmn_debug_recv(sc->debug.debugfs_phy, &sc->debug.stats.rxstats);
1281 ath9k_cmn_debug_phy_err(sc->debug.debugfs_phy, &sc->debug.stats.rxstats); 1202 ath9k_cmn_debug_phy_err(sc->debug.debugfs_phy, &sc->debug.stats.rxstats);
@@ -1297,8 +1218,9 @@ int ath9k_init_debug(struct ath_hw *ah)
1297 &ah->config.cwm_ignore_extcca); 1218 &ah->config.cwm_ignore_extcca);
1298 debugfs_create_file("regdump", S_IRUSR, sc->debug.debugfs_phy, sc, 1219 debugfs_create_file("regdump", S_IRUSR, sc->debug.debugfs_phy, sc,
1299 &fops_regdump); 1220 &fops_regdump);
1300 debugfs_create_file("dump_nfcal", S_IRUSR, sc->debug.debugfs_phy, sc, 1221 debugfs_create_devm_seqfile(sc->dev, "dump_nfcal",
1301 &fops_dump_nfcal); 1222 sc->debug.debugfs_phy,
1223 read_file_dump_nfcal);
1302 1224
1303 ath9k_cmn_debug_base_eeprom(sc->debug.debugfs_phy, sc->sc_ah); 1225 ath9k_cmn_debug_base_eeprom(sc->debug.debugfs_phy, sc->sc_ah);
1304 ath9k_cmn_debug_modal_eeprom(sc->debug.debugfs_phy, sc->sc_ah); 1226 ath9k_cmn_debug_modal_eeprom(sc->debug.debugfs_phy, sc->sc_ah);
diff --git a/drivers/net/wireless/ath/ath9k/pci.c b/drivers/net/wireless/ath/ath9k/pci.c
index c018dea0b2e8..90c9e3cbf958 100644
--- a/drivers/net/wireless/ath/ath9k/pci.c
+++ b/drivers/net/wireless/ath/ath9k/pci.c
@@ -856,6 +856,7 @@ static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
856 sc = hw->priv; 856 sc = hw->priv;
857 sc->hw = hw; 857 sc->hw = hw;
858 sc->dev = &pdev->dev; 858 sc->dev = &pdev->dev;
859 dev_set_drvdata(sc->dev, sc);
859 sc->mem = pcim_iomap_table(pdev)[0]; 860 sc->mem = pcim_iomap_table(pdev)[0];
860 sc->driver_data = id->driver_data; 861 sc->driver_data = id->driver_data;
861 862