2 * This file is part of wl12xx
4 * Copyright (C) 2012 Texas Instruments. All rights reserved.
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * version 2 as published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
22 #ifndef __WL12XX_SCAN_H__
23 #define __WL12XX_SCAN_H__
25 #include "../wlcore/wlcore.h"
26 #include "../wlcore/cmd.h"
27 #include "../wlcore/scan.h"
29 struct basic_scan_params {
30 /* Scan option flags (WL1271_SCAN_OPT_*) */
33 /* Number of scan channels in the list (maximum 30) */
35 /* This field indicates the number of probe requests to send
36 per channel for an active scan */
42 /* Rate bit field for sending the probes */
45 u8 ssid[IEEE80211_MAX_SSID_LEN];
53 struct basic_scan_channel_params {
54 /* Duration in TU to wait for frames on a channel for active scan */
62 /* FW internal use only! */
68 struct wl1271_cmd_scan {
69 struct wl1271_cmd_header header;
71 struct basic_scan_params params;
72 struct basic_scan_channel_params channels[WL1271_SCAN_MAX_CHANNELS];
79 struct wl1271_cmd_sched_scan_config {
80 struct wl1271_cmd_header header;
82 __le32 intervals[SCAN_MAX_CYCLE_INTERVALS];
84 s8 rssi_threshold; /* for filtering (in dBm) */
85 s8 snr_threshold; /* for filtering (in dB) */
87 u8 cycles; /* maximum number of scan cycles */
88 u8 report_after; /* report when this number of results are received */
89 u8 terminate; /* stop scanning after reporting */
92 u8 bss_type; /* for filtering */
95 u8 ssid_len; /* For SCAN_SSID_FILTER_SPECIFIC */
96 u8 ssid[IEEE80211_MAX_SSID_LEN];
98 u8 n_probe_reqs; /* Number of probes requests per channel */
100 u8 passive[SCAN_MAX_BANDS];
101 u8 active[SCAN_MAX_BANDS];
105 u8 n_pactive_ch; /* number of pactive (passive until fw detects energy)
106 channels in BG band */
109 struct conn_scan_ch_params channels_2[MAX_CHANNELS_2GHZ];
110 struct conn_scan_ch_params channels_5[MAX_CHANNELS_5GHZ];
111 struct conn_scan_ch_params channels_4[MAX_CHANNELS_4GHZ];
114 struct wl1271_cmd_sched_scan_start {
115 struct wl1271_cmd_header header;
122 struct wl1271_cmd_sched_scan_stop {
123 struct wl1271_cmd_header header;
130 int wl12xx_scan_start(struct wl1271 *wl, struct wl12xx_vif *wlvif,
131 struct cfg80211_scan_request *req);
132 int wl12xx_scan_stop(struct wl1271 *wl, struct wl12xx_vif *wlvif);
133 void wl12xx_scan_completed(struct wl1271 *wl, struct wl12xx_vif *wlvif);
134 int wl12xx_sched_scan_start(struct wl1271 *wl, struct wl12xx_vif *wlvif,
135 struct cfg80211_sched_scan_request *req,
136 struct ieee80211_sched_scan_ies *ies);
137 void wl12xx_scan_sched_scan_stop(struct wl1271 *wl, struct wl12xx_vif *wlvif);