From patchwork Tue Dec 17 14:19:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Crispin X-Patchwork-Id: 11297711 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 57752930 for ; Tue, 17 Dec 2019 14:19:45 +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 2B1EC206E0 for ; Tue, 17 Dec 2019 14:19:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="pIZtaZd1" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2B1EC206E0 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=HdorvvNfj68qnSRvB8sW+W7TZqKojx2gba623dXL+VA=; b=pIZtaZd1NZMFww 9RaNk0A7lUCx01Fu6bEuvQTpbThMbtN4X9g+oyA3R4tFT5Xi/Bev1hJMOOvCYBYAMW0IbrbgD1ISa XUt/Vf8KqoBxA8X8wDgeetzI7U0fMrfwC6GVVno0Rpt2iqzUcFwmxw7Kyxe+ne+8Q/6hVDFN/JiGf 0aHHToXdM5VzuNpM+RyW4RTepXgEzuZASJuquc7Muz0kzGSvk6d6VtR/VzRKUhuBUbMHpyADSrbOc x9Z9uDT5OmlDTELsZyfmkkyENsAgXGnAvk/0vue12nJeDJIsFYEPdC3M/1yOiE6VRLR1gdv/2hlwb xCQe8MMoOcCC7ILrEEwQ==; 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 1ihDhP-0002Ff-MP; Tue, 17 Dec 2019 14:19:43 +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 1ihDhM-0002Dc-6V for ath11k@lists.infradead.org; Tue, 17 Dec 2019 14:19:41 +0000 Received: from pd95fd66b.dip0.t-ipconnect.de ([217.95.214.107] helo=bertha.fritz.box) by ds12 with esmtpa (Exim 4.89) (envelope-from ) id 1ihDhD-0001fe-MP; Tue, 17 Dec 2019 15:19:31 +0100 From: John Crispin To: Johannes Berg , Kalle Valo Subject: [PATCH V3 4/4] ath11k: add handling for BSS color Date: Tue, 17 Dec 2019 15:19:21 +0100 Message-Id: <20191217141921.8114-4-john@phrozen.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191217141921.8114-1-john@phrozen.org> References: <20191217141921.8114-1-john@phrozen.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191217_061940_415186_066657A0 X-CRM114-Status: UNSURE ( 9.99 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.2 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 This patch adds code to handle the BSS_CHANGED_BSS_COLOR flag. It will trigger the propagation of BSS color settings into the FW. Handling is slightly different between AP and STA interfaces. Signed-off-by: John Crispin --- Changes in V2 * handle return codes drivers/net/wireless/ath/ath11k/mac.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c index 6a8c1c3b8da2..fec268b9b711 100644 --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c @@ -1928,6 +1928,33 @@ static void ath11k_mac_op_bss_info_changed(struct ieee80211_hw *hw, ath11k_wmi_send_obss_spr_cmd(ar, arvif->vdev_id, &info->he_obss_pd); + if (changed & BSS_CHANGED_HE_BSS_COLOR) { + if (vif->type == NL80211_IFTYPE_AP) { + ret = ath11k_wmi_send_obss_color_collision_cfg_cmd( + ar, arvif->vdev_id, info->he_bss_color.color, + ATH11K_BSS_COLOR_COLLISION_DETECTION_AP_PERIOD_MS, + !info->he_bss_color.disabled); + if (ret) + ath11k_warn(ar->ab, + "failed to set bss color collision on vdev %i: %d\n", + arvif->vdev_id, ret); + } else if (vif->type == NL80211_IFTYPE_STATION) { + ret = ath11k_wmi_send_bss_color_change_enable_cmd(ar, + arvif->vdev_id, 1); + if (ret) + ath11k_warn(ar->ab, + "failed to enable bss color change on vdev %i: %d\n", + arvif->vdev_id, ret); + ret = ath11k_wmi_send_obss_color_collision_cfg_cmd( + ar, arvif->vdev_id, 0, + ATH11K_BSS_COLOR_COLLISION_DETECTION_STA_PERIOD_MS, 1); + if (ret) + ath11k_warn(ar->ab, + "failed to set bss color collision on vdev %i: %d\n", + arvif->vdev_id, ret); +} + } + mutex_unlock(&ar->conf_mutex); }