From patchwork Sun Nov 9 16:50:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arik Nemtsov X-Patchwork-Id: 5261581 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 084F4C11AC for ; Sun, 9 Nov 2014 16:50:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2D8A620127 for ; Sun, 9 Nov 2014 16:50:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5F7B82011D for ; Sun, 9 Nov 2014 16:50:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752055AbaKIQug (ORCPT ); Sun, 9 Nov 2014 11:50:36 -0500 Received: from mail-wi0-f174.google.com ([209.85.212.174]:43806 "EHLO mail-wi0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751954AbaKIQuf (ORCPT ); Sun, 9 Nov 2014 11:50:35 -0500 Received: by mail-wi0-f174.google.com with SMTP id d1so8338512wiv.1 for ; Sun, 09 Nov 2014 08:50:34 -0800 (PST) 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:in-reply-to :references; bh=n1O+mmsI77ZssbPwaMAOeEjtSa6y5Ow6rmQ6oMmiGJc=; b=LmHpObbvMioly62ukylTWDhnf4oghLYjKulo9+P5kkQLyIiYFxVSZk480rLankMU8c lCNCM8mpM72Y2FLxkuScG6Q1zSr+09QrMzBk9ijrd4OR/cXw2fNbAo8SSdchnFm/C0pk Z4HI2heXOgOBswAnhCDRvurxqgJCceu71GjIj/I+PEfYCWE9oqq1Mj88JMO+lgauhXsd 3Oha8aA1CWKnGiQm+vQAW44M7lQT+vicRIXVgLWvgy+uo2nJMe+92LG309tez7fECIuW JidU9uWIdCiM2PsqHy/eUrbg0GsEfwk4u9p9RTCsG9SrSQ+vOoYZPp7KKolGD8wYtALg Wtdg== X-Gm-Message-State: ALoCoQkNIcTKoK5cWBKidOow1YnTLVfbfgZfugisGESPoJo6sXIpeXICMLQk8gEwOwqEbe6Fjzbc X-Received: by 10.194.2.244 with SMTP id 20mr36079706wjx.4.1415551834343; Sun, 09 Nov 2014 08:50:34 -0800 (PST) Received: from athena.amr.corp.intel.com (93-172-126-236.bb.netvision.net.il. [93.172.126.236]) by mx.google.com with ESMTPSA id r2sm9994037wif.23.2014.11.09.08.50.32 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 09 Nov 2014 08:50:33 -0800 (PST) From: Arik Nemtsov To: Cc: Johannes Berg , Arik Nemtsov Subject: [PATCH 07/16] mac80211: add BSS coex IE to TDLS setup frames Date: Sun, 9 Nov 2014 18:50:13 +0200 Message-Id: <1415551822-20121-7-git-send-email-arik@wizery.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1415551822-20121-1-git-send-email-arik@wizery.com> References: <1415551822-20121-1-git-send-email-arik@wizery.com> 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.0 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY, URIBL_RHS_DOB 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 Add the BSS coex IE in case we support HT40 channels, as mandated by section 8.5.13 in IEEE802.11 2012. Signed-off-by: Arik Nemtsov Reviewed-by: Johannes Berg Signed-off-by: Arik Nemtsov --- include/linux/ieee80211.h | 3 +++ net/mac80211/tdls.c | 15 +++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index 4e2bb91..adac1be 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h @@ -2037,6 +2037,9 @@ enum ieee80211_tdls_actioncode { /* TDLS specific payload type in the LLC/SNAP header */ #define WLAN_TDLS_SNAP_RFTYPE 0x2 +/* BSS Coex IE information field bits */ +#define WLAN_BSS_COEX_INFORMATION_REQUEST BIT(0) + /** * enum - mesh synchronization method identifier * diff --git a/net/mac80211/tdls.c b/net/mac80211/tdls.c index 8fb314b..30a4c10 100644 --- a/net/mac80211/tdls.c +++ b/net/mac80211/tdls.c @@ -117,6 +117,16 @@ ieee80211_tdls_add_supp_channels(struct ieee80211_sub_if_data *sdata, *pos = 2 * subband_cnt; } +static void ieee80211_tdls_add_bss_coex_ie(struct sk_buff *skb) +{ + u8 *pos = (void *)skb_put(skb, 3); + + *pos++ = WLAN_EID_BSS_COEX_2040; + *pos++ = 1; /* len */ + + *pos++ = WLAN_BSS_COEX_INFORMATION_REQUEST; +} + static u16 ieee80211_get_tdls_sta_capab(struct ieee80211_sub_if_data *sdata, u16 status_code) { @@ -341,6 +351,10 @@ ieee80211_tdls_add_setup_start_ies(struct ieee80211_sub_if_data *sdata, rcu_read_unlock(); + if (ht_cap.ht_supported && + (ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40)) + ieee80211_tdls_add_bss_coex_ie(skb); + /* add any remaining IEs */ if (extra_ies_len) { noffset = extra_ies_len; @@ -597,6 +611,7 @@ ieee80211_tdls_prep_mgmt_packet(struct wiphy *wiphy, struct net_device *dev, 2 + max(sizeof(struct ieee80211_ht_cap), sizeof(struct ieee80211_ht_operation)) + 50 + /* supported channels */ + 3 + /* 40/20 BSS coex */ extra_ies_len + sizeof(struct ieee80211_tdls_lnkie)); if (!skb)