From 1d29b516aa06a40730f6603c5162289d47ead913 Mon Sep 17 00:00:00 2001 From: patrick Date: Mon, 18 Dec 2017 16:33:37 +0000 Subject: [PATCH] Pass scan type directly to the scan command instead of using the global variable. --- sys/dev/ic/bwfm.c | 9 ++------- sys/dev/ic/bwfmreg.h | 5 ++++- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/sys/dev/ic/bwfm.c b/sys/dev/ic/bwfm.c index 37278f481f3..7c988c611a0 100644 --- a/sys/dev/ic/bwfm.c +++ b/sys/dev/ic/bwfm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bwfm.c,v 1.19 2017/12/18 00:08:28 patrick Exp $ */ +/* $OpenBSD: bwfm.c,v 1.20 2017/12/18 16:33:37 patrick Exp $ */ /* * Copyright (c) 2010-2016 Broadcom Corporation * Copyright (c) 2016,2017 Patrick Wildt @@ -1311,12 +1311,6 @@ bwfm_scan(struct bwfm_softc *sc) uint32_t nssid = 0, nchannel = 0; size_t params_size; -#if 0 - /* Active scan is used for scanning for an SSID */ - bwfm_fwvar_cmd_set_int(sc, BWFM_C_SET_PASSIVE_SCAN, 0); -#endif - bwfm_fwvar_cmd_set_int(sc, BWFM_C_SET_PASSIVE_SCAN, 1); - params_size = sizeof(*params); params_size += sizeof(uint32_t) * ((nchannel + 1) / 2); params_size += sizeof(struct bwfm_ssid) * nssid; @@ -1325,6 +1319,7 @@ bwfm_scan(struct bwfm_softc *sc) memset(params->scan_params.bssid, 0xff, sizeof(params->scan_params.bssid)); params->scan_params.bss_type = 2; + params->scan_params.scan_type = BWFM_SCANTYPE_PASSIVE; params->scan_params.nprobes = htole32(-1); params->scan_params.active_time = htole32(-1); params->scan_params.passive_time = htole32(-1); diff --git a/sys/dev/ic/bwfmreg.h b/sys/dev/ic/bwfmreg.h index 79b74097628..d84e736a8d8 100644 --- a/sys/dev/ic/bwfmreg.h +++ b/sys/dev/ic/bwfmreg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bwfmreg.h,v 1.10 2017/12/16 23:45:16 patrick Exp $ */ +/* $OpenBSD: bwfmreg.h,v 1.11 2017/12/18 16:33:37 patrick Exp $ */ /* * Copyright (c) 2010-2016 Broadcom Corporation * Copyright (c) 2016,2017 Patrick Wildt @@ -329,6 +329,9 @@ struct bwfm_scan_params { uint8_t bss_type; #define DOT11_BSSTYPE_ANY 2 uint8_t scan_type; +#define BWFM_SCANTYPE_ACTIVE 0 +#define BWFM_SCANTYPE_PASSIVE 1 +#define BWFM_SCANTYPE_DEFAULT 0xff uint32_t nprobes; uint32_t active_time; uint32_t passive_time; -- 2.20.1