From patchwork Thu Jun 4 07:09:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Crispin X-Patchwork-Id: 11587041 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A7FCF14F6 for ; Thu, 4 Jun 2020 07:10:23 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8676C2074B for ; Thu, 4 Jun 2020 07:10:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="fgc9Zk+C" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8676C2074B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=phrozen.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=ath11k-bounces+patchwork-ath11k=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=wHvv2hqqAy9G3WJaTtX11tjseSaSoQX9nQgqFbe39dc=; b=fgc9Zk+CMHtreI jL7sBTH1lYAT9//7T/qA0ul75eipmvN3Z+LGXEL4Vwt+wwn2kz3Axlwg6XhcVKucu7ZBNshTPIjSn Q0zn/wZIzx8MONju+cRqlr9/XTSoEWyIzSeVTrLvUydQZ+8U1H0sKp49fpUFjxR7xNZyj29Tq5fBB xvnrb8h8v8+LXnsGg2KY9n4eQFTMvU5QMTHpWQPScrN6wSIX7wTOCcDpn13VZAm40/fgw1CZLA1FI sITVSVZxsZKf+jyaaN2FAp6loHybHEEMhN4h4Hcuk0Do+HvrNmZ231jjAXYAL6utmUYI71wlww0aE Vd4BdWdeA92X93dwJdkA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jgk18-0002x9-1U; Thu, 04 Jun 2020 07:10:22 +0000 Received: from nbd.name ([2a01:4f8:221:3d45::2]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jgk0p-0000I1-R6 for ath11k@lists.infradead.org; Thu, 04 Jun 2020 07:10:08 +0000 Received: from [46.59.202.224] (helo=localhost.localdomain) by ds12 with esmtpa (Exim 4.89) (envelope-from ) id 1jgk0m-0001P3-Ad; Thu, 04 Jun 2020 09:10:00 +0200 From: John Crispin To: Johannes Berg Subject: [PATCH 08/12] ath11k: pass multiple bssid info to FW when a new vdev is created Date: Thu, 4 Jun 2020 09:09:48 +0200 Message-Id: <20200604070952.15481-9-john@phrozen.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200604070952.15481-1-john@phrozen.org> References: <20200604070952.15481-1-john@phrozen.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200604_001004_027042_CF2ABC47 X-CRM114-Status: GOOD ( 14.85 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-BeenThere: ath11k@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-wireless@vger.kernel.org, ath11k@lists.infradead.org, John Crispin Sender: "ath11k" Errors-To: ath11k-bounces+patchwork-ath11k=patchwork.kernel.org@lists.infradead.org When we use multiple bssid the FW needs to know if the bssid is non/transmitting and what the vdev_id of the parent is. This patch adds the required code to achieve this. Signed-off-by: John Crispin --- drivers/net/wireless/ath/ath11k/mac.c | 28 +++++++++++++++++++++++++-- drivers/net/wireless/ath/ath11k/wmi.c | 2 ++ drivers/net/wireless/ath/ath11k/wmi.h | 10 ++++++++++ 3 files changed, 38 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c index 2f11259de24a..b38b687d1100 100644 --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c @@ -4163,17 +4163,36 @@ static void ath11k_mac_op_stop(struct ieee80211_hw *hw) atomic_set(&ar->num_pending_mgmt_tx, 0); } -static void +static int ath11k_mac_setup_vdev_create_params(struct ath11k_vif *arvif, struct vdev_create_params *params) { struct ath11k *ar = arvif->ar; struct ath11k_pdev *pdev = ar->pdev; + struct ieee80211_vif *parent; params->if_id = arvif->vdev_id; params->type = arvif->vdev_type; params->subtype = arvif->vdev_subtype; params->pdev_id = pdev->pdev_id; + params->vdevid_trans = 0; + switch (ieee80211_get_multi_bssid_mode(arvif->vif)) { + case NL80211_MULTIPLE_BSSID_TRANSMITTED: + params->flags = WMI_HOST_VDEV_FLAGS_TRANSMIT_AP; + break; + case NL80211_MULTIPLE_BSSID_NON_TRANSMITTED: + params->flags = WMI_HOST_VDEV_FLAGS_NON_TRANSMIT_AP; + parent = ieee80211_get_multi_bssid_parent(arvif->vif); + if (!parent) + return -ENOENT; + if (ar->hw->wiphy != ieee80211_vif_to_wdev(parent)->wiphy) + return -EINVAL; + params->vdevid_trans = ath11k_vif_to_arvif(parent)->vdev_id; + break; + default: + params->flags = WMI_HOST_VDEV_FLAGS_NON_MBSSID_AP; + break; + } if (pdev->cap.supported_bands & WMI_HOST_WLAN_2G_CAP) { params->chains[NL80211_BAND_2GHZ].tx = ar->num_tx_chains; @@ -4183,6 +4202,7 @@ ath11k_mac_setup_vdev_create_params(struct ath11k_vif *arvif, params->chains[NL80211_BAND_5GHZ].tx = ar->num_tx_chains; params->chains[NL80211_BAND_5GHZ].rx = ar->num_rx_chains; } + return 0; } static u32 @@ -4334,7 +4354,11 @@ static int ath11k_mac_op_add_interface(struct ieee80211_hw *hw, for (i = 0; i < ARRAY_SIZE(vif->hw_queue); i++) vif->hw_queue[i] = i % (ATH11K_HW_MAX_QUEUES - 1); - ath11k_mac_setup_vdev_create_params(arvif, &vdev_param); + ret = ath11k_mac_setup_vdev_create_params(arvif, &vdev_param); + if (ret) { + ath11k_warn(ab, "failed to prepare vdev %d\n", ret); + goto err; + } ret = ath11k_wmi_vdev_create(ar, vif->addr, &vdev_param); if (ret) { diff --git a/drivers/net/wireless/ath/ath11k/wmi.c b/drivers/net/wireless/ath/ath11k/wmi.c index 5b35d06a0d81..a46aa831d8be 100644 --- a/drivers/net/wireless/ath/ath11k/wmi.c +++ b/drivers/net/wireless/ath/ath11k/wmi.c @@ -603,6 +603,8 @@ int ath11k_wmi_vdev_create(struct ath11k *ar, u8 *macaddr, cmd->vdev_subtype = param->subtype; cmd->num_cfg_txrx_streams = WMI_NUM_SUPPORTED_BAND_MAX; cmd->pdev_id = param->pdev_id; + cmd->flags = param->flags; + cmd->vdevid_trans = param->vdevid_trans; ether_addr_copy(cmd->vdev_macaddr.addr, macaddr); ptr = skb->data + sizeof(*cmd); diff --git a/drivers/net/wireless/ath/ath11k/wmi.h b/drivers/net/wireless/ath/ath11k/wmi.h index 82929415e119..761e27a3a306 100644 --- a/drivers/net/wireless/ath/ath11k/wmi.h +++ b/drivers/net/wireless/ath/ath11k/wmi.h @@ -107,6 +107,12 @@ enum { WMI_HOST_WLAN_2G_5G_CAP = 0x3, }; +enum { + WMI_HOST_VDEV_FLAGS_NON_MBSSID_AP = 1, + WMI_HOST_VDEV_FLAGS_TRANSMIT_AP = 2, + WMI_HOST_VDEV_FLAGS_NON_TRANSMIT_AP = 4, +}; + /* * wmi command groups. */ @@ -2376,6 +2382,8 @@ struct vdev_create_params { u8 rx; } chains[NUM_NL80211_BANDS]; u32 pdev_id; + u32 flags; + u32 vdevid_trans; }; struct wmi_vdev_create_cmd { @@ -2386,6 +2394,8 @@ struct wmi_vdev_create_cmd { struct wmi_mac_addr vdev_macaddr; u32 num_cfg_txrx_streams; u32 pdev_id; + u32 flags; + u32 vdevid_trans; } __packed; struct wmi_vdev_txrx_streams {