commit 45a51613c4c24067fe0e35b4c084a50124282b36
parent f09fc78aeb05483a30009532a931921205aabb99
Author: James Prestwood <james.prestwood@linux.intel.com>
Date: Thu, 21 Mar 2019 09:03:45 -0700
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.
Diffstat:
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/netdev.c b/src/netdev.c
@@ -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();