Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
scan.h
Go to the documentation of this file.
1 /*
2  * This file is part of wl1271
3  *
4  * Copyright (C) 2009-2010 Nokia Corporation
5  *
6  * Contact: Luciano Coelho <[email protected]>
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 __SCAN_H__
25 #define __SCAN_H__
26 
27 #include "wlcore.h"
28 
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);
39  struct wl12xx_vif *wlvif,
41  struct ieee80211_sched_scan_ies *ies);
42 int wl1271_scan_sched_scan_start(struct wl1271 *wl, struct wl12xx_vif *wlvif);
43 void wl1271_scan_sched_scan_stop(struct wl1271 *wl, struct wl12xx_vif *wlvif);
44 void wl1271_scan_sched_scan_results(struct wl1271 *wl);
45 
46 #define WL1271_SCAN_MAX_CHANNELS 24
47 #define WL1271_SCAN_DEFAULT_TAG 1
48 #define WL1271_SCAN_CURRENT_TX_PWR 0
49 #define WL1271_SCAN_OPT_ACTIVE 0
50 #define WL1271_SCAN_OPT_PASSIVE 1
51 #define WL1271_SCAN_OPT_SPLIT_SCAN 2
52 #define WL1271_SCAN_OPT_PRIORITY_HIGH 4
53 /* scan even if we fail to enter psm */
54 #define WL1271_SCAN_OPT_FORCE 8
55 #define WL1271_SCAN_BAND_2_4_GHZ 0
56 #define WL1271_SCAN_BAND_5_GHZ 1
57 
58 #define WL1271_SCAN_TIMEOUT 30000 /* msec */
59 
60 enum {
67 };
68 
70  /* Scan option flags (WL1271_SCAN_OPT_*) */
73  /* Number of scan channels in the list (maximum 30) */
75  /* This field indicates the number of probe requests to send
76  per channel for an active scan */
81 
82  /* Rate bit field for sending the probes */
84 
86  /* Band to scan */
88 
91 } __packed;
92 
94  /* Duration in TU to wait for frames on a channel for active scan */
102  /* FW internal use only! */
106 } __packed;
107 
110 
113 
114  /* src mac address */
117 } __packed;
118 
121 
123 } __packed;
124 
125 #define MAX_CHANNELS_2GHZ 14
126 #define MAX_CHANNELS_5GHZ 23
127 #define MAX_CHANNELS_4GHZ 4
128 
129 #define SCAN_MAX_CYCLE_INTERVALS 16
130 #define SCAN_MAX_BANDS 3
131 
132 enum {
137 };
138 
139 enum {
143 };
144 
145 #define SCAN_CHANNEL_FLAGS_DFS BIT(0) /* channel is passive until an
146  activity is detected on it */
147 #define SCAN_CHANNEL_FLAGS_DFS_ENABLED BIT(1)
156 
157  /* bit 0: DFS channel; bit 1: DFS enabled */
158  u8 flags;
160  u8 padding[3];
161 } __packed;
164  struct wl1271_cmd_header header;
168  s8 rssi_threshold; /* for filtering (in dBm) */
169  s8 snr_threshold; /* for filtering (in dB) */
171  u8 cycles; /* maximum number of scan cycles */
172  u8 report_after; /* report when this number of results are received */
173  u8 terminate; /* stop scanning after reporting */
176  u8 bss_type; /* for filtering */
177  u8 filter_type;
179  u8 ssid_len; /* For SCAN_SSID_FILTER_SPECIFIC */
182  u8 n_probe_reqs; /* Number of probes requests per channel */
187  u8 dfs;
189  u8 n_pactive_ch; /* number of pactive (passive until fw detects energy)
190  channels in BG band */
192  u8 padding[1];
197 } __packed;
198 
200 #define SCHED_SCAN_MAX_SSIDS 16
201 
202 enum {
205 };
207 struct wl1271_ssid {
211  /* u8 padding[2]; */
212 } __packed;
215  struct wl1271_cmd_header header;
220  u8 padding[2];
221 } __packed;
224  struct wl1271_cmd_header header;
228  u8 padding[2];
229 } __packed;
232  struct wl1271_cmd_header header;
236  u8 padding[2];
237 } __packed;
238 
239 
240 #endif /* __WL1271_SCAN_H__ */