diff options
author | Patrick Wildt <patrick@cvs.openbsd.org> | 2024-12-23 00:12:45 +0000 |
---|---|---|
committer | Patrick Wildt <patrick@cvs.openbsd.org> | 2024-12-23 00:12:45 +0000 |
commit | 5d3512291b152d7572806ec032df28ecde6ac61e (patch) | |
tree | 848ff638ed7c29d3f3cb612fe7eca61f836b6fa1 | |
parent | faaeb3f19cc06dfdbba9afaac45224a91c6d1ce4 (diff) |
Update scan arguments.
-rw-r--r-- | sys/dev/ic/qwz.c | 56 | ||||
-rw-r--r-- | sys/dev/ic/qwzreg.h | 13 |
2 files changed, 18 insertions, 51 deletions
diff --git a/sys/dev/ic/qwz.c b/sys/dev/ic/qwz.c index dc19627c8bc..deffee1c721 100644 --- a/sys/dev/ic/qwz.c +++ b/sys/dev/ic/qwz.c @@ -1,4 +1,4 @@ -/* $OpenBSD: qwz.c,v 1.17 2024/12/22 23:30:27 patrick Exp $ */ +/* $OpenBSD: qwz.c,v 1.18 2024/12/23 00:12:44 patrick Exp $ */ /* * Copyright 2023 Stefan Sperling <stsp@openbsd.org> @@ -16170,11 +16170,8 @@ qwz_wmi_copy_scan_event_cntrl_flags(struct wmi_start_scan_cmd *cmd, cmd->scan_ctrl_flags |= WMI_SCAN_ENABLE_IE_WHTELIST_IN_PROBE_REQ; - /* for adaptive scan mode using 3 bits (21 - 23 bits) */ - WMI_SCAN_SET_DWELL_MODE(cmd->scan_ctrl_flags, + cmd->scan_ctrl_flags |= FIELD_PREP(WMI_SCAN_DWELL_MODE_MASK, param->adaptive_dwell_time_mode); - - cmd->scan_ctrl_flags_ext = param->scan_ctrl_flags_ext; } int @@ -16208,13 +16205,6 @@ qwz_wmi_send_scan_start_cmd(struct qwz_softc *sc, if (params->num_bssid) len += sizeof(*bssid) * params->num_bssid; - len += TLV_HDR_SIZE; - if (params->extraie.len && params->extraie.len <= 0xFFFF) { - extraie_len_with_pad = roundup(params->extraie.len, - sizeof(uint32_t)); - } - len += extraie_len_with_pad; - if (params->num_hint_bssid) { len += TLV_HDR_SIZE + params->num_hint_bssid * sizeof(struct hint_bssid); @@ -16225,6 +16215,19 @@ qwz_wmi_send_scan_start_cmd(struct qwz_softc *sc, params->num_hint_s_ssid * sizeof(struct hint_short_ssid); } + len += TLV_HDR_SIZE; + if (params->extraie.len) + extraie_len_with_pad = roundup(params->extraie.len, + sizeof(uint32_t)); + if (extraie_len_with_pad <= + (wmi->wmi->max_msg_len[params->pdev_id] - len)) { + len += extraie_len_with_pad; + } else { + printf("%s: discard large size %d bytes extraie for scan start\n", + __func__, params->extraie.len); + extraie_len_with_pad = 0; + } + m = qwz_wmi_alloc_mbuf(len); if (!m) return ENOMEM; @@ -16262,8 +16265,6 @@ qwz_wmi_send_scan_start_cmd(struct qwz_softc *sc, cmd->num_ssids = params->num_ssids; cmd->ie_len = params->extraie.len; cmd->n_probes = params->n_probes; - IEEE80211_ADDR_COPY(cmd->mac_addr.addr, params->mac_addr.addr); - IEEE80211_ADDR_COPY(cmd->mac_mask.addr, params->mac_mask.addr); ptr += sizeof(*cmd); @@ -22629,11 +22630,6 @@ qwz_wmi_start_scan_init(struct qwz_softc *sc, struct scan_req_params *arg) WMI_SCAN_EVENT_FOREIGN_CHAN | WMI_SCAN_EVENT_DEQUEUED; arg->scan_flags |= WMI_SCAN_CHAN_STAT_EVENT; - if (isset(sc->wmi.svc_map, - WMI_TLV_SERVICE_PASSIVE_SCAN_START_TIME_ENHANCE)) - arg->scan_ctrl_flags_ext |= - WMI_SCAN_FLAG_EXT_PASSIVE_SCAN_START_TIME_ENHANCE; - arg->num_bssid = 1; /* fill bssid_list[0] with 0xff, otherwise bssid and RA will be @@ -22948,27 +22944,7 @@ qwz_scan(struct qwz_softc *sc) for (chan = &ic->ic_channels[1]; chan <= lastc; chan++) { if (chan->ic_flags == 0) continue; - if (isset(sc->wmi.svc_map, - WMI_TLV_SERVICE_SCAN_CONFIG_PER_CHANNEL)) { - arg->chan_list[i++] = chan->ic_freq & - WMI_SCAN_CONFIG_PER_CHANNEL_MASK; -#if 0 - /* If NL80211_SCAN_FLAG_COLOCATED_6GHZ is set in scan - * flags, then scan all PSC channels in 6 GHz band and - * those non-PSC channels where RNR IE is found during - * the legacy 2.4/5 GHz scan. - * If NL80211_SCAN_FLAG_COLOCATED_6GHZ is not set, - * then all channels in 6 GHz will be scanned. - */ - if (req->channels[i]->band == NL80211_BAND_6GHZ && - req->flags & NL80211_SCAN_FLAG_COLOCATED_6GHZ && - !cfg80211_channel_is_psc(req->channels[i])) - arg->chan_list[i] |= - WMI_SCAN_CH_FLAG_SCAN_ONLY_IF_RNR_FOUND; -#endif - } else { - arg->chan_list[i++] = chan->ic_freq; - } + arg->chan_list[i++] = chan->ic_freq; } } #if 0 diff --git a/sys/dev/ic/qwzreg.h b/sys/dev/ic/qwzreg.h index 586b89e7de5..1bf134f19cd 100644 --- a/sys/dev/ic/qwzreg.h +++ b/sys/dev/ic/qwzreg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: qwzreg.h,v 1.10 2024/12/22 23:30:27 patrick Exp $ */ +/* $OpenBSD: qwzreg.h,v 1.11 2024/12/23 00:12:44 patrick Exp $ */ /* * Copyright (c) 2021-2022, Qualcomm Innovation Center, Inc. @@ -3415,12 +3415,7 @@ struct wmi_start_scan_cmd { #define WMI_SCAN_RANDOM_SEQ_NO_IN_PROBE_REQ 0x80000 #define WMI_SCAN_ENABLE_IE_WHTELIST_IN_PROBE_REQ 0x100000 -#define WMI_SCAN_DWELL_MODE_MASK 0x00E00000 -#define WMI_SCAN_DWELL_MODE_SHIFT 21 -#define WMI_SCAN_FLAG_EXT_PASSIVE_SCAN_START_TIME_ENHANCE 0x00000800 - -#define WMI_SCAN_CONFIG_PER_CHANNEL_MASK GENMASK(19, 0) -#define WMI_SCAN_CH_FLAG_SCAN_ONLY_IF_RNR_FOUND BIT(20) +#define WMI_SCAN_DWELL_MODE_MASK GENMASK(23, 21) enum { WMI_SCAN_DWELL_MODE_DEFAULT = 0, @@ -3430,10 +3425,6 @@ enum { WMI_SCAN_DWELL_MODE_STATIC = 4, }; -#define WMI_SCAN_SET_DWELL_MODE(flag, mode) \ - ((flag) |= (((mode) << WMI_SCAN_DWELL_MODE_SHIFT) & \ - WMI_SCAN_DWELL_MODE_MASK)) - struct hint_short_ssid { uint32_t freq_flags; uint32_t short_ssid; |