78dea13a49071f0890fbb57fcd735202836e0ce8
[openwrt/openwrt.git] /
1 From b1b01e46a3db5ad44d1e4691ba37c1e0832cd5cf Mon Sep 17 00:00:00 2001
2 From: Suraj P Kizhakkethil <quic_surapk@quicinc.com>
3 Date: Tue, 4 Mar 2025 15:23:14 +0530
4 Subject: [PATCH 1/2] wifi: ath12k: Pass correct values of center freq1 and
5 center freq2 for 160 MHz
6
7 Currently, for 160 MHz bandwidth, center frequency1 and
8 center frequency2 are not passed correctly to the firmware.
9 Set center frequency1 as the center frequency
10 of the primary 80 MHz channel segment and center frequency2 as
11 the center frequency of the 160 MHz channel and pass the values
12 to the firmware.
13
14 Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1
15
16 Signed-off-by: Suraj P Kizhakkethil <quic_surapk@quicinc.com>
17 Reviewed-by: Aditya Kumar Singh <aditya.kumar.singh@oss.qualcomm.com>
18 Link: https://patch.msgid.link/20250304095315.3050325-2-quic_surapk@quicinc.com
19 Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
20 ---
21 drivers/net/wireless/ath/ath12k/wmi.c | 16 +++++++++++++---
22 1 file changed, 13 insertions(+), 3 deletions(-)
23
24 --- a/drivers/net/wireless/ath/ath12k/wmi.c
25 +++ b/drivers/net/wireless/ath/ath12k/wmi.c
26 @@ -1000,14 +1000,24 @@ int ath12k_wmi_vdev_down(struct ath12k *
27 static void ath12k_wmi_put_wmi_channel(struct ath12k_wmi_channel_params *chan,
28 struct wmi_vdev_start_req_arg *arg)
29 {
30 + u32 center_freq1 = arg->band_center_freq1;
31 +
32 memset(chan, 0, sizeof(*chan));
33
34 chan->mhz = cpu_to_le32(arg->freq);
35 - chan->band_center_freq1 = cpu_to_le32(arg->band_center_freq1);
36 - if (arg->mode == MODE_11AC_VHT80_80)
37 + chan->band_center_freq1 = cpu_to_le32(center_freq1);
38 + if (arg->mode == MODE_11BE_EHT160) {
39 + if (arg->freq > center_freq1)
40 + chan->band_center_freq1 = cpu_to_le32(center_freq1 + 40);
41 + else
42 + chan->band_center_freq1 = cpu_to_le32(center_freq1 - 40);
43 +
44 + chan->band_center_freq2 = cpu_to_le32(center_freq1);
45 + } else if (arg->mode == MODE_11BE_EHT80_80) {
46 chan->band_center_freq2 = cpu_to_le32(arg->band_center_freq2);
47 - else
48 + } else {
49 chan->band_center_freq2 = 0;
50 + }
51
52 chan->info |= le32_encode_bits(arg->mode, WMI_CHAN_INFO_MODE);
53 if (arg->passive)