commit f0a19ade9dc1c5707681bb0b7fb934e9a6f3dcd3 Author: Jiri Slaby Date: Sat Jul 21 11:52:28 2007 +0200 add opmode to softc diff --git a/ath.c b/ath.c index 8d7cf57..e6eb3ec 100644 --- a/ath.c +++ b/ath.c @@ -456,7 +456,7 @@ next: static u32 ath_calcrxfilter(struct ath_softc *sc) { struct ath_hw *ah = sc->ah; - unsigned int opmode = IEEE80211_IF_TYPE_STA; + unsigned int opmode = sc->opmode; u32 rfilt; rfilt = (ath5k_hw_get_rx_filter(ah) & AR5K_RX_FILTER_PHYERR) | @@ -542,7 +542,7 @@ static int ath_init(struct ath_softc *sc) mutex_lock(&sc->lock); -// DPRINTF(sc, ATH_DEBUG_RESET, "%s: mode %d\n", __func__, sc->opmode); + DPRINTF(sc, ATH_DEBUG_RESET, "%s: mode %d\n", __func__, sc->opmode); /* * Stop anything previously setup. This is safe @@ -558,7 +558,7 @@ static int ath_init(struct ath_softc *sc) * and then setup of the interrupt mask. */ sc->curchan = sc->hw->conf.chan; - ret = ath5k_hw_reset(sc->ah, IEEE80211_IF_TYPE_STA, sc->curchan, false); + ret = ath5k_hw_reset(sc->ah, sc->opmode, sc->curchan, false); if (ret) { printk(KERN_ERR "unable to reset hardware: %d\n", ret); goto done; @@ -866,7 +866,7 @@ static int ath_chan_set(struct ath_softc *sc, struct ieee80211_channel *chan) ath5k_hw_set_intr(ah, 0); /* disable interrupts */ ath_draintxq(sc); /* clear pending tx frames */ ath_stoprecv(sc); /* turn off frame recv */ - ret = ath5k_hw_reset(ah, IEEE80211_IF_TYPE_STA, chan, true); + ret = ath5k_hw_reset(ah, sc->opmode, chan, true); if (ret) { printk(KERN_ERR "%s: unable to reset channel %u " "(%u Mhz)\n", __func__, chan->chan, chan->freq); @@ -1022,7 +1022,7 @@ static int ath_reset(struct ieee80211_hw *hw) ath_draintxq(sc); ath_stoprecv(sc); - ret = ath5k_hw_reset(ah, IEEE80211_IF_TYPE_STA, sc->curchan, true); + ret = ath5k_hw_reset(ah, sc->opmode, sc->curchan, true); if (unlikely(ret)) { printk(KERN_ERR "ath: can't reset hardware (%d)\n", ret); goto err; @@ -1984,6 +1984,7 @@ static int __devinit ath_pci_probe(struct pci_dev *pdev, sc->invalid = 1; sc->iobase = mem; sc->cachelsz = csz * sizeof(u32); /* convert to bytes */ + sc->opmode = IEEE80211_IF_TYPE_STA; mutex_init(&sc->lock); spin_lock_init(&sc->rxbuflock); spin_lock_init(&sc->txbuflock); diff --git a/ath.h b/ath.h index 2baa4aa..c616a3e 100644 --- a/ath.h +++ b/ath.h @@ -129,10 +129,9 @@ struct ath_softc { struct ieee80211_hw_mode modes[NUM_IEEE80211_MODES]; struct ieee80211_channel channels[ATH_CHAN_MAX]; struct ieee80211_rate rates[AR5K_MAX_RATES * NUM_IEEE80211_MODES]; - struct ath_hw *ah; /* Atheros HW */ -#ifdef UNUSED enum ieee80211_if_types opmode; -#endif + struct ath_hw *ah; /* Atheros HW */ + int debug; struct ath_buf *bufptr; /* allocated buffer ptr */