From patchwork Mon Mar 24 06:25:16 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Karthikeyan Periyasamy X-Patchwork-Id: 14026790 X-Patchwork-Delegate: quic_jjohnson@quicinc.com Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.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 BB61C19CC34 for ; Mon, 24 Mar 2025 06:25:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742797558; cv=none; b=Bp6fAt+EIznx/E817oQFD5MS6tjqOixsPRvgcHAWmzKnVdOain1DZRQsiCHk7z7U5YPiUjKNk/tLOIiDD8Wv5Prf2qWyxXvxx7duU5mHnXHvjgL7dbch4ZBC3Q7Fv0J5Kn1N7HbNX3q/LYk+4VsSWTYmWiCLyCXqPRih1qlO12U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742797558; c=relaxed/simple; bh=VuLiz9WeAossF53sn0PRz3CwKmaPL2ok044xIMYnXLE=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=q8eiNGRuA6gUmxmZZTk8/vAH7/SYgsl2jmzDI6ui4EbIY0Pt7kzixs177ZPxAaMJfBgqGSS/7KJRKfLG/JS49xRbHWomI23uf4+YXuucdGd7z3g84siG08jzYTr9Uutvulo0faEWSAqK59DxsUYzV1Ou76dFzVtJoPrbfWeAiCM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=n5u+6eBF; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="n5u+6eBF" Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 52O6FYo3010592; Mon, 24 Mar 2025 06:25:53 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= sy1BUijpS6qBozjmJtRlQj5GKK3Iyjfq079WYgE1s3I=; b=n5u+6eBF6GeWeTTz HunP2Yl0UhvxgK9bsvFK2Igrgj0HbMJO7RDwXfCfXiW6bSXEo3if1Hg0UUmu5gpS MFHksrd9+9RxrEZF0w47veLRS3Zx5nMv3BOWH82MOrEUzgc9T5Ns6p4CuN2+5a32 dRjcK0oiiMgdbyKa9N7sayjdCIPLuQawAn1kT9krRUG11rlf4JWPORcvkUSY5yN2 6xmjdPRVMP+W75x+5lVbxzs1/rPsqzaYf9Rh0LMDss7+SFO8lLmwxnkq/hxt/TVR SNWFCP0T6odAAJKDtgWl6R0VkhNkO8J4Nog9YeHqu/4Plj4CnaHxLsqr0ysfu1x5 LjySag== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 45hmhk3agm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 24 Mar 2025 06:25:53 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA01.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 52O6PqwK013118 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 24 Mar 2025 06:25:52 GMT Received: from hu-periyasa-blr.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Sun, 23 Mar 2025 23:25:50 -0700 From: Karthikeyan Periyasamy To: CC: , Karthikeyan Periyasamy , Vasanthakumar Thiagarajan Subject: [PATCH v11 08/10] wifi: ath12k: Refactor the monitor channel context procedure Date: Mon, 24 Mar 2025 11:55:16 +0530 Message-ID: <20250324062518.2752822-9-quic_periyasa@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250324062518.2752822-1-quic_periyasa@quicinc.com> References: <20250324062518.2752822-1-quic_periyasa@quicinc.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Authority-Analysis: v=2.4 cv=C4PpyRP+ c=1 sm=1 tr=0 ts=67e0faf1 cx=c_pps a=ouPCqIW2jiPt+lZRy3xVPw==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=GEpy-HfZoHoA:10 a=Vs1iUdzkB0EA:10 a=EUspDBNiAAAA:8 a=COk6AnOGAAAA:8 a=ix54J4PnvFNUGTDFoFUA:9 a=TjNXssC_j7lpFel5tvFf:22 X-Proofpoint-GUID: jXFQhvh_vyNEEWvQHWZotolToDbsn2oJ X-Proofpoint-ORIG-GUID: jXFQhvh_vyNEEWvQHWZotolToDbsn2oJ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1093,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-03-24_03,2025-03-21_01,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 mlxscore=0 phishscore=0 mlxlogscore=761 priorityscore=1501 impostorscore=0 bulkscore=0 clxscore=1015 spamscore=0 malwarescore=0 suspectscore=0 lowpriorityscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2502280000 definitions=main-2503240046 Currently, the monitor start procedure use the iteration callback to pick the last available channel definition in the mac80211 hardware. This approach is incorrect for the single wiphy model, as it holds multiple radio/link channel contexts within the same mac80211 hardware. To fix this, change the iteration callback to pick the specific channel context for the given radio/link. This approach makes the monitor start procedure compatible with both multi wiphy and single wiphy models. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1 Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3 Reviewed-by: Vasanthakumar Thiagarajan Signed-off-by: Karthikeyan Periyasamy --- drivers/net/wireless/ath/ath12k/mac.c | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c index 520d7dc52f02..c659f1d83b22 100644 --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c @@ -1336,19 +1336,9 @@ static int ath12k_mac_monitor_vdev_delete(struct ath12k *ar) return ret; } -static void -ath12k_mac_get_any_chandef_iter(struct ieee80211_hw *hw, - struct ieee80211_chanctx_conf *conf, - void *data) -{ - struct cfg80211_chan_def **def = data; - - *def = &conf->def; -} - static int ath12k_mac_monitor_start(struct ath12k *ar) { - struct cfg80211_chan_def *chandef = NULL; + struct ath12k_mac_get_any_chanctx_conf_arg arg; int ret; lockdep_assert_wiphy(ath12k_ar_to_hw(ar)->wiphy); @@ -1356,13 +1346,16 @@ static int ath12k_mac_monitor_start(struct ath12k *ar) if (ar->monitor_started) return 0; + arg.ar = ar; + arg.chanctx_conf = NULL; ieee80211_iter_chan_contexts_atomic(ath12k_ar_to_hw(ar), - ath12k_mac_get_any_chandef_iter, - &chandef); - if (!chandef) + ath12k_mac_get_any_chanctx_conf_iter, + &arg); + if (!arg.chanctx_conf) return 0; - ret = ath12k_mac_monitor_vdev_start(ar, ar->monitor_vdev_id, chandef); + ret = ath12k_mac_monitor_vdev_start(ar, ar->monitor_vdev_id, + &arg.chanctx_conf->def); if (ret) { ath12k_warn(ar->ab, "failed to start monitor vdev: %d\n", ret); ath12k_mac_monitor_vdev_delete(ar);