Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2925591lqp; Mon, 25 Mar 2024 13:17:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUlSkval9HH5I91ZHOlbailaXsfUh2b/vmZEm+Bcql3E8EF3e6Pqq0YVm1BjS3rbcORN8FKRzj0/HhoqeQT5+OqSoiSa7hBkemHd0WYeA== X-Google-Smtp-Source: AGHT+IFPTKIt/F0kcuMNDAW4+hp/X0K+V5xz8OOF7H/g7ti4mi5fWyBPo7t3dz0ry73iewHy65tp X-Received: by 2002:a19:6446:0:b0:513:c53b:90db with SMTP id b6-20020a196446000000b00513c53b90dbmr5404111lfj.8.1711397822521; Mon, 25 Mar 2024 13:17:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711397822; cv=pass; d=google.com; s=arc-20160816; b=WNFpD5bgpif7+NMUA5yfS2tBYAbGiudFjCCvzImd4tRA+OsbtxLMB5yHVmmH8QKQkc 0ykJXOfWS0EYepFAhdBqDvt0lj9B98Gvva7iG5FNbmQf6tm5TniG6YbXlowZbg4fxO5x PdD4VycR1dG0XYi3UiPq/kEXInEwgN9MNej4YiMEcGcOYu/r8nenxfi53gur15xxT3DQ amSIu5oIxMQaQ19KEsN9rRgit/OzlTaaIHcdMm0ObnWx+ibSKB/syiBH/EMb68m2O/1C 9Azx26CWpY1iQaFnqz5ifpbYR60QCFm98Gd07oKs+GFXjt4EcMiKshm1wXxDVnz6tDZm zbqQ== 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=oc3hTCWIsKw2AFXxyjYWViNVMUhHCBGU4HVX5WFHhXA=; fh=pGsTab+RUH+9r/6ZhhJeRz+N0kJvd4lyVG0vuCruCFU=; b=VHYxLWugM0IcvnbQYxIBuaKtR6zOOgZr7TPYR34oCW+lfvScPDyGEawW3hf0+S85q4 4QEMEEaye1qFdxv5OEAgu1DONONFsdaUXzpw/6mxxHVTylIq1BbzHSA/DVaAupZP34ce DwQMZ26EYXIcL9mpa7ljlkKvoKQ+Mo/WwiI2Tg9ETCwR5TtB8gkvciNrIlouCKRLMOUs xHRawM/ChOvaIxATkeD1al7AYhWRfzHnoZbmle8GUHvpMjxr+nJ3ExJmC2+dkOTq9t1s h3xDPp2kYnDawxRcrvoWi7H5mW45WxXVsAxC0ofmE8txdtv1REckV+hu3hVr5cmXu53j PMdg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=G8gFxt+E; 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-5237-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-5237-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id g12-20020a1709063b0c00b00a46cc89b5ecsi2694635ejf.160.2024.03.25.13.17.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 13:17:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-5237-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=G8gFxt+E; 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-5237-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-5237-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 am.mirrors.kernel.org (Postfix) with ESMTPS id DE2911FA37AE for ; Mon, 25 Mar 2024 20:11:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9723847784; Mon, 25 Mar 2024 20:10:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="G8gFxt+E" 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 08E26446AF for ; Mon, 25 Mar 2024 20:10:54 +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=1711397456; cv=none; b=nWpWmVI1z3+0vV2Rj0zkuG+tM2DzS9nRX8yOOtF8SQtqsXN/oKyt7l5lMgmT1Q8XiatN8Uy286YxtL6GkZeXPfHANZsiaxzdimRSi8giI6FCaFiK0W2LLsObCSgdeRRQoJnBQOOFz7WmVvJ6tXlqq34VQa8j/RP7OsgpNxd3l2I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711397456; c=relaxed/simple; bh=r7BNcmnjEUzpcM7xXxoFlcWhCcicO4GAgOtIIBrlaUc=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=YE2gelgFZXXDyupL9d0d4WBuw3lzX8owNScRpMLc2JRBVlgPe6bB0lNEHEApC0mvxY+/vgtr6I524iO0V4SLvbHDVaaD9L7DxFAgqaHOYgTVLREWYgsohjg4b4OTm35cxtQRuL+F8xOA6W6cBKGqgU1LRReFX+4zkfJ7jg9WdWU= 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=G8gFxt+E; 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.17.1.24/8.17.1.24) with ESMTP id 42PJoZqj008563; Mon, 25 Mar 2024 20:10:52 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=oc3hTCWIsKw2AFXxyjYW ViNVMUhHCBGU4HVX5WFHhXA=; b=G8gFxt+E5T9/nl5k7KemTW7M+fvmdi6H5n4j OVDu1eJ2oomBlluZaW8bmotAi+XglKiNwnUTXykhzy2FNWl2rAWRo7GAaDMqel/E bKAlYwQjV1sgFKlwI7pGViBqXbOTqTqqHk1/or3vX1chHTylAnXgMXcvvQmOBpri fsjYx3U5L6wu+boNRaRVohQ7NNsnSENEU031rVg7CbdwoVEPc2YfOmT8uED79Zw9 rKWn1lkeey2JoDL2WBgSfGrtpEyNgVqF9PBf0jjDszjmRAoQ9f9b+R8Rz1x7SL35 HCqbF9GdMcIMqOON4svSomubeDsThj8nvAXS2s2f5Pq3Rz0d9Q== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3x31wst330-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 25 Mar 2024 20:10:51 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 42PKApr3002684 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 25 Mar 2024 20:10:51 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.1118.40; Mon, 25 Mar 2024 13:10:50 -0700 From: Pradeep Kumar Chitrapu To: CC: , Pradeep Kumar Chitrapu , Muna Sinada Subject: [PATCH 04/10] wifi: ath12k: move HE MCS mapper to a separate function Date: Mon, 25 Mar 2024 13:10:25 -0700 Message-ID: <20240325201031.10837-5-quic_pradeepc@quicinc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240325201031.10837-1-quic_pradeepc@quicinc.com> References: <20240325201031.10837-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: 1SE7ELYeNLTwC57b0UwCHGvXd8qUEW28 X-Proofpoint-ORIG-GUID: 1SE7ELYeNLTwC57b0UwCHGvXd8qUEW28 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-03-25_19,2024-03-21_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 clxscore=1015 malwarescore=0 priorityscore=1501 phishscore=0 bulkscore=0 adultscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 impostorscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2403210001 definitions=main-2403250123 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 6465dc11a92e..72b157e60158 100644 --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c @@ -4879,12 +4879,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, @@ -4922,13 +4934,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