aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorBen Greear <greearb@candelatech.com>2010-11-29 17:13:22 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-12-02 15:16:41 -0500
commiteb272441fc14ad126abfa46de8a9c58bda8added (patch)
treef515a84a67da57721bd8672c730182ad05c49511 /drivers/net/wireless
parent8cbe6e66889d2e4dbea37b2fc6f276bd69d1ef67 (diff)
ath9k: Move debugfs under ieee80211/[phyname]/ath9k/
This fixes debugfs problems when a phy is renamed, and is able to remove a bit of code that is no longer needed. Signed-off-by: Ben Greear <greearb@candelatech.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/ath/ath9k/debug.c35
-rw-r--r--drivers/net/wireless/ath/ath9k/debug.h16
-rw-r--r--drivers/net/wireless/ath/ath9k/init.c30
3 files changed, 12 insertions, 69 deletions
diff --git a/drivers/net/wireless/ath/ath9k/debug.c b/drivers/net/wireless/ath/ath9k/debug.c
index 0c3c74c157fb..3586c43077a7 100644
--- a/drivers/net/wireless/ath/ath9k/debug.c
+++ b/drivers/net/wireless/ath/ath9k/debug.c
@@ -24,8 +24,6 @@
24#define REG_READ_D(_ah, _reg) \ 24#define REG_READ_D(_ah, _reg) \
25 ath9k_hw_common(_ah)->ops->read((_ah), (_reg)) 25 ath9k_hw_common(_ah)->ops->read((_ah), (_reg))
26 26
27static struct dentry *ath9k_debugfs_root;
28
29static int ath9k_debugfs_open(struct inode *inode, struct file *file) 27static int ath9k_debugfs_open(struct inode *inode, struct file *file)
30{ 28{
31 file->private_data = inode->i_private; 29 file->private_data = inode->i_private;
@@ -878,11 +876,8 @@ int ath9k_init_debug(struct ath_hw *ah)
878 struct ath_common *common = ath9k_hw_common(ah); 876 struct ath_common *common = ath9k_hw_common(ah);
879 struct ath_softc *sc = (struct ath_softc *) common->priv; 877 struct ath_softc *sc = (struct ath_softc *) common->priv;
880 878
881 if (!ath9k_debugfs_root) 879 sc->debug.debugfs_phy = debugfs_create_dir("ath9k",
882 return -ENOENT; 880 sc->hw->wiphy->debugfsdir);
883
884 sc->debug.debugfs_phy = debugfs_create_dir(wiphy_name(sc->hw->wiphy),
885 ath9k_debugfs_root);
886 if (!sc->debug.debugfs_phy) 881 if (!sc->debug.debugfs_phy)
887 return -ENOMEM; 882 return -ENOMEM;
888 883
@@ -935,29 +930,7 @@ int ath9k_init_debug(struct ath_hw *ah)
935 sc->debug.regidx = 0; 930 sc->debug.regidx = 0;
936 return 0; 931 return 0;
937err: 932err:
938 ath9k_exit_debug(ah);
939 return -ENOMEM;
940}
941
942void ath9k_exit_debug(struct ath_hw *ah)
943{
944 struct ath_common *common = ath9k_hw_common(ah);
945 struct ath_softc *sc = (struct ath_softc *) common->priv;
946
947 debugfs_remove_recursive(sc->debug.debugfs_phy); 933 debugfs_remove_recursive(sc->debug.debugfs_phy);
948} 934 sc->debug.debugfs_phy = NULL;
949 935 return -ENOMEM;
950int ath9k_debug_create_root(void)
951{
952 ath9k_debugfs_root = debugfs_create_dir(KBUILD_MODNAME, NULL);
953 if (!ath9k_debugfs_root)
954 return -ENOENT;
955
956 return 0;
957}
958
959void ath9k_debug_remove_root(void)
960{
961 debugfs_remove(ath9k_debugfs_root);
962 ath9k_debugfs_root = NULL;
963} 936}
diff --git a/drivers/net/wireless/ath/ath9k/debug.h b/drivers/net/wireless/ath/ath9k/debug.h
index 646ff7e04c88..1e5078bd0344 100644
--- a/drivers/net/wireless/ath/ath9k/debug.h
+++ b/drivers/net/wireless/ath/ath9k/debug.h
@@ -164,10 +164,7 @@ struct ath9k_debug {
164}; 164};
165 165
166int ath9k_init_debug(struct ath_hw *ah); 166int ath9k_init_debug(struct ath_hw *ah);
167void ath9k_exit_debug(struct ath_hw *ah);
168 167
169int ath9k_debug_create_root(void);
170void ath9k_debug_remove_root(void);
171void ath_debug_stat_interrupt(struct ath_softc *sc, enum ath9k_int status); 168void ath_debug_stat_interrupt(struct ath_softc *sc, enum ath9k_int status);
172void ath_debug_stat_tx(struct ath_softc *sc, struct ath_buf *bf, 169void ath_debug_stat_tx(struct ath_softc *sc, struct ath_buf *bf,
173 struct ath_tx_status *ts); 170 struct ath_tx_status *ts);
@@ -180,19 +177,6 @@ static inline int ath9k_init_debug(struct ath_hw *ah)
180 return 0; 177 return 0;
181} 178}
182 179
183static inline void ath9k_exit_debug(struct ath_hw *ah)
184{
185}
186
187static inline int ath9k_debug_create_root(void)
188{
189 return 0;
190}
191
192static inline void ath9k_debug_remove_root(void)
193{
194}
195
196static inline void ath_debug_stat_interrupt(struct ath_softc *sc, 180static inline void ath_debug_stat_interrupt(struct ath_softc *sc,
197 enum ath9k_int status) 181 enum ath9k_int status)
198{ 182{
diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c
index d11e6da4d892..ef39a4551bd5 100644
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -570,13 +570,6 @@ static int ath9k_init_softc(u16 devid, struct ath_softc *sc, u16 subsysid,
570 if (ret) 570 if (ret)
571 goto err_hw; 571 goto err_hw;
572 572
573 ret = ath9k_init_debug(ah);
574 if (ret) {
575 ath_print(common, ATH_DBG_FATAL,
576 "Unable to create debugfs files\n");
577 goto err_debug;
578 }
579
580 ret = ath9k_init_queues(sc); 573 ret = ath9k_init_queues(sc);
581 if (ret) 574 if (ret)
582 goto err_queues; 575 goto err_queues;
@@ -599,8 +592,6 @@ err_btcoex:
599 if (ATH_TXQ_SETUP(sc, i)) 592 if (ATH_TXQ_SETUP(sc, i))
600 ath_tx_cleanupq(sc, &sc->tx.txq[i]); 593 ath_tx_cleanupq(sc, &sc->tx.txq[i]);
601err_queues: 594err_queues:
602 ath9k_exit_debug(ah);
603err_debug:
604 ath9k_hw_deinit(ah); 595 ath9k_hw_deinit(ah);
605err_hw: 596err_hw:
606 tasklet_kill(&sc->intr_tq); 597 tasklet_kill(&sc->intr_tq);
@@ -744,6 +735,13 @@ int ath9k_init_device(u16 devid, struct ath_softc *sc, u16 subsysid,
744 if (error) 735 if (error)
745 goto error_register; 736 goto error_register;
746 737
738 error = ath9k_init_debug(ah);
739 if (error) {
740 ath_print(common, ATH_DBG_FATAL,
741 "Unable to create debugfs files\n");
742 goto error_world;
743 }
744
747 /* Handle world regulatory */ 745 /* Handle world regulatory */
748 if (!ath_is_world_regd(reg)) { 746 if (!ath_is_world_regd(reg)) {
749 error = regulatory_hint(hw->wiphy, reg->alpha2); 747 error = regulatory_hint(hw->wiphy, reg->alpha2);
@@ -802,7 +800,6 @@ static void ath9k_deinit_softc(struct ath_softc *sc)
802 if (ATH_TXQ_SETUP(sc, i)) 800 if (ATH_TXQ_SETUP(sc, i))
803 ath_tx_cleanupq(sc, &sc->tx.txq[i]); 801 ath_tx_cleanupq(sc, &sc->tx.txq[i]);
804 802
805 ath9k_exit_debug(sc->sc_ah);
806 ath9k_hw_deinit(sc->sc_ah); 803 ath9k_hw_deinit(sc->sc_ah);
807 804
808 tasklet_kill(&sc->intr_tq); 805 tasklet_kill(&sc->intr_tq);
@@ -869,20 +866,12 @@ static int __init ath9k_init(void)
869 goto err_out; 866 goto err_out;
870 } 867 }
871 868
872 error = ath9k_debug_create_root();
873 if (error) {
874 printk(KERN_ERR
875 "ath9k: Unable to create debugfs root: %d\n",
876 error);
877 goto err_rate_unregister;
878 }
879
880 error = ath_pci_init(); 869 error = ath_pci_init();
881 if (error < 0) { 870 if (error < 0) {
882 printk(KERN_ERR 871 printk(KERN_ERR
883 "ath9k: No PCI devices found, driver not installed.\n"); 872 "ath9k: No PCI devices found, driver not installed.\n");
884 error = -ENODEV; 873 error = -ENODEV;
885 goto err_remove_root; 874 goto err_rate_unregister;
886 } 875 }
887 876
888 error = ath_ahb_init(); 877 error = ath_ahb_init();
@@ -896,8 +885,6 @@ static int __init ath9k_init(void)
896 err_pci_exit: 885 err_pci_exit:
897 ath_pci_exit(); 886 ath_pci_exit();
898 887
899 err_remove_root:
900 ath9k_debug_remove_root();
901 err_rate_unregister: 888 err_rate_unregister:
902 ath_rate_control_unregister(); 889 ath_rate_control_unregister();
903 err_out: 890 err_out:
@@ -909,7 +896,6 @@ static void __exit ath9k_exit(void)
909{ 896{
910 ath_ahb_exit(); 897 ath_ahb_exit();
911 ath_pci_exit(); 898 ath_pci_exit();
912 ath9k_debug_remove_root();
913 ath_rate_control_unregister(); 899 ath_rate_control_unregister();
914 printk(KERN_INFO "%s: Driver unloaded\n", dev_info); 900 printk(KERN_INFO "%s: Driver unloaded\n", dev_info);
915} 901}