On Wed, Dec 7, 2011 at 5:53 AM, Rajkumar Manoharan <rmanohar@xxxxxxxxxxxxxxxx> wrote: > The current regulatory for world roaming mode cards might be > overriden by country IE from the assiciated AP. But these > regulatory values are failed to be restored on disconnection. > This patch ensures to resotre regulatry values at driver side. > > Signed-off-by: Rajkumar Manoharan <rmanohar@xxxxxxxxxxxxxxxx> > --- > drivers/net/wireless/ath/ath9k/main.c | 8 ++++++++ > 1 files changed, 8 insertions(+), 0 deletions(-) > > diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c > index 424289f..a4dbb7b 100644 > --- a/drivers/net/wireless/ath/ath9k/main.c > +++ b/drivers/net/wireless/ath/ath9k/main.c > @@ -2046,6 +2046,14 @@ static void ath9k_config_bss(struct ath_softc *sc, struct ieee80211_vif *vif) > sc->sc_flags &= ~SC_OP_ANI_RUN; > del_timer_sync(&common->ani.timer); > memset(&sc->caldata, 0, sizeof(sc->caldata)); > + /* > + * Restore regulatory values that might be updated > + * by country IEs. > + */ > + if (!ath_is_world_regd(&common->regulatory) && > + ath_is_world_regd(&common->reg_world_copy)) > + memcpy(&common->regulatory, &common->reg_world_copy, > + sizeof(struct ath_regulatory)); > } NACK, this patch should not be required given that patch [2/4] in this series restores this on the reg_notifier() for the NL80211_REGDOM_SET_BY_CORE case -- the trick is that when cfg80211 detects not only a disconnect, but any regulatory restore, it will *always* send a reg core hint! Again the hunk from patch [2/4] was: @@ -363,14 +381,37 @@ int ath_reg_notifier_apply(struct wiphy *wiphy, return 0; switch (request->initiator) { - case NL80211_REGDOM_SET_BY_DRIVER: case NL80211_REGDOM_SET_BY_CORE: + /* + * If common->reg_world_copy is world roaming it means we *were* + * world roaming... so we now have to restore that data. + */ + if (!ath_is_world_regd(&common->reg_world_copy)) + break; + + memcpy(reg, &common->reg_world_copy, + sizeof(struct ath_regulatory)); + break; + case NL80211_REGDOM_SET_BY_DRIVER: case NL80211_REGDOM_SET_BY_USER: break; Can you please test without this patch and ensure you get the data properly restored? Luis -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html