Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp65210lqe; Fri, 5 Apr 2024 12:46:38 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVO+/Xd/LHrePAASLr4mbQXH2hjcJARMa8QaLjEoktVN57X656GZyXhOcnFP6buFjFu14S1db0GFc1mUCpGpOkNBX6qVSvuzE17z5nMPA== X-Google-Smtp-Source: AGHT+IGn7unCUvkKC8hB6PjSPxCWCIZJEpCUH70CTEzn41Va/a5I9YZq7jmUrpFiQuHTWMrPc015 X-Received: by 2002:a05:6102:358d:b0:479:e281:95e5 with SMTP id h13-20020a056102358d00b00479e28195e5mr1884818vsu.12.1712346398142; Fri, 05 Apr 2024 12:46:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712346398; cv=pass; d=google.com; s=arc-20160816; b=xd37dINxuXxEVm/EIhyIcWOHCN5dOmN582Z24i+ekiIB4vuBbtUNqtxcB+/gWJTPG6 7tFbcvD7AWtR9+1V1G19oTIRtkNJSv23xQ9seG+rBz4WpC+v3LbXhyczcoZ/1E3kRNb9 iqu0AgPywV3X6ODHegxl6HXpy2ZDHEneFWhGRX+j1PGwL/yfMB0mLU9hAjYMxUOo8r4e I89tuHEdzCIAE6n1DfECAt7+R96YyZZE6iUdx8oqUEmk96GvsRC02ykylPJ1cec9lgwF jh250y8bHixlTapMRRP3NLEw86cvo1m0wl+8DEN1ZcxBCAYWKEZF4bOPjWnTNotY/H5R rIxQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=XK2s6Noz1QM8tLx00wqkagSTQ96Hwv0it0m74qD7CSw=; fh=hXmvBwTcrACbulhadJq4aGomw93PvN9px3WarQqqC4o=; b=LQyS12WCd62nxDu1eXK8UUTp3dcTc5V5saIAt4tq7mCrcTiuujUFIStTj6bULhWn2U V1f7AQmLaSpsGveLAf8B5+Q/bikMGzjj1z1K5eoZ8mG2X//rOV8frgKpDuaPVTsVKGh3 Fxi+GTDEraeb1apWCp70H9uPOq5ZMvi3mRe2KxHM7bWPy3BBYEkNeESOsiudgt2ImW7B /ycCo+zqkczQtjqmC6Q/onCd3uan4J7wLwZEEgB4nNQxxA71oAsPrlhdPJBKfZ5fNZ4W 3dg6tVaK42SNZE9ufHr4yYUiAPrDY1vmGaMs+M06/mF4tclbB50XGI8oHLR+u1JX8Moz ypKA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=G1JUfBDS; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-wireless+bounces-5930-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-5930-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id cp14-20020ad44aee000000b006994885bf8fsi879735qvb.527.2024.04.05.12.46.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 12:46:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-5930-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=G1JUfBDS; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-wireless+bounces-5930-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-5930-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id CC24D1C20F60 for ; Fri, 5 Apr 2024 19:46:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 52FB817334C; Fri, 5 Apr 2024 19:46:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="G1JUfBDS" X-Original-To: linux-wireless@vger.kernel.org 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 C4F9F17334A for ; Fri, 5 Apr 2024 19:46:06 +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=1712346368; cv=none; b=swrqIn15CCxaOkpzzGkQgVzQtgH7g+t98CnB1vTv0J4kIh+Ok77TICjmZagjLBTC+BNK9UBBiHA3kSTiQtH3KZa8bu/MZJhzJKsuWdLXDyiz2pnc/rIkKjxDaCz+0UFn5caFC9g8q/W5dNmKVUHTN/DOMNZlkXZGaMFl7OQwKPQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712346368; c=relaxed/simple; bh=56AdkXLhjPUJcOId7vnqwyhEI5FQznfNxMCVb1Bh6S8=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=YJBEeb/Qty3IOUutsaT7l5hJujvqFlJsLM8U9QaYF/l6LfnoJZ/RdAfrd9BymOvwG0+aMmuQHJLn7bsSOS90H90w6q8OJNV6EuafytoODcxnYnq64+d3io3sP3pBKp4mXX9MsIdgbuB/T5kqKDd1PnlMEx8ahWiqEvpdXVGSnFw= 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=G1JUfBDS; 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 Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 435Jav44002153; Fri, 5 Apr 2024 19:46:02 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= qcppdkim1; bh=XK2s6Noz1QM8tLx00wqkagSTQ96Hwv0it0m74qD7CSw=; b=G1 JUfBDSw0feCjJGz4mRPS4bXMDikxlVCK5kPQ0VYcb+4yz1abgRW3SrTu83UuJynl 9iaJd0Y0jEbETS6v3Io8LPdczAmWYWGLw2PGX5Bj1CdObGVFCM9GYrSdXibO9+Cm zUKUgza01mq+lniFwEiko+c+1newRAcp8M/xqRdwtBUdbNDPD/+11Sv+qr6UWu/l NQGUkGCgmKpiMcPfjt55yoOTdAbZXW8qNELJg1P6M81DEmonFYNMgIcgsD3aPS2W yHPUtlnwUGdKtAcQkxy++QuOrSFxpea0WdzhyzP9MnKzRb1Sz+yRg0WSYCK1spoe Hywr8q+WbwZ1z59pXhuA== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3xad7h1hf4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 05 Apr 2024 19:46:02 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 435Jk1xw029991 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 5 Apr 2024 19:46:01 GMT Received: from hu-ramess-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.4; Fri, 5 Apr 2024 12:45:59 -0700 From: Rameshkumar Sundaram To: CC: , Sriram R , Rameshkumar Sundaram , Jeff Johnson Subject: [PATCH v7 12/12] wifi: ath12k: support get_survey mac op for single wiphy Date: Sat, 6 Apr 2024 01:15:19 +0530 Message-ID: <20240405194519.1337906-13-quic_ramess@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240405194519.1337906-1-quic_ramess@quicinc.com> References: <20240405194519.1337906-1-quic_ramess@quicinc.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain 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-Proofpoint-GUID: uGZ97KWnOTb53Ju0-ofXbuB7n163IRnr X-Proofpoint-ORIG-GUID: uGZ97KWnOTb53Ju0-ofXbuB7n163IRnr X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-04-05_21,2024-04-05_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 adultscore=0 mlxlogscore=882 clxscore=1015 mlxscore=0 bulkscore=0 lowpriorityscore=0 suspectscore=0 malwarescore=0 impostorscore=0 phishscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2404010003 definitions=main-2404050138 From: Sriram R The radio for which the survey info needs to be collected depends on the channel idx which could be based on the band. Use the idx to identify the appropriate sband since multiple bands could be combined for single wiphy case. Also use the channel idx and sband to identify the corresponding radio on which the survey results needs to be populated. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1 Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3 Signed-off-by: Sriram R Signed-off-by: Rameshkumar Sundaram Acked-by: Jeff Johnson --- drivers/net/wireless/ath/ath12k/mac.c | 29 ++++++++++++++------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c index 72495136022b..f15dcd75157d 100644 --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c @@ -7851,21 +7851,13 @@ ath12k_mac_update_bss_chan_survey(struct ath12k *ar, static int ath12k_mac_op_get_survey(struct ieee80211_hw *hw, int idx, struct survey_info *survey) { - struct ath12k_hw *ah = ath12k_hw_to_ah(hw); struct ath12k *ar; struct ieee80211_supported_band *sband; struct survey_info *ar_survey; - int ret = 0; if (idx >= ATH12K_NUM_CHANS) return -ENOENT; - ar = ath12k_ah_to_ar(ah, 0); - - ar_survey = &ar->survey[idx]; - - mutex_lock(&ar->conf_mutex); - sband = hw->wiphy->bands[NL80211_BAND_2GHZ]; if (sband && idx >= sband->n_channels) { idx -= sband->n_channels; @@ -7875,11 +7867,22 @@ static int ath12k_mac_op_get_survey(struct ieee80211_hw *hw, int idx, if (!sband) sband = hw->wiphy->bands[NL80211_BAND_5GHZ]; - if (!sband || idx >= sband->n_channels) { - ret = -ENOENT; - goto exit; + if (!sband || idx >= sband->n_channels) + return -ENOENT; + + ar = ath12k_mac_get_ar_by_chan(hw, &sband->channels[idx]); + if (!ar) { + if (sband->channels[idx].flags & IEEE80211_CHAN_DISABLED) { + memset(survey, 0, sizeof(*survey)); + return 0; + } + return -ENOENT; } + ar_survey = &ar->survey[idx]; + + mutex_lock(&ar->conf_mutex); + ath12k_mac_update_bss_chan_survey(ar, &sband->channels[idx]); spin_lock_bh(&ar->data_lock); @@ -7891,10 +7894,8 @@ static int ath12k_mac_op_get_survey(struct ieee80211_hw *hw, int idx, if (ar->rx_channel == survey->channel) survey->filled |= SURVEY_INFO_IN_USE; -exit: mutex_unlock(&ar->conf_mutex); - - return ret; + return 0; } static void ath12k_mac_op_sta_statistics(struct ieee80211_hw *hw, -- 2.25.1