2 * This file is part of wl1271
4 * Copyright (C) 2009-2010 Nokia Corporation
6 * Contact: Luciano Coelho <luciano.coelho@nokia.com>
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.
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.
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
24 #ifndef __WL1271_SCAN_H__
25 #define __WL1271_SCAN_H__
29 int wl1271_scan(struct wl1271
*wl
, const u8
*ssid
, size_t ssid_len
,
30 struct cfg80211_scan_request
*req
);
31 int wl1271_scan_build_probe_req(struct wl1271
*wl
,
32 const u8
*ssid
, size_t ssid_len
,
33 const u8
*ie
, size_t ie_len
, u8 band
);
34 void wl1271_scan_stm(struct wl1271
*wl
);
35 void wl1271_scan_complete_work(struct work_struct
*work
);
37 #define WL1271_SCAN_MAX_CHANNELS 24
38 #define WL1271_SCAN_DEFAULT_TAG 1
39 #define WL1271_SCAN_CURRENT_TX_PWR 0
40 #define WL1271_SCAN_OPT_ACTIVE 0
41 #define WL1271_SCAN_OPT_PASSIVE 1
42 #define WL1271_SCAN_OPT_PRIORITY_HIGH 4
43 #define WL1271_SCAN_BAND_2_4_GHZ 0
44 #define WL1271_SCAN_BAND_5_GHZ 1
46 #define WL1271_SCAN_TIMEOUT 10000 /* msec */
49 WL1271_SCAN_STATE_IDLE
,
50 WL1271_SCAN_STATE_2GHZ_ACTIVE
,
51 WL1271_SCAN_STATE_2GHZ_PASSIVE
,
52 WL1271_SCAN_STATE_5GHZ_ACTIVE
,
53 WL1271_SCAN_STATE_5GHZ_PASSIVE
,
54 WL1271_SCAN_STATE_DONE
57 struct basic_scan_params
{
58 __le32 rx_config_options
;
59 __le32 rx_filter_options
;
60 /* Scan option flags (WL1271_SCAN_OPT_*) */
62 /* Number of scan channels in the list (maximum 30) */
64 /* This field indicates the number of probe requests to send
65 per channel for an active scan */
67 /* Rate bit field for sending the probes */
71 /* in order to align */
73 u8 ssid
[IW_ESSID_MAX_SIZE
];
81 struct basic_scan_channel_params
{
82 /* Duration in TU to wait for frames on a channel for active scan */
90 /* FW internal use only! */
96 struct wl1271_cmd_scan
{
97 struct wl1271_cmd_header header
;
99 struct basic_scan_params params
;
100 struct basic_scan_channel_params channels
[WL1271_SCAN_MAX_CHANNELS
];
103 struct wl1271_cmd_trigger_scan_to
{
104 struct wl1271_cmd_header header
;
109 #endif /* __WL1271_SCAN_H__ */