From patchwork Tue Oct 10 08:11:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: yintang@qti.qualcomm.com X-Patchwork-Id: 9995261 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id EDF4D60230 for ; Tue, 10 Oct 2017 08:09:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E16C7280FC for ; Tue, 10 Oct 2017 08:09:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D645828173; Tue, 10 Oct 2017 08:09:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 83CFA280FC for ; Tue, 10 Oct 2017 08:09:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755645AbdJJIJd (ORCPT ); Tue, 10 Oct 2017 04:09:33 -0400 Received: from alexa-out.qualcomm.com ([129.46.98.28]:12276 "EHLO alexa-out.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754894AbdJJIJd (ORCPT ); Tue, 10 Oct 2017 04:09:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qti.qualcomm.com; i=@qti.qualcomm.com; q=dns/txt; s=qcdkim; t=1507622973; x=1539158973; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=Lg6LZFzIpBerXtS5JIypLgl7eHCaC4GT9RXcOeMf0pQ=; b=aoDrE/YRvzkvuvDKzdJGNEUcuLvRAhbw2s1ENvjwsLdt6lEJTqtTqf6A t+eT0jmWXiHhrp6s1jn0fd54p7uf0+3pDKEPesGyAEJTykKam6Hhp3LsG eJ7cLpfMVjPSKIt+G2xljJQu7kj8PkviXpO35gST2FiQv1NsnEEW1tqT0 Y=; X-IronPort-AV: E=Sophos;i="5.42,503,1500966000"; d="scan'208";a="6209256" Received: from ironmsg04-l-new.qualcomm.com (HELO Ironmsg04-L.qualcomm.com) ([10.53.140.111]) by alexa-out.qualcomm.com with ESMTP; 10 Oct 2017 01:09:33 -0700 X-IronPort-AV: E=McAfee;i="5900,7806,8679"; a="1439814785" X-MGA-submission: =?us-ascii?q?MDEvbVdy9lCQqFzbdpAYFn6kb5C8eJLT90NtpZ?= =?us-ascii?q?CaaWSOe5ZJQAJ3YuHQoe+OK0V+h7fGFRYSVEeNPYC1xuYkCUre66go28?= =?us-ascii?q?tFJTmnayOfEk5DM61RE9lm4PFbhVxjoGpWZ1iWGPAFEGqHcidHP2c4em?= =?us-ascii?q?6w?= Received: from nasanexm03f.na.qualcomm.com ([10.85.0.47]) by Ironmsg04-L.qualcomm.com with ESMTP/TLS/AES256-SHA; 10 Oct 2017 01:09:32 -0700 Received: from aptaiexm02b.ap.qualcomm.com (10.249.150.12) by nasanexm03f.na.qualcomm.com (10.85.0.47) with Microsoft SMTP Server (TLS) id 15.0.1293.2; Tue, 10 Oct 2017 01:09:31 -0700 Received: from yintang-HP-EliteBook-1.qca.qualcomm.com (10.80.80.8) by aptaiexm02b.ap.qualcomm.com (10.249.150.12) with Microsoft SMTP Server (TLS) id 15.0.1293.2; Tue, 10 Oct 2017 16:09:27 +0800 From: To: CC: Subject: [PATCH V5 1/5] mac80211: Enable TDLS peer buffer STA feature Date: Tue, 10 Oct 2017 16:11:16 +0800 Message-ID: <1507623080-9311-2-git-send-email-yintang@qti.qualcomm.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1507623080-9311-1-git-send-email-yintang@qti.qualcomm.com> References: <1507623080-9311-1-git-send-email-yintang@qti.qualcomm.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: NASANEXM01E.na.qualcomm.com (10.85.0.31) To aptaiexm02b.ap.qualcomm.com (10.249.150.12) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Yingying Tang Enable TDLS peer buffer STA feature. Set extended capability bit to enable buffer STA when driver support it. Signed-off-by: Yingying Tang --- include/net/cfg80211.h | 3 +++ net/mac80211/tdls.c | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index f12fa52..edefc25 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h @@ -3249,6 +3249,8 @@ struct cfg80211_ops { * beaconing mode (AP, IBSS, Mesh, ...). * @WIPHY_FLAG_HAS_STATIC_WEP: The device supports static WEP key installation * before connection. + * @WIPHY_FLAG_SUPPORT_TDLS_BUFFER_ST: Device support buffer STA when TDLS is + * established. */ enum wiphy_flags { /* use hole at 0 */ @@ -3275,6 +3277,7 @@ enum wiphy_flags { WIPHY_FLAG_SUPPORTS_5_10_MHZ = BIT(22), WIPHY_FLAG_HAS_CHANNEL_SWITCH = BIT(23), WIPHY_FLAG_HAS_STATIC_WEP = BIT(24), + WIPHY_FLAG_SUPPORT_TDLS_BUFFER_STA = BIT(25), }; /** diff --git a/net/mac80211/tdls.c b/net/mac80211/tdls.c index 91093d4..f99e379 100644 --- a/net/mac80211/tdls.c +++ b/net/mac80211/tdls.c @@ -49,6 +49,8 @@ static void ieee80211_tdls_add_ext_capab(struct ieee80211_sub_if_data *sdata, !ifmgd->tdls_wider_bw_prohibited; struct ieee80211_supported_band *sband = ieee80211_get_sband(sdata); bool vht = sband && sband->vht_cap.vht_supported; + bool buffer_sta = + local->hw.wiphy->flags & WIPHY_FLAG_SUPPORT_TDLS_BUFFER_STA; u8 *pos = skb_put(skb, 10); *pos++ = WLAN_EID_EXT_CAPABILITY; @@ -56,7 +58,8 @@ static void ieee80211_tdls_add_ext_capab(struct ieee80211_sub_if_data *sdata, *pos++ = 0x0; *pos++ = 0x0; *pos++ = 0x0; - *pos++ = chan_switch ? WLAN_EXT_CAPA4_TDLS_CHAN_SWITCH : 0; + *pos++ = (chan_switch ? WLAN_EXT_CAPA4_TDLS_CHAN_SWITCH : 0) | + (buffer_sta ? WLAN_EXT_CAPA4_TDLS_BUFFER_STA : 0); *pos++ = WLAN_EXT_CAPA5_TDLS_ENABLED; *pos++ = 0; *pos++ = 0;