blob: 0002e815cb439567deb5d25c28dd2bedb1b36216 [file] [log] [blame]
Luciano Coelho34dd2aa2010-07-08 17:50:06 +03001/*
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
24#ifndef __WL1271_SCAN_H__
25#define __WL1271_SCAN_H__
26
27#include "wl1271.h"
28
29int wl1271_scan(struct wl1271 *wl, const u8 *ssid, size_t ssid_len,
30 struct cfg80211_scan_request *req, u8 active_scan,
31 u8 high_prio, u8 band, u8 probe_requests);
32int wl1271_scan_build_probe_req(struct wl1271 *wl,
33 const u8 *ssid, size_t ssid_len,
34 const u8 *ie, size_t ie_len, u8 band);
35int wl1271_scan_complete(struct wl1271 *wl);
36
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_CHAN_MIN_DURATION 30000 /* TU */
44#define WL1271_SCAN_CHAN_MAX_DURATION 60000 /* TU */
45#define WL1271_SCAN_BAND_2_4_GHZ 0
46#define WL1271_SCAN_BAND_5_GHZ 1
47#define WL1271_SCAN_BAND_DUAL 2
48
49struct basic_scan_params {
50 __le32 rx_config_options;
51 __le32 rx_filter_options;
52 /* Scan option flags (WL1271_SCAN_OPT_*) */
53 __le16 scan_options;
54 /* Number of scan channels in the list (maximum 30) */
55 u8 num_channels;
56 /* This field indicates the number of probe requests to send
57 per channel for an active scan */
58 u8 num_probe_requests;
59 /* Rate bit field for sending the probes */
60 __le32 tx_rate;
61 u8 tid_trigger;
62 u8 ssid_len;
63 /* in order to align */
64 u8 padding1[2];
65 u8 ssid[IW_ESSID_MAX_SIZE];
66 /* Band to scan */
67 u8 band;
68 u8 use_ssid_list;
69 u8 scan_tag;
70 u8 padding2;
71} __attribute__ ((packed));
72
73struct basic_scan_channel_params {
74 /* Duration in TU to wait for frames on a channel for active scan */
75 __le32 min_duration;
76 __le32 max_duration;
77 __le32 bssid_lsb;
78 __le16 bssid_msb;
79 u8 early_termination;
80 u8 tx_power_att;
81 u8 channel;
82 /* FW internal use only! */
83 u8 dfs_candidate;
84 u8 activity_detected;
85 u8 pad;
86} __attribute__ ((packed));
87
88struct wl1271_cmd_scan {
89 struct wl1271_cmd_header header;
90
91 struct basic_scan_params params;
92 struct basic_scan_channel_params channels[WL1271_SCAN_MAX_CHANNELS];
93} __attribute__ ((packed));
94
95struct wl1271_cmd_trigger_scan_to {
96 struct wl1271_cmd_header header;
97
98 __le32 timeout;
99} __attribute__ ((packed));
100
101#endif /* __WL1271_SCAN_H__ */