Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 122809
b: refs/heads/master
c: ca8a856
h: refs/heads/master
i:
  122807: 16c54cf
v: v3
  • Loading branch information
Vasanthakumar Thiagarajan authored and John W. Linville committed Dec 19, 2008
1 parent 59e72a4 commit 4ec7662
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9bf9fca8dea70116016d32c2bf3f83170c8fba76
refs/heads/master: ca8a8560569c5eb954cb18c3a91087797ffa81a4
30 changes: 14 additions & 16 deletions trunk/drivers/net/wireless/ath9k/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1229,9 +1229,6 @@ static void ath_detach(struct ath_softc *sc)
ath_deinit_leds(sc);

ieee80211_unregister_hw(hw);

ath_rate_control_unregister();

ath_rx_cleanup(sc);
ath_tx_cleanup(sc);

Expand Down Expand Up @@ -1512,15 +1509,7 @@ static int ath_attach(u16 devid, struct ath_softc *sc)
hw->sta_data_size = sizeof(struct ath_node);
hw->vif_data_size = sizeof(struct ath_vap);

/* Register rate control */
hw->rate_control_algorithm = "ath9k_rate_control";
error = ath_rate_control_register();
if (error != 0) {
DPRINTF(sc, ATH_DBG_FATAL,
"Unable to register rate control algorithm: %d\n", error);
ath_rate_control_unregister();
goto bad;
}

if (sc->sc_ah->ah_caps.hw_caps & ATH9K_HW_CAP_HT) {
setup_ht_cap(&sc->sbands[IEEE80211_BAND_2GHZ].ht_cap);
Expand Down Expand Up @@ -1553,18 +1542,13 @@ static int ath_attach(u16 devid, struct ath_softc *sc)
#endif

error = ieee80211_register_hw(hw);
if (error != 0) {
ath_rate_control_unregister();
goto bad;
}

/* Initialize LED control */
ath_init_leds(sc);

return 0;
detach:
ath_detach(sc);
bad:
return error;
}

Expand Down Expand Up @@ -2714,11 +2698,24 @@ static struct pci_driver ath_pci_driver = {

static int __init init_ath_pci(void)
{
int error;

printk(KERN_INFO "%s: %s\n", dev_info, ATH_PCI_VERSION);

/* Register rate control algorithm */
error = ath_rate_control_register();
if (error != 0) {
printk(KERN_ERR
"Unable to register rate control algorithm: %d\n",
error);
ath_rate_control_unregister();
return error;
}

if (pci_register_driver(&ath_pci_driver) < 0) {
printk(KERN_ERR
"ath_pci: No devices found, driver not installed.\n");
ath_rate_control_unregister();
pci_unregister_driver(&ath_pci_driver);
return -ENODEV;
}
Expand All @@ -2729,6 +2726,7 @@ module_init(init_ath_pci);

static void __exit exit_ath_pci(void)
{
ath_rate_control_unregister();
pci_unregister_driver(&ath_pci_driver);
printk(KERN_INFO "%s: Driver unloaded\n", dev_info);
}
Expand Down

0 comments on commit 4ec7662

Please sign in to comment.