From patchwork Tue Sep 24 07:59:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: You-Sheng Yang X-Patchwork-Id: 1166438 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46ctv82KXqz9sP7; Tue, 24 Sep 2019 18:01:56 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1iCfle-0000FG-Vi; Tue, 24 Sep 2019 08:01:50 +0000 Received: from mail-pf1-f194.google.com ([209.85.210.194]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1iCflE-0008Dh-5e for kernel-team@lists.ubuntu.com; Tue, 24 Sep 2019 08:01:24 +0000 Received: by mail-pf1-f194.google.com with SMTP id a2so809780pfo.10 for ; Tue, 24 Sep 2019 01:01:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=sBGRIWrw4BiMgubcgFAZ4699tRQd3JhW+5KNeh8WmsY=; b=q9ObHbWLxYSV4qeA3i7OrseP6WuP4FXMpPbXVi2EMl082oA4ctTUcGEUpAMl7mNtU0 /1Td2SeLWutlzjeBwOlJIerKiSNhJfzX9c9TX+DpppeU04G+vA/aiUk4sHDquBBf1ZZU E53xLuw9PUamUu+ny46N5+2kLgaNhDrRnm/7aXAe15QWGnQ/eflMmY1lCZvdlBmtVaZ2 PBAv4BxPRXCVD7mbnQqys+kxIaf0C92UR3GQ8Fc5vRJH/4jXQo/DpYyrsJpzX/Lq6/AQ Efzhv6sYYyhTleh/94Er7OwyJVvR+aq+TStbAwIKINRL3qCRbtD9uxRyFgq4tgQ3pCY8 xXnw== X-Gm-Message-State: APjAAAUPI9NgzsCvJbCuyrqZMhiOhYGqDeJwzYUsoMMv2TxiFn0Zy7u9 dnMIWW7UTBOD4Zk8Xp0zy5/vuWQK X-Google-Smtp-Source: APXvYqx2BKZpaNNKKJWP4qZjU6Sbm8Ham2h2CPBs6e6SgaxHcLg+6u5Zn/nOCUUC9z548U8QkvH14w== X-Received: by 2002:a17:90a:cb16:: with SMTP id z22mr1655319pjt.70.1569312081946; Tue, 24 Sep 2019 01:01:21 -0700 (PDT) Received: from localhost.localdomain (61-220-137-37.HINET-IP.hinet.net. [61.220.137.37]) by smtp.gmail.com with ESMTPSA id g202sm1359780pfb.155.2019.09.24.01.01.13 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 24 Sep 2019 01:01:21 -0700 (PDT) From: You-Sheng Yang To: kernel-team@lists.ubuntu.com Subject: [PATCH 15/21][SRU][OEM-OSP1-B] mac80211: indicate support for multiple BSSID Date: Tue, 24 Sep 2019 15:59:41 +0800 Message-Id: <20190924075947.33954-16-vicamo.yang@canonical.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190924075947.33954-1-vicamo.yang@canonical.com> References: <20190924075947.33954-1-vicamo.yang@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Sara Sharon BugLink: https://bugs.launchpad.net/bugs/1845138 Set multi-bssid support flags according to driver support. Signed-off-by: Sara Sharon Signed-off-by: Johannes Berg (backported from commit caf56338c22f00098bf2acd646b0ddc691c80c24) Signed-off-by: You-Sheng Yang --- include/linux/ieee80211.h | 5 +++++ include/net/mac80211.h | 7 +++++++ net/mac80211/debugfs.c | 4 +++- net/mac80211/main.c | 13 ++++++++++++- net/mac80211/mlme.c | 15 +++++++++++++++ 5 files changed, 42 insertions(+), 2 deletions(-) diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index 583597ed97889..c9946ef2f48f9 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h @@ -2667,6 +2667,11 @@ enum ieee80211_tdls_actioncode { */ #define WLAN_EXT_CAPA1_EXT_CHANNEL_SWITCHING BIT(2) +/* Multiple BSSID capability is set in the 6th bit of 3rd byte of the + * @WLAN_EID_EXT_CAPABILITY information element + */ +#define WLAN_EXT_CAPA3_MULTI_BSSID_SUPPORT BIT(6) + /* TDLS capabilities in the the 4th byte of @WLAN_EID_EXT_CAPABILITY */ #define WLAN_EXT_CAPA4_TDLS_BUFFER_STA BIT(4) #define WLAN_EXT_CAPA4_TDLS_PEER_PSM BIT(5) diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 2ba14021668fe..fe6208d601743 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -2199,6 +2199,11 @@ struct ieee80211_txq { * MMPDUs on station interfaces. This of course requires the driver to use * TXQs to start with. * + * @IEEE80211_HW_SUPPORTS_MULTI_BSSID: Hardware supports multi BSSID + * + * @IEEE80211_HW_SUPPORTS_ONLY_HE_MULTI_BSSID: Hardware supports multi BSSID + * only for HE APs. Applies if @IEEE80211_HW_SUPPORTS_MULTI_BSSID is set. + * * @NUM_IEEE80211_HW_FLAGS: number of hardware flags, used for sizing arrays */ enum ieee80211_hw_flags { @@ -2247,6 +2252,8 @@ enum ieee80211_hw_flags { IEEE80211_HW_BUFF_MMPDU_TXQ, IEEE80211_HW_SUPPORTS_VHT_EXT_NSS_BW, IEEE80211_HW_STA_MMPDU_TXQ, + IEEE80211_HW_SUPPORTS_MULTI_BSSID, + IEEE80211_HW_SUPPORTS_ONLY_HE_MULTI_BSSID, /* keep last, obviously */ NUM_IEEE80211_HW_FLAGS diff --git a/net/mac80211/debugfs.c b/net/mac80211/debugfs.c index 3fe541e358f3c..70b5dac1ce22c 100644 --- a/net/mac80211/debugfs.c +++ b/net/mac80211/debugfs.c @@ -3,7 +3,7 @@ * * Copyright 2007 Johannes Berg * Copyright 2013-2014 Intel Mobile Communications GmbH - * Copyright (C) 2018 Intel Corporation + * Copyright (C) 2018 - 2019 Intel Corporation * * GPLv2 * @@ -218,6 +218,8 @@ static const char *hw_flag_names[] = { FLAG(BUFF_MMPDU_TXQ), FLAG(SUPPORTS_VHT_EXT_NSS_BW), FLAG(STA_MMPDU_TXQ), + FLAG(SUPPORTS_MULTI_BSSID), + FLAG(SUPPORTS_ONLY_HE_MULTI_BSSID), #undef FLAG }; diff --git a/net/mac80211/main.c b/net/mac80211/main.c index 977dea436ee89..debbf12b7f548 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c @@ -4,7 +4,7 @@ * Copyright 2006-2007 Jiri Benc * Copyright 2013-2014 Intel Mobile Communications GmbH * Copyright (C) 2017 Intel Deutschland GmbH - * Copyright (C) 2018 Intel Corporation + * Copyright (C) 2018 - 2019 Intel Corporation * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -1104,6 +1104,17 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) if (ieee80211_hw_check(&local->hw, CHANCTX_STA_CSA)) local->ext_capa[0] |= WLAN_EXT_CAPA1_EXT_CHANNEL_SWITCHING; + /* mac80211 supports multi BSSID, if the driver supports it */ + if (ieee80211_hw_check(&local->hw, SUPPORTS_MULTI_BSSID)) { + local->hw.wiphy->support_mbssid = true; + if (ieee80211_hw_check(&local->hw, + SUPPORTS_ONLY_HE_MULTI_BSSID)) + local->hw.wiphy->support_only_he_mbssid = true; + else + local->ext_capa[2] |= + WLAN_EXT_CAPA3_MULTI_BSSID_SUPPORT; + } + local->hw.wiphy->max_num_csa_counters = IEEE80211_MAX_CSA_COUNTERS_NUM; result = wiphy_register(local->hw.wiphy); diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 264f857af24b2..a4519e257743a 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -813,6 +813,21 @@ static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata) } } + /* Set MBSSID support for HE AP if needed */ + if (ieee80211_hw_check(&local->hw, SUPPORTS_ONLY_HE_MULTI_BSSID) && + !(ifmgd->flags & IEEE80211_STA_DISABLE_HE) && assoc_data->ie_len) { + struct element *elem; + + /* we know it's writable, cast away the const */ + elem = (void *)cfg80211_find_elem(WLAN_EID_EXT_CAPABILITY, + assoc_data->ie, + assoc_data->ie_len); + + /* We can probably assume both always true */ + if (elem && elem->datalen >= 3) + elem->data[2] |= WLAN_EXT_CAPA3_MULTI_BSSID_SUPPORT; + } + /* if present, add any custom IEs that go before HT */ if (assoc_data->ie_len) { static const u8 before_ht[] = {