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>
This commit is contained in:
committed by
John W. Linville
parent
8cbe6e6688
commit
eb272441fc
@@ -24,8 +24,6 @@
|
|||||||
#define REG_READ_D(_ah, _reg) \
|
#define REG_READ_D(_ah, _reg) \
|
||||||
ath9k_hw_common(_ah)->ops->read((_ah), (_reg))
|
ath9k_hw_common(_ah)->ops->read((_ah), (_reg))
|
||||||
|
|
||||||
static struct dentry *ath9k_debugfs_root;
|
|
||||||
|
|
||||||
static int ath9k_debugfs_open(struct inode *inode, struct file *file)
|
static int ath9k_debugfs_open(struct inode *inode, struct file *file)
|
||||||
{
|
{
|
||||||
file->private_data = inode->i_private;
|
file->private_data = inode->i_private;
|
||||||
@@ -878,11 +876,8 @@ int ath9k_init_debug(struct ath_hw *ah)
|
|||||||
struct ath_common *common = ath9k_hw_common(ah);
|
struct ath_common *common = ath9k_hw_common(ah);
|
||||||
struct ath_softc *sc = (struct ath_softc *) common->priv;
|
struct ath_softc *sc = (struct ath_softc *) common->priv;
|
||||||
|
|
||||||
if (!ath9k_debugfs_root)
|
sc->debug.debugfs_phy = debugfs_create_dir("ath9k",
|
||||||
return -ENOENT;
|
sc->hw->wiphy->debugfsdir);
|
||||||
|
|
||||||
sc->debug.debugfs_phy = debugfs_create_dir(wiphy_name(sc->hw->wiphy),
|
|
||||||
ath9k_debugfs_root);
|
|
||||||
if (!sc->debug.debugfs_phy)
|
if (!sc->debug.debugfs_phy)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
@@ -935,29 +930,7 @@ int ath9k_init_debug(struct ath_hw *ah)
|
|||||||
sc->debug.regidx = 0;
|
sc->debug.regidx = 0;
|
||||||
return 0;
|
return 0;
|
||||||
err:
|
err:
|
||||||
ath9k_exit_debug(ah);
|
debugfs_remove_recursive(sc->debug.debugfs_phy);
|
||||||
|
sc->debug.debugfs_phy = NULL;
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ath9k_exit_debug(struct ath_hw *ah)
|
|
||||||
{
|
|
||||||
struct ath_common *common = ath9k_hw_common(ah);
|
|
||||||
struct ath_softc *sc = (struct ath_softc *) common->priv;
|
|
||||||
|
|
||||||
debugfs_remove_recursive(sc->debug.debugfs_phy);
|
|
||||||
}
|
|
||||||
|
|
||||||
int ath9k_debug_create_root(void)
|
|
||||||
{
|
|
||||||
ath9k_debugfs_root = debugfs_create_dir(KBUILD_MODNAME, NULL);
|
|
||||||
if (!ath9k_debugfs_root)
|
|
||||||
return -ENOENT;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ath9k_debug_remove_root(void)
|
|
||||||
{
|
|
||||||
debugfs_remove(ath9k_debugfs_root);
|
|
||||||
ath9k_debugfs_root = NULL;
|
|
||||||
}
|
|
||||||
|
@@ -164,10 +164,7 @@ struct ath9k_debug {
|
|||||||
};
|
};
|
||||||
|
|
||||||
int ath9k_init_debug(struct ath_hw *ah);
|
int ath9k_init_debug(struct ath_hw *ah);
|
||||||
void ath9k_exit_debug(struct ath_hw *ah);
|
|
||||||
|
|
||||||
int ath9k_debug_create_root(void);
|
|
||||||
void ath9k_debug_remove_root(void);
|
|
||||||
void ath_debug_stat_interrupt(struct ath_softc *sc, enum ath9k_int status);
|
void ath_debug_stat_interrupt(struct ath_softc *sc, enum ath9k_int status);
|
||||||
void ath_debug_stat_tx(struct ath_softc *sc, struct ath_buf *bf,
|
void ath_debug_stat_tx(struct ath_softc *sc, struct ath_buf *bf,
|
||||||
struct ath_tx_status *ts);
|
struct ath_tx_status *ts);
|
||||||
@@ -180,19 +177,6 @@ static inline int ath9k_init_debug(struct ath_hw *ah)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void ath9k_exit_debug(struct ath_hw *ah)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline int ath9k_debug_create_root(void)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void ath9k_debug_remove_root(void)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void ath_debug_stat_interrupt(struct ath_softc *sc,
|
static inline void ath_debug_stat_interrupt(struct ath_softc *sc,
|
||||||
enum ath9k_int status)
|
enum ath9k_int status)
|
||||||
{
|
{
|
||||||
|
@@ -570,13 +570,6 @@ static int ath9k_init_softc(u16 devid, struct ath_softc *sc, u16 subsysid,
|
|||||||
if (ret)
|
if (ret)
|
||||||
goto err_hw;
|
goto err_hw;
|
||||||
|
|
||||||
ret = ath9k_init_debug(ah);
|
|
||||||
if (ret) {
|
|
||||||
ath_print(common, ATH_DBG_FATAL,
|
|
||||||
"Unable to create debugfs files\n");
|
|
||||||
goto err_debug;
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = ath9k_init_queues(sc);
|
ret = ath9k_init_queues(sc);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto err_queues;
|
goto err_queues;
|
||||||
@@ -599,8 +592,6 @@ err_btcoex:
|
|||||||
if (ATH_TXQ_SETUP(sc, i))
|
if (ATH_TXQ_SETUP(sc, i))
|
||||||
ath_tx_cleanupq(sc, &sc->tx.txq[i]);
|
ath_tx_cleanupq(sc, &sc->tx.txq[i]);
|
||||||
err_queues:
|
err_queues:
|
||||||
ath9k_exit_debug(ah);
|
|
||||||
err_debug:
|
|
||||||
ath9k_hw_deinit(ah);
|
ath9k_hw_deinit(ah);
|
||||||
err_hw:
|
err_hw:
|
||||||
tasklet_kill(&sc->intr_tq);
|
tasklet_kill(&sc->intr_tq);
|
||||||
@@ -744,6 +735,13 @@ int ath9k_init_device(u16 devid, struct ath_softc *sc, u16 subsysid,
|
|||||||
if (error)
|
if (error)
|
||||||
goto error_register;
|
goto error_register;
|
||||||
|
|
||||||
|
error = ath9k_init_debug(ah);
|
||||||
|
if (error) {
|
||||||
|
ath_print(common, ATH_DBG_FATAL,
|
||||||
|
"Unable to create debugfs files\n");
|
||||||
|
goto error_world;
|
||||||
|
}
|
||||||
|
|
||||||
/* Handle world regulatory */
|
/* Handle world regulatory */
|
||||||
if (!ath_is_world_regd(reg)) {
|
if (!ath_is_world_regd(reg)) {
|
||||||
error = regulatory_hint(hw->wiphy, reg->alpha2);
|
error = regulatory_hint(hw->wiphy, reg->alpha2);
|
||||||
@@ -802,7 +800,6 @@ static void ath9k_deinit_softc(struct ath_softc *sc)
|
|||||||
if (ATH_TXQ_SETUP(sc, i))
|
if (ATH_TXQ_SETUP(sc, i))
|
||||||
ath_tx_cleanupq(sc, &sc->tx.txq[i]);
|
ath_tx_cleanupq(sc, &sc->tx.txq[i]);
|
||||||
|
|
||||||
ath9k_exit_debug(sc->sc_ah);
|
|
||||||
ath9k_hw_deinit(sc->sc_ah);
|
ath9k_hw_deinit(sc->sc_ah);
|
||||||
|
|
||||||
tasklet_kill(&sc->intr_tq);
|
tasklet_kill(&sc->intr_tq);
|
||||||
@@ -869,20 +866,12 @@ static int __init ath9k_init(void)
|
|||||||
goto err_out;
|
goto err_out;
|
||||||
}
|
}
|
||||||
|
|
||||||
error = ath9k_debug_create_root();
|
|
||||||
if (error) {
|
|
||||||
printk(KERN_ERR
|
|
||||||
"ath9k: Unable to create debugfs root: %d\n",
|
|
||||||
error);
|
|
||||||
goto err_rate_unregister;
|
|
||||||
}
|
|
||||||
|
|
||||||
error = ath_pci_init();
|
error = ath_pci_init();
|
||||||
if (error < 0) {
|
if (error < 0) {
|
||||||
printk(KERN_ERR
|
printk(KERN_ERR
|
||||||
"ath9k: No PCI devices found, driver not installed.\n");
|
"ath9k: No PCI devices found, driver not installed.\n");
|
||||||
error = -ENODEV;
|
error = -ENODEV;
|
||||||
goto err_remove_root;
|
goto err_rate_unregister;
|
||||||
}
|
}
|
||||||
|
|
||||||
error = ath_ahb_init();
|
error = ath_ahb_init();
|
||||||
@@ -896,8 +885,6 @@ static int __init ath9k_init(void)
|
|||||||
err_pci_exit:
|
err_pci_exit:
|
||||||
ath_pci_exit();
|
ath_pci_exit();
|
||||||
|
|
||||||
err_remove_root:
|
|
||||||
ath9k_debug_remove_root();
|
|
||||||
err_rate_unregister:
|
err_rate_unregister:
|
||||||
ath_rate_control_unregister();
|
ath_rate_control_unregister();
|
||||||
err_out:
|
err_out:
|
||||||
@@ -909,7 +896,6 @@ static void __exit ath9k_exit(void)
|
|||||||
{
|
{
|
||||||
ath_ahb_exit();
|
ath_ahb_exit();
|
||||||
ath_pci_exit();
|
ath_pci_exit();
|
||||||
ath9k_debug_remove_root();
|
|
||||||
ath_rate_control_unregister();
|
ath_rate_control_unregister();
|
||||||
printk(KERN_INFO "%s: Driver unloaded\n", dev_info);
|
printk(KERN_INFO "%s: Driver unloaded\n", dev_info);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user