]> git.ipfire.org Git - thirdparty/openwrt.git/blob
fe33f85a1968d17624d2d294bdd6774243ec7f10
[thirdparty/openwrt.git] /
1 From patchwork Wed Sep 18 21:20:51 2024
2 Content-Type: text/plain; charset="utf-8"
3 MIME-Version: 1.0
4 Content-Transfer-Encoding: 7bit
5 X-Patchwork-Submitter: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
6 X-Patchwork-Id: 13807215
7 X-Patchwork-Delegate: quic_jjohnson@quicinc.com
8 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com
9 [205.220.180.131])
10 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
11 (No client certificate requested)
12 by smtp.subspace.kernel.org (Postfix) with ESMTPS id A88651CB32C
13 for <linux-wireless@vger.kernel.org>; Wed, 18 Sep 2024 21:21:14 +0000 (UTC)
14 Authentication-Results: smtp.subspace.kernel.org;
15 arc=none smtp.client-ip=205.220.180.131
16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
17 t=1726694476; cv=none;
18 b=Lkqx2oSLyeGRxKcm+N4Vmg+KOuwHpt6xhgWj9SpyWNXxxWkVExVyHvPrWaP/u4OXd0YjYBJC3Dg0NJYY9WJyL0A3RP8GK++s9CiRloNaEmEjI71S/f3+0HVXu5bCmi8cyiIMFzCpAcNuZ67J7r/WxvNRbeox3iZHmXK1WFUb4Hs=
19 ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
20 s=arc-20240116; t=1726694476; c=relaxed/simple;
21 bh=nv4kc89H7eGC0FLgCwC70zFDhNkClMNiRf5HjDZHHuQ=;
22 h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References:
23 MIME-Version:Content-Type;
24 b=B1oJWv7vHZKRChjamOFJnRzQVtL7qBs7/Ho9GojLQtHyCKtrCEOJt/lWvhkqISf48/5MaQOCdkHhCrQT/eHP9hZ1wnCdeOKXh6Wmk/QYt9yEcc0X6HT5wUxgpaA3PooH/cMlJCX0c8hyhT7XBm6vWnPwQjt/FnLTubA3uj+X8oE=
25 ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
26 dmarc=pass (p=none dis=none) header.from=quicinc.com;
27 spf=pass smtp.mailfrom=quicinc.com;
28 dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com
29 header.b=WweZPnje; arc=none smtp.client-ip=205.220.180.131
30 Authentication-Results: smtp.subspace.kernel.org;
31 dmarc=pass (p=none dis=none) header.from=quicinc.com
32 Authentication-Results: smtp.subspace.kernel.org;
33 spf=pass smtp.mailfrom=quicinc.com
34 Authentication-Results: smtp.subspace.kernel.org;
35 dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com
36 header.b="WweZPnje"
37 Received: from pps.filterd (m0279872.ppops.net [127.0.0.1])
38 by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id
39 48IACJst031540;
40 Wed, 18 Sep 2024 21:21:09 GMT
41 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=
42 cc:content-transfer-encoding:content-type:date:from:in-reply-to
43 :message-id:mime-version:references:subject:to; s=qcppdkim1; bh=
44 ARu9Fu0s66NeuLm2pdCBchANS+rlgd275Q/E4KE2T1o=; b=WweZPnjehL/ZQW57
45 4JHJDsl8A5hyljMaJrVPdmZwNktTurJPMpD5z0akqx2dq3bfjzx2rx5NAtMb831x
46 ieysvT1ApK5V32fmb9xzG7FMIU3DH4eqr/9ApZbHFVPTglHrVoVzHJLps3I+Ts5P
47 gi1dsIAdwTai7hW1FchcW/pZ2kJMq6zN7oljoFs7pc1CvzHfIJowQM8gFfslkqlL
48 lvm9A9knvnUlkrEvzgpoZfZxm/91t9bQzkQDTX91wRc0oGR/9liT+z4Sdum2rLwb
49 fri8rhQIw8w1ExGM1nzChPaajmDIsE86ODjDL2xBbd/DcdsVvOYl8ewJ8AX45qNs
50 +LpHtg==
51 Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com
52 [129.46.96.20])
53 by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 41n4j6uagq-1
54 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
55 Wed, 18 Sep 2024 21:21:09 +0000 (GMT)
56 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com
57 [10.47.209.196])
58 by NALASPPMTA03.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id
59 48ILL8gM005103
60 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
61 Wed, 18 Sep 2024 21:21:08 GMT
62 Received: from ath12k-linux1.qualcomm.com (10.80.80.8) by
63 nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server
64 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
65 15.2.1544.9; Wed, 18 Sep 2024 14:21:07 -0700
66 From: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
67 To: <ath12k@lists.infradead.org>
68 CC: <linux-wireless@vger.kernel.org>,
69 Pradeep Kumar Chitrapu
70 <quic_pradeepc@quicinc.com>,
71 Muna Sinada <quic_msinada@quicinc.com>,
72 "Jeff
73 Johnson" <quic_jjohnson@quicinc.com>
74 Subject: [PATCH V8 4/9] wifi: ath12k: generate rx and tx mcs maps for
75 supported HE mcs
76 Date: Wed, 18 Sep 2024 14:20:51 -0700
77 Message-ID: <20240918212056.4137076-5-quic_pradeepc@quicinc.com>
78 X-Mailer: git-send-email 2.34.1
79 In-Reply-To: <20240918212056.4137076-1-quic_pradeepc@quicinc.com>
80 References: <20240918212056.4137076-1-quic_pradeepc@quicinc.com>
81 Precedence: bulk
82 X-Mailing-List: linux-wireless@vger.kernel.org
83 List-Id: <linux-wireless.vger.kernel.org>
84 List-Subscribe: <mailto:linux-wireless+subscribe@vger.kernel.org>
85 List-Unsubscribe: <mailto:linux-wireless+unsubscribe@vger.kernel.org>
86 MIME-Version: 1.0
87 X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To
88 nalasex01a.na.qualcomm.com (10.47.209.196)
89 X-QCInternal: smtphost
90 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800
91 signatures=585085
92 X-Proofpoint-ORIG-GUID: wHJ63GZpWGKZ4XSyQZiVlsARNAgr5CQM
93 X-Proofpoint-GUID: wHJ63GZpWGKZ4XSyQZiVlsARNAgr5CQM
94 X-Proofpoint-Virus-Version: vendor=baseguard
95 engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29
96 definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01
97 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
98 phishscore=0 mlxlogscore=999
99 mlxscore=0 malwarescore=0 bulkscore=0 priorityscore=1501 clxscore=1015
100 adultscore=0 suspectscore=0 lowpriorityscore=0 spamscore=0 impostorscore=0
101 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2408220000
102 definitions=main-2409180140
103
104 Generate rx and tx mcs maps in ath12k_mac_set_hemcsmap() based
105 on number of supported tx/rx chains and set them in supported
106 mcs/nss for HE capabilities.
107
108 Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
109
110 Co-developed-by: Muna Sinada <quic_msinada@quicinc.com>
111 Signed-off-by: Muna Sinada <quic_msinada@quicinc.com>
112 Signed-off-by: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
113 Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
114 ---
115 drivers/net/wireless/ath/ath12k/mac.c | 40 ++++++++++++++++++++-------
116 1 file changed, 30 insertions(+), 10 deletions(-)
117
118 --- a/drivers/net/wireless/ath/ath12k/mac.c
119 +++ b/drivers/net/wireless/ath/ath12k/mac.c
120 @@ -5519,20 +5519,40 @@ static __le16 ath12k_mac_setup_he_6ghz_c
121 return cpu_to_le16(bcap->he_6ghz_capa);
122 }
123
124 -static void ath12k_mac_set_hemcsmap(struct ath12k_band_cap *band_cap,
125 +static void ath12k_mac_set_hemcsmap(struct ath12k *ar,
126 + struct ath12k_pdev_cap *cap,
127 struct ieee80211_sta_he_cap *he_cap)
128 {
129 struct ieee80211_he_mcs_nss_supp *mcs_nss = &he_cap->he_mcs_nss_supp;
130 + u16 txmcs_map, rxmcs_map;
131 + u32 i;
132
133 - mcs_nss->rx_mcs_80 = cpu_to_le16(band_cap->he_mcs & 0xffff);
134 - mcs_nss->tx_mcs_80 = cpu_to_le16(band_cap->he_mcs & 0xffff);
135 - mcs_nss->rx_mcs_160 = cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
136 - mcs_nss->tx_mcs_160 = cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
137 - mcs_nss->rx_mcs_80p80 = cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
138 - mcs_nss->tx_mcs_80p80 = cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
139 + rxmcs_map = 0;
140 + txmcs_map = 0;
141 + for (i = 0; i < 8; i++) {
142 + if (i < ar->num_tx_chains &&
143 + (ar->cfg_tx_chainmask >> cap->tx_chain_mask_shift) & BIT(i))
144 + txmcs_map |= IEEE80211_HE_MCS_SUPPORT_0_11 << (i * 2);
145 + else
146 + txmcs_map |= IEEE80211_HE_MCS_NOT_SUPPORTED << (i * 2);
147 +
148 + if (i < ar->num_rx_chains &&
149 + (ar->cfg_rx_chainmask >> cap->tx_chain_mask_shift) & BIT(i))
150 + rxmcs_map |= IEEE80211_HE_MCS_SUPPORT_0_11 << (i * 2);
151 + else
152 + rxmcs_map |= IEEE80211_HE_MCS_NOT_SUPPORTED << (i * 2);
153 + }
154 +
155 + mcs_nss->rx_mcs_80 = cpu_to_le16(rxmcs_map & 0xffff);
156 + mcs_nss->tx_mcs_80 = cpu_to_le16(txmcs_map & 0xffff);
157 + mcs_nss->rx_mcs_160 = cpu_to_le16(rxmcs_map & 0xffff);
158 + mcs_nss->tx_mcs_160 = cpu_to_le16(txmcs_map & 0xffff);
159 + mcs_nss->rx_mcs_80p80 = cpu_to_le16(rxmcs_map & 0xffff);
160 + mcs_nss->tx_mcs_80p80 = cpu_to_le16(txmcs_map & 0xffff);
161 }
162
163 -static void ath12k_mac_copy_he_cap(struct ath12k_band_cap *band_cap,
164 +static void ath12k_mac_copy_he_cap(struct ath12k *ar,
165 + struct ath12k_band_cap *band_cap,
166 int iftype, u8 num_tx_chains,
167 struct ieee80211_sta_he_cap *he_cap)
168 {
169 @@ -5574,7 +5594,7 @@ static void ath12k_mac_copy_he_cap(struc
170 break;
171 }
172
173 - ath12k_mac_set_hemcsmap(band_cap, he_cap);
174 + ath12k_mac_set_hemcsmap(ar, &ar->pdev->cap, he_cap);
175 memset(he_cap->ppe_thres, 0, sizeof(he_cap->ppe_thres));
176 if (he_cap_elem->phy_cap_info[6] &
177 IEEE80211_HE_PHY_CAP6_PPE_THRESHOLD_PRESENT)
178 @@ -5763,7 +5783,7 @@ static int ath12k_mac_copy_sband_iftype_
179
180 data[idx].types_mask = BIT(i);
181
182 - ath12k_mac_copy_he_cap(band_cap, i, ar->num_tx_chains, he_cap);
183 + ath12k_mac_copy_he_cap(ar, band_cap, i, ar->num_tx_chains, he_cap);
184 if (band == NL80211_BAND_6GHZ) {
185 data[idx].he_6ghz_capa.capa =
186 ath12k_mac_setup_he_6ghz_cap(cap, band_cap);