From patchwork Thu May 7 12:30:41 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arik Nemtsov X-Patchwork-Id: 6357371 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2831FBEEE1 for ; Thu, 7 May 2015 12:30:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 40C9220386 for ; Thu, 7 May 2015 12:30:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 17E8220320 for ; Thu, 7 May 2015 12:30:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750907AbbEGMar (ORCPT ); Thu, 7 May 2015 08:30:47 -0400 Received: from mail-wi0-f169.google.com ([209.85.212.169]:34247 "EHLO mail-wi0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750755AbbEGMaq (ORCPT ); Thu, 7 May 2015 08:30:46 -0400 Received: by wicmx19 with SMTP id mx19so12698091wic.1 for ; Thu, 07 May 2015 05:30:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=yPZtT7zmweKPLb5bvU0nc1eM4ZgNKv2vjaPBF/nPfNA=; b=RmgBg7IH4eMRG/gDQ+5mx+UI+TXA8UJeVqvdzkWTRqF+W05sf+UWLUw4eQpqVyxeLn iH3YOoLb3hnLMQNke9Q0HIpbPJjdUmS7+1K49eYOUADc1kOjNbvb0mvmY5DQXG1QHcTK JJtNcjug7S/RLB8WBMm/uSiJCdrhGz0RxZ7S96LShUcQ+MktO4401Tt0BtcwdlZf/Zm2 HyUX0Tqkc9/zzge25NhDn5t+udY00su9+Mw7V5rkigZqfoQXg7V6evTkTAxkcN7BXfbN XHumg6lvuH+um4CQv20zF2vvYVwGUbWVj0lJwJKI+7XagKuZ7XeGgqwU7n4MOGyNejKB OWRw== X-Gm-Message-State: ALoCoQmO92kdo2mafmdttFBJmU61WrjGYEXLpEm0D1z4AJijUi/xtN0wPj9V28Z/Z3fQQxKk5VZp X-Received: by 10.180.99.39 with SMTP id en7mr6264120wib.31.1431001845428; Thu, 07 May 2015 05:30:45 -0700 (PDT) Received: from athena.ger.corp.intel.com ([93.172.48.98]) by mx.google.com with ESMTPSA id fo7sm3786983wic.1.2015.05.07.05.30.43 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 07 May 2015 05:30:44 -0700 (PDT) From: Arik Nemtsov To: Cc: Johannes Berg Subject: [PATCH] mac80211: TDLS: use the BSS chandef for HT/VHT operation IEs Date: Thu, 7 May 2015 15:30:41 +0300 Message-Id: <1431001841-1876-1-git-send-email-arik@wizery.com> X-Mailer: git-send-email 2.1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The chandef of the current channel context might be wider (though compatible). The TDLS link cares only about the channel of the BSS. In addition make sure to specify the VHT operation IE when VHT is supported on a non-2.4GHz band, as required by IEEE802.11ac-2013. This is not the same as HT-operation, to be specified only if the BSS doesn't support HT. Signed-off-by: Arik Nemtsov Reviewed-by: Johannes Berg --- net/mac80211/tdls.c | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/net/mac80211/tdls.c b/net/mac80211/tdls.c index fff0d86..8a92a92 100644 --- a/net/mac80211/tdls.c +++ b/net/mac80211/tdls.c @@ -527,30 +527,19 @@ ieee80211_tdls_add_setup_cfm_ies(struct ieee80211_sub_if_data *sdata, /* if HT support is only added in TDLS, we need an HT-operation IE */ if (!ap_sta->sta.ht_cap.ht_supported && sta->sta.ht_cap.ht_supported) { - struct ieee80211_chanctx_conf *chanctx_conf = - rcu_dereference(sdata->vif.chanctx_conf); - if (!WARN_ON(!chanctx_conf)) { - pos = skb_put(skb, 2 + - sizeof(struct ieee80211_ht_operation)); - /* send an empty HT operation IE */ - ieee80211_ie_build_ht_oper(pos, &sta->sta.ht_cap, - &chanctx_conf->def, 0); - } + pos = skb_put(skb, 2 + sizeof(struct ieee80211_ht_operation)); + /* send an empty HT operation IE */ + ieee80211_ie_build_ht_oper(pos, &sta->sta.ht_cap, + &sdata->vif.bss_conf.chandef, 0); } ieee80211_tdls_add_link_ie(sdata, skb, peer, initiator); /* only include VHT-operation if not on the 2.4GHz band */ - if (band != IEEE80211_BAND_2GHZ && !ap_sta->sta.vht_cap.vht_supported && - sta->sta.vht_cap.vht_supported) { - struct ieee80211_chanctx_conf *chanctx_conf = - rcu_dereference(sdata->vif.chanctx_conf); - if (!WARN_ON(!chanctx_conf)) { - pos = skb_put(skb, 2 + - sizeof(struct ieee80211_vht_operation)); - ieee80211_ie_build_vht_oper(pos, &sta->sta.vht_cap, - &chanctx_conf->def); - } + if (band != IEEE80211_BAND_2GHZ && sta->sta.vht_cap.vht_supported) { + pos = skb_put(skb, 2 + sizeof(struct ieee80211_vht_operation)); + ieee80211_ie_build_vht_oper(pos, &sta->sta.vht_cap, + &sdata->vif.bss_conf.chandef); } rcu_read_unlock();