From patchwork Fri Dec 6 14:34:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Crispin X-Patchwork-Id: 11276539 X-Patchwork-Delegate: kvalo@adurom.com 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 583ED139A for ; Fri, 6 Dec 2019 14:34:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 36D0A24659 for ; Fri, 6 Dec 2019 14:34:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726411AbfLFOeL (ORCPT ); Fri, 6 Dec 2019 09:34:11 -0500 Received: from nbd.name ([46.4.11.11]:36458 "EHLO nbd.name" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726244AbfLFOeJ (ORCPT ); Fri, 6 Dec 2019 09:34:09 -0500 Received: from tmo-101-57.customers.d1-online.com ([80.187.101.57] helo=bertha.datto.lan) by ds12 with esmtpa (Exim 4.89) (envelope-from ) id 1idEgJ-0004Lm-28; Fri, 06 Dec 2019 15:34:07 +0100 From: John Crispin To: Johannes Berg , Kalle Valo Cc: linux-wireless@vger.kernel.org, ath11k@lists.infradead.org, John Crispin Subject: [PATCH 7/7] ath11k: add handling for BSS color Date: Fri, 6 Dec 2019 15:34:01 +0100 Message-Id: <20191206143401.4080-7-john@phrozen.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191206143401.4080-1-john@phrozen.org> References: <20191206143401.4080-1-john@phrozen.org> MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.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 --- drivers/net/wireless/ath/ath11k/mac.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c index 6a8c1c3b8da2..c692922513b2 100644 --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c @@ -1928,6 +1928,19 @@ 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) { + 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); + } else if (vif->type == NL80211_IFTYPE_STATION) { + ath11k_wmi_send_bss_color_change_enable_cmd(ar, arvif->vdev_id, 1); + ath11k_wmi_send_obss_color_collision_cfg_cmd(ar, arvif->vdev_id, 0, + ATH11K_BSS_COLOR_COLLISION_DETECTION_STA_PERIOD_MS, 1); + } + } + mutex_unlock(&ar->conf_mutex); }