Received: by 2002:ab2:7a09:0:b0:1f8:46dc:890e with SMTP id k9csp189119lqo; Wed, 15 May 2024 11:14:18 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUYZI16MpIIpfHDkNIg6tAPCdzgHijc8dhHWQFk9kp3z/sWQf4o+7fTjgqBnY5hy3Q7U0qWF9mcJPL5YJIVj8pf01aH/3yfogg64TmBWA== X-Google-Smtp-Source: AGHT+IHL6T51UaBcrlLwrO92HtBQkRLeDZa8M8AcQ1TJT808p1UpACThuWTJV8HfRmRtL5JkSM9L X-Received: by 2002:a05:6a20:72a5:b0:1a7:59b5:4276 with SMTP id adf61e73a8af0-1afde1df5b2mr17050595637.54.1715796858160; Wed, 15 May 2024 11:14:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715796858; cv=pass; d=google.com; s=arc-20160816; b=UEbWa9W4ajl9bRYGBUC99t7lI7Pqjnvi4aRVC+I2aC6xQuTCVcMdlvZT/dRY1/gpVU YffRcHSo4xXt6dfY4iIjg7z9g5oXTstqz7QMoXuxG5DEczVWXW9XjOrCobFBLYW2ZvQ3 MKN1RQBnHtszVvY3LwtsTpjOn2mtGqt3PtbSqY4sNGTOfv5UzYkFI+l+9c4G+zsUvh/e cbRjGavBBe6aEBVHYV+tKMbeXP/HphVjyAyMQXEDehyFEZP5W0dSmYabhg2Se4q/gpBf iqvxYm1fwtM115SvoCGh9w0LK27GmJoAkJhH3K+2XWhN37WKvXiU7Wbxbx4yBs12SUtA uWUQ== 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=KqgwSud5LHDNcWKkbiosVTYgiYJzP/tgDysaaypB+gg=; fh=pGsTab+RUH+9r/6ZhhJeRz+N0kJvd4lyVG0vuCruCFU=; b=B3QnjeXrj76nIejSkKdJ7dVrlpteI2BYEV7+UYkwyzOO0GRB7RGRoxJ7UnNlMjb0dM Ylo8TGz7Cf2Gus4lQLj60x64J8EItZqnl41kmS5txiD1vQ21ksSuBjz7ozostkAfyvxc 37gRABCtfkDAIZHtEuZ8yETzXsk+kiHE/GQS675HeSeQd1uSLpvbsC1A55ia79Cz/+8I LQxBxnQYHsCEN53hcsQpEgG7H82qWk01+K75Rl+r0aWt4hDXWUVeUyCEraJL8aWHHDhp YZ7ayBkxQzNkO5GUvRXW7+1jxFYHzXf913WakRVlfMZjWhBPTrOY52sg5D2J3yeKQgQn bSOA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=OnHqUnLS; 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-7706-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-wireless+bounces-7706-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-63409e83a64si14242514a12.173.2024.05.15.11.14.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 May 2024 11:14:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-7706-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=OnHqUnLS; 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-7706-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-wireless+bounces-7706-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id D5CF0284A97 for ; Wed, 15 May 2024 18:14:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3DADC159217; Wed, 15 May 2024 18:13:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="OnHqUnLS" 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 66D22158DCE for ; Wed, 15 May 2024 18:13:50 +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=1715796833; cv=none; b=gkoidCpLqAFkJ1takJ128Q2KaonszXtgCw6CfXP8kb9RWv53qRTdGwNV7IQpnTRAMagtE/tCrT+1IPNE38coNKcWD9DkBfp53Hd6L6ddOBjUM/pTKUImCIkQKd0i1L7KSpGenbrzy6nEEVC+s1YVAbcPr9vNi4/kcoulCtG5gns= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715796833; c=relaxed/simple; bh=bnINdESdocHMf23JE9c4NMOuKgqdWMojNUyhCLHEohU=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=En0mHClS9fesV1JlsMiVYcfbRQZyC+gl/ehI2WunhveAI1lFcoAgD6FX/c0Ic+eeS5bbGPP88conuM5Pa2Bi4OCqnLQAMFM47R9hDzG0712WP2MhGY39eIQgiokh39SnN65WejuybzuvsR+dwIeg3vUmTfbMyTo3nLmKlwvfNUk= 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=OnHqUnLS; 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 (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 44F916Ko030011; Wed, 15 May 2024 18:13:40 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=KqgwSud5LHDNcWKkbios VTYgiYJzP/tgDysaaypB+gg=; b=OnHqUnLS7bPIBKzvU4V0UF9+Bdil/t2DswJ1 jAcyYaNBp/UWEhjwzLKoYw8P1T6AeZgZsp3uvZfbc82Bltkn2wWg1Bg6YuhIlK0v 9a0o4CeKB/5GGNihRpmvNlpf06TvLP+PHyArEQETXjTjsp7c3M6awhGtTT95DWcy JiryvJmqK4e9VBBuEVIpG2ju9uZNIQUU3MKeSmB41/rcKcU/rWdBeIdLWW41fVC1 AADzCZ4l0wJfoFa5Y+QEZn97CU/zKqEraQioj4/S/XLNX01zauTGyqsy2UKAlERu 7DkQnzydjZcowyZZ5GNPtS3k1ui7pFsMvDzzXFzupQecAnYAcQ== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3y21edhmk1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 15 May 2024 18:13:40 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 44FIDdo2017566 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 15 May 2024 18:13:39 GMT Received: from pradeepc-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; Wed, 15 May 2024 11:13:39 -0700 From: Pradeep Kumar Chitrapu To: CC: , Pradeep Kumar Chitrapu , Muna Sinada Subject: [PATCH V6 04/10] wifi: ath12k: move HE MCS mapper to a separate function Date: Wed, 15 May 2024 11:13:21 -0700 Message-ID: <20240515181327.12855-5-quic_pradeepc@quicinc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240515181327.12855-1-quic_pradeepc@quicinc.com> References: <20240515181327.12855-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: 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: 6lpMluYfOmhfjQ8wASM_9-_hNYPhaDCP X-Proofpoint-ORIG-GUID: 6lpMluYfOmhfjQ8wASM_9-_hNYPhaDCP 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-15_11,2024-05-15_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 adultscore=0 priorityscore=1501 bulkscore=0 spamscore=0 mlxscore=0 malwarescore=0 suspectscore=0 impostorscore=0 clxscore=1015 lowpriorityscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2405010000 definitions=main-2405150129 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 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