}
static void
-usteer_local_node_update_sta_rrm_wnm(const uint8_t *addr, struct blob_attr *client_attr)
+usteer_local_node_update_sta_rrm_wnm(struct sta_info *si, struct blob_attr *client_attr)
{
static const struct blobmsg_policy rrm_policy = {
.name = "rrm",
.type = BLOBMSG_TYPE_ARRAY,
};
struct blob_attr *rrm_blob = NULL, *wnm_blob = NULL, *cur;
- struct sta *sta;
int rem;
int i = 0;
- if (!addr)
- return;
-
- /* Don't create the STA */
- sta = usteer_sta_get(addr, false);
- if (!sta)
- return;
-
/* RRM */
blobmsg_parse(&rrm_policy, 1, &rrm_blob, blobmsg_data(client_attr), blobmsg_data_len(client_attr));
if (!rrm_blob)
return;
- sta->rrm = blobmsg_get_u32(blobmsg_data(rrm_blob));
+ si->rrm = blobmsg_get_u32(blobmsg_data(rrm_blob));
/* Extended Capabilities / WNM */
blobmsg_parse(&ext_capa_policy, 1, &wnm_blob, blobmsg_data(client_attr), blobmsg_data_len(client_attr));
if (i == 2) {
if (blobmsg_get_u32(cur) & (1 << 3))
- sta->bss_transition = true;
+ si->bss_transition = true;
}
i++;
}
/* Read RRM information */
- usteer_local_node_update_sta_rrm_wnm(addr, cur);
+ usteer_local_node_update_sta_rrm_wnm(si, cur);
}
node->n_assoc = n_assoc;
}
bool
-usteer_sta_supports_beacon_measurement_mode(struct sta *sta, enum usteer_beacon_measurement_mode mode)
+usteer_sta_supports_beacon_measurement_mode(struct sta_info *si, enum usteer_beacon_measurement_mode mode)
{
switch (mode) {
case BEACON_MEASUREMENT_PASSIVE:
- return sta->rrm & (1 << 4);
+ return si->rrm & (1 << 4);
case BEACON_MEASUREMENT_ACTIVE:
- return sta->rrm & (1 << 5);
+ return si->rrm & (1 << 5);
case BEACON_MEASUREMENT_TABLE:
- return sta->rrm & (1 << 6);
+ return si->rrm & (1 << 6);
}
return false;
/* Beacon measurement modes */
a = blobmsg_open_array(&b, "beacon-measurement-modes");
- if (usteer_sta_supports_beacon_measurement_mode(si->sta, BEACON_MEASUREMENT_PASSIVE))
+ if (usteer_sta_supports_beacon_measurement_mode(si, BEACON_MEASUREMENT_PASSIVE))
blobmsg_add_string(&b, "", "PASSIVE");
- if (usteer_sta_supports_beacon_measurement_mode(si->sta, BEACON_MEASUREMENT_ACTIVE))
+ if (usteer_sta_supports_beacon_measurement_mode(si, BEACON_MEASUREMENT_ACTIVE))
blobmsg_add_string(&b, "", "ACTIVE");
- if (usteer_sta_supports_beacon_measurement_mode(si->sta, BEACON_MEASUREMENT_TABLE))
+ if (usteer_sta_supports_beacon_measurement_mode(si, BEACON_MEASUREMENT_TABLE))
blobmsg_add_string(&b, "", "TABLE");
blobmsg_close_array(&b, a);
/* BSS-Transition support */
- blobmsg_add_u8(&b, "bss-transition-management", si->sta->bss_transition);
+ blobmsg_add_u8(&b, "bss-transition-management", si->bss_transition);
/* Measurements */
a = blobmsg_open_array(&b, "measurements");
{
struct usteer_local_node *ln = container_of(si->node, struct usteer_local_node, node);
- if (!usteer_sta_supports_beacon_measurement_mode(si->sta, BEACON_MEASUREMENT_ACTIVE)) {
+ if (!usteer_sta_supports_beacon_measurement_mode(si, BEACON_MEASUREMENT_ACTIVE)) {
MSG(DEBUG, "STA does not support beacon measurement sta=" MAC_ADDR_FMT "\n", MAC_ADDR_DATA(si->sta->addr));
return 0;
}
uint64_t last_connected;
int signal;
+ uint8_t rrm;
+ bool bss_transition;
+
enum roam_trigger_state roam_state;
uint8_t roam_tries;
uint64_t roam_event;
uint8_t seen_5ghz : 1;
uint8_t addr[6];
-
- uint8_t rrm;
- bool bss_transition;
};
struct usteer_beacon_report {
struct sta *usteer_sta_get(const uint8_t *addr, bool create);
struct sta_info *usteer_sta_info_get(struct sta *sta, struct usteer_node *node, bool *create);
-bool usteer_sta_supports_beacon_measurement_mode(struct sta *sta, enum usteer_beacon_measurement_mode mode);
+bool usteer_sta_supports_beacon_measurement_mode(struct sta_info *si, 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);