3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-19 02:39:29 +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); netdev->user_data);
} }
/* -70 dBm is a popular choice for low signal threshold for roaming */ /* Threshold RSSI for roaming to trigger, configurable in main.conf */
#define LOW_SIGNAL_THRESHOLD -70 static int LOW_SIGNAL_THRESHOLD;
static void netdev_cqm_event_rssi_threshold(struct netdev *netdev, static void netdev_cqm_event_rssi_threshold(struct netdev *netdev,
uint32_t rssi_event) uint32_t rssi_event)
@ -5054,6 +5054,8 @@ bool netdev_watch_remove(uint32_t id)
bool netdev_init(const char *whitelist, const char *blacklist) bool netdev_init(const char *whitelist, const char *blacklist)
{ {
const struct l_settings *settings = iwd_get_config();
if (rtnl) if (rtnl)
return false; return false;
@ -5075,6 +5077,10 @@ bool netdev_init(const char *whitelist, const char *blacklist)
return false; return false;
} }
if (!l_settings_get_int(settings, "General", "roam_rssi_threshold",
&LOW_SIGNAL_THRESHOLD))
LOW_SIGNAL_THRESHOLD = -70;
watchlist_init(&netdev_watches, NULL); watchlist_init(&netdev_watches, NULL);
netdev_list = l_queue_new(); netdev_list = l_queue_new();