if (si->connected != STA_DISCONNECTED)
continue;
- si->connected = STA_NOT_CONNECTED;
- usteer_sta_info_update_timeout(si, config.local_sta_timeout);
+ usteer_sta_disconnected(si);
MSG(VERBOSE, "station "MAC_ADDR_FMT" disconnected from node %s\n",
MAC_ADDR_DATA(si->sta->addr), usteer_node_name(node));
}
*create = true;
/* Node is by default not connected. */
- si->connected = STA_NOT_CONNECTED;
- usteer_sta_info_update_timeout(si, config.local_sta_timeout);
+ usteer_sta_disconnected(si);
return si;
}
return sta;
}
+void usteer_sta_disconnected(struct sta_info *si)
+{
+ si->connected = STA_NOT_CONNECTED;
+ usteer_sta_info_update_timeout(si, config.local_sta_timeout);
+}
+
void
usteer_sta_info_update(struct sta_info *si, int signal, bool avg)
{
blobmsg_add_u32(&b, "reason", config.load_kick_reason_code);
blobmsg_add_u8(&b, "deauth", 1);
ubus_invoke(ubus_ctx, ln->obj_id, "del_client", b.head, NULL, 0, 100);
- si->connected = STA_NOT_CONNECTED;
+ usteer_sta_disconnected(si);
si->roam_kick = current_time;
}
bool usteer_sta_supports_beacon_measurement_mode(struct sta *sta, enum usteer_beacon_measurement_mode mode);
+void usteer_sta_disconnected(struct sta_info *si);
void usteer_sta_info_update_timeout(struct sta_info *si, int timeout);
void usteer_sta_info_update(struct sta_info *si, int signal, bool avg);