Skip to main content
Sign in
Snippets Groups Projects
Commit bfaad222 authored by Janusz Dziedzic's avatar Janusz Dziedzic
Browse files

show current opclass when bh_topology_dump

parent b4b1fd2f
No related branches found
No related tags found
1 merge request!251show current opclass when bh_topology_dump
Pipeline #106913 passed
...@@ -481,7 +481,7 @@ static char *cntrl_status_reason(uint8_t reason) ...@@ -481,7 +481,7 @@ static char *cntrl_status_reason(uint8_t reason)
return "unknown"; return "unknown";
} }
static void cntlr_status_add_opclass(struct blob_buf *bb, struct wifi_radio_opclass *opclass, void cntlr_status_add_opclass(struct blob_buf *bb, struct wifi_radio_opclass *opclass,
const char *name, int opclass_id) const char *name, int opclass_id)
{ {
char age[64]; char age[64];
... ...
......
...@@ -32,5 +32,7 @@ int cntlr_wait_for_object_timeout(struct controller *c, void *object, ...@@ -32,5 +32,7 @@ int cntlr_wait_for_object_timeout(struct controller *c, void *object,
int ieee1905_buildcmdu_linkmetric_resp(struct controller *c, uint16_t msg_type); int ieee1905_buildcmdu_linkmetric_resp(struct controller *c, uint16_t msg_type);
int cntlr_get_ieee1905_almac(struct controller *c, uint8_t *almac); int cntlr_get_ieee1905_almac(struct controller *c, uint8_t *almac);
void cntlr_status_add_opclass(struct blob_buf *bb, struct wifi_radio_opclass *opclass,
const char *name, int opclass_id);
#endif /* CNTLR_UBUS_H */ #endif /* CNTLR_UBUS_H */
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
#include "cntlr_cmdu.h" #include "cntlr_cmdu.h"
#include "backhaul_topology.h" #include "backhaul_topology.h"
#include "backhaul_topology_dbg.h" #include "backhaul_topology_dbg.h"
#include "cntlr_ubus.h"
#define OBJECT_INVALID ((uint32_t)-1) #define OBJECT_INVALID ((uint32_t)-1)
...@@ -168,6 +169,35 @@ static int cntlr_dbg_clear_steer_summary(struct ubus_context *ctx, struct ubus_o ...@@ -168,6 +169,35 @@ static int cntlr_dbg_clear_steer_summary(struct ubus_context *ctx, struct ubus_o
return UBUS_STATUS_OK; return UBUS_STATUS_OK;
} }
static struct wifi_radio_opclass *
cntrl_dbg_get_cur_opclass_by_bssid(struct controller *c, const unsigned char *bssid)
{
struct node *node;
list_for_each_entry(node, &c->nodelist, list) {
struct netif_radio *radio = NULL;
list_for_each_entry(radio, &node->radiolist, list) {
struct netif_iface *iface = NULL;
list_for_each_entry(iface, &radio->iflist, list) {
if (!iface->bss)
continue;
if (!iface->bss->enabled)
continue;
if (!iface->bss->is_bbss)
continue;
if (memcmp(iface->bss->bssid, bssid, 6))
continue;
return &radio->radio_el->cur_opclass;
}
}
}
return NULL;
}
static int cntrl_dbg_bh_topology_dump(struct ubus_context *ctx, static int cntrl_dbg_bh_topology_dump(struct ubus_context *ctx,
struct ubus_object *obj, struct ubus_object *obj,
struct ubus_request_data *req, struct ubus_request_data *req,
...@@ -202,6 +232,7 @@ static int cntrl_dbg_bh_topology_dump(struct ubus_context *ctx, ...@@ -202,6 +232,7 @@ static int cntrl_dbg_bh_topology_dump(struct ubus_context *ctx,
/* If device is not root device */ /* If device is not root device */
if (bh_info->parent_in_tree) { if (bh_info->parent_in_tree) {
void *bh_table = blobmsg_open_table(&bb, "bh_info"); void *bh_table = blobmsg_open_table(&bb, "bh_info");
struct wifi_radio_opclass *opclass;
blobmsg_add_string(&bb, "parent_in_tree", blobmsg_add_string(&bb, "parent_in_tree",
hwaddr_ntoa(bh_info->parent_in_tree->al_macaddr, macaddrstr)); hwaddr_ntoa(bh_info->parent_in_tree->al_macaddr, macaddrstr));
...@@ -215,6 +246,12 @@ static int cntrl_dbg_bh_topology_dump(struct ubus_context *ctx, ...@@ -215,6 +246,12 @@ static int cntrl_dbg_bh_topology_dump(struct ubus_context *ctx,
hwaddr_ntoa(bh_info->own_iface->macaddr, macaddrstr)); hwaddr_ntoa(bh_info->own_iface->macaddr, macaddrstr));
} }
if ((bh_info->parent_iface->media_type >> 8) == 1) {
opclass = cntrl_dbg_get_cur_opclass_by_bssid(c, bh_info->parent_iface->macaddr);
if (opclass)
cntlr_status_add_opclass(&bb, opclass, "cur_opclass", 0);
}
blobmsg_close_table(&bb, bh_table); blobmsg_close_table(&bb, bh_table);
} }
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment