Received: by 2002:ab2:6991:0:b0:1f2:fff1:ace7 with SMTP id v17csp202975lqo; Wed, 27 Mar 2024 10:34:25 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVsRhmjgAbt+ZVg3mrXdRhpmPGPSPma4BF+NBGB+GadBEMS3yMZ4K3+GKjc9R4dSEKZ0QnCKybonGIq+pjY6scg7BfN0Xw3qrsERL/LaA== X-Google-Smtp-Source: AGHT+IEqr4tF3ysQWsr8lkMvKTflmyVsHRueGuYzWS0Biz86kN3MQoSBfl3ctHxfJECq5gguwV4y X-Received: by 2002:a05:6a20:da8c:b0:1a3:5fa1:3d4 with SMTP id iy12-20020a056a20da8c00b001a35fa103d4mr630467pzb.0.1711560865019; Wed, 27 Mar 2024 10:34:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711560865; cv=pass; d=google.com; s=arc-20160816; b=bBfZa5uwjjWkQCkUmZ6ynCUbOD0AKYXEEkhFkjrtHal9NAcD9x3WGXlGvKwyOwzNh0 IEROVXbVjZgU9IV+F/QspFfkjXT80+m9GuskrT0bEsRNhfkrJltKuQBA7nfY9D6Wnij8 aVjOla/ZY+4tKx9tUt8sZmLVoAmormpdnMWVJk5buKFtTZGzKB1gt5J7EpBOKUZiZgQW gic8iUoj91BvJDBW3z6idF8FO+8jUIIyyLew0TEBM3ccbBM08NQDQixEcyVk9EbTdh5j J6n8I0etnCtqcLIbJ5qYCKPUVgyCZXF+0aw5kuzHvDNsvT+J8fVTwpmBPiU0McllZeTY /FLg== 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=fS4FQ6X9sJgW/D8Tw+yBpTvY98i0ED61A3fGWmlE70yyQ9CY7q83/b4x9WlJ2lcuy0 NcFQ/ztrKukwwy5xZIrfSF35Mnt8ZgH57GcC1yVLLKEo+B0fpVHqr3fVQpedwkVU5N7d HqG1Mn73xKChFveU9Brdlt1gW06lYh3kVNJlAKjZFaFnqa8COEdF0HAq52SAjePIMefX OtKkb1aYkvJkDoRcIZdiJgQw6mch4yun6I60SECQfnjEiZHEf9XPoLsu6JWBo45bEOVl O21gvc3Q5jACEbsS6b6bVh0B0hvxFGc7KsVoHO856hvd8jMTtN2OWQOiVvBmoXNBGC6B VMSg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=CR3uwo0Y; 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-5381-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-wireless+bounces-5381-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 c125-20020a633583000000b005e85aa0e44esi11669830pga.434.2024.03.27.10.34.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 10:34:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-5381-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=CR3uwo0Y; 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-5381-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-wireless+bounces-5381-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 5375EB2A5E9 for ; Wed, 27 Mar 2024 17:10:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A861C14D43B; Wed, 27 Mar 2024 17:09:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="CR3uwo0Y" 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 D34F214D42D for ; Wed, 27 Mar 2024 17:09:31 +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=1711559373; cv=none; b=ROa9eduj6CJcFWFosWeH093odjKaoZ8E8GaWXxyYKhvjM71hqhckcMLEWwJ5hJ1CKfFdMZciWf81q3r5WZpI/8gCcJpQ4P42ba80K9HTGyImntFhvF6l250EhSpfJHb6Sv+qHirSptDD8erDiFCQcrfpsuMG4QNFGsL0HK+A35o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711559373; c=relaxed/simple; bh=NkoJ3JQfKrhjBZ7+ssg0U2zJVBt5DmHCkaJqdn/ipIA=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=e2GnSeoBUABBEdoivYMH4m4VbY2U6AO/fXjoKvR3DfMhE5zBPKtov1Rm/87IxMrMWmNraZO9SFDLmFgZ9FxTdO0c5d1Hi3n07VcxMkigerxN5GNi7lPMNRfibSm75Ox/EYq8/braJ3b0Sa/BJ0UIXd/OIzLxwEY7niLoN5vYN2w= 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=CR3uwo0Y; 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 42REWKAO012346; Wed, 27 Mar 2024 17:09:23 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=CR3uwo0YBaFMjWx3je2QjAFZ+ibxLiG6NmMB sFqd+F6q+uX7SYIMxi1taK7z7Awje6SIqKs+ewPe00tawhPDnxhicBaD0wuL+FQU Yq84bowDmccneuE7XfvCbfWE+Ia0cxfYizPoz3JvIkjFKsNA1nmIyZ6E6kqah2WI GI19K+1NwV4tqEehYKqWpxSnjkueWwHK+VAf0fKy0HQL0DsdlINjhNItFQtA4vvg 5iE1AyYeVkWuYbQoLh0tMXQGdPz3RcNxbi8vuCDSHQhg4WPj8A6ZPIZ0OhcP3L0P kIgoNFG/utIiILn/nv6edKJ+TpuwHp1jq7JtYDPeoUOaUR/qsg== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3x477yth19-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 27 Mar 2024 17:09:23 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 42RH9MOO021775 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 27 Mar 2024 17:09:22 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; Wed, 27 Mar 2024 10:09:22 -0700 From: Pradeep Kumar Chitrapu To: CC: , Pradeep Kumar Chitrapu , Muna Sinada Subject: [PATCH v2 05/10] wifi: ath12k: generate rx and tx mcs maps for supported HE mcs Date: Wed, 27 Mar 2024 10:09:05 -0700 Message-ID: <20240327170910.23975-6-quic_pradeepc@quicinc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240327170910.23975-1-quic_pradeepc@quicinc.com> References: <20240327170910.23975-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: 4PbzPFcj1j7mzw7qwVDgywDIvz9HjuB3 X-Proofpoint-ORIG-GUID: 4PbzPFcj1j7mzw7qwVDgywDIvz9HjuB3 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-27_13,2024-03-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 priorityscore=1501 phishscore=0 adultscore=0 mlxscore=0 spamscore=0 lowpriorityscore=0 malwarescore=0 suspectscore=0 impostorscore=0 mlxlogscore=999 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2403210001 definitions=main-2403270119 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