3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-23 06:02:37 +01:00

scan: Make periodic scan optional

This commit is contained in:
Tim Kourt 2018-11-15 12:54:24 -08:00 committed by Denis Kenzior
parent 7b8c069383
commit e4a76018fd

View File

@ -2,7 +2,7 @@
* *
* Wireless daemon for Linux * Wireless daemon for Linux
* *
* Copyright (C) 2015 Intel Corporation. All rights reserved. * Copyright (C) 2015-2018 Intel Corporation. All rights reserved.
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -654,11 +654,26 @@ static bool scan_periodic_send_start(struct scan_context *sc)
return true; return true;
} }
static bool scan_periodic_is_disabled(void)
{
const struct l_settings *config = iwd_get_config();
bool disabled;
if (!l_settings_get_bool(config, "Scan", "disable_periodic_scan",
&disabled))
return false;
return disabled;
}
void scan_periodic_start(uint32_t ifindex, scan_trigger_func_t trigger, void scan_periodic_start(uint32_t ifindex, scan_trigger_func_t trigger,
scan_notify_func_t func, void *userdata) scan_notify_func_t func, void *userdata)
{ {
struct scan_context *sc; struct scan_context *sc;
if (scan_periodic_is_disabled())
return;
sc = l_queue_find(scan_contexts, scan_context_match, sc = l_queue_find(scan_contexts, scan_context_match,
L_UINT_TO_PTR(ifindex)); L_UINT_TO_PTR(ifindex));