1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * This file is part of wl1271
5 * Copyright (C) 2009-2010 Nokia Corporation
7 * Contact: Luciano Coelho <luciano.coelho@nokia.com>
15 int wlcore_scan(struct wl1271
*wl
, struct ieee80211_vif
*vif
,
16 const u8
*ssid
, size_t ssid_len
,
17 struct cfg80211_scan_request
*req
);
18 int wl1271_scan_build_probe_req(struct wl1271
*wl
,
19 const u8
*ssid
, size_t ssid_len
,
20 const u8
*ie
, size_t ie_len
, u8 band
);
21 void wl1271_scan_stm(struct wl1271
*wl
, struct wl12xx_vif
*wlvif
);
22 void wl1271_scan_complete_work(struct work_struct
*work
);
23 int wl1271_scan_sched_scan_config(struct wl1271
*wl
,
24 struct wl12xx_vif
*wlvif
,
25 struct cfg80211_sched_scan_request
*req
,
26 struct ieee80211_scan_ies
*ies
);
27 int wl1271_scan_sched_scan_start(struct wl1271
*wl
, struct wl12xx_vif
*wlvif
);
28 void wlcore_scan_sched_scan_results(struct wl1271
*wl
);
30 #define WL1271_SCAN_MAX_CHANNELS 24
31 #define WL1271_SCAN_DEFAULT_TAG 1
32 #define WL1271_SCAN_CURRENT_TX_PWR 0
33 #define WL1271_SCAN_OPT_ACTIVE 0
34 #define WL1271_SCAN_OPT_PASSIVE 1
35 #define WL1271_SCAN_OPT_SPLIT_SCAN 2
36 #define WL1271_SCAN_OPT_PRIORITY_HIGH 4
37 /* scan even if we fail to enter psm */
38 #define WL1271_SCAN_OPT_FORCE 8
39 #define WL1271_SCAN_BAND_2_4_GHZ 0
40 #define WL1271_SCAN_BAND_5_GHZ 1
42 #define WL1271_SCAN_TIMEOUT 30000 /* msec */
45 WL1271_SCAN_STATE_IDLE
,
46 WL1271_SCAN_STATE_2GHZ_ACTIVE
,
47 WL1271_SCAN_STATE_2GHZ_PASSIVE
,
48 WL1271_SCAN_STATE_5GHZ_ACTIVE
,
49 WL1271_SCAN_STATE_5GHZ_PASSIVE
,
50 WL1271_SCAN_STATE_DONE
53 struct wl1271_cmd_trigger_scan_to
{
54 struct wl1271_cmd_header header
;
59 #define MAX_CHANNELS_2GHZ 14
60 #define MAX_CHANNELS_4GHZ 4
63 * This max value here is used only for the struct definition of
64 * wlcore_scan_channels. This struct is used by both 12xx
65 * and 18xx (which have different max 5ghz channels value).
66 * In order to make sure this is large enough, just use the
67 * max possible 5ghz channels.
69 #define MAX_CHANNELS_5GHZ 42
71 #define SCAN_MAX_CYCLE_INTERVALS 16
73 /* The FW intervals can take up to 16 entries.
74 * The 1st entry isn't used (scan is immediate). The last
75 * entry should be used for the long_interval
77 #define SCAN_MAX_SHORT_INTERVALS (SCAN_MAX_CYCLE_INTERVALS - 2)
78 #define SCAN_MAX_BANDS 3
81 SCAN_SSID_FILTER_ANY
= 0,
82 SCAN_SSID_FILTER_SPECIFIC
= 1,
83 SCAN_SSID_FILTER_LIST
= 2,
84 SCAN_SSID_FILTER_DISABLED
= 3
88 SCAN_BSS_TYPE_INDEPENDENT
,
89 SCAN_BSS_TYPE_INFRASTRUCTURE
,
93 #define SCAN_CHANNEL_FLAGS_DFS BIT(0) /* channel is passive until an
94 activity is detected on it */
95 #define SCAN_CHANNEL_FLAGS_DFS_ENABLED BIT(1)
97 struct conn_scan_ch_params
{
100 __le16 passive_duration
;
105 /* bit 0: DFS channel; bit 1: DFS enabled */
111 #define SCHED_SCAN_MAX_SSIDS 16
114 SCAN_SSID_TYPE_PUBLIC
= 0,
115 SCAN_SSID_TYPE_HIDDEN
= 1,
121 u8 ssid
[IEEE80211_MAX_SSID_LEN
];
125 struct wl1271_cmd_sched_scan_ssid_list
{
126 struct wl1271_cmd_header header
;
129 struct wl1271_ssid ssids
[SCHED_SCAN_MAX_SSIDS
];
134 struct wlcore_scan_channels
{
135 u8 passive
[SCAN_MAX_BANDS
]; /* number of passive scan channels */
136 u8 active
[SCAN_MAX_BANDS
]; /* number of active scan channels */
137 u8 dfs
; /* number of dfs channels in 5ghz */
138 u8 passive_active
; /* number of passive before active channels 2.4ghz */
140 struct conn_scan_ch_params channels_2
[MAX_CHANNELS_2GHZ
];
141 struct conn_scan_ch_params channels_5
[MAX_CHANNELS_5GHZ
];
142 struct conn_scan_ch_params channels_4
[MAX_CHANNELS_4GHZ
];
146 SCAN_TYPE_SEARCH
= 0,
147 SCAN_TYPE_PERIODIC
= 1,
148 SCAN_TYPE_TRACKING
= 2,
152 wlcore_set_scan_chan_params(struct wl1271
*wl
,
153 struct wlcore_scan_channels
*cfg
,
154 struct ieee80211_channel
*channels
[],
160 wlcore_scan_sched_scan_ssid_list(struct wl1271
*wl
,
161 struct wl12xx_vif
*wlvif
,
162 struct cfg80211_sched_scan_request
*req
);
164 #endif /* __WL1271_SCAN_H__ */