Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2922815lqp; Mon, 25 Mar 2024 13:11:41 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUO4ouBnt9qm5A0qPEZMWgMseNwKRRSCSVcrpRXtdZGL76ggYZEFxLPxxiehnzVy9NFqOwTC61MjgIRKsI7VU6724U8xbvcA/CSpcl4IQ== X-Google-Smtp-Source: AGHT+IHbSXoQa6Bu1ApMTin7bvcf+jisMhzJvCTyv5m8DVgvU0hqY+HEY2OcDu7Sx2E9dt+U8eiZ X-Received: by 2002:a17:90a:f518:b0:29b:c34b:7e6b with SMTP id cs24-20020a17090af51800b0029bc34b7e6bmr5451532pjb.32.1711397501665; Mon, 25 Mar 2024 13:11:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711397501; cv=pass; d=google.com; s=arc-20160816; b=uQKdwHiWLOdVJ7QBmZlJxIRGstIHv02GocK/dhykh9xZPi53jVS7qZMO0PBAhGl8MP ylLDSVYV9TAiKvPYVR6nESapU8+bUp39bqa2h6MVhRk2I6lisv+9yomCRAai36PkuZzV XbgrrSTnIzPkJTuOX+8vHlbrzyVgkWrrP8L3Mhbq0cpmZhbHZoAF9TCk799olgmo0vu1 hlhUtFSswt0ai7Bb8drhrY/ki4raZrdspXBfiJilOZKUCHY+iQmdWY84r3fP1rr5UU1l bRKsNlaqI6BHDrUVh21iau/C85ninq1vxY7QVJEdiFJtvrkSwfSwcuSSbDsvJa3jH48q I8Kg== 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=kyOmCvDEsKnvQ3TY7Fr+vH0/fa3PEurubCg3+XGoPRE=; fh=pGsTab+RUH+9r/6ZhhJeRz+N0kJvd4lyVG0vuCruCFU=; b=x9u5BGe5VSpwwfp0vezjdVio4a2XE5qwG9aadkn7aTU8PZzOxtRAMOvVzW/JBDJ4K/ 9kSisTWO2o+qOud5bOCM0JrzYGDSWRulIAzLYXfowTAipoRb0upf4D1bQ2CSKIluwdQt tQGsIHSGLdnqSKKt3b9E0gzEVf3Kyce9IqjTtL6Tt4vSpVrT+ChJwNrgmqQo39ivy/Mv 1qfMm4slxiSa+od1SIsbMYZMBOgoTVSfr7lbqklM2Bo9tbBZVG83bivi8VODauTsRVUu 4HEWGz4vJz79x2HercQWxboONLRkl/vdjSAsssuyL1y/g/J/7Is52DrEfG56I1TK0JkV gjxg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=GwpyT8K1; 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-5240-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-5240-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. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id w3-20020a17090aad4300b002a043e98f74si6472104pjv.15.2024.03.25.13.11.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 13:11:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-5240-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=GwpyT8K1; 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-5240-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-5240-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 4F5DE3024C5 for ; Mon, 25 Mar 2024 20:11:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 90D7A4DA19; Mon, 25 Mar 2024 20:10:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="GwpyT8K1" 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 BA7073FBA0 for ; Mon, 25 Mar 2024 20:10:56 +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=1711397458; cv=none; b=FdF2p9+xXNA6apgzD4HFjNPqOSKKb5HxpgdNAd+tPrxc2g23E2VoZMGMirXB8KnazlBdnqSeLHRk6oFVDgDjGK2fFqNf0h4Q1jT6Qzd4pugpS6bfHmo7XwaGGXkLWKxVncosQf4j6wOppsEdI7jdbbfkf8e2aN3Ww3MpP0ACI78= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711397458; c=relaxed/simple; bh=NkoJ3JQfKrhjBZ7+ssg0U2zJVBt5DmHCkaJqdn/ipIA=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=KMl+sg5g5Ia/cjX3vTbdjt4JsxKyF+vfFT983JzCi2jcb6UAJ0LL6DseFhZe92dDQRTM9qvuwEziUeandzEYCXNyhSv5JqAKswei6OLGFMxMGrjgX2x2L6hLWITxqkG7/F8cjdQNk21iuUxZSbAFp5Jaw5zUHrHxPAdQOEuvu10= 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=GwpyT8K1; 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 (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 42PJOGri020879; Mon, 25 Mar 2024 20:10:53 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=kyOmCvDEsKnvQ3TY7Fr+ vH0/fa3PEurubCg3+XGoPRE=; b=GwpyT8K1+LJTFuqw4dPxddsdp5WKEvTf87RQ +Q3bm+2/mFHXyylIbLkLZZt2oJ656IpaL0z2Ai6ZAsSFoBm/5NiV1FrcDv5dvtpt Xmv6NS9o/0KiCk4iac/JHbAEjv/RbxDmGhf7vdyMcc6G/Iig9owB9RiN6OzMiyds FmWN0EHkbxhrnRSunb86xfVyObof173zDfZHCo8HPIRrQktoeM6rJ1Mt1nkob73b Ie6EAyAiWkGCRNaWryTHHqRkl50EgK/eO2IfKmE07RmHmGIsD23s8LlNoqn/cAX2 4EZXROQdVXSYw9D30JL6QXPbR5f3EftsgPq69HyYEY9iMl9eZw== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3x35eahmqc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 25 Mar 2024 20:10:52 +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 42PKAp9n009861 (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:51 -0700 From: Pradeep Kumar Chitrapu To: CC: , Pradeep Kumar Chitrapu , Muna Sinada Subject: [PATCH 05/10] wifi: ath12k: generate rx and tx mcs maps for supported HE mcs Date: Mon, 25 Mar 2024 13:10:26 -0700 Message-ID: <20240325201031.10837-6-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: -lChyBXLhaeEekiUpq0LJtcAGDMgTcid X-Proofpoint-ORIG-GUID: -lChyBXLhaeEekiUpq0LJtcAGDMgTcid 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 adultscore=0 impostorscore=0 bulkscore=0 mlxlogscore=999 malwarescore=0 spamscore=0 priorityscore=1501 phishscore=0 mlxscore=0 clxscore=1015 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2403210001 definitions=main-2403250123 Generate rx and tx mcs maps in ath12k_mac_set_hemcsmap() based on number of supported tx/rx chains and set them in supported mcs/nss for HE capabilities. 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 | 40 ++++++++++++++++++++------- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c index 72b157e60158..46ef2d63a3de 100644 --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c @@ -4879,20 +4879,40 @@ 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, +static void ath12k_mac_set_hemcsmap(struct ath12k *ar, + struct ath12k_pdev_cap *cap, struct ieee80211_sta_he_cap *he_cap) { struct ieee80211_he_mcs_nss_supp *mcs_nss = &he_cap->he_mcs_nss_supp; + u16 txmcs_map, rxmcs_map; + u32 i; + + rxmcs_map = 0; + txmcs_map = 0; + for (i = 0; i < 8; i++) { + if (i < ar->num_tx_chains && + (ar->cfg_tx_chainmask >> cap->tx_chain_mask_shift) & BIT(i)) + txmcs_map |= IEEE80211_HE_MCS_SUPPORT_0_11 << (i * 2); + else + txmcs_map |= IEEE80211_HE_MCS_NOT_SUPPORTED << (i * 2); + + if (i < ar->num_rx_chains && + (ar->cfg_rx_chainmask >> cap->tx_chain_mask_shift) & BIT(i)) + rxmcs_map |= IEEE80211_HE_MCS_SUPPORT_0_11 << (i * 2); + else + rxmcs_map |= IEEE80211_HE_MCS_NOT_SUPPORTED << (i * 2); + } - 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); + mcs_nss->rx_mcs_80 = cpu_to_le16(rxmcs_map & 0xffff); + mcs_nss->tx_mcs_80 = cpu_to_le16(txmcs_map & 0xffff); + mcs_nss->rx_mcs_160 = cpu_to_le16(rxmcs_map & 0xffff); + mcs_nss->tx_mcs_160 = cpu_to_le16(txmcs_map & 0xffff); + mcs_nss->rx_mcs_80p80 = cpu_to_le16(rxmcs_map & 0xffff); + mcs_nss->tx_mcs_80p80 = cpu_to_le16(txmcs_map & 0xffff); } -static void ath12k_mac_copy_he_cap(struct ath12k_band_cap *band_cap, +static void ath12k_mac_copy_he_cap(struct ath12k *ar, + struct ath12k_band_cap *band_cap, int iftype, u8 num_tx_chains, struct ieee80211_sta_he_cap *he_cap) { @@ -4934,7 +4954,7 @@ static void ath12k_mac_copy_he_cap(struct ath12k_band_cap *band_cap, break; } - ath12k_mac_set_hemcsmap(band_cap, he_cap); + ath12k_mac_set_hemcsmap(ar, &ar->pdev->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) @@ -5123,7 +5143,7 @@ static int ath12k_mac_copy_sband_iftype_data(struct ath12k *ar, data[idx].types_mask = BIT(i); - ath12k_mac_copy_he_cap(band_cap, i, ar->num_tx_chains, he_cap); + ath12k_mac_copy_he_cap(ar, band_cap, i, ar->num_tx_chains, he_cap); if (band == NL80211_BAND_6GHZ) { data[idx].he_6ghz_capa.capa = ath12k_mac_setup_he_6ghz_cap(cap, band_cap); -- 2.17.1