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 #define WL12XX_MAX_CHANNELS_5GHZ 23
31 struct basic_scan_params
{
32 /* Scan option flags (WL1271_SCAN_OPT_*) */
35 /* Number of scan channels in the list (maximum 30) */
37 /* This field indicates the number of probe requests to send
38 per channel for an active scan */
44 /* Rate bit field for sending the probes */
47 u8 ssid
[IEEE80211_MAX_SSID_LEN
];
55 struct basic_scan_channel_params
{
56 /* Duration in TU to wait for frames on a channel for active scan */
64 /* FW internal use only! */
70 struct wl1271_cmd_scan
{
71 struct wl1271_cmd_header header
;
73 struct basic_scan_params params
;
74 struct basic_scan_channel_params channels
[WL1271_SCAN_MAX_CHANNELS
];
81 struct wl1271_cmd_sched_scan_config
{
82 struct wl1271_cmd_header header
;
84 __le32 intervals
[SCAN_MAX_CYCLE_INTERVALS
];
86 s8 rssi_threshold
; /* for filtering (in dBm) */
87 s8 snr_threshold
; /* for filtering (in dB) */
89 u8 cycles
; /* maximum number of scan cycles */
90 u8 report_after
; /* report when this number of results are received */
91 u8 terminate
; /* stop scanning after reporting */
94 u8 bss_type
; /* for filtering */
97 u8 ssid_len
; /* For SCAN_SSID_FILTER_SPECIFIC */
98 u8 ssid
[IEEE80211_MAX_SSID_LEN
];
100 u8 n_probe_reqs
; /* Number of probes requests per channel */
102 u8 passive
[SCAN_MAX_BANDS
];
103 u8 active
[SCAN_MAX_BANDS
];
107 u8 n_pactive_ch
; /* number of pactive (passive until fw detects energy)
108 channels in BG band */
111 struct conn_scan_ch_params channels_2
[MAX_CHANNELS_2GHZ
];
112 struct conn_scan_ch_params channels_5
[WL12XX_MAX_CHANNELS_5GHZ
];
113 struct conn_scan_ch_params channels_4
[MAX_CHANNELS_4GHZ
];
116 struct wl1271_cmd_sched_scan_start
{
117 struct wl1271_cmd_header header
;
124 struct wl1271_cmd_sched_scan_stop
{
125 struct wl1271_cmd_header header
;
132 int wl12xx_scan_start(struct wl1271
*wl
, struct wl12xx_vif
*wlvif
,
133 struct cfg80211_scan_request
*req
);
134 int wl12xx_scan_stop(struct wl1271
*wl
, struct wl12xx_vif
*wlvif
);
135 void wl12xx_scan_completed(struct wl1271
*wl
, struct wl12xx_vif
*wlvif
);
136 int wl12xx_sched_scan_start(struct wl1271
*wl
, struct wl12xx_vif
*wlvif
,
137 struct cfg80211_sched_scan_request
*req
,
138 struct ieee80211_sched_scan_ies
*ies
);
139 void wl12xx_scan_sched_scan_stop(struct wl1271
*wl
, struct wl12xx_vif
*wlvif
);