MSG_FREQ,
MSG_CHANNEL,
MSG_OP_CLASS,
+ MSG_BEACON_INTERVAL,
__MSG_MAX,
};
static struct blobmsg_policy policy[__MSG_MAX] = {
[MSG_FREQ] = { "freq", BLOBMSG_TYPE_INT32 },
[MSG_CHANNEL] = { "channel", BLOBMSG_TYPE_INT32 },
[MSG_OP_CLASS] = { "op_class", BLOBMSG_TYPE_INT32 },
+ [MSG_BEACON_INTERVAL] = { "beacon_interval", BLOBMSG_TYPE_INT32 },
};
struct blob_attr *tb[__MSG_MAX];
struct usteer_local_node *ln;
node->channel = blobmsg_get_u32(tb[MSG_CHANNEL]);
if (tb[MSG_OP_CLASS])
node->op_class = blobmsg_get_u32(tb[MSG_OP_CLASS]);
+
+ /* Local-Node */
+ if (tb[MSG_BEACON_INTERVAL])
+ ln->beacon_interval = blobmsg_get_u32(tb[MSG_BEACON_INTERVAL]);
}
static void
struct usteer_node *node;
struct sta_info *si;
struct sta *sta;
-
- uint8_t validity_period = 100; /* ~ 10 seconds */
+ uint8_t validity_period;
ln = container_of(timeout, struct usteer_local_node, bss_tm_queries_timeout);
node = &ln->node;
+ validity_period = 10000 / usteer_local_node_get_beacon_interval(ln); /* ~ 10 seconds */
+
list_for_each_entry_safe(query, tmp, &ln->bss_tm_queries, list) {
sta = usteer_sta_get(query->sta_addr, false);
if (!sta)
usteer_register_node(ctx, obj->path, obj->id);
}
+int
+usteer_local_node_get_beacon_interval(struct usteer_local_node *ln)
+{
+ /* Check if beacon-interval is not available (pre-21.02+) */
+ if (ln->beacon_interval < 1)
+ return 100;
+
+ return ln->beacon_interval;
+}
+
void config_set_node_up_script(struct blob_attr *data)
{
const char *val;
config.initial_connect_delay = 0;
config.remote_node_timeout = 10;
- config.roam_kick_delay = 100;
+ config.roam_kick_delay = 10000;
config.roam_process_timeout = 5 * 1000;
config.roam_scan_tries = 3;
config.roam_scan_timeout = 0;
struct uloop_timeout bss_tm_queries_timeout;
struct list_head bss_tm_queries;
+ int beacon_interval;
+
struct {
bool present;
struct uloop_timeout update;
# Minimum time (ms) between client roaming trigger attempts
#option roam_trigger_interval 60000
- # Timeout (in 100ms beacon intervals) for client roam requests
- #option roam_kick_delay 100
+ # Timeout (ms) for client roam requests. usteer will kick the client after this times out.
+ #option roam_kick_delay 10000
# Minimum signal strength difference until AP steering policy is active
#option signal_diff_threshold 0
blob_buf_init(&b, 0);
blobmsg_printf(&b, "addr", MAC_ADDR_FMT, MAC_ADDR_DATA(si->sta->addr));
- blobmsg_add_u32(&b, "duration", config.roam_kick_delay);
+ blobmsg_add_u32(&b, "duration", config.roam_kick_delay / usteer_local_node_get_beacon_interval(ln));
usteer_ubus_disassoc_add_neighbors(si);
return ubus_invoke(ubus_ctx, ln->obj_id, "wnm_disassoc_imminent", b.head, NULL, 0, 100);
}
void usteer_local_nodes_init(struct ubus_context *ctx);
void usteer_local_node_kick(struct usteer_local_node *ln);
+int usteer_local_node_get_beacon_interval(struct usteer_local_node *ln);
+
void usteer_ubus_init(struct ubus_context *ctx);
void usteer_ubus_kick_client(struct sta_info *si);
int usteer_ubus_trigger_client_scan(struct sta_info *si);