* [PATCH] ath9k: Enable MIB and TIM interrupts for station mode.
@ 2009-01-28 9:35 Vivek Natarajan
2009-01-28 14:54 ` Luis R. Rodriguez
0 siblings, 1 reply; 2+ messages in thread
From: Vivek Natarajan @ 2009-01-28 9:35 UTC (permalink / raw)
To: linville; +Cc: linux-wireless
Enable operating mode specific interrupts in ath9k_add_interface instead
of ath9k_start.
Signed-off-by: Vivek Natarajan <vnatarajan@atheros.com>
---
drivers/net/wireless/ath9k/main.c | 40 +++++++++++++++++++-----------------
1 files changed, 21 insertions(+), 19 deletions(-)
diff --git a/drivers/net/wireless/ath9k/main.c b/drivers/net/wireless/ath9k/main.c
index d8e8266..8b149ef 100644
--- a/drivers/net/wireless/ath9k/main.c
+++ b/drivers/net/wireless/ath9k/main.c
@@ -1957,25 +1957,6 @@ static int ath9k_start(struct ieee80211_hw *hw)
if (sc->sc_ah->ah_caps.hw_caps & ATH9K_HW_CAP_HT)
sc->sc_imask |= ATH9K_INT_CST;
- /*
- * Enable MIB interrupts when there are hardware phy counters.
- * Note we only do this (at the moment) for station mode.
- */
- if (ath9k_hw_phycounters(sc->sc_ah) &&
- ((sc->sc_ah->ah_opmode == NL80211_IFTYPE_STATION) ||
- (sc->sc_ah->ah_opmode == NL80211_IFTYPE_ADHOC)))
- sc->sc_imask |= ATH9K_INT_MIB;
- /*
- * Some hardware processes the TIM IE and fires an
- * interrupt when the TIM bit is set. For hardware
- * that does, if not overridden by configuration,
- * enable the TIM interrupt when operating as station.
- */
- if ((sc->sc_ah->ah_caps.hw_caps & ATH9K_HW_CAP_ENHANCEDPM) &&
- (sc->sc_ah->ah_opmode == NL80211_IFTYPE_STATION) &&
- !sc->sc_config.swBeaconProcess)
- sc->sc_imask |= ATH9K_INT_TIM;
-
ath_cache_conf_rate(sc, &hw->conf);
sc->sc_flags &= ~SC_OP_INVALID;
@@ -2124,6 +2105,27 @@ static int ath9k_add_interface(struct ieee80211_hw *hw,
/* Set the device opmode */
sc->sc_ah->ah_opmode = ic_opmode;
+ /*
+ * Enable MIB interrupts when there are hardware phy counters.
+ * Note we only do this (at the moment) for station mode.
+ */
+ if (ath9k_hw_phycounters(sc->sc_ah) &&
+ ((sc->sc_ah->ah_opmode == NL80211_IFTYPE_STATION) ||
+ (sc->sc_ah->ah_opmode == NL80211_IFTYPE_ADHOC)))
+ sc->sc_imask |= ATH9K_INT_MIB;
+ /*
+ * Some hardware processes the TIM IE and fires an
+ * interrupt when the TIM bit is set. For hardware
+ * that does, if not overridden by configuration,
+ * enable the TIM interrupt when operating as station.
+ */
+ if ((sc->sc_ah->ah_caps.hw_caps & ATH9K_HW_CAP_ENHANCEDPM) &&
+ (sc->sc_ah->ah_opmode == NL80211_IFTYPE_STATION) &&
+ !sc->sc_config.swBeaconProcess)
+ sc->sc_imask |= ATH9K_INT_TIM;
+
+ ath9k_hw_set_interrupts(sc->sc_ah, sc->sc_imask);
+
if (conf->type == NL80211_IFTYPE_AP) {
/* TODO: is this a suitable place to start ANI for AP mode? */
/* Start ANI */
--
1.6.0.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ath9k: Enable MIB and TIM interrupts for station mode.
2009-01-28 9:35 [PATCH] ath9k: Enable MIB and TIM interrupts for station mode Vivek Natarajan
@ 2009-01-28 14:54 ` Luis R. Rodriguez
0 siblings, 0 replies; 2+ messages in thread
From: Luis R. Rodriguez @ 2009-01-28 14:54 UTC (permalink / raw)
To: Vivek Natarajan; +Cc: linville@tuxdriver.com, linux-wireless@vger.kernel.org
On Wed, Jan 28, 2009 at 01:35:39AM -0800, Vivek Natarajan wrote:
> Enable operating mode specific interrupts in ath9k_add_interface instead
> of ath9k_start.
>
> Signed-off-by: Vivek Natarajan <vnatarajan@atheros.com>
> ---
> drivers/net/wireless/ath9k/main.c | 40 +++++++++++++++++++-----------------
> 1 files changed, 21 insertions(+), 19 deletions(-)
>
> diff --git a/drivers/net/wireless/ath9k/main.c b/drivers/net/wireless/ath9k/main.c
> index d8e8266..8b149ef 100644
> --- a/drivers/net/wireless/ath9k/main.c
> +++ b/drivers/net/wireless/ath9k/main.c
> @@ -1957,25 +1957,6 @@ static int ath9k_start(struct ieee80211_hw *hw)
> if (sc->sc_ah->ah_caps.hw_caps & ATH9K_HW_CAP_HT)
> sc->sc_imask |= ATH9K_INT_CST;
>
> - /*
> - * Enable MIB interrupts when there are hardware phy counters.
> - * Note we only do this (at the moment) for station mode.
> - */
> - if (ath9k_hw_phycounters(sc->sc_ah) &&
> - ((sc->sc_ah->ah_opmode == NL80211_IFTYPE_STATION) ||
> - (sc->sc_ah->ah_opmode == NL80211_IFTYPE_ADHOC)))
> - sc->sc_imask |= ATH9K_INT_MIB;
> - /*
> - * Some hardware processes the TIM IE and fires an
> - * interrupt when the TIM bit is set. For hardware
> - * that does, if not overridden by configuration,
> - * enable the TIM interrupt when operating as station.
> - */
> - if ((sc->sc_ah->ah_caps.hw_caps & ATH9K_HW_CAP_ENHANCEDPM) &&
> - (sc->sc_ah->ah_opmode == NL80211_IFTYPE_STATION) &&
> - !sc->sc_config.swBeaconProcess)
> - sc->sc_imask |= ATH9K_INT_TIM;
> -
> ath_cache_conf_rate(sc, &hw->conf);
>
> sc->sc_flags &= ~SC_OP_INVALID;
> @@ -2124,6 +2105,27 @@ static int ath9k_add_interface(struct ieee80211_hw *hw,
> /* Set the device opmode */
> sc->sc_ah->ah_opmode = ic_opmode;
>
> + /*
> + * Enable MIB interrupts when there are hardware phy counters.
> + * Note we only do this (at the moment) for station mode.
> + */
> + if (ath9k_hw_phycounters(sc->sc_ah) &&
> + ((sc->sc_ah->ah_opmode == NL80211_IFTYPE_STATION) ||
> + (sc->sc_ah->ah_opmode == NL80211_IFTYPE_ADHOC)))
Please use conf->type == NL80211_IFTYPE_STATION as done
below instead of our own sc->sc_ah->ah_opmode. We want
to try to avoid duplicated data for configuration and eventually
remove it.
> + sc->sc_imask |= ATH9K_INT_MIB;
> + /*
> + * Some hardware processes the TIM IE and fires an
> + * interrupt when the TIM bit is set. For hardware
> + * that does, if not overridden by configuration,
> + * enable the TIM interrupt when operating as station.
> + */
> + if ((sc->sc_ah->ah_caps.hw_caps & ATH9K_HW_CAP_ENHANCEDPM) &&
> + (sc->sc_ah->ah_opmode == NL80211_IFTYPE_STATION) &&
Same here.
> + !sc->sc_config.swBeaconProcess)
> + sc->sc_imask |= ATH9K_INT_TIM;
> +
> + ath9k_hw_set_interrupts(sc->sc_ah, sc->sc_imask);
> +
> if (conf->type == NL80211_IFTYPE_AP) {
Like this.
> /* TODO: is this a suitable place to start ANI for AP mode? */
> /* Start ANI */
> --
Luis
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-01-28 14:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-28 9:35 [PATCH] ath9k: Enable MIB and TIM interrupts for station mode Vivek Natarajan
2009-01-28 14:54 ` Luis R. Rodriguez
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).