scan.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. /*
  2. * This file is part of wl12xx
  3. *
  4. * Copyright (C) 2012 Texas Instruments. All rights reserved.
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License
  8. * version 2 as published by the Free Software Foundation.
  9. *
  10. * This program is distributed in the hope that it will be useful, but
  11. * WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. * General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program; if not, write to the Free Software
  17. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  18. * 02110-1301 USA
  19. *
  20. */
  21. #ifndef __WL12XX_SCAN_H__
  22. #define __WL12XX_SCAN_H__
  23. #include "../wlcore/wlcore.h"
  24. #include "../wlcore/cmd.h"
  25. #include "../wlcore/scan.h"
  26. struct basic_scan_params {
  27. /* Scan option flags (WL1271_SCAN_OPT_*) */
  28. __le16 scan_options;
  29. u8 role_id;
  30. /* Number of scan channels in the list (maximum 30) */
  31. u8 n_ch;
  32. /* This field indicates the number of probe requests to send
  33. per channel for an active scan */
  34. u8 n_probe_reqs;
  35. u8 tid_trigger;
  36. u8 ssid_len;
  37. u8 use_ssid_list;
  38. /* Rate bit field for sending the probes */
  39. __le32 tx_rate;
  40. u8 ssid[IEEE80211_MAX_SSID_LEN];
  41. /* Band to scan */
  42. u8 band;
  43. u8 scan_tag;
  44. u8 padding2[2];
  45. } __packed;
  46. struct basic_scan_channel_params {
  47. /* Duration in TU to wait for frames on a channel for active scan */
  48. __le32 min_duration;
  49. __le32 max_duration;
  50. __le32 bssid_lsb;
  51. __le16 bssid_msb;
  52. u8 early_termination;
  53. u8 tx_power_att;
  54. u8 channel;
  55. /* FW internal use only! */
  56. u8 dfs_candidate;
  57. u8 activity_detected;
  58. u8 pad;
  59. } __packed;
  60. struct wl1271_cmd_scan {
  61. struct wl1271_cmd_header header;
  62. struct basic_scan_params params;
  63. struct basic_scan_channel_params channels[WL1271_SCAN_MAX_CHANNELS];
  64. /* src mac address */
  65. u8 addr[ETH_ALEN];
  66. u8 padding[2];
  67. } __packed;
  68. struct wl1271_cmd_sched_scan_config {
  69. struct wl1271_cmd_header header;
  70. __le32 intervals[SCAN_MAX_CYCLE_INTERVALS];
  71. s8 rssi_threshold; /* for filtering (in dBm) */
  72. s8 snr_threshold; /* for filtering (in dB) */
  73. u8 cycles; /* maximum number of scan cycles */
  74. u8 report_after; /* report when this number of results are received */
  75. u8 terminate; /* stop scanning after reporting */
  76. u8 tag;
  77. u8 bss_type; /* for filtering */
  78. u8 filter_type;
  79. u8 ssid_len; /* For SCAN_SSID_FILTER_SPECIFIC */
  80. u8 ssid[IEEE80211_MAX_SSID_LEN];
  81. u8 n_probe_reqs; /* Number of probes requests per channel */
  82. u8 passive[SCAN_MAX_BANDS];
  83. u8 active[SCAN_MAX_BANDS];
  84. u8 dfs;
  85. u8 n_pactive_ch; /* number of pactive (passive until fw detects energy)
  86. channels in BG band */
  87. u8 role_id;
  88. u8 padding[1];
  89. struct conn_scan_ch_params channels_2[MAX_CHANNELS_2GHZ];
  90. struct conn_scan_ch_params channels_5[MAX_CHANNELS_5GHZ];
  91. struct conn_scan_ch_params channels_4[MAX_CHANNELS_4GHZ];
  92. } __packed;
  93. struct wl1271_cmd_sched_scan_start {
  94. struct wl1271_cmd_header header;
  95. u8 tag;
  96. u8 role_id;
  97. u8 padding[2];
  98. } __packed;
  99. struct wl1271_cmd_sched_scan_stop {
  100. struct wl1271_cmd_header header;
  101. u8 tag;
  102. u8 role_id;
  103. u8 padding[2];
  104. } __packed;
  105. int wl12xx_scan_start(struct wl1271 *wl, struct wl12xx_vif *wlvif,
  106. struct cfg80211_scan_request *req);
  107. int wl12xx_scan_stop(struct wl1271 *wl, struct wl12xx_vif *wlvif);
  108. void wl12xx_scan_completed(struct wl1271 *wl, struct wl12xx_vif *wlvif);
  109. int wl12xx_sched_scan_start(struct wl1271 *wl, struct wl12xx_vif *wlvif,
  110. struct cfg80211_sched_scan_request *req,
  111. struct ieee80211_sched_scan_ies *ies);
  112. void wl12xx_scan_sched_scan_stop(struct wl1271 *wl, struct wl12xx_vif *wlvif);
  113. #endif