From patchwork Sun Jan 19 05:22:48 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: aloka.dixit@oss.qualcomm.com X-Patchwork-Id: 13944352 X-Patchwork-Delegate: kvalo@adurom.com Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ADA1718A6AB for ; Sun, 19 Jan 2025 05:23:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737264182; cv=none; b=pKNWFkWqlH0LsF5OSwv73oYyf2EY0J9rdWIIBp0MLm2JvPAn9FBQQiQhfnp4e3Hqpb1JNdRWzQb2DqyjQvHyw0KlKbx6Jf14ndsoiLLw9rfpIx3ZoqLqxR47jU/TIECWaTSltRmmzIztFkiWxOlYRN8npCX7T1d5ogO1Fss/ZI4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737264182; c=relaxed/simple; bh=4BZ++bHcf9DnP1mC9j5YH3EidhhkXGrvSThT+Xj8ssU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=PXRRLSZTMW3u4K204GJvBbWHXeC/cG339iwIXlc+QkejoCdxORP3F5WOWxdpoBkY9cYW2HzZjsv9kZ+TdH7rXGma6HywO3qEBvV0lL/I/5dk+x2tNegUeE+bU5s7DzVyCpRmg69bnQVP1rZsnLSftgLcdksErzDyKJUuNEOOCYY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=QdfXgp97; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="QdfXgp97" Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 50J4F6on016745 for ; Sun, 19 Jan 2025 05:23:00 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=N7GyAD+vCSG m60Mo83UiwkZrzF+LzppL5JloceOQESw=; b=QdfXgp97iUcJ6+1jU6mjC4QXlne qsFPjvsjcXppP9hbdaPcQR9h0hSfoCszDU8MVdIP3FrVCClyZYZhMlDIQ2tDR/xU yRDAj2cwHcZQioIfJTc2iBC25WAO2YVxjpx8eemjk0OavLqu19QZdHR/QL65dMJo OJ4I36R4OPsFZ3pUo8CCI3R32iK/mfrsVjCckkYG3x5aGGzv31wih3EChJVV3g4h 1wW+9fBtzcEULDNk7WOnI3fJjK5Nzf7k9XFdn3Sr4SUnu2+gXXrvS4IuZrkLfnxh n1W0kXOSOZE898L6z/1BGXE4ua7sIxblZZ512Nmv5Jjs4eozhfCl3zVMPQA== Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4485k7sgh1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Sun, 19 Jan 2025 05:22:59 +0000 (GMT) Received: by mail-pj1-f71.google.com with SMTP id 98e67ed59e1d1-2ee46799961so9807306a91.2 for ; Sat, 18 Jan 2025 21:22:59 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737264178; x=1737868978; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=N7GyAD+vCSGm60Mo83UiwkZrzF+LzppL5JloceOQESw=; b=kAi36/AuIK0oyRSNvtd2zamYrQ/+lDAkE/4PFswoHgyBHRSKKorXdYqfrV3xkC5Jih VNFgs+38Gp1NTlwESkzjv0CGW0ixApt17ptSV/8H6WLPbIjx7oqiOf34Z73E5J2OwidU b9YZ7vZ63EPXels5JdTUwb/AL+E03JZFigWJm6wS6dF19PgnWIB2lybQlsuAthaYfb/u /ot/H7pDRdzDnQW8ArkRGO1UKvyN7NF3Evmj4M0XU1bpXX+EPkL7PXmYdj/XXbinnKjU olNYeKyrR3SM/zbdejo0EFenNm3ywV2pFuLU44gcZ2Zx30apPwi9LkxeGOBwKCIerHFT N4UQ== X-Forwarded-Encrypted: i=1; AJvYcCVpoy4PAXKFSwvVQIxe3YIVoLVMGd/qX99LAH/f60NCRaxh1vLJcg88M6hBox5co8rQv2zFNAS7cdDQdCh3Lg==@vger.kernel.org X-Gm-Message-State: AOJu0YxFbCHjrZshUHkexO7FTuS4B1cwC5mUs3IC2gPEU+ROIb3BWc4h RZ1QP21wzA+G6C23rNl56fXop69jKPoQdcnjSxM8kPg956v6Kw7aPjAHRgnbD19anfVQYUNe6Mx OMvIMq7yjyMQeKEW0+zpjzX9Z+FditVw+jWai24IfOtpBT9CFFhaJjMS8gaAc0oKQ8w== X-Gm-Gg: ASbGnctV0UmaNRC769mfHVKYuejpm24EDHXz6LeO+emgWsSv6UBVP8+iAdKh5JJXlOQ sUpRUWTh9oHgDyvmMAOw1VrI8NDQsHehbkEV4WZo49ZxDDz+2Rkm3dJJiTWJUmFNMsx/oIVgH/t MFPn0yHSjrppmFoRBy+TlOqs6Jlu7WZlhIGs9mS4SDpPqUQOM8apTDKc1fNwKj3PjrBjVXDThwe GbPvMwD/EekZT0nvKfAy3hVDRL1k5/d5DyvIQ2EFoajjcm8JWFeqU4mUgDqC3bCoymfxWDkyLqa IRNeibUodf+wua1pdW4rwoAa3QOlo2G4QfDtiAP8FNHamyBBNg== X-Received: by 2002:a17:90b:2d88:b0:2f2:a664:df1a with SMTP id 98e67ed59e1d1-2f782c628bbmr13479377a91.2.1737264178323; Sat, 18 Jan 2025 21:22:58 -0800 (PST) X-Google-Smtp-Source: AGHT+IExsbmTylEtID6b8ELRkciz1dg3uqWpIv6JoKs+D7h0yiRGLjbKP8ugf7sOsWSJ36M7pOe9yw== X-Received: by 2002:a17:90b:2d88:b0:2f2:a664:df1a with SMTP id 98e67ed59e1d1-2f782c628bbmr13479359a91.2.1737264177978; Sat, 18 Jan 2025 21:22:57 -0800 (PST) Received: from alokad-linux.qualcomm.com (i-global254.qualcomm.com. [199.106.103.254]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f77611a295sm5062553a91.7.2025.01.18.21.22.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Jan 2025 21:22:57 -0800 (PST) From: aloka.dixit@oss.qualcomm.com To: ath11k@lists.infradead.org, ath12k@lists.infradead.org, linux-wireless@vger.kernel.org Cc: Aloka Dixit Subject: [PATCH v2 3/5] wifi: ath12k: refactor transmitted arvif retrieval Date: Sat, 18 Jan 2025 21:22:48 -0800 Message-Id: <20250119052250.3488343-4-aloka.dixit@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250119052250.3488343-1-aloka.dixit@oss.qualcomm.com> References: <20250119052250.3488343-1-aloka.dixit@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: hNpSmpSApWdrqe_dqUnWVljjGHJgD3zg X-Proofpoint-GUID: hNpSmpSApWdrqe_dqUnWVljjGHJgD3zg X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-01-18_10,2025-01-16_01,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 spamscore=0 lowpriorityscore=0 bulkscore=0 mlxscore=0 impostorscore=0 priorityscore=1501 suspectscore=0 mlxlogscore=999 clxscore=1015 adultscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2501190042 From: Aloka Dixit Create a new function ath12k_mac_get_tx_arvif() to retrieve 'arvif' for the transmitted interface of the MBSSID set. This clean up will help modifying the same code path for MLO changes. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1 Signed-off-by: Aloka Dixit --- drivers/net/wireless/ath/ath12k/mac.c | 60 +++++++++++++++------------ 1 file changed, 33 insertions(+), 27 deletions(-) diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c index 2d062b5904a8..f189ee008226 100644 --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c @@ -502,6 +502,19 @@ static int ath12k_mac_vif_link_chan(struct ieee80211_vif *vif, u8 link_id, return 0; } +static struct ath12k_link_vif *ath12k_mac_get_tx_arvif(struct ath12k_link_vif *arvif) +{ + struct ath12k_vif *tx_ahvif; + + if (arvif->ahvif->vif->mbssid_tx_vif) { + tx_ahvif = ath12k_vif_to_ahvif(arvif->ahvif->vif->mbssid_tx_vif); + if (tx_ahvif) + return &tx_ahvif->deflink; + } + + return NULL; +} + static struct ieee80211_bss_conf * ath12k_mac_get_link_bss_conf(struct ath12k_link_vif *arvif) { @@ -1557,7 +1570,6 @@ static int ath12k_mac_setup_bcn_tmpl_ema(struct ath12k_link_vif *arvif) struct ieee80211_ema_beacons *beacons; struct ath12k_link_vif *tx_arvif; bool nontx_profile_found = false; - struct ath12k_vif *tx_ahvif; int ret = 0; u8 i; @@ -1569,10 +1581,9 @@ static int ath12k_mac_setup_bcn_tmpl_ema(struct ath12k_link_vif *arvif) return -ENOLINK; } - tx_ahvif = ath12k_vif_to_ahvif(ahvif->vif->mbssid_tx_vif); - tx_arvif = &tx_ahvif->deflink; + tx_arvif = ath12k_mac_get_tx_arvif(arvif); beacons = ieee80211_beacon_get_template_ema_list(ath12k_ar_to_hw(tx_arvif->ar), - tx_ahvif->vif, + tx_arvif->ahvif->vif, tx_arvif->link_id); if (!beacons || !beacons->cnt) { ath12k_warn(arvif->ar->ab, @@ -1616,11 +1627,10 @@ static int ath12k_mac_setup_bcn_tmpl(struct ath12k_link_vif *arvif) struct ath12k_vif *ahvif = arvif->ahvif; struct ieee80211_vif *vif = ath12k_ahvif_to_vif(ahvif); struct ieee80211_bss_conf *link_conf; - struct ath12k_link_vif *tx_arvif = arvif; + struct ath12k_link_vif *tx_arvif; struct ath12k *ar = arvif->ar; struct ath12k_base *ab = ar->ab; struct ieee80211_mutable_offsets offs = {}; - struct ath12k_vif *tx_ahvif = ahvif; bool nontx_profile_found = false; struct sk_buff *bcn; int ret; @@ -1635,17 +1645,19 @@ static int ath12k_mac_setup_bcn_tmpl(struct ath12k_link_vif *arvif) return -ENOLINK; } - if (vif->mbssid_tx_vif) { - tx_ahvif = ath12k_vif_to_ahvif(vif->mbssid_tx_vif); - tx_arvif = &tx_ahvif->deflink; + tx_arvif = ath12k_mac_get_tx_arvif(arvif); + if (tx_arvif) { if (tx_arvif != arvif && arvif->is_up) return 0; if (link_conf->ema_ap) return ath12k_mac_setup_bcn_tmpl_ema(arvif); + } else { + tx_arvif = arvif; } - bcn = ieee80211_beacon_get_template(ath12k_ar_to_hw(tx_arvif->ar), tx_ahvif->vif, + bcn = ieee80211_beacon_get_template(ath12k_ar_to_hw(tx_arvif->ar), + tx_arvif->ahvif->vif, &offs, tx_arvif->link_id); if (!bcn) { ath12k_warn(ab, "failed to get beacon template from mac80211\n"); @@ -1702,6 +1714,7 @@ static void ath12k_control_beaconing(struct ath12k_link_vif *arvif, { struct ath12k_wmi_vdev_up_params params = {}; struct ath12k_vif *ahvif = arvif->ahvif; + struct ath12k_link_vif *tx_arvif; struct ath12k *ar = arvif->ar; int ret; @@ -1732,11 +1745,9 @@ static void ath12k_control_beaconing(struct ath12k_link_vif *arvif, params.vdev_id = arvif->vdev_id; params.aid = ahvif->aid; params.bssid = arvif->bssid; - if (ahvif->vif->mbssid_tx_vif) { - struct ath12k_vif *tx_ahvif = - ath12k_vif_to_ahvif(ahvif->vif->mbssid_tx_vif); - struct ath12k_link_vif *tx_arvif = &tx_ahvif->deflink; + tx_arvif = ath12k_mac_get_tx_arvif(arvif); + if (tx_arvif) { params.tx_bssid = tx_arvif->bssid; params.nontx_profile_idx = info->bssid_index; params.nontx_profile_cnt = 1 << info->bssid_indicator; @@ -7561,14 +7572,9 @@ static int ath12k_mac_setup_vdev_params_mbssid(struct ath12k_link_vif *arvif, u32 *flags, u32 *tx_vdev_id) { struct ath12k_vif *ahvif = arvif->ahvif; - struct ieee80211_vif *tx_vif = ahvif->vif->mbssid_tx_vif; struct ieee80211_bss_conf *link_conf; struct ath12k *ar = arvif->ar; struct ath12k_link_vif *tx_arvif; - struct ath12k_vif *tx_ahvif; - - if (!tx_vif) - return 0; link_conf = ath12k_mac_get_link_bss_conf(arvif); if (!link_conf) { @@ -7577,11 +7583,13 @@ static int ath12k_mac_setup_vdev_params_mbssid(struct ath12k_link_vif *arvif, return -ENOLINK; } - tx_ahvif = ath12k_vif_to_ahvif(tx_vif); - tx_arvif = &tx_ahvif->deflink; + tx_arvif = ath12k_mac_get_tx_arvif(arvif); + if (!tx_arvif) + return 0; if (link_conf->nontransmitted) { - if (ar->ah->hw->wiphy != ieee80211_vif_to_wdev(tx_vif)->wiphy) + if (ath12k_ar_to_hw(ar)->wiphy != + ath12k_ar_to_hw(tx_arvif->ar)->wiphy) return -EINVAL; *flags = WMI_VDEV_MBSSID_FLAGS_NON_TRANSMIT_AP; @@ -8982,9 +8990,9 @@ ath12k_mac_update_vif_chan(struct ath12k *ar, int n_vifs) { struct ath12k_wmi_vdev_up_params params = {}; + struct ath12k_link_vif *arvif, *tx_arvif; struct ieee80211_bss_conf *link_conf; struct ath12k_base *ab = ar->ab; - struct ath12k_link_vif *arvif; struct ieee80211_vif *vif; struct ath12k_vif *ahvif; u8 link_id; @@ -9052,11 +9060,9 @@ ath12k_mac_update_vif_chan(struct ath12k *ar, params.vdev_id = arvif->vdev_id; params.aid = ahvif->aid; params.bssid = arvif->bssid; - if (vif->mbssid_tx_vif) { - struct ath12k_vif *tx_ahvif = - ath12k_vif_to_ahvif(vif->mbssid_tx_vif); - struct ath12k_link_vif *tx_arvif = &tx_ahvif->deflink; + tx_arvif = ath12k_mac_get_tx_arvif(arvif); + if (tx_arvif) { params.tx_bssid = tx_arvif->bssid; params.nontx_profile_idx = link_conf->bssid_index; params.nontx_profile_cnt = 1 << link_conf->bssid_indicator;