sta: remove duplicate code
Move the sta frequency-seen logic to usteer_sta_info_update. This method is called on every occurence the seen frequency is set now, thus removing the duplicate code. Signed-off-by: David Bauer <mail@david-bauer.net>
This commit is contained in:
@@ -173,11 +173,6 @@ usteer_local_node_assoc_update(struct sta_info *si, struct blob_attr *data)
|
|||||||
}
|
}
|
||||||
si->connected = STA_CONNECTED;
|
si->connected = STA_CONNECTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (si->node->freq < 4000)
|
|
||||||
si->sta->seen_2ghz = 1;
|
|
||||||
else
|
|
||||||
si->sta->seen_5ghz = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
11
sta.c
11
sta.c
@@ -156,6 +156,12 @@ usteer_sta_info_update(struct sta_info *si, int signal, bool avg)
|
|||||||
si->signal = signal;
|
si->signal = signal;
|
||||||
|
|
||||||
si->seen = current_time;
|
si->seen = current_time;
|
||||||
|
|
||||||
|
if (si->node->freq < 4000)
|
||||||
|
si->sta->seen_2ghz = 1;
|
||||||
|
else
|
||||||
|
si->sta->seen_5ghz = 1;
|
||||||
|
|
||||||
usteer_sta_info_update_timeout(si, config.local_sta_timeout);
|
usteer_sta_info_update_timeout(si, config.local_sta_timeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -173,11 +179,6 @@ usteer_handle_sta_event(struct usteer_node *node, const uint8_t *addr,
|
|||||||
if (!sta)
|
if (!sta)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (freq < 4000)
|
|
||||||
sta->seen_2ghz = 1;
|
|
||||||
else
|
|
||||||
sta->seen_5ghz = 1;
|
|
||||||
|
|
||||||
si = usteer_sta_info_get(sta, node, &create);
|
si = usteer_sta_info_get(sta, node, &create);
|
||||||
usteer_sta_info_update(si, signal, false);
|
usteer_sta_info_update(si, signal, false);
|
||||||
si->roam_scan_done = current_time;
|
si->roam_scan_done = current_time;
|
||||||
|
Reference in New Issue
Block a user