Skip to content
Snippets Groups Projects
Commit 971df6f8 authored by Anjan Chanda's avatar Anjan Chanda
Browse files

add cntlr_find_fbss() and cntlr_find_bbss() helpers

parent 06ca26cf
Branches
No related tags found
No related merge requests found
Pipeline #189537 passed
......@@ -78,6 +78,28 @@ struct netif_iface *cntlr_find_iface(struct controller *c, uint8_t *macaddr)
return (struct netif_iface *)entry->data;
}
struct netif_iface *cntlr_find_iface_type(struct controller *c, uint8_t *macaddr,
enum macaddr_type type)
{
struct macaddr_entry *entry = NULL;
entry = mactable_lookup(c->mac_table, macaddr, type);
if (WARN_ON(!entry))
return NULL;
return (struct netif_iface *)entry->data;
}
struct netif_iface *cntlr_find_fbss(struct controller *c, uint8_t *macaddr)
{
return cntlr_find_iface_type(c, macaddr, MAC_ENTRY_FBSS);
}
struct netif_iface *cntlr_find_bbss(struct controller *c, uint8_t *macaddr)
{
return cntlr_find_iface_type(c, macaddr, MAC_ENTRY_BBSS);
}
struct netif_radio *cntlr_find_radio(struct controller *c, uint8_t *macaddr)
{
struct macaddr_entry *entry = NULL;
......
......
......@@ -382,6 +382,10 @@ struct netif_radio *cntlr_find_radio_in_node_by_band(struct controller *c, struc
struct netif_iface *cntlr_radio_add_iface(struct controller *c,
struct netif_radio *r, uint8_t *hwaddr);
struct netif_iface *cntlr_find_iface(struct controller *c, uint8_t *macaddr);
struct netif_iface *cntlr_find_iface_type(struct controller *c, uint8_t *macaddr,
enum macaddr_type type);
struct netif_iface *cntlr_find_fbss(struct controller *c, uint8_t *macaddr);
struct netif_iface *cntlr_find_bbss(struct controller *c, uint8_t *macaddr);
#if (EASYMESH_VERSION >= 6)
bool cntlr_radio_support_ap_wifi7(struct controller *c,
......
......
......@@ -18,11 +18,12 @@
enum macaddr_type {
MAC_ENTRY_UNKNOWN = 0,
MAC_ENTRY_FBSS, /**< data points to struct netif_iface */
MAC_ENTRY_BSTA, /**< data points to struct sta */
MAC_ENTRY_ALID, /**< data points to struct node */
MAC_ENTRY_RADIO, /**< data points to struct netif_radio */
_MAC_ENTRY_MAX
MAC_ENTRY_FBSS = (1 << 0), /**< data points to struct netif_iface */
MAC_ENTRY_BBSS = (1 << 1), /**< data points to struct netif_iface */
MAC_ENTRY_BSTA = (1 << 2), /**< data points to struct sta */
MAC_ENTRY_ALID = (1 << 3), /**< data points to struct node */
MAC_ENTRY_RADIO = (1 << 4), /**< data points to struct netif_radio */
NUM_MAC_ENTRY_TYPES,
};
struct macaddr_entry {
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment