1 From patchwork Wed Sep 18 21:20:56 2024
2 Content-Type: text/plain; charset="utf-8"
4 Content-Transfer-Encoding: 7bit
5 X-Patchwork-Submitter: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
6 X-Patchwork-Id: 13807214
7 X-Patchwork-Delegate: quic_jjohnson@quicinc.com
8 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com
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 A44471CB32B
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.168.131
16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
17 t=1726694476; cv=none;
18 b=YnQUUZ4IfmLtgtYCtYRGhH8uRGd6VL74IRylGv6Ihb2PMO/n5UdfZlDk/m9w0OH4/sSsqULSz2lupiSTwXCPxc+73uK+OUjIEmCfPlNdrtzK2naXyiXAASPqonpnRBnyoIFwaE8zj8AHUqk5TAajedqpK9EnOaboX2XGYVbe0yI=
19 ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
20 s=arc-20240116; t=1726694476; c=relaxed/simple;
21 bh=TAPBD6g5pYNuC8Odk6t6JkL8GvKdG9H30IPHTEgA7C0=;
22 h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References:
23 MIME-Version:Content-Type;
24 b=djAINL+wQRgQaGOI4fotrExnm1Yz5quwEW2I7s85hWLI3gB+HsjwPKWJypllDKm8W0FDcrsoZWFmOrfx0wJ5LIe+OtXJ4ijSG7xcJeGtgDXZ3hAA5ZBk/B+CD+g+NZ3c0mwkSKpUm5dUBPKi1+kJsPuVEwKeCmdMVj8QHSYMXPw=
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=i4iTJD+Z; arc=none smtp.client-ip=205.220.168.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
37 Received: from pps.filterd (m0279863.ppops.net [127.0.0.1])
38 by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id
40 Wed, 18 Sep 2024 21:21:11 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 2gwv4CbPGErAHv9NWtZrCSVk7NoZpHzKz9tuTs+8dV4=; b=i4iTJD+ZMXDp8Ul8
45 HTo5IL/NLwS3mnlutEaaL+juUKm+wsFdl/BeMp9CC4H/sapolIhM4Zje9t3H9K0R
46 +z1OxQDEekvWrrfUlikEaUHjOEwQ4YKSPJ+1uAIrbbA3REWeW5z39IITJ3dGU05N
47 hnfPQEiFcPgDbFQv0Iaf434znv8rbOow6dc+M1E6EjpGd92Mq80BpsJqP8Ee0RUr
48 WO3rsws1kXzFs6ELsg/FmC3l6eG9A4z9SUxcZ7QqTaz8aPOAZS/lclN0cOJT7VgK
49 7UNPGoDoJhTmHEX17W/rQR8RiV8c0hMciOuB1sfI7H/1uGkEPMjmfIsEdBjQ/9oa
51 Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com
53 by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 41n4hfk92c-1
54 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
55 Wed, 18 Sep 2024 21:21:11 +0000 (GMT)
56 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com
58 by NALASPPMTA02.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id
60 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
61 Wed, 18 Sep 2024 21:21:10 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:09 -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 Jeff Johnson <quic_jjohnson@quicinc.com>
72 Subject: [PATCH V8 9/9] wifi: ath12k: add extended NSS bandwidth support for
74 Date: Wed, 18 Sep 2024 14:20:56 -0700
75 Message-ID: <20240918212056.4137076-10-quic_pradeepc@quicinc.com>
76 X-Mailer: git-send-email 2.34.1
77 In-Reply-To: <20240918212056.4137076-1-quic_pradeepc@quicinc.com>
78 References: <20240918212056.4137076-1-quic_pradeepc@quicinc.com>
80 X-Mailing-List: linux-wireless@vger.kernel.org
81 List-Id: <linux-wireless.vger.kernel.org>
82 List-Subscribe: <mailto:linux-wireless+subscribe@vger.kernel.org>
83 List-Unsubscribe: <mailto:linux-wireless+unsubscribe@vger.kernel.org>
85 X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To
86 nalasex01a.na.qualcomm.com (10.47.209.196)
87 X-QCInternal: smtphost
88 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800
90 X-Proofpoint-GUID: Mta6b5FqdCLrvsiUf1WwMHFr8SiJUh5L
91 X-Proofpoint-ORIG-GUID: Mta6b5FqdCLrvsiUf1WwMHFr8SiJUh5L
92 X-Proofpoint-Virus-Version: vendor=baseguard
93 engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29
94 definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01
95 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
97 clxscore=1015 phishscore=0 malwarescore=0 mlxlogscore=999 mlxscore=0
98 impostorscore=0 adultscore=0 suspectscore=0 lowpriorityscore=0 spamscore=0
99 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1
100 engine=8.19.0-2408220000 definitions=main-2409180140
102 Currently rx and tx MCS map for 160 MHz under HE capabilities
103 are not updating properly, when 160 MHz is configured with NSS
104 lesser than max NSS support. Fix this by utilizing
105 nss_ratio_enabled and nss_ratio_info fields sent by firmware
106 in service ready event.
108 However, if firmware advertises EXT NSS BW support in VHT caps
109 as 1(1x2) and when nss_ratio_info indicates 1:1, reset the EXT
110 NSS BW Support in VHT caps to 0 which indicates 1x1. This is
111 to avoid incorrectly choosing 1:2 NSS ratio when using the
112 default VHT caps advertised by firmware.
114 Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
116 Signed-off-by: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
117 Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
119 drivers/net/wireless/ath/ath12k/mac.c | 33 ++++++++++++++++++++++-----
120 1 file changed, 27 insertions(+), 6 deletions(-)
122 --- a/drivers/net/wireless/ath/ath12k/mac.c
123 +++ b/drivers/net/wireless/ath/ath12k/mac.c
124 @@ -2477,8 +2477,10 @@ static void ath12k_peer_assoc_h_he(struc
125 arg->peer_nss = min(sta->deflink.rx_nss, max_nss);
127 if (arg->peer_phymode == MODE_11AX_HE160) {
128 - tx_nss = ath12k_get_nss_160mhz(ar, max_nss);
129 + tx_nss = ath12k_get_nss_160mhz(ar, ar->num_tx_chains);
130 rx_nss = min(arg->peer_nss, tx_nss);
132 + arg->peer_nss = min(sta->deflink.rx_nss, ar->num_rx_chains);
133 arg->peer_bw_rxnss_override = ATH12K_BW_NSS_MAP_ENABLE;
136 @@ -5635,6 +5637,12 @@ ath12k_create_vht_cap(struct ath12k *ar,
137 vht_cap.vht_mcs.rx_mcs_map = cpu_to_le16(rxmcs_map);
138 vht_cap.vht_mcs.tx_mcs_map = cpu_to_le16(txmcs_map);
140 + /* Check if the HW supports 1:1 NSS ratio and reset
141 + * EXT NSS BW Support field to 0 to indicate 1:1 ratio
143 + if (ar->pdev->cap.nss_ratio_info == WMI_NSS_RATIO_1_NSS)
144 + vht_cap.cap &= ~IEEE80211_VHT_CAP_EXT_NSS_BW_MASK;
149 @@ -5815,11 +5823,12 @@ static void ath12k_mac_set_hemcsmap(stru
150 struct ieee80211_sta_he_cap *he_cap)
152 struct ieee80211_he_mcs_nss_supp *mcs_nss = &he_cap->he_mcs_nss_supp;
153 - u16 txmcs_map, rxmcs_map;
154 + u8 maxtxnss_160 = ath12k_get_nss_160mhz(ar, ar->num_tx_chains);
155 + u8 maxrxnss_160 = ath12k_get_nss_160mhz(ar, ar->num_rx_chains);
156 + u16 txmcs_map_160 = 0, rxmcs_map_160 = 0;
157 + u16 txmcs_map = 0, rxmcs_map = 0;
162 for (i = 0; i < 8; i++) {
163 if (i < ar->num_tx_chains &&
164 (ar->cfg_tx_chainmask >> cap->tx_chain_mask_shift) & BIT(i))
165 @@ -5832,12 +5841,24 @@ static void ath12k_mac_set_hemcsmap(stru
166 rxmcs_map |= IEEE80211_HE_MCS_SUPPORT_0_11 << (i * 2);
168 rxmcs_map |= IEEE80211_HE_MCS_NOT_SUPPORTED << (i * 2);
170 + if (i < maxtxnss_160 &&
171 + (ar->cfg_tx_chainmask >> cap->tx_chain_mask_shift) & BIT(i))
172 + txmcs_map_160 |= IEEE80211_HE_MCS_SUPPORT_0_11 << (i * 2);
174 + txmcs_map_160 |= IEEE80211_HE_MCS_NOT_SUPPORTED << (i * 2);
176 + if (i < maxrxnss_160 &&
177 + (ar->cfg_tx_chainmask >> cap->tx_chain_mask_shift) & BIT(i))
178 + rxmcs_map_160 |= IEEE80211_HE_MCS_SUPPORT_0_11 << (i * 2);
180 + rxmcs_map_160 |= IEEE80211_HE_MCS_NOT_SUPPORTED << (i * 2);
183 mcs_nss->rx_mcs_80 = cpu_to_le16(rxmcs_map & 0xffff);
184 mcs_nss->tx_mcs_80 = cpu_to_le16(txmcs_map & 0xffff);
185 - mcs_nss->rx_mcs_160 = cpu_to_le16(rxmcs_map & 0xffff);
186 - mcs_nss->tx_mcs_160 = cpu_to_le16(txmcs_map & 0xffff);
187 + mcs_nss->rx_mcs_160 = cpu_to_le16(rxmcs_map_160 & 0xffff);
188 + mcs_nss->tx_mcs_160 = cpu_to_le16(txmcs_map_160 & 0xffff);
191 static void ath12k_mac_copy_he_cap(struct ath12k *ar,