From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-bk0-f52.google.com ([209.85.214.52]:42853 "EHLO mail-bk0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751599Ab3KRRG7 (ORCPT ); Mon, 18 Nov 2013 12:06:59 -0500 Received: by mail-bk0-f52.google.com with SMTP id u14so2485071bkz.25 for ; Mon, 18 Nov 2013 09:06:58 -0800 (PST) From: Emmanuel Grumbach To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Avri Altman Subject: [PATCH RESEND 4/5] mac80211: update ht flag if bss configuration changed Date: Mon, 18 Nov 2013 19:06:48 +0200 Message-Id: <1384794409-11211-4-git-send-email-egrumbach@gmail.com> (sfid-20131118_180710_487855_CE08E371) In-Reply-To: <1384794409-11211-1-git-send-email-egrumbach@gmail.com> References: <1384794166-10906-1-git-send-email-egrumbach@gmail.com> <1384794409-11211-1-git-send-email-egrumbach@gmail.com> Sender: linux-wireless-owner@vger.kernel.org List-ID: From: Avri Altman The bug concerned failing to update the ht flag properly. updating the ht flag when bss configuration changes should be done independently of channel changes. Signed-off-by: Avri Altman Reviewed-by: Johannes Berg --- net/mac80211/mlme.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index b3a3ce3..03aa33f 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -330,6 +330,16 @@ static int ieee80211_config_bw(struct ieee80211_sub_if_data *sdata, if (WARN_ON_ONCE(!sta)) return -EINVAL; + /* + * if bss configuration changed store the new one - + * this may be applicable even if channel is identical + */ + ht_opmode = le16_to_cpu(ht_oper->operation_mode); + if (sdata->vif.bss_conf.ht_operation_mode != ht_opmode) { + *changed |= BSS_CHANGED_HT; + sdata->vif.bss_conf.ht_operation_mode = ht_opmode; + } + chan = sdata->vif.bss_conf.chandef.chan; sband = local->hw.wiphy->bands[chan->band]; @@ -416,14 +426,6 @@ static int ieee80211_config_bw(struct ieee80211_sub_if_data *sdata, IEEE80211_RC_BW_CHANGED); } - ht_opmode = le16_to_cpu(ht_oper->operation_mode); - - /* if bss configuration changed store the new one */ - if (sdata->vif.bss_conf.ht_operation_mode != ht_opmode) { - *changed |= BSS_CHANGED_HT; - sdata->vif.bss_conf.ht_operation_mode = ht_opmode; - } - return 0; } -- 1.7.9.5