Pass scan type directly to the scan command instead of using the global
authorpatrick <patrick@openbsd.org>
Mon, 18 Dec 2017 16:33:37 +0000 (16:33 +0000)
committerpatrick <patrick@openbsd.org>
Mon, 18 Dec 2017 16:33:37 +0000 (16:33 +0000)
variable.

sys/dev/ic/bwfm.c
sys/dev/ic/bwfmreg.h

index 37278f4..7c988c6 100644 (file)
@@ -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 <patrick@blueri.se>
@@ -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);
index 79b7409..d84e736 100644 (file)
@@ -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 <patrick@blueri.se>
@@ -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;