Received: by 2002:ab2:6f44:0:b0:1fd:c486:4f03 with SMTP id l4csp56397lqq; Wed, 12 Jun 2024 16:42:33 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV2x797Gup6IRWj5QSbWGB4idM7Myk5o5xjTtMJja4ocfMI2PF+mfMlOmX1zWkqVpcglVV+Ss89faUfLpYjEJ6SsHCt8t0Wrdww7nzJaQ== X-Google-Smtp-Source: AGHT+IFRenT6qVXG12N3tIrt5qH6I6s3LYP03SNSi8ESfxC5meqwzkfUWdKY9ezlF54gqjezXicc X-Received: by 2002:a05:6358:71c8:b0:199:313c:710b with SMTP id e5c5f4694b2df-19f69d5f267mr414206155d.18.1718235753043; Wed, 12 Jun 2024 16:42:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718235752; cv=pass; d=google.com; s=arc-20160816; b=iR95eJgwvc7c8pxKqWhBFBznj0WyjFsk2pxXzVWrwT9bRX2iy/x9T5LPJ1Xfkf235i rrq/Le7miLQ/9eoQs5a+HypyOoXwU7r4JPTB0rw+6pYUmQC4B4c1o9I5advuzTIaOV7b unzQRIExFrAyCeNKDklPneX3afZElreDTHG9+Ic/8sDXX7jLm6tRii0DJWfIN3GszFoh 0uAiEgH1USL0trwFdAbegDYH41ANO+6O9nAy3ZwaRfRGKx/t8fhBFteMvPbs1JaTjt2a vZC49taIVPwrbqBzLTr14FPfN9himUUukEg/QPuyvhA28dRjBQ2T+Mw5eSuOb8Yedonh 0xsA== 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=M2GnSt4AYD9QvRB0xcex7GNqugRQhrhmdyTTfrQEIx8=; fh=crEu+w2csGJ29oEUPPLIavXvzW8xdw/KYVDhAqNAfVc=; b=r0hE3wX9p1MbP7QShz1bw9PV7n7XmDJscM7HN1EGY7y6pxGPYa8Bp/yxzSgNNZF3mI /85l1PJh+MHh5+lVtRiiugefdr/kYUc1m5X5fkvbGUgHTjaxXTfImkcoIO2dDrQ4iTuk X/4r5m0z2DYdgCGRhK7Pi9lVSwaaKm7yafRoKlHNK2cy+ceQa3GSLXes7EJYk7cJLy2i TlUa/llAccHsuFrg6nuPxDTNPEXGnoscuhqQaxseH1n8kRZr18GLoV4Kj79mF+wewlKu 3zxWa53uQWWF1+z9KLGXKZeDDt+NLOVChS0myOnlJB2d2HMcbRhaw05l3Ar1xRi/fnWa tQXQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b="Cs/sSBSL"; 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-8900-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-8900-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6fee310d192si84417a12.248.2024.06.12.16.42.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 16:42:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-8900-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b="Cs/sSBSL"; 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-8900-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-8900-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 0F1CEB214D4 for ; Wed, 12 Jun 2024 23:42:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1959C12D219; Wed, 12 Jun 2024 23:42:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="Cs/sSBSL" X-Original-To: linux-wireless@vger.kernel.org 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 A0CBC12C526 for ; Wed, 12 Jun 2024 23:42:24 +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=1718235746; cv=none; b=gVrINC5Uot8LdLralUgnSqb0OnqETfiDEFDBNoQKYv0+FEgpRXr/3x4DPp4+6La1JWxnBCi0LkQD1sxhSWVvmbmU4d2mmlV0Auxq7NSGHpXLb3/i7pD0VbCHsw/CBBh3LMLNPvw+2Se6IkyDT6X3+ds+RDLq+pof953roZ2f+LE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718235746; c=relaxed/simple; bh=2GfKujUstZ67taTCiAh8aDWXnpKKpZfcZADfkXDwpSk=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=svDw+5a4QNaHvG88/dGVgrcv1mFjEGjTgtUdc35I6OjtDeiVmTemz8hSOuMc/hT3Nf/VJyrkSJ6xfOI8//WfWdB/cfMormQyvPRmNjdZURAG/yampfd9vqjRvDa43P9FkHie1P6r1O/8GsI5nKYElFn0ge5AXBwvU22QbnqyOv8= 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=Cs/sSBSL; arc=none smtp.client-ip=205.220.168.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 (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45CKnJO4024376; Wed, 12 Jun 2024 23:42:22 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= M2GnSt4AYD9QvRB0xcex7GNqugRQhrhmdyTTfrQEIx8=; b=Cs/sSBSL7oEMD5JY MCSTEq5+8nQOnM25qgFxp1uqYepqyH0tCacPvvjjzvo/6yLMZLZaclQvxr6HjjHN Q8lYG1Eod4ZuOYItmlEUss3XF61UBSndnseBQdk4jGjHJ9Tfw48jTEmL1D2qMMZK kD4fqdhKcpDDzab+25rJyvkCv3YnhFw0FLA5Vw/9+jMhDQJHrYX4XsBimub+uple FyaUYu/eZIg789l1EB3F8rKUlF4hXbvbGk9z9lPHbdlc5YbPvAO4pfLYtBn3Tl30 ZTg5A6dqk/fs1taaXl8Y39ucVTRnbpUebu7ejs+NWJNVtcW1lskmfhS1j5tbY3JI v969EQ== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3yqcxthesm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 12 Jun 2024 23:42:22 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA02.qualcomm.com (8.17.1.19/8.17.1.19) with ESMTPS id 45CNgLGO001815 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 12 Jun 2024 23:42:21 GMT Received: from pradeepc-linux2.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; Wed, 12 Jun 2024 16:42:21 -0700 From: Pradeep Kumar Chitrapu To: CC: , Pradeep Kumar Chitrapu , Muna Sinada , "Jeff Johnson" Subject: [PATCH V7 3/9] wifi: ath12k: move HE MCS mapper to a separate function Date: Wed, 12 Jun 2024 16:42:03 -0700 Message-ID: <20240612234209.2324181-4-quic_pradeepc@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240612234209.2324181-1-quic_pradeepc@quicinc.com> References: <20240612234209.2324181-1-quic_pradeepc@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-ORIG-GUID: QDdBV8klGUnYvCrohhhEZRkgTx2v4Gyt X-Proofpoint-GUID: QDdBV8klGUnYvCrohhhEZRkgTx2v4Gyt X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-12_11,2024-06-12_02,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 adultscore=0 lowpriorityscore=0 mlxlogscore=999 spamscore=0 mlxscore=0 priorityscore=1501 bulkscore=0 phishscore=0 suspectscore=0 malwarescore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2405170001 definitions=main-2406120169 Refactor the HE MCS mapper functionality in ath12k_mac_copy_he_cap() into a new function. This helps improve readability, extensibility and will be used when adding support for 160 MHz bandwidth in subsequent patches. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1 Co-developed-by: Muna Sinada Signed-off-by: Muna Sinada Signed-off-by: Pradeep Kumar Chitrapu Acked-by: Jeff Johnson --- drivers/net/wireless/ath/ath12k/mac.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c index 3d219952cbdf..238decbb16f9 100644 --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c @@ -5405,12 +5405,24 @@ static __le16 ath12k_mac_setup_he_6ghz_cap(struct ath12k_pdev_cap *pcap, return cpu_to_le16(bcap->he_6ghz_capa); } +static void ath12k_mac_set_hemcsmap(struct ath12k_band_cap *band_cap, + struct ieee80211_sta_he_cap *he_cap) +{ + struct ieee80211_he_mcs_nss_supp *mcs_nss = &he_cap->he_mcs_nss_supp; + + mcs_nss->rx_mcs_80 = cpu_to_le16(band_cap->he_mcs & 0xffff); + mcs_nss->tx_mcs_80 = cpu_to_le16(band_cap->he_mcs & 0xffff); + mcs_nss->rx_mcs_160 = cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff); + mcs_nss->tx_mcs_160 = cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff); + mcs_nss->rx_mcs_80p80 = cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff); + mcs_nss->tx_mcs_80p80 = cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff); +} + static void ath12k_mac_copy_he_cap(struct ath12k_band_cap *band_cap, int iftype, u8 num_tx_chains, struct ieee80211_sta_he_cap *he_cap) { struct ieee80211_he_cap_elem *he_cap_elem = &he_cap->he_cap_elem; - struct ieee80211_he_mcs_nss_supp *mcs_nss = &he_cap->he_mcs_nss_supp; he_cap->has_he = true; memcpy(he_cap_elem->mac_cap_info, band_cap->he_cap_info, @@ -5448,13 +5460,7 @@ static void ath12k_mac_copy_he_cap(struct ath12k_band_cap *band_cap, break; } - mcs_nss->rx_mcs_80 = cpu_to_le16(band_cap->he_mcs & 0xffff); - mcs_nss->tx_mcs_80 = cpu_to_le16(band_cap->he_mcs & 0xffff); - mcs_nss->rx_mcs_160 = cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff); - mcs_nss->tx_mcs_160 = cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff); - mcs_nss->rx_mcs_80p80 = cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff); - mcs_nss->tx_mcs_80p80 = cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff); - + ath12k_mac_set_hemcsmap(band_cap, he_cap); memset(he_cap->ppe_thres, 0, sizeof(he_cap->ppe_thres)); if (he_cap_elem->phy_cap_info[6] & IEEE80211_HE_PHY_CAP6_PPE_THRESHOLD_PRESENT) -- 2.34.1