wl1271_scan.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /*
  2. * This file is part of wl1271
  3. *
  4. * Copyright (C) 2009-2010 Nokia Corporation
  5. *
  6. * Contact: Luciano Coelho <luciano.coelho@nokia.com>
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License
  10. * version 2 as published by the Free Software Foundation.
  11. *
  12. * This program is distributed in the hope that it will be useful, but
  13. * WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  20. * 02110-1301 USA
  21. *
  22. */
  23. #ifndef __WL1271_SCAN_H__
  24. #define __WL1271_SCAN_H__
  25. #include "wl1271.h"
  26. int wl1271_scan(struct wl1271 *wl, const u8 *ssid, size_t ssid_len,
  27. struct cfg80211_scan_request *req, u8 active_scan,
  28. u8 high_prio, u8 band, u8 probe_requests);
  29. int wl1271_scan_build_probe_req(struct wl1271 *wl,
  30. const u8 *ssid, size_t ssid_len,
  31. const u8 *ie, size_t ie_len, u8 band);
  32. int wl1271_scan_complete(struct wl1271 *wl);
  33. #define WL1271_SCAN_MAX_CHANNELS 24
  34. #define WL1271_SCAN_DEFAULT_TAG 1
  35. #define WL1271_SCAN_CURRENT_TX_PWR 0
  36. #define WL1271_SCAN_OPT_ACTIVE 0
  37. #define WL1271_SCAN_OPT_PASSIVE 1
  38. #define WL1271_SCAN_OPT_PRIORITY_HIGH 4
  39. #define WL1271_SCAN_CHAN_MIN_DURATION 30000 /* TU */
  40. #define WL1271_SCAN_CHAN_MAX_DURATION 60000 /* TU */
  41. #define WL1271_SCAN_BAND_2_4_GHZ 0
  42. #define WL1271_SCAN_BAND_5_GHZ 1
  43. #define WL1271_SCAN_BAND_DUAL 2
  44. struct basic_scan_params {
  45. __le32 rx_config_options;
  46. __le32 rx_filter_options;
  47. /* Scan option flags (WL1271_SCAN_OPT_*) */
  48. __le16 scan_options;
  49. /* Number of scan channels in the list (maximum 30) */
  50. u8 num_channels;
  51. /* This field indicates the number of probe requests to send
  52. per channel for an active scan */
  53. u8 num_probe_requests;
  54. /* Rate bit field for sending the probes */
  55. __le32 tx_rate;
  56. u8 tid_trigger;
  57. u8 ssid_len;
  58. /* in order to align */
  59. u8 padding1[2];
  60. u8 ssid[IW_ESSID_MAX_SIZE];
  61. /* Band to scan */
  62. u8 band;
  63. u8 use_ssid_list;
  64. u8 scan_tag;
  65. u8 padding2;
  66. } __attribute__ ((packed));
  67. struct basic_scan_channel_params {
  68. /* Duration in TU to wait for frames on a channel for active scan */
  69. __le32 min_duration;
  70. __le32 max_duration;
  71. __le32 bssid_lsb;
  72. __le16 bssid_msb;
  73. u8 early_termination;
  74. u8 tx_power_att;
  75. u8 channel;
  76. /* FW internal use only! */
  77. u8 dfs_candidate;
  78. u8 activity_detected;
  79. u8 pad;
  80. } __attribute__ ((packed));
  81. struct wl1271_cmd_scan {
  82. struct wl1271_cmd_header header;
  83. struct basic_scan_params params;
  84. struct basic_scan_channel_params channels[WL1271_SCAN_MAX_CHANNELS];
  85. } __attribute__ ((packed));
  86. struct wl1271_cmd_trigger_scan_to {
  87. struct wl1271_cmd_header header;
  88. __le32 timeout;
  89. } __attribute__ ((packed));
  90. #endif /* __WL1271_SCAN_H__ */