scan.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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. #define WL12XX_MAX_CHANNELS_5GHZ 23
  27. struct basic_scan_params {
  28. /* Scan option flags (WL1271_SCAN_OPT_*) */
  29. __le16 scan_options;
  30. u8 role_id;
  31. /* Number of scan channels in the list (maximum 30) */
  32. u8 n_ch;
  33. /* This field indicates the number of probe requests to send
  34. per channel for an active scan */
  35. u8 n_probe_reqs;
  36. u8 tid_trigger;
  37. u8 ssid_len;
  38. u8 use_ssid_list;
  39. /* Rate bit field for sending the probes */
  40. __le32 tx_rate;
  41. u8 ssid[IEEE80211_MAX_SSID_LEN];
  42. /* Band to scan */
  43. u8 band;
  44. u8 scan_tag;
  45. u8 padding2[2];
  46. } __packed;
  47. struct basic_scan_channel_params {
  48. /* Duration in TU to wait for frames on a channel for active scan */
  49. __le32 min_duration;
  50. __le32 max_duration;
  51. __le32 bssid_lsb;
  52. __le16 bssid_msb;
  53. u8 early_termination;
  54. u8 tx_power_att;
  55. u8 channel;
  56. /* FW internal use only! */
  57. u8 dfs_candidate;
  58. u8 activity_detected;
  59. u8 pad;
  60. } __packed;
  61. struct wl1271_cmd_scan {
  62. struct wl1271_cmd_header header;
  63. struct basic_scan_params params;
  64. struct basic_scan_channel_params channels[WL1271_SCAN_MAX_CHANNELS];
  65. /* src mac address */
  66. u8 addr[ETH_ALEN];
  67. u8 padding[2];
  68. } __packed;
  69. struct wl1271_cmd_sched_scan_config {
  70. struct wl1271_cmd_header header;
  71. __le32 intervals[SCAN_MAX_CYCLE_INTERVALS];
  72. s8 rssi_threshold; /* for filtering (in dBm) */
  73. s8 snr_threshold; /* for filtering (in dB) */
  74. u8 cycles; /* maximum number of scan cycles */
  75. u8 report_after; /* report when this number of results are received */
  76. u8 terminate; /* stop scanning after reporting */
  77. u8 tag;
  78. u8 bss_type; /* for filtering */
  79. u8 filter_type;
  80. u8 ssid_len; /* For SCAN_SSID_FILTER_SPECIFIC */
  81. u8 ssid[IEEE80211_MAX_SSID_LEN];
  82. u8 n_probe_reqs; /* Number of probes requests per channel */
  83. u8 passive[SCAN_MAX_BANDS];
  84. u8 active[SCAN_MAX_BANDS];
  85. u8 dfs;
  86. u8 n_pactive_ch; /* number of pactive (passive until fw detects energy)
  87. channels in BG band */
  88. u8 role_id;
  89. u8 padding[1];
  90. struct conn_scan_ch_params channels_2[MAX_CHANNELS_2GHZ];
  91. struct conn_scan_ch_params channels_5[WL12XX_MAX_CHANNELS_5GHZ];
  92. struct conn_scan_ch_params channels_4[MAX_CHANNELS_4GHZ];
  93. } __packed;
  94. struct wl1271_cmd_sched_scan_start {
  95. struct wl1271_cmd_header header;
  96. u8 tag;
  97. u8 role_id;
  98. u8 padding[2];
  99. } __packed;
  100. struct wl1271_cmd_sched_scan_stop {
  101. struct wl1271_cmd_header header;
  102. u8 tag;
  103. u8 role_id;
  104. u8 padding[2];
  105. } __packed;
  106. int wl12xx_scan_start(struct wl1271 *wl, struct wl12xx_vif *wlvif,
  107. struct cfg80211_scan_request *req);
  108. int wl12xx_scan_stop(struct wl1271 *wl, struct wl12xx_vif *wlvif);
  109. void wl12xx_scan_completed(struct wl1271 *wl, struct wl12xx_vif *wlvif);
  110. int wl12xx_sched_scan_start(struct wl1271 *wl, struct wl12xx_vif *wlvif,
  111. struct cfg80211_sched_scan_request *req,
  112. struct ieee80211_scan_ies *ies);
  113. void wl12xx_scan_sched_scan_stop(struct wl1271 *wl, struct wl12xx_vif *wlvif);
  114. #endif