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
29 int wl1271_scan(struct wl1271
*wl
, struct ieee80211_vif
*vif
,
30 const u8
*ssid
, size_t ssid_len
,
31 struct cfg80211_scan_request
*req
);
32 int wl1271_scan_stop(struct wl1271
*wl
);
33 int wl1271_scan_build_probe_req(struct wl1271
*wl
,
34 const u8
*ssid
, size_t ssid_len
,
35 const u8
*ie
, size_t ie_len
, u8 band
);
36 void wl1271_scan_stm(struct wl1271
*wl
, struct ieee80211_vif
*vif
);
37 void wl1271_scan_complete_work(struct work_struct
*work
);
38 int wl1271_scan_sched_scan_config(struct wl1271
*wl
,
39 struct cfg80211_sched_scan_request
*req
,
40 struct ieee80211_sched_scan_ies
*ies
);
41 int wl1271_scan_sched_scan_start(struct wl1271
*wl
);
42 void wl1271_scan_sched_scan_stop(struct wl1271
*wl
);
43 void wl1271_scan_sched_scan_results(struct wl1271
*wl
);
45 #define WL1271_SCAN_MAX_CHANNELS 24
46 #define WL1271_SCAN_DEFAULT_TAG 1
47 #define WL1271_SCAN_CURRENT_TX_PWR 0
48 #define WL1271_SCAN_OPT_ACTIVE 0
49 #define WL1271_SCAN_OPT_PASSIVE 1
50 #define WL1271_SCAN_OPT_TRIGGERED_SCAN 2
51 #define WL1271_SCAN_OPT_PRIORITY_HIGH 4
52 /* scan even if we fail to enter psm */
53 #define WL1271_SCAN_OPT_FORCE 8
54 #define WL1271_SCAN_BAND_2_4_GHZ 0
55 #define WL1271_SCAN_BAND_5_GHZ 1
57 #define WL1271_SCAN_TIMEOUT 10000 /* msec */
60 WL1271_SCAN_STATE_IDLE
,
61 WL1271_SCAN_STATE_2GHZ_ACTIVE
,
62 WL1271_SCAN_STATE_2GHZ_PASSIVE
,
63 WL1271_SCAN_STATE_5GHZ_ACTIVE
,
64 WL1271_SCAN_STATE_5GHZ_PASSIVE
,
65 WL1271_SCAN_STATE_DONE
68 struct basic_scan_params
{
69 /* Scan option flags (WL1271_SCAN_OPT_*) */
72 /* Number of scan channels in the list (maximum 30) */
74 /* This field indicates the number of probe requests to send
75 per channel for an active scan */
81 /* Rate bit field for sending the probes */
84 u8 ssid
[IEEE80211_MAX_SSID_LEN
];
92 struct basic_scan_channel_params
{
93 /* Duration in TU to wait for frames on a channel for active scan */
101 /* FW internal use only! */
103 u8 activity_detected
;
107 struct wl1271_cmd_scan
{
108 struct wl1271_cmd_header header
;
110 struct basic_scan_params params
;
111 struct basic_scan_channel_params channels
[WL1271_SCAN_MAX_CHANNELS
];
113 /* src mac address */
118 struct wl1271_cmd_trigger_scan_to
{
119 struct wl1271_cmd_header header
;
124 #define MAX_CHANNELS_2GHZ 14
125 #define MAX_CHANNELS_5GHZ 23
126 #define MAX_CHANNELS_4GHZ 4
128 #define SCAN_MAX_CYCLE_INTERVALS 16
129 #define SCAN_MAX_BANDS 3
132 SCAN_SSID_FILTER_ANY
= 0,
133 SCAN_SSID_FILTER_SPECIFIC
= 1,
134 SCAN_SSID_FILTER_LIST
= 2,
135 SCAN_SSID_FILTER_DISABLED
= 3
139 SCAN_BSS_TYPE_INDEPENDENT
,
140 SCAN_BSS_TYPE_INFRASTRUCTURE
,
144 #define SCAN_CHANNEL_FLAGS_DFS BIT(0)
145 #define SCAN_CHANNEL_FLAGS_DFS_ENABLED BIT(1)
147 struct conn_scan_ch_params
{
150 __le16 passive_duration
;
155 /* bit 0: DFS channel; bit 1: DFS enabled */
161 struct wl1271_cmd_sched_scan_config
{
162 struct wl1271_cmd_header header
;
164 __le32 intervals
[SCAN_MAX_CYCLE_INTERVALS
];
166 s8 rssi_threshold
; /* for filtering (in dBm) */
167 s8 snr_threshold
; /* for filtering (in dB) */
169 u8 cycles
; /* maximum number of scan cycles */
170 u8 report_after
; /* report when this number of results are received */
171 u8 terminate
; /* stop scanning after reporting */
174 u8 bss_type
; /* for filtering */
177 u8 ssid_len
; /* For SCAN_SSID_FILTER_SPECIFIC */
178 u8 ssid
[IEEE80211_MAX_SSID_LEN
];
180 u8 n_probe_reqs
; /* Number of probes requests per channel */
182 u8 passive
[SCAN_MAX_BANDS
];
183 u8 active
[SCAN_MAX_BANDS
];
189 struct conn_scan_ch_params channels_2
[MAX_CHANNELS_2GHZ
];
190 struct conn_scan_ch_params channels_5
[MAX_CHANNELS_5GHZ
];
191 struct conn_scan_ch_params channels_4
[MAX_CHANNELS_4GHZ
];
195 #define SCHED_SCAN_MAX_SSIDS 16
198 SCAN_SSID_TYPE_PUBLIC
= 0,
199 SCAN_SSID_TYPE_HIDDEN
= 1,
205 u8 ssid
[IEEE80211_MAX_SSID_LEN
];
209 struct wl1271_cmd_sched_scan_ssid_list
{
210 struct wl1271_cmd_header header
;
213 struct wl1271_ssid ssids
[SCHED_SCAN_MAX_SSIDS
];
217 struct wl1271_cmd_sched_scan_start
{
218 struct wl1271_cmd_header header
;
224 struct wl1271_cmd_sched_scan_stop
{
225 struct wl1271_cmd_header header
;
232 #endif /* __WL1271_SCAN_H__ */