Received: by 2002:ab2:7a09:0:b0:1f8:46dc:890e with SMTP id k9csp189168lqo; Wed, 15 May 2024 11:14:23 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXxBC9SgLIdoFbNxvfKBgYahD9lisjdTkxsSd5WLO5IUind0OxwQ1sqSpkjL94xp++r8G+1ck4tq+0yzmvtFbxWDkM9TVaTChWXb5S13g== X-Google-Smtp-Source: AGHT+IE55zG/J3WFRHa58ZTOUijRVf2jPT0VRN5brYUa1FRqxUDl7Cb9MyySwi9EERQ6+hPkIPI7 X-Received: by 2002:a05:620a:2205:b0:790:888c:50a6 with SMTP id af79cd13be357-792c75f0c59mr1651763585a.61.1715796862773; Wed, 15 May 2024 11:14:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715796862; cv=pass; d=google.com; s=arc-20160816; b=t03eXoUrea6s2RxtBOfptN/Ng3ivCYfd0K7nT7nlDYPkmPnW5SYUBvtogqCCyYgvMx 4O61iPp4iKvbcUOEtuECF1AA1g0ezdf9dSUX0NKsLlNfz2kWX5sRJlaSSNYaBpptewwG hiANv/N8MZp+tx9rf2xrKd7NzXkrgBHu/nWzPl3tizsfhfIRMd6glRCPMKobqnsbgVO0 13oF0Yu8s4n8LGN4iPLNSTDflESl8GIFeorLxa3y0CINPzpk8BafvURZzkFb0B0kjeDn C1cO3AXPJt2pQ3xPCBdzo+0/erwstfhWtx3vcGgOzTA42oB7asfa60q5iklAsv4ZuI0/ OjYw== 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=QPNFqMpva86xliftRIBYXJMbBqcCd+VItXf7CDU6HwU=; fh=pGsTab+RUH+9r/6ZhhJeRz+N0kJvd4lyVG0vuCruCFU=; b=w0HYf+SnfT2B5/uJFpiAR2lgfJuHyxIbW8IECVHo6Q32EOVSthrCjlIAU2kk0xaO1b o63Nu9SQR5FHCJG5fgHzSGGIdnGxqI/mlWX1ONJayvWFmHgC65Qq/Qu/lke26lvyaPZp 1r+MTN231aoWEUYU648wFMOcumbXqDwKtvKZAgHaEjsMjEx5iQIM4cjId8FoA8yXBDgC hMLx+Ng3maKGvK+H9TnYleghIUIsprvXnRO4WwGa3rbIMFRhcEC7Wybg+IcaXCa8XwXa +G4e6+u//pgCu5bRWfQaWnsrye71TlTE3rBjvLq+s+HI/sEZUMEMgUpPyGbyCfUvFpbJ EiWA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=ZGiJiRuj; 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-7710-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-7710-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id af79cd13be357-792bf38d2dfsi1372549785a.755.2024.05.15.11.14.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 May 2024 11:14:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-7710-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=ZGiJiRuj; 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-7710-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-7710-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 558651C21325 for ; Wed, 15 May 2024 18:14:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 317131598EE; Wed, 15 May 2024 18:13:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="ZGiJiRuj" 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 89DC2159565 for ; Wed, 15 May 2024 18:13:53 +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=1715796835; cv=none; b=mQ0sdG7DgGOCbDtr5/q+T+9aX8e+CcbnH9Idq45jWPfckjeYkUkLGB5T7HWqqX7CGBcAisG4G3+pcY6Zsg5ZWcwHyGTIpgXEXrB37zCA1VJK3t5WQn8F+SnBVaM1y5hjB+ypZSFpIeBUvUqK1apo7jKMX9/IWNdQvGKWdMcGOGk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715796835; c=relaxed/simple; bh=/Rq39zwoK0RFa5eJa9njgxWdj9DOIZBej85jwmmj4rc=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=q3HmCEjQULpoVQ0OVf4E0AOS0dNNPzMHKYbrjeG2h2J4Lf6o2Mh9ln7BJIUe31KjfIHIjolU6YnrG2No7KKzWmPYhPCf6dM+UkINbG/vkSP7wjTU/Mo/5JYKGMYPsm+/0xuQ9RoSzqqHYlCtAQo6KlFFuiOP9XOzTAx+Mge2xHw= 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=ZGiJiRuj; 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 (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 44F90ZCb026455; Wed, 15 May 2024 18:13:41 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=QPNFqMpva86xliftRIBY XJMbBqcCd+VItXf7CDU6HwU=; b=ZGiJiRujreuIaQkwtctCtRWwB4sWVMYFMP5w HPn1Q8ugPb+kk/X7aDweTSCJo1/VMoreZ9aSXUzEL8J33LMSUDoGEYDBimTTY+wx QwtRjcqVJgz/tEkWENnNjTi2Fsx42mEc5ytmX0SFnq0K4eNqX12l1Bfy7REKXTaV YGNzSpGzn56OvFs0bA7JECbpXWGeG+zBSxkrycxbKm1cy+3MMZ1my7aGv6jpZT/8 RUjKmGNtHdEHT56B76rvw8O6g0si6GaJTRuKAb85Kg1gfL4k8r1K2wW+J519f1qb XMDgqK/DCB1uRW6wwm/1KRqVE4EXb0pU5IgDzRJRQUvKuVeW0Q== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3y47egbnve-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 NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 44FIDdxi005099 (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 05/10] wifi: ath12k: generate rx and tx mcs maps for supported HE mcs Date: Wed, 15 May 2024 11:13:22 -0700 Message-ID: <20240515181327.12855-6-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: pUFsEFV7DVV1PrBYOdZqHMNp1xgtcCcS X-Proofpoint-ORIG-GUID: pUFsEFV7DVV1PrBYOdZqHMNp1xgtcCcS 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 mlxscore=0 adultscore=0 malwarescore=0 phishscore=0 spamscore=0 mlxlogscore=999 lowpriorityscore=0 clxscore=1015 impostorscore=0 suspectscore=0 priorityscore=1501 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2405010000 definitions=main-2405150129 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 Acked-by: Jeff Johnson --- 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 e60da45b9c7f..2f99a1c97b85 100644 --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c @@ -5162,20 +5162,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) { @@ -5217,7 +5237,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) @@ -5406,7 +5426,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