diff mbox series

[v2,1/2] wifi: ath11k: Do not directly use scan_flags in struct scan_req_params

Message ID 20240209113536.266822-2-nico.escande@gmail.com (mailing list archive)
State Accepted
Commit 64493a7ff74b679640ff493aed11753a1d284ca9
Delegated to: Kalle Valo
Headers show
Series wifi: ath11k: fix layout of scan_flags in struct scan_req_params | expand

Commit Message

Nicolas Escande Feb. 9, 2024, 11:35 a.m. UTC
As discussed in [1] lets not use WMI_SCAN_XXX defines in combination with
scan_flags directly when setting scan params in struct scan_req_params but use
the underlying bitfield. This bitfield is then converted to WMI_SCAN_XXX when
filling the WMI command to send to the firmware.

[1] https://lore.kernel.org/all/871qae51wx.fsf@kernel.org/

Tested-on: QCN9074 PCI WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1

Signed-off-by: Nicolas Escande <nico.escande@gmail.com>
---
 drivers/net/wireless/ath/ath11k/mac.c | 6 +++---
 drivers/net/wireless/ath/ath11k/wmi.c | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

Comments

Jeff Johnson Feb. 9, 2024, 7:01 p.m. UTC | #1
On 2/9/2024 3:35 AM, Nicolas Escande wrote:
> As discussed in [1] lets not use WMI_SCAN_XXX defines in combination with
> scan_flags directly when setting scan params in struct scan_req_params but use
> the underlying bitfield. This bitfield is then converted to WMI_SCAN_XXX when
> filling the WMI command to send to the firmware.
> 
> [1] https://lore.kernel.org/all/871qae51wx.fsf@kernel.org/
> 
> Tested-on: QCN9074 PCI WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1
> 
> Signed-off-by: Nicolas Escande <nico.escande@gmail.com>
Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
Kalle Valo Feb. 14, 2024, 8:15 a.m. UTC | #2
Nicolas Escande <nico.escande@gmail.com> wrote:

> As discussed in [1] lets not use WMI_SCAN_XXX defines in combination with
> scan_flags directly when setting scan params in struct scan_req_params but use
> the underlying bitfield. This bitfield is then converted to WMI_SCAN_XXX when
> filling the WMI command to send to the firmware.
> 
> [1] https://lore.kernel.org/all/871qae51wx.fsf@kernel.org/
> 
> Tested-on: QCN9074 PCI WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1
> 
> Signed-off-by: Nicolas Escande <nico.escande@gmail.com>
> Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>

2 patches applied to ath-next branch of ath.git, thanks.

64493a7ff74b wifi: ath11k: Do not directly use scan_flags in struct scan_req_params
79ad70c6df0a wifi: ath11k: Remove scan_flags union from struct scan_req_params
diff mbox series

Patch

diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c
index be04f823566f..7bf5d1068164 100644
--- a/drivers/net/wireless/ath/ath11k/mac.c
+++ b/drivers/net/wireless/ath/ath11k/mac.c
@@ -4013,7 +4013,7 @@  static int ath11k_mac_op_hw_scan(struct ieee80211_hw *hw,
 			       req->ssids[i].ssid_len);
 		}
 	} else {
-		arg->scan_flags |= WMI_SCAN_FLAG_PASSIVE;
+		arg->scan_f_passive = 1;
 	}
 
 	if (req->n_channels) {
@@ -9252,8 +9252,8 @@  static int ath11k_mac_op_remain_on_channel(struct ieee80211_hw *hw,
 	arg->dwell_time_active = scan_time_msec;
 	arg->dwell_time_passive = scan_time_msec;
 	arg->max_scan_time = scan_time_msec;
-	arg->scan_flags |= WMI_SCAN_FLAG_PASSIVE;
-	arg->scan_flags |= WMI_SCAN_FILTER_PROBE_REQ;
+	arg->scan_f_passive = 1;
+	arg->scan_f_filter_prb_req = 1;
 	arg->burst_duration = duration;
 
 	ret = ath11k_start_scan(ar, arg);
diff --git a/drivers/net/wireless/ath/ath11k/wmi.c b/drivers/net/wireless/ath/ath11k/wmi.c
index 688ee20528a0..78c11025c21c 100644
--- a/drivers/net/wireless/ath/ath11k/wmi.c
+++ b/drivers/net/wireless/ath/ath11k/wmi.c
@@ -2098,7 +2098,7 @@  void ath11k_wmi_start_scan_init(struct ath11k *ar,
 				  WMI_SCAN_EVENT_BSS_CHANNEL |
 				  WMI_SCAN_EVENT_FOREIGN_CHAN |
 				  WMI_SCAN_EVENT_DEQUEUED;
-	arg->scan_flags |= WMI_SCAN_CHAN_STAT_EVENT;
+	arg->scan_f_chan_stat_evnt = 1;
 
 	if (test_bit(WMI_TLV_SERVICE_PASSIVE_SCAN_START_TIME_ENHANCE,
 		     ar->ab->wmi_ab.svc_map))