sta: uniform disconnect state handling
Logic for handling STA transition to disconnected state is present multiple times. Create a new method to remove duplicate code. Signed-off-by: David Bauer <mail@david-bauer.net>
This commit is contained in:
9
sta.c
9
sta.c
@@ -105,8 +105,7 @@ usteer_sta_info_get(struct sta *sta, struct usteer_node *node, bool *create)
|
||||
*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;
|
||||
}
|
||||
@@ -145,6 +144,12 @@ usteer_sta_get(const uint8_t *addr, bool create)
|
||||
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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user