scan.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * This file is part of wl12xx
  4. *
  5. * Copyright (C) 2012 Texas Instruments. All rights reserved.
  6. */
  7. #ifndef __WL12XX_SCAN_H__
  8. #define __WL12XX_SCAN_H__
  9. #include "../wlcore/wlcore.h"
  10. #include "../wlcore/cmd.h"
  11. #include "../wlcore/scan.h"
  12. #define WL12XX_MAX_CHANNELS_5GHZ 23
  13. struct basic_scan_params {
  14. /* Scan option flags (WL1271_SCAN_OPT_*) */
  15. __le16 scan_options;
  16. u8 role_id;
  17. /* Number of scan channels in the list (maximum 30) */
  18. u8 n_ch;
  19. /* This field indicates the number of probe requests to send
  20. per channel for an active scan */
  21. u8 n_probe_reqs;
  22. u8 tid_trigger;
  23. u8 ssid_len;
  24. u8 use_ssid_list;
  25. /* Rate bit field for sending the probes */
  26. __le32 tx_rate;
  27. u8 ssid[IEEE80211_MAX_SSID_LEN];
  28. /* Band to scan */
  29. u8 band;
  30. u8 scan_tag;
  31. u8 padding2[2];
  32. } __packed;
  33. struct basic_scan_channel_params {
  34. /* Duration in TU to wait for frames on a channel for active scan */
  35. __le32 min_duration;
  36. __le32 max_duration;
  37. __le32 bssid_lsb;
  38. __le16 bssid_msb;
  39. u8 early_termination;
  40. u8 tx_power_att;
  41. u8 channel;
  42. /* FW internal use only! */
  43. u8 dfs_candidate;
  44. u8 activity_detected;
  45. u8 pad;
  46. } __packed;
  47. struct wl1271_cmd_scan {
  48. struct wl1271_cmd_header header;
  49. struct basic_scan_params params;
  50. struct basic_scan_channel_params channels[WL1271_SCAN_MAX_CHANNELS];
  51. /* src mac address */
  52. u8 addr[ETH_ALEN];
  53. u8 padding[2];
  54. } __packed;
  55. struct wl1271_cmd_sched_scan_config {
  56. struct wl1271_cmd_header header;
  57. __le32 intervals[SCAN_MAX_CYCLE_INTERVALS];
  58. s8 rssi_threshold; /* for filtering (in dBm) */
  59. s8 snr_threshold; /* for filtering (in dB) */
  60. u8 cycles; /* maximum number of scan cycles */
  61. u8 report_after; /* report when this number of results are received */
  62. u8 terminate; /* stop scanning after reporting */
  63. u8 tag;
  64. u8 bss_type; /* for filtering */
  65. u8 filter_type;
  66. u8 ssid_len; /* For SCAN_SSID_FILTER_SPECIFIC */
  67. u8 ssid[IEEE80211_MAX_SSID_LEN];
  68. u8 n_probe_reqs; /* Number of probes requests per channel */
  69. u8 passive[SCAN_MAX_BANDS];
  70. u8 active[SCAN_MAX_BANDS];
  71. u8 dfs;
  72. u8 n_pactive_ch; /* number of pactive (passive until fw detects energy)
  73. channels in BG band */
  74. u8 role_id;
  75. u8 padding[1];
  76. struct conn_scan_ch_params channels_2[MAX_CHANNELS_2GHZ];
  77. struct conn_scan_ch_params channels_5[WL12XX_MAX_CHANNELS_5GHZ];
  78. struct conn_scan_ch_params channels_4[MAX_CHANNELS_4GHZ];
  79. } __packed;
  80. struct wl1271_cmd_sched_scan_start {
  81. struct wl1271_cmd_header header;
  82. u8 tag;
  83. u8 role_id;
  84. u8 padding[2];
  85. } __packed;
  86. struct wl1271_cmd_sched_scan_stop {
  87. struct wl1271_cmd_header header;
  88. u8 tag;
  89. u8 role_id;
  90. u8 padding[2];
  91. } __packed;
  92. int wl12xx_scan_start(struct wl1271 *wl, struct wl12xx_vif *wlvif,
  93. struct cfg80211_scan_request *req);
  94. int wl12xx_scan_stop(struct wl1271 *wl, struct wl12xx_vif *wlvif);
  95. void wl12xx_scan_completed(struct wl1271 *wl, struct wl12xx_vif *wlvif);
  96. int wl12xx_sched_scan_start(struct wl1271 *wl, struct wl12xx_vif *wlvif,
  97. struct cfg80211_sched_scan_request *req,
  98. struct ieee80211_scan_ies *ies);
  99. void wl12xx_scan_sched_scan_stop(struct wl1271 *wl, struct wl12xx_vif *wlvif);
  100. #endif