Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp536230pxa; Wed, 12 Aug 2020 08:04:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwHv9UV/67s7CyweFhWYx4KaXa1keXb8taW7S8nBwDWDtI6258rriz22xzAo6FnAEsV744w X-Received: by 2002:a05:6402:6d9:: with SMTP id n25mr326963edy.304.1597244684187; Wed, 12 Aug 2020 08:04:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597244684; cv=none; d=google.com; s=arc-20160816; b=XH0HlOHSifH2qltKkGRddjoarDTQmtQhc/7JZgLdUfW2N0avL8fYhEHT5kjNceUrdp 3YUFQWWRIE6/VUKvB1g5Kn7+SyUWBlVl/tpkPHF/7elX89cCHudz0KxYNPrYJSGvUVWv WAKC2UlltifZ58pdtg7Ms6Qe8fk1e4R0gxu87BFuUlSDNvOcdW/2J7K4rUrBT1PUBNMI 1epCBF96ebzhRjOyzZr0BU3UN9klNhpsfmlJWZS0QYyL0q2G+O4t+Yz7Mlpl9AJs52Wq cLLaqkEDTB97ujufoiLavPrXPJz/wS7dL+hFNiMFtc7qMzkre9OH92O9uWeu+TDip8Vg WtoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=A5GtdySJ1ObcJAaE8L/OOcFaD5GTyQ/2j2h6eZLF0OY=; b=oJwrxBfm+nzta9AjUhAN7wYeuoa2cAzHGkAFp0Cz152dILpnWofNpnwjxsHWk8em0x IoSbiPn/E42FctN+qMZmTb+mjvZ2IHedSiRB35JLK8IpW7sWXkdqDL/dtHHbbCOB8UjE nrxcIEgzZ+LYaYEeDsNk3rh1H930IzY/Rrx8oFsEmj++/RBOiJm5Q1BtFx0PG/lqRKdF CYB9sqKg6hg4O8043EZopqO4uLsOupWwRmVmqOeIsFgWJ+sbJABfNpe/ORieHQDAJLaa x8mTDdFRSlNcPAp1NTJqqUODoRP0WlCX2XNZVUezVmp0Q64H8Ks1mTM98hgdqvKC/hcK RuJA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t24si1373071edy.465.2020.08.12.08.04.19; Wed, 12 Aug 2020 08:04:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726606AbgHLPBq (ORCPT + 99 others); Wed, 12 Aug 2020 11:01:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51358 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726587AbgHLPBC (ORCPT ); Wed, 12 Aug 2020 11:01:02 -0400 Received: from nbd.name (nbd.name [IPv6:2a01:4f8:221:3d45::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C627C061387 for ; Wed, 12 Aug 2020 08:01:01 -0700 (PDT) Received: from [149.224.82.90] (helo=localhost.localdomain) by ds12 with esmtpa (Exim 4.89) (envelope-from ) id 1k5sFO-0002OP-Fl; Wed, 12 Aug 2020 17:00:58 +0200 From: John Crispin To: Johannes Berg Cc: linux-wireless@vger.kernel.org, ath11k@lists.infradead.org, John Crispin Subject: [PATCH V3 7/9] ath11k: add multiple bssid support to device creation Date: Wed, 12 Aug 2020 17:00:48 +0200 Message-Id: <20200812150050.2683396-8-john@phrozen.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200812150050.2683396-1-john@phrozen.org> References: <20200812150050.2683396-1-john@phrozen.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org We need to pass info such as parent device, bssid count/index and (non-)transmit mode information to the FW when we create a new vdev. Signed-off-by: John Crispin --- drivers/net/wireless/ath/ath11k/mac.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c index 2e4f1966da21..08e7f4ac8a26 100644 --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c @@ -4269,17 +4269,30 @@ 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 ieee80211_vif *parent; struct ath11k_pdev *pdev = ar->pdev; 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; + if (arvif->vif->multiple_bssid.non_transmitted) { + params->flags = WMI_HOST_VDEV_FLAGS_NON_TRANSMIT_AP; + parent = arvif->vif->multiple_bssid.parent; + 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; + } else { + params->flags = WMI_HOST_VDEV_FLAGS_TRANSMIT_AP; + } if (pdev->cap.supported_bands & WMI_HOST_WLAN_2G_CAP) { params->chains[NL80211_BAND_2GHZ].tx = ar->num_tx_chains; @@ -4294,6 +4307,7 @@ ath11k_mac_setup_vdev_create_params(struct ath11k_vif *arvif, params->chains[NL80211_BAND_6GHZ].tx = ar->num_tx_chains; params->chains[NL80211_BAND_6GHZ].rx = ar->num_rx_chains; } + return 0; } static u32 @@ -4443,7 +4457,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) { -- 2.25.1