|
@@ -1538,6 +1538,7 @@ bad2:
|
|
bad:
|
|
bad:
|
|
if (ah)
|
|
if (ah)
|
|
ath9k_hw_detach(ah);
|
|
ath9k_hw_detach(ah);
|
|
|
|
+ ath9k_exit_debug(sc);
|
|
|
|
|
|
return error;
|
|
return error;
|
|
}
|
|
}
|
|
@@ -1545,7 +1546,7 @@ bad:
|
|
static int ath_attach(u16 devid, struct ath_softc *sc)
|
|
static int ath_attach(u16 devid, struct ath_softc *sc)
|
|
{
|
|
{
|
|
struct ieee80211_hw *hw = sc->hw;
|
|
struct ieee80211_hw *hw = sc->hw;
|
|
- int error = 0;
|
|
|
|
|
|
+ int error = 0, i;
|
|
|
|
|
|
DPRINTF(sc, ATH_DBG_CONFIG, "Attach ATH hw\n");
|
|
DPRINTF(sc, ATH_DBG_CONFIG, "Attach ATH hw\n");
|
|
|
|
|
|
@@ -1589,11 +1590,11 @@ static int ath_attach(u16 devid, struct ath_softc *sc)
|
|
/* initialize tx/rx engine */
|
|
/* initialize tx/rx engine */
|
|
error = ath_tx_init(sc, ATH_TXBUF);
|
|
error = ath_tx_init(sc, ATH_TXBUF);
|
|
if (error != 0)
|
|
if (error != 0)
|
|
- goto detach;
|
|
|
|
|
|
+ goto error_attach;
|
|
|
|
|
|
error = ath_rx_init(sc, ATH_RXBUF);
|
|
error = ath_rx_init(sc, ATH_RXBUF);
|
|
if (error != 0)
|
|
if (error != 0)
|
|
- goto detach;
|
|
|
|
|
|
+ goto error_attach;
|
|
|
|
|
|
#if defined(CONFIG_RFKILL) || defined(CONFIG_RFKILL_MODULE)
|
|
#if defined(CONFIG_RFKILL) || defined(CONFIG_RFKILL_MODULE)
|
|
/* Initialze h/w Rfkill */
|
|
/* Initialze h/w Rfkill */
|
|
@@ -1601,8 +1602,9 @@ static int ath_attach(u16 devid, struct ath_softc *sc)
|
|
INIT_DELAYED_WORK(&sc->rf_kill.rfkill_poll, ath_rfkill_poll);
|
|
INIT_DELAYED_WORK(&sc->rf_kill.rfkill_poll, ath_rfkill_poll);
|
|
|
|
|
|
/* Initialize s/w rfkill */
|
|
/* Initialize s/w rfkill */
|
|
- if (ath_init_sw_rfkill(sc))
|
|
|
|
- goto detach;
|
|
|
|
|
|
+ error = ath_init_sw_rfkill(sc);
|
|
|
|
+ if (error)
|
|
|
|
+ goto error_attach;
|
|
#endif
|
|
#endif
|
|
|
|
|
|
error = ieee80211_register_hw(hw);
|
|
error = ieee80211_register_hw(hw);
|
|
@@ -1611,8 +1613,16 @@ static int ath_attach(u16 devid, struct ath_softc *sc)
|
|
ath_init_leds(sc);
|
|
ath_init_leds(sc);
|
|
|
|
|
|
return 0;
|
|
return 0;
|
|
-detach:
|
|
|
|
- ath_detach(sc);
|
|
|
|
|
|
+
|
|
|
|
+error_attach:
|
|
|
|
+ /* cleanup tx queues */
|
|
|
|
+ for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++)
|
|
|
|
+ if (ATH_TXQ_SETUP(sc, i))
|
|
|
|
+ ath_tx_cleanupq(sc, &sc->tx.txq[i]);
|
|
|
|
+
|
|
|
|
+ ath9k_hw_detach(sc->sc_ah);
|
|
|
|
+ ath9k_exit_debug(sc);
|
|
|
|
+
|
|
return error;
|
|
return error;
|
|
}
|
|
}
|
|
|
|
|