scan.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * This file is part of wl18xx
  4. *
  5. * Copyright (C) 2012 Texas Instruments. All rights reserved.
  6. */
  7. #ifndef __WL18XX_SCAN_H__
  8. #define __WL18XX_SCAN_H__
  9. #include "../wlcore/wlcore.h"
  10. #include "../wlcore/cmd.h"
  11. #include "../wlcore/scan.h"
  12. struct tracking_ch_params {
  13. struct conn_scan_ch_params channel;
  14. __le32 bssid_lsb;
  15. __le16 bssid_msb;
  16. u8 padding[2];
  17. } __packed;
  18. /* probe request rate */
  19. enum
  20. {
  21. WL18XX_SCAN_RATE_1 = 0,
  22. WL18XX_SCAN_RATE_5_5 = 1,
  23. WL18XX_SCAN_RATE_6 = 2,
  24. };
  25. #define WL18XX_MAX_CHANNELS_5GHZ 32
  26. struct wl18xx_cmd_scan_params {
  27. struct wl1271_cmd_header header;
  28. u8 role_id;
  29. u8 scan_type;
  30. s8 rssi_threshold; /* for filtering (in dBm) */
  31. s8 snr_threshold; /* for filtering (in dB) */
  32. u8 bss_type; /* for filtering */
  33. u8 ssid_from_list; /* use ssid from configured ssid list */
  34. u8 filter; /* forward only results with matching ssids */
  35. /*
  36. * add broadcast ssid in addition to the configured ssids.
  37. * the driver should add dummy entry for it (?).
  38. */
  39. u8 add_broadcast;
  40. u8 urgency;
  41. u8 protect; /* ??? */
  42. u8 n_probe_reqs; /* Number of probes requests per channel */
  43. u8 terminate_after; /* early terminate scan operation */
  44. u8 passive[SCAN_MAX_BANDS]; /* number of passive scan channels */
  45. u8 active[SCAN_MAX_BANDS]; /* number of active scan channels */
  46. u8 dfs; /* number of dfs channels in 5ghz */
  47. u8 passive_active; /* number of passive before active channels 2.4ghz */
  48. __le16 short_cycles_msec;
  49. __le16 long_cycles_msec;
  50. u8 short_cycles_count;
  51. u8 total_cycles; /* 0 - infinite */
  52. u8 padding[2];
  53. union {
  54. struct {
  55. struct conn_scan_ch_params channels_2[MAX_CHANNELS_2GHZ];
  56. struct conn_scan_ch_params channels_5[WL18XX_MAX_CHANNELS_5GHZ];
  57. struct conn_scan_ch_params channels_4[MAX_CHANNELS_4GHZ];
  58. };
  59. struct tracking_ch_params channels_tracking[WL1271_SCAN_MAX_CHANNELS];
  60. } ;
  61. u8 ssid[IEEE80211_MAX_SSID_LEN];
  62. u8 ssid_len; /* For SCAN_SSID_FILTER_SPECIFIC */
  63. u8 tag;
  64. u8 rate;
  65. /* send SCAN_REPORT_EVENT in periodic scans after each cycle
  66. * if number of results >= report_threshold. Must be 0 for
  67. * non periodic scans
  68. */
  69. u8 report_threshold;
  70. /* Should periodic scan stop after a report event was created.
  71. * Must be 0 for non periodic scans.
  72. */
  73. u8 terminate_on_report;
  74. u8 padding1[3];
  75. } __packed;
  76. struct wl18xx_cmd_scan_stop {
  77. struct wl1271_cmd_header header;
  78. u8 role_id;
  79. u8 scan_type;
  80. u8 padding[2];
  81. } __packed;
  82. int wl18xx_scan_start(struct wl1271 *wl, struct wl12xx_vif *wlvif,
  83. struct cfg80211_scan_request *req);
  84. int wl18xx_scan_stop(struct wl1271 *wl, struct wl12xx_vif *wlvif);
  85. void wl18xx_scan_completed(struct wl1271 *wl, struct wl12xx_vif *wlvif);
  86. int wl18xx_sched_scan_start(struct wl1271 *wl, struct wl12xx_vif *wlvif,
  87. struct cfg80211_sched_scan_request *req,
  88. struct ieee80211_scan_ies *ies);
  89. void wl18xx_scan_sched_scan_stop(struct wl1271 *wl, struct wl12xx_vif *wlvif);
  90. #endif