Lines Matching +full:out +full:- +full:of +full:- +full:band

1 // SPDX-License-Identifier: GPL-2.0-only
3 * This file is part of wl12xx
16 enum nl80211_band band, bool passive) in wl1271_get_scan_channels() argument
18 struct conf_scan_settings *c = &wl->conf.scan; in wl1271_get_scan_channels()
23 i < req->n_channels && j < WL1271_SCAN_MAX_CHANNELS; in wl1271_get_scan_channels()
25 flags = req->channels[i]->flags; in wl1271_get_scan_channels()
27 if (!test_bit(i, wl->scan.scanned_ch) && in wl1271_get_scan_channels()
29 (req->channels[i]->band == band) && in wl1271_get_scan_channels()
37 wl1271_debug(DEBUG_SCAN, "band %d, center_freq %d ", in wl1271_get_scan_channels()
38 req->channels[i]->band, in wl1271_get_scan_channels()
39 req->channels[i]->center_freq); in wl1271_get_scan_channels()
41 req->channels[i]->hw_value, in wl1271_get_scan_channels()
42 req->channels[i]->flags); in wl1271_get_scan_channels()
45 req->channels[i]->max_antenna_gain, in wl1271_get_scan_channels()
46 req->channels[i]->max_power); in wl1271_get_scan_channels()
48 req->channels[i]->beacon_found); in wl1271_get_scan_channels()
52 cpu_to_le32(c->min_dwell_time_active); in wl1271_get_scan_channels()
54 cpu_to_le32(c->max_dwell_time_active); in wl1271_get_scan_channels()
57 cpu_to_le32(c->dwell_time_passive); in wl1271_get_scan_channels()
59 cpu_to_le32(c->dwell_time_passive); in wl1271_get_scan_channels()
62 channels[j].tx_power_att = req->channels[i]->max_power; in wl1271_get_scan_channels()
63 channels[j].channel = req->channels[i]->hw_value; in wl1271_get_scan_channels()
69 set_bit(i, wl->scan.scanned_ch); in wl1271_get_scan_channels()
81 enum nl80211_band band, in wl1271_scan_send() argument
91 if (!passive && wl->scan.req->n_ssids == 0) in wl1271_scan_send()
97 ret = -ENOMEM; in wl1271_scan_send()
98 goto out; in wl1271_scan_send()
101 if (wl->conf.scan.split_scan_timeout) in wl1271_scan_send()
109 cmd->params.role_id = wlvif->dev_role_id; in wl1271_scan_send()
111 cmd->params.role_id = wlvif->role_id; in wl1271_scan_send()
113 if (WARN_ON(cmd->params.role_id == WL12XX_INVALID_ROLE_ID)) { in wl1271_scan_send()
114 ret = -EINVAL; in wl1271_scan_send()
115 goto out; in wl1271_scan_send()
118 cmd->params.scan_options = cpu_to_le16(scan_options); in wl1271_scan_send()
120 cmd->params.n_ch = wl1271_get_scan_channels(wl, wl->scan.req, in wl1271_scan_send()
121 cmd->channels, in wl1271_scan_send()
122 band, passive); in wl1271_scan_send()
123 if (cmd->params.n_ch == 0) { in wl1271_scan_send()
125 goto out; in wl1271_scan_send()
128 cmd->params.tx_rate = cpu_to_le32(basic_rate); in wl1271_scan_send()
129 cmd->params.n_probe_reqs = wl->conf.scan.num_probe_reqs; in wl1271_scan_send()
130 cmd->params.tid_trigger = CONF_TX_AC_ANY_TID; in wl1271_scan_send()
131 cmd->params.scan_tag = WL1271_SCAN_DEFAULT_TAG; in wl1271_scan_send()
133 if (band == NL80211_BAND_2GHZ) in wl1271_scan_send()
134 cmd->params.band = WL1271_SCAN_BAND_2_4_GHZ; in wl1271_scan_send()
136 cmd->params.band = WL1271_SCAN_BAND_5_GHZ; in wl1271_scan_send()
138 if (wl->scan.ssid_len) { in wl1271_scan_send()
139 cmd->params.ssid_len = wl->scan.ssid_len; in wl1271_scan_send()
140 memcpy(cmd->params.ssid, wl->scan.ssid, wl->scan.ssid_len); in wl1271_scan_send()
143 memcpy(cmd->addr, vif->addr, ETH_ALEN); in wl1271_scan_send()
146 cmd->params.role_id, band, in wl1271_scan_send()
147 wl->scan.ssid, wl->scan.ssid_len, in wl1271_scan_send()
148 wl->scan.req->ie, in wl1271_scan_send()
149 wl->scan.req->ie_len, NULL, 0, false); in wl1271_scan_send()
152 goto out; in wl1271_scan_send()
155 trigger->timeout = cpu_to_le32(wl->conf.scan.split_scan_timeout); in wl1271_scan_send()
160 goto out; in wl1271_scan_send()
168 goto out; in wl1271_scan_send()
171 out: in wl1271_scan_send()
182 if (WARN_ON(wl->scan.state == WL1271_SCAN_STATE_IDLE)) in wl12xx_scan_stop()
183 return -EINVAL; in wl12xx_scan_stop()
189 ret = -ENOMEM; in wl12xx_scan_stop()
190 goto out; in wl12xx_scan_stop()
197 goto out; in wl12xx_scan_stop()
199 out: in wl12xx_scan_stop()
207 enum nl80211_band band; in wl1271_scan_stm() local
210 switch (wl->scan.state) { in wl1271_scan_stm()
215 band = NL80211_BAND_2GHZ; in wl1271_scan_stm()
216 mask = wlvif->bitrate_masks[band]; in wl1271_scan_stm()
217 if (wl->scan.req->no_cck) { in wl1271_scan_stm()
223 ret = wl1271_scan_send(wl, wlvif, band, false, rate); in wl1271_scan_stm()
225 wl->scan.state = WL1271_SCAN_STATE_2GHZ_PASSIVE; in wl1271_scan_stm()
232 band = NL80211_BAND_2GHZ; in wl1271_scan_stm()
233 mask = wlvif->bitrate_masks[band]; in wl1271_scan_stm()
234 if (wl->scan.req->no_cck) { in wl1271_scan_stm()
240 ret = wl1271_scan_send(wl, wlvif, band, true, rate); in wl1271_scan_stm()
242 if (wl->enable_11a) in wl1271_scan_stm()
243 wl->scan.state = WL1271_SCAN_STATE_5GHZ_ACTIVE; in wl1271_scan_stm()
245 wl->scan.state = WL1271_SCAN_STATE_DONE; in wl1271_scan_stm()
252 band = NL80211_BAND_5GHZ; in wl1271_scan_stm()
253 rate = wl1271_tx_min_rate_get(wl, wlvif->bitrate_masks[band]); in wl1271_scan_stm()
254 ret = wl1271_scan_send(wl, wlvif, band, false, rate); in wl1271_scan_stm()
256 wl->scan.state = WL1271_SCAN_STATE_5GHZ_PASSIVE; in wl1271_scan_stm()
263 band = NL80211_BAND_5GHZ; in wl1271_scan_stm()
264 rate = wl1271_tx_min_rate_get(wl, wlvif->bitrate_masks[band]); in wl1271_scan_stm()
265 ret = wl1271_scan_send(wl, wlvif, band, true, rate); in wl1271_scan_stm()
267 wl->scan.state = WL1271_SCAN_STATE_DONE; in wl1271_scan_stm()
274 wl->scan.failed = false; in wl1271_scan_stm()
275 cancel_delayed_work(&wl->scan_complete_work); in wl1271_scan_stm()
276 ieee80211_queue_delayed_work(wl->hw, &wl->scan_complete_work, in wl1271_scan_stm()
286 cancel_delayed_work(&wl->scan_complete_work); in wl1271_scan_stm()
287 ieee80211_queue_delayed_work(wl->hw, &wl->scan_complete_work, in wl1271_scan_stm()
295 memcpy(cmd->passive, cmd_channels->passive, sizeof(cmd->passive)); in wl12xx_adjust_channels()
296 memcpy(cmd->active, cmd_channels->active, sizeof(cmd->active)); in wl12xx_adjust_channels()
297 cmd->dfs = cmd_channels->dfs; in wl12xx_adjust_channels()
298 cmd->n_pactive_ch = cmd_channels->passive_active; in wl12xx_adjust_channels()
300 memcpy(cmd->channels_2, cmd_channels->channels_2, in wl12xx_adjust_channels()
301 sizeof(cmd->channels_2)); in wl12xx_adjust_channels()
302 memcpy(cmd->channels_5, cmd_channels->channels_5, in wl12xx_adjust_channels()
303 sizeof(cmd->channels_5)); in wl12xx_adjust_channels()
314 struct conf_sched_scan_settings *c = &wl->conf.sched_scan; in wl1271_scan_sched_scan_config()
316 bool force_passive = !req->n_ssids; in wl1271_scan_sched_scan_config()
322 return -ENOMEM; in wl1271_scan_sched_scan_config()
324 cfg->role_id = wlvif->role_id; in wl1271_scan_sched_scan_config()
325 cfg->rssi_threshold = c->rssi_threshold; in wl1271_scan_sched_scan_config()
326 cfg->snr_threshold = c->snr_threshold; in wl1271_scan_sched_scan_config()
327 cfg->n_probe_reqs = c->num_probe_reqs; in wl1271_scan_sched_scan_config()
329 cfg->cycles = 0; in wl1271_scan_sched_scan_config()
331 cfg->report_after = 1; in wl1271_scan_sched_scan_config()
333 cfg->terminate = 0; in wl1271_scan_sched_scan_config()
334 cfg->tag = WL1271_SCAN_DEFAULT_TAG; in wl1271_scan_sched_scan_config()
336 cfg->bss_type = SCAN_BSS_TYPE_ANY; in wl1271_scan_sched_scan_config()
339 cfg->intervals[i] = cpu_to_le32(req->scan_plans[0].interval * in wl1271_scan_sched_scan_config()
342 cfg->ssid_len = 0; in wl1271_scan_sched_scan_config()
345 goto out; in wl1271_scan_sched_scan_config()
347 cfg->filter_type = ret; in wl1271_scan_sched_scan_config()
349 wl1271_debug(DEBUG_SCAN, "filter_type = %d", cfg->filter_type); in wl1271_scan_sched_scan_config()
353 ret = -ENOMEM; in wl1271_scan_sched_scan_config()
354 goto out; in wl1271_scan_sched_scan_config()
357 if (!wlcore_set_scan_chan_params(wl, cfg_channels, req->channels, in wl1271_scan_sched_scan_config()
358 req->n_channels, req->n_ssids, in wl1271_scan_sched_scan_config()
361 ret = -EINVAL; in wl1271_scan_sched_scan_config()
362 goto out; in wl1271_scan_sched_scan_config()
366 if (!force_passive && cfg->active[0]) { in wl1271_scan_sched_scan_config()
367 u8 band = NL80211_BAND_2GHZ; in wl1271_scan_sched_scan_config() local
369 wlvif->role_id, band, in wl1271_scan_sched_scan_config()
370 req->ssids[0].ssid, in wl1271_scan_sched_scan_config()
371 req->ssids[0].ssid_len, in wl1271_scan_sched_scan_config()
372 ies->ies[band], in wl1271_scan_sched_scan_config()
373 ies->len[band], in wl1271_scan_sched_scan_config()
374 ies->common_ies, in wl1271_scan_sched_scan_config()
375 ies->common_ie_len, in wl1271_scan_sched_scan_config()
379 goto out; in wl1271_scan_sched_scan_config()
383 if (!force_passive && cfg->active[1]) { in wl1271_scan_sched_scan_config()
384 u8 band = NL80211_BAND_5GHZ; in wl1271_scan_sched_scan_config() local
386 wlvif->role_id, band, in wl1271_scan_sched_scan_config()
387 req->ssids[0].ssid, in wl1271_scan_sched_scan_config()
388 req->ssids[0].ssid_len, in wl1271_scan_sched_scan_config()
389 ies->ies[band], in wl1271_scan_sched_scan_config()
390 ies->len[band], in wl1271_scan_sched_scan_config()
391 ies->common_ies, in wl1271_scan_sched_scan_config()
392 ies->common_ie_len, in wl1271_scan_sched_scan_config()
396 goto out; in wl1271_scan_sched_scan_config()
406 goto out; in wl1271_scan_sched_scan_config()
408 out: in wl1271_scan_sched_scan_config()
421 if (wlvif->bss_type != BSS_TYPE_STA_BSS) in wl1271_scan_sched_scan_start()
422 return -EOPNOTSUPP; in wl1271_scan_sched_scan_start()
424 if ((wl->quirks & WLCORE_QUIRK_NO_SCHED_SCAN_WHILE_CONN) && in wl1271_scan_sched_scan_start()
425 test_bit(WLVIF_FLAG_IN_USE, &wlvif->flags)) in wl1271_scan_sched_scan_start()
426 return -EBUSY; in wl1271_scan_sched_scan_start()
430 return -ENOMEM; in wl1271_scan_sched_scan_start()
432 start->role_id = wlvif->role_id; in wl1271_scan_sched_scan_start()
433 start->tag = WL1271_SCAN_DEFAULT_TAG; in wl1271_scan_sched_scan_start()
474 stop->role_id = wlvif->role_id; in wl12xx_scan_sched_scan_stop()
475 stop->tag = WL1271_SCAN_DEFAULT_TAG; in wl12xx_scan_sched_scan_stop()