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

netdev: add conf option to set RSSI threshold

Environments with several AP's, all at low signal strength may
want to lower the roaming RSSI threshold to prevent IWD from
roaming excessively. This adds an option 'roam_rssi_threshold',
which is still defaulted to -70.
This commit is contained in:
James Prestwood 2019-03-21 09:03:45 -07:00 committed by Denis Kenzior
parent f09fc78aeb
commit 45a51613c4

View File

@ -724,8 +724,8 @@ static void netdev_lost_beacon(struct netdev *netdev)
netdev->user_data);
}
/* -70 dBm is a popular choice for low signal threshold for roaming */
#define LOW_SIGNAL_THRESHOLD -70
/* Threshold RSSI for roaming to trigger, configurable in main.conf */
static int LOW_SIGNAL_THRESHOLD;
static void netdev_cqm_event_rssi_threshold(struct netdev *netdev,
uint32_t rssi_event)
@ -5054,6 +5054,8 @@ bool netdev_watch_remove(uint32_t id)
bool netdev_init(const char *whitelist, const char *blacklist)
{
const struct l_settings *settings = iwd_get_config();
if (rtnl)
return false;
@ -5075,6 +5077,10 @@ bool netdev_init(const char *whitelist, const char *blacklist)
return false;
}
if (!l_settings_get_int(settings, "General", "roam_rssi_threshold",
&LOW_SIGNAL_THRESHOLD))
LOW_SIGNAL_THRESHOLD = -70;
watchlist_init(&netdev_watches, NULL);
netdev_list = l_queue_new();