1
0

0033-wifi-ath11k-Set-ext-passive-scan-flag-to-adjust-pass.patch 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. From cf8f3d4deb02a8fdc806c46d4112b69868544697 Mon Sep 17 00:00:00 2001
  2. From: Tamizh Chelvam Raja <quic_tamizhr@quicinc.com>
  3. Date: Wed, 15 Feb 2023 20:31:36 +0200
  4. Subject: [PATCH] wifi: ath11k: Set ext passive scan flag to adjust passive
  5. scan start time
  6. Set the WMI_SCAN_FLAG_EXT_PASSIVE_SCAN_START_TIME_ENHANCE flag
  7. while sending the scan command. If this flag is enabled when the
  8. incoming scan request comes with a strict start time and its duration
  9. overlaps with next TBTT, then target adjust the start time accordingly
  10. for passive scan. Target supporting this feature will advertise
  11. WMI_TLV_SERVICE_PASSIVE_SCAN_START_TIME_ENHANCE.
  12. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-01467-QCAHKSWPL_SILICONZ-1
  13. Signed-off-by: Tamizh Chelvam Raja <quic_tamizhr@quicinc.com>
  14. Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
  15. Link: https://lore.kernel.org/r/20221222131720.11368-1-quic_tamizhr@quicinc.com
  16. ---
  17. drivers/net/wireless/ath/ath11k/wmi.c | 8 ++++++++
  18. drivers/net/wireless/ath/ath11k/wmi.h | 3 +++
  19. 2 files changed, 11 insertions(+)
  20. --- a/drivers/net/wireless/ath/ath11k/wmi.c
  21. +++ b/drivers/net/wireless/ath/ath11k/wmi.c
  22. @@ -2068,6 +2068,12 @@ void ath11k_wmi_start_scan_init(struct a
  23. WMI_SCAN_EVENT_FOREIGN_CHAN |
  24. WMI_SCAN_EVENT_DEQUEUED;
  25. arg->scan_flags |= WMI_SCAN_CHAN_STAT_EVENT;
  26. +
  27. + if (test_bit(WMI_TLV_SERVICE_PASSIVE_SCAN_START_TIME_ENHANCE,
  28. + ar->ab->wmi_ab.svc_map))
  29. + arg->scan_ctrl_flags_ext |=
  30. + WMI_SCAN_FLAG_EXT_PASSIVE_SCAN_START_TIME_ENHANCE;
  31. +
  32. arg->num_bssid = 1;
  33. /* fill bssid_list[0] with 0xff, otherwise bssid and RA will be
  34. @@ -2149,6 +2155,8 @@ ath11k_wmi_copy_scan_event_cntrl_flags(s
  35. /* for adaptive scan mode using 3 bits (21 - 23 bits) */
  36. WMI_SCAN_SET_DWELL_MODE(cmd->scan_ctrl_flags,
  37. param->adaptive_dwell_time_mode);
  38. +
  39. + cmd->scan_ctrl_flags_ext = param->scan_ctrl_flags_ext;
  40. }
  41. int ath11k_wmi_send_scan_start_cmd(struct ath11k *ar,
  42. --- a/drivers/net/wireless/ath/ath11k/wmi.h
  43. +++ b/drivers/net/wireless/ath/ath11k/wmi.h
  44. @@ -2093,6 +2093,7 @@ enum wmi_tlv_service {
  45. WMI_TLV_SERVICE_EXT2_MSG = 220,
  46. WMI_TLV_SERVICE_PEER_POWER_SAVE_DURATION_SUPPORT = 246,
  47. WMI_TLV_SERVICE_SRG_SRP_SPATIAL_REUSE_SUPPORT = 249,
  48. + WMI_TLV_SERVICE_PASSIVE_SCAN_START_TIME_ENHANCE = 263,
  49. /* The second 128 bits */
  50. WMI_MAX_EXT_SERVICE = 256,
  51. @@ -3223,6 +3224,7 @@ struct wmi_start_scan_cmd {
  52. #define WMI_SCAN_DWELL_MODE_MASK 0x00E00000
  53. #define WMI_SCAN_DWELL_MODE_SHIFT 21
  54. +#define WMI_SCAN_FLAG_EXT_PASSIVE_SCAN_START_TIME_ENHANCE 0x00000800
  55. enum {
  56. WMI_SCAN_DWELL_MODE_DEFAULT = 0,
  57. @@ -3270,6 +3272,7 @@ struct scan_req_params {
  58. };
  59. u32 scan_events;
  60. };
  61. + u32 scan_ctrl_flags_ext;
  62. u32 dwell_time_active;
  63. u32 dwell_time_active_2g;
  64. u32 dwell_time_passive;