1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * This file is part of wl12xx
5 * Copyright (C) 2012 Texas Instruments. All rights reserved.
8 #ifndef __WL12XX_SCAN_H__
9 #define __WL12XX_SCAN_H__
11 #include "../wlcore/wlcore.h"
12 #include "../wlcore/cmd.h"
13 #include "../wlcore/scan.h"
15 #define WL12XX_MAX_CHANNELS_5GHZ 23
17 struct basic_scan_params {
18 /* Scan option flags (WL1271_SCAN_OPT_*) */
21 /* Number of scan channels in the list (maximum 30) */
23 /* This field indicates the number of probe requests to send
24 per channel for an active scan */
30 /* Rate bit field for sending the probes */
33 u8 ssid[IEEE80211_MAX_SSID_LEN];
41 struct basic_scan_channel_params {
42 /* Duration in TU to wait for frames on a channel for active scan */
50 /* FW internal use only! */
56 struct wl1271_cmd_scan {
57 struct wl1271_cmd_header header;
59 struct basic_scan_params params;
60 struct basic_scan_channel_params channels[WL1271_SCAN_MAX_CHANNELS];
67 struct wl1271_cmd_sched_scan_config {
68 struct wl1271_cmd_header header;
70 __le32 intervals[SCAN_MAX_CYCLE_INTERVALS];
72 s8 rssi_threshold; /* for filtering (in dBm) */
73 s8 snr_threshold; /* for filtering (in dB) */
75 u8 cycles; /* maximum number of scan cycles */
76 u8 report_after; /* report when this number of results are received */
77 u8 terminate; /* stop scanning after reporting */
80 u8 bss_type; /* for filtering */
83 u8 ssid_len; /* For SCAN_SSID_FILTER_SPECIFIC */
84 u8 ssid[IEEE80211_MAX_SSID_LEN];
86 u8 n_probe_reqs; /* Number of probes requests per channel */
88 u8 passive[SCAN_MAX_BANDS];
89 u8 active[SCAN_MAX_BANDS];
93 u8 n_pactive_ch; /* number of pactive (passive until fw detects energy)
94 channels in BG band */
97 struct conn_scan_ch_params channels_2[MAX_CHANNELS_2GHZ];
98 struct conn_scan_ch_params channels_5[WL12XX_MAX_CHANNELS_5GHZ];
99 struct conn_scan_ch_params channels_4[MAX_CHANNELS_4GHZ];
102 struct wl1271_cmd_sched_scan_start {
103 struct wl1271_cmd_header header;
110 struct wl1271_cmd_sched_scan_stop {
111 struct wl1271_cmd_header header;
118 int wl12xx_scan_start(struct wl1271 *wl, struct wl12xx_vif *wlvif,
119 struct cfg80211_scan_request *req);
120 int wl12xx_scan_stop(struct wl1271 *wl, struct wl12xx_vif *wlvif);
121 void wl12xx_scan_completed(struct wl1271 *wl, struct wl12xx_vif *wlvif);
122 int wl12xx_sched_scan_start(struct wl1271 *wl, struct wl12xx_vif *wlvif,
123 struct cfg80211_sched_scan_request *req,
124 struct ieee80211_scan_ies *ies);
125 void wl12xx_scan_sched_scan_stop(struct wl1271 *wl, struct wl12xx_vif *wlvif);