Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp198609lqo; Tue, 7 May 2024 17:45:42 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVH5BNoS2Xd9YykApsAfQFMpjMb+1jqWsPoUxAoaYENx34ModrIZ124U37kxmJoPh4en85jhf+cLq3LYM6zTkhPq6UaXHDqaQ+QO9pdZQ== X-Google-Smtp-Source: AGHT+IGevguxiXLIbgqcuB/VKOPL0JI71I6qm45xndGT7Xt/9Tnoy1Fq2yLWGSL7zCnSPxgDS8dQ X-Received: by 2002:a17:902:ed45:b0:1ea:b3ba:79f5 with SMTP id d9443c01a7336-1eeb0bad5f2mr10816985ad.60.1715129142548; Tue, 07 May 2024 17:45:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715129142; cv=pass; d=google.com; s=arc-20160816; b=u2paeZMObgTxFGPX1DX8yH7oFnHhDwffvWaYSDCXVUi1wvyoPego6wBd8U49kPN1+y fl0ABZE7LIAN73hm6vNQSaDdsIwnDl29anT7zZVjvgfN4CaJewji17QouSMIMFzNZmyu hTchXLlDP+dgPDBXb9Jon9FX+o6YCOpUf/aq8Q3h+ep7uzxhhvL5hyM/ROUCo0Id9lSV nmUKOVQEwjymYIb4JHeojmGd0HnUaD5eQPQmZnMLAdjagG999m9PBj5XTjf4kNYJpTt9 CuawlznOPwNh3inYN2wz14Oe5+ZfF21IlG3MEy7KAC43tYOguL9XyuwswPDlPPtWgPNf 8C8A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=9kGqNiU+k8HVPA+LLeV7qbBaooaW5xUvfMcvOiJloW4=; fh=pGsTab+RUH+9r/6ZhhJeRz+N0kJvd4lyVG0vuCruCFU=; b=NkYOp3WHMs2O/Vp+QjkH2pM4gVYADqmSnKJ2enYE6x2S8ZBK+a3kQvUmZsN/0Buy3N xOw5q3tLyjAFok/UgShm+Xryg2Tepul4ARpBNM+eRHezdj5Thg2W/I9tpa1AaHAbyQQN IA1N8LjgyT+CM6+w7iVE25EPTnJrpxzIMwBs6GEviFNwM9J1h1yS2a9Cr4bXlUSoL3wP 1JIuwzOh1y3gxcI5RWGZM7T/c1QxracNwa3Vd/deE8ekL6SVl8ToTdNpewqL+Oa9SB5S CqaDdIDt3nPRQWYa7NP4PgqlKd/a8mMW0JKM6SWPYfZ4ErnVGNv9oPJDL8jZGrJ1j6Zr 89+g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b="KW+/NrxS"; 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-7317-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-wireless+bounces-7317-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. [147.75.48.161]) by mx.google.com with ESMTPS id k12-20020a170902d58c00b001ec3e03ffbasi8105534plh.380.2024.05.07.17.45.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 17:45:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-7317-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b="KW+/NrxS"; 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-7317-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-wireless+bounces-7317-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 72786B229D9 for ; Wed, 8 May 2024 00:21:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DF4FC7490; Wed, 8 May 2024 00:21:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="KW+/NrxS" 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 75F8A364 for ; Wed, 8 May 2024 00:21:12 +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=1715127673; cv=none; b=rSFG636HQP4RG4aTQ/gyfE47jtpEbdZpfpSjI4b4oSkW5/MjRzWB2sMAh4sB8Wr1mVv2Xc7wTyM7/zixoSEBTXzBuxEzQHdL7CI0MByMeGIxEGVEDYR5g4EyKVuu2J9W4I92Adr+ROLnv8Cqj+YvwgIpjyuO6XGJfnGZhqclyL8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715127673; c=relaxed/simple; bh=dkeuEUICS6pQXMZXIa0kvFDAyaVfaCUp9c1lwrqYSXY=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=FQqjZczdUepHeTof1qMInEDRl2DKJh/fSSr+xffu9/Cp/MKvGT3+Ow3xpVmxrwYmJTZkQX1LihrAy1i2uvQowUEdJsLJLNOWP60/cdz7RQnVjpxOssjZbefGhj2MEn8aEmMnHDpnGQhedvajWqDy7Zx3qpKuhrgMeMzDQ2BQyJs= 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=KW+/NrxS; 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 (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 447L4Gs6005571; Wed, 8 May 2024 00:21:07 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-type; s=qcppdkim1; bh=9kGqNiU+k8HVPA+LLeV7 qbBaooaW5xUvfMcvOiJloW4=; b=KW+/NrxSszVaAuX4Q1Fp9V72VJvM+TS45fju VbHG6EeznT8lkPmD4dQSqBrdaK1j8IHrsns9xcRMiqtihGsQ9tN4F8x7zh5MCCbe NiFahsQ9f3ZJc1C5kvpC4YIm0GbJPtt41yrl0PWBXicEHt7iBOrV2LDl69KoFV+D B6k1PCTx4d8c9jrw3ZpbR/u4ChJntsX5elY2BGBi1/iLhrT4psbHeMEjpHwk0PWk +uzANPLh9swZWeADPnM01sfau3wTdVPLoST6BNy2hvgjoC5oUd00YcNsZ/NI+5as Ee0mc7LflEPp0FFwOdFBtx0nFMgGzIooqckYrZ8IwoF6bsSYjA== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3xysg4rkhm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 08 May 2024 00:21:07 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 4480L6mr032568 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 8 May 2024 00:21:06 GMT Received: from pradeepc2-linux.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; Tue, 7 May 2024 17:21:06 -0700 From: Pradeep Kumar Chitrapu To: CC: , Pradeep Kumar Chitrapu , Muna Sinada Subject: [PATCH V4 04/10] wifi: ath12k: move HE MCS mapper to a separate function Date: Tue, 7 May 2024 17:20:49 -0700 Message-ID: <20240508002055.17705-5-quic_pradeepc@quicinc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240508002055.17705-1-quic_pradeepc@quicinc.com> References: <20240508002055.17705-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-Type: text/plain X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) 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: kfpdCghmXdsWbxEeGDw9EWXKM6oaaZy4 X-Proofpoint-ORIG-GUID: kfpdCghmXdsWbxEeGDw9EWXKM6oaaZy4 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.650,FMLib:17.11.176.26 definitions=2024-05-07_16,2024-05-06_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 bulkscore=0 phishscore=0 lowpriorityscore=0 adultscore=0 priorityscore=1501 mlxscore=0 impostorscore=0 mlxlogscore=999 clxscore=1015 malwarescore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2405010000 definitions=main-2405080001 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 --- 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 f58558a52eef..e60da45b9c7f 100644 --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c @@ -5162,12 +5162,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, @@ -5205,13 +5217,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.17.1