Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp84232rwi; Tue, 18 Oct 2022 14:29:47 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4Dl2e4LDZeEZX4UJzFJsOCd0rrvwezl7JbpMmCG76BAPjNPGXsgk5M6aBwz528bwIl9Utv X-Received: by 2002:aa7:9057:0:b0:565:d7dd:a453 with SMTP id n23-20020aa79057000000b00565d7dda453mr4934889pfo.33.1666128587279; Tue, 18 Oct 2022 14:29:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666128587; cv=none; d=google.com; s=arc-20160816; b=lzwzRcrsNyWf+cQSX3aqrbWuzyTh44Q/LaYaNzGnT2CiFRFYc5+46atUbky183a18S 3Ysq35bHneLBTHTosuKvxMkwKMb/E1IPx0P4gO4pwD5rTzSOP4hhp+GIqQsdPCkgJ9Pw iUHGDbFYJeghbKDzM9Y598NKJGH3dUrTL89oOBuPCVA8/nTV+7azo0Hqpz4Scd+ajagt c+q7XJ72HuypELziEU9OvN3kW0SPaH9TPvAqL4hH0bfRwp894JBS8bO/ZaDU+NUHkTmA uW8qEDyV4x5giBXFMf7p7KuBEI1a9+I4aSqHmkh+AZNRFpYm8WQx2AZ0gEjNAhQoSnQr ZkLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=JN2Ez6gQ/VNqgofyRH0gYCcE8+S1uzur+8LzMnY1lus=; b=kW1Uywn1g06RR1ifDiYTqqv5TUcYjUsRVj8L5oWOU/VoAX7I/tyEa96zBdrbsY3Lm9 v/ooToj5lOzem9uY6rdGdBha5RcY4SeXOn/g2dvD+XjWFpda2+imLDDF3BsU6t3DMW09 VgQyrDzUvhqG0aUzMRFhjwpgotCymCsVKWLbH7hnihMw2TRqHdN2xDoAow5Mrd2ZKKIa wqEgeYJOdSUcc3k87Qq3hrBLP7SAJ+DIGwFCXjPMbCctnj/s2EisHHqtnhSGC4jDOK3a wXiyHGusz35vmReVGqkp4mmwSre7ECV4IXPbYinIeu8ZGmLsg9VoY2L13/kHXHxsWuef aLoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=SNM7I23S; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b13-20020a6541cd000000b0043cb43f582asi16156005pgq.564.2022.10.18.14.29.38; Tue, 18 Oct 2022 14:29:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=SNM7I23S; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230182AbiJRV27 (ORCPT + 63 others); Tue, 18 Oct 2022 17:28:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230085AbiJRV25 (ORCPT ); Tue, 18 Oct 2022 17:28:57 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D280B6033 for ; Tue, 18 Oct 2022 14:28:49 -0700 (PDT) Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 29IHYFZJ017917; Tue, 18 Oct 2022 21:28:46 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=JN2Ez6gQ/VNqgofyRH0gYCcE8+S1uzur+8LzMnY1lus=; b=SNM7I23SXZGc0r4XZu9UfNl7mQ77Uk1kfgtkNFsWIS+9AEimYhE/+3qMULGidqOW+9Yx HTA6znj7LDNVUDehzX4a8NbkojRo76xqPXXdLac7Jt76DWUiSw3kStTBwApA/2xiUCpk EIsXrpSTlDKEBTsdWUfzaDpCbLoBEOVip+4bud3UfjCG/ouPxvJce+1Ln+GbCgSUrdsr d50Az2a4mw2eGxGzlzQy3kGbMFCDW/XNkpno2Y1jKm88jyQa10HPBgL9DlbUB9oLlRZ8 rEa3jXaBT/QyzOoSPeW2UWf0Tk3qSHLR/2QlgbH0pOBYZ2PhqWg7ynfUNd/3ocSJ1Ru+ Ag== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3k9bfg4ayk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 18 Oct 2022 21:28:45 +0000 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 29ILSjCl005073 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 18 Oct 2022 21:28:45 GMT Received: from msinada-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.986.29; Tue, 18 Oct 2022 14:28:44 -0700 From: Muna Sinada To: CC: , Muna Sinada Subject: [PATCH v2 3/4] wifi: ath11k: move HE MCS mapper to a separate function Date: Tue, 18 Oct 2022 14:28:20 -0700 Message-ID: <1666128501-12364-4-git-send-email-quic_msinada@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1666128501-12364-1-git-send-email-quic_msinada@quicinc.com> References: <1666128501-12364-1-git-send-email-quic_msinada@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.80.80.8] 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-ORIG-GUID: D0GWeXgBfA-TfKdSQjaMNqZPOKi7_HUq X-Proofpoint-GUID: D0GWeXgBfA-TfKdSQjaMNqZPOKi7_HUq X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-18_07,2022-10-18_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 priorityscore=1501 malwarescore=0 adultscore=0 impostorscore=0 mlxlogscore=999 mlxscore=0 bulkscore=0 spamscore=0 suspectscore=0 clxscore=1015 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210180120 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Move HE MCS mapper to a separate function and call new function in ath11k_mac_copy_he_cap(). Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-00356-QCAHKSWPL_SILICONZ-1 Signed-off-by: Muna Sinada --- drivers/net/wireless/ath/ath11k/mac.c | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c index 83d4a565fe84..56335e47939b 100644 --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c @@ -5459,6 +5459,27 @@ static __le16 ath11k_mac_setup_he_6ghz_cap(struct ath11k_pdev_cap *pcap, return cpu_to_le16(bcap->he_6ghz_capa); } +static void ath11k_mac_set_hemcsmap(struct ath11k *ar, + struct ath11k_pdev_cap *cap, + struct ieee80211_sta_he_cap *he_cap, + int band) +{ + struct ath11k_band_cap *band_cap = &cap->band[band]; + + he_cap->he_mcs_nss_supp.rx_mcs_80 = + cpu_to_le16(band_cap->he_mcs & 0xffff); + he_cap->he_mcs_nss_supp.tx_mcs_80 = + cpu_to_le16(band_cap->he_mcs & 0xffff); + he_cap->he_mcs_nss_supp.rx_mcs_160 = + cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff); + he_cap->he_mcs_nss_supp.tx_mcs_160 = + cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff); + he_cap->he_mcs_nss_supp.rx_mcs_80p80 = + cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff); + he_cap->he_mcs_nss_supp.tx_mcs_80p80 = + cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff); +} + static int ath11k_mac_copy_he_cap(struct ath11k *ar, struct ath11k_pdev_cap *cap, struct ieee80211_sband_iftype_data *data, @@ -5520,18 +5541,7 @@ static int ath11k_mac_copy_he_cap(struct ath11k *ar, break; } - he_cap->he_mcs_nss_supp.rx_mcs_80 = - cpu_to_le16(band_cap->he_mcs & 0xffff); - he_cap->he_mcs_nss_supp.tx_mcs_80 = - cpu_to_le16(band_cap->he_mcs & 0xffff); - he_cap->he_mcs_nss_supp.rx_mcs_160 = - cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff); - he_cap->he_mcs_nss_supp.tx_mcs_160 = - cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff); - he_cap->he_mcs_nss_supp.rx_mcs_80p80 = - cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff); - he_cap->he_mcs_nss_supp.tx_mcs_80p80 = - cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff); + ath11k_mac_set_hemcsmap(ar, cap, he_cap, band); memset(he_cap->ppe_thres, 0, sizeof(he_cap->ppe_thres)); if (he_cap_elem->phy_cap_info[6] & -- 2.7.4