diff --git a/src/allmac.c b/src/allmac.c index 8417ed15497c744abd05845343777cb1f624eb60..1f17fe9208cacd66ae9e16d8519a899b411399b6 100644 --- a/src/allmac.c +++ b/src/allmac.c @@ -38,8 +38,6 @@ const char *allmac_type2str(enum allmac_type type) switch (type) { case MAC_ENTRY_FBSS: return "fbss"; - case MAC_ENTRY_BSTA: - return "bsta"; case MAC_ENTRY_ALID: return "alid"; case MAC_ENTRY_RADIO: diff --git a/src/allmac.h b/src/allmac.h index d1b6232cb19a1b25ee4331858cb3f6ecde8dc033..95739db0544becb5f59c82144dc04c1406a917f9 100644 --- a/src/allmac.h +++ b/src/allmac.h @@ -14,10 +14,9 @@ enum allmac_type { MAC_ENTRY_UNKNOWN = 0, /**< type unset or unknown */ MAC_ENTRY_FBSS, /**< fronthaul iface MAC */ - MAC_ENTRY_BSTA, /**< backhaul STA MAC */ MAC_ENTRY_ALID, /**< node alid MAC */ MAC_ENTRY_RADIO, /**< radio MAC */ - MAC_ENTRY_STA, /**< normal STA MAC */ + MAC_ENTRY_STA, /**< (b)STA MAC */ _MAC_ENTRY_MAX }; diff --git a/src/cntlr.c b/src/cntlr.c index c9a5af95d639acc74722f1b7b0ac1f60aa66f2e6..a03304ae5bd7ba3dbc3aae4d68603df76a598c39 100644 --- a/src/cntlr.c +++ b/src/cntlr.c @@ -302,19 +302,12 @@ struct sta *cntlr_find_sta(struct controller *c, uint8_t *mac) struct map_macaddr_entry *entry = NULL; struct sta *res; - entry = allmac_lookup(&c->mac_table, mac, MAC_ENTRY_BSTA); - if (!entry) - entry = allmac_lookup(&c->mac_table, mac, MAC_ENTRY_STA); - - if (WARN_ON(!entry)) { - /* fall back to old find - TODO: deprecate */ - res = _cntlr_find_sta(c, mac); - } else { - res = (struct sta*)entry->data; - } + entry = allmac_lookup(&c->mac_table, mac, MAC_ENTRY_STA); + if (WARN_ON(!entry)) + return NULL; - if (res) - time(&res->lookup_time); + res = (struct sta*)entry->data; + time(&res->lookup_time); return res; } @@ -1107,15 +1100,12 @@ void cntlr_toggle_sta_type(struct controller *c, struct sta *s) s->type = was_bsta ? NON_IEEE1905 : IEEE1905; /* add entry with new type */ - allmac_insert(&c->mac_table, s->de_sta->macaddr, - was_bsta ? MAC_ENTRY_STA : MAC_ENTRY_BSTA, - (void *)s); + allmac_insert(&c->mac_table, s->de_sta->macaddr, MAC_ENTRY_STA, (void *)s); } static void node_remove_sta(struct controller *c, struct node *n, struct sta *s) { - enum device_type type = s->type; uint8_t macaddr[6]; memcpy(macaddr, s->de_sta->macaddr, 6); @@ -1129,8 +1119,7 @@ static void node_remove_sta(struct controller *c, struct node *n, n->sta_count--; /* Remove MAC address from lookup table */ - allmac_clean_entry(&c->mac_table, macaddr, - type == NON_IEEE1905 ? MAC_ENTRY_STA : MAC_ENTRY_BSTA); + allmac_clean_entry(&c->mac_table, macaddr, MAC_ENTRY_STA); } struct sta *cntlr_add_sta(struct controller *c, struct node *n, @@ -1189,9 +1178,7 @@ struct sta *cntlr_add_sta(struct controller *c, struct node *n, INIT_LIST_HEAD(&s->umetriclist); list_add(&s->list, &n->stalist); n->sta_count++; - allmac_insert(&c->mac_table, macaddr, - is_bsta ? MAC_ENTRY_BSTA : MAC_ENTRY_STA, - (void *)s); + allmac_insert(&c->mac_table, macaddr, MAC_ENTRY_STA, (void *)s); timer_init(&s->bcn_metrics_timer, cntlr_bcn_metrics_parse); timer_init(&s->btm_req_timer, cntlr_btm_req_timer_cb);