Skip to content
Snippets Groups Projects
Commit 209ffb0b authored by Filip Matusiak's avatar Filip Matusiak
Browse files

Prepare channel list promptly prior to sending bcn request

parent 0bc8a460
No related branches found
No related tags found
1 merge request!236Don't mark beacon metrics stale until response complete
Pipeline #98757 passed
...@@ -398,7 +398,6 @@ struct controller { ...@@ -398,7 +398,6 @@ struct controller {
struct hlist_head *as_table; /** active sta hash table */ struct hlist_head *as_table; /** active sta hash table */
struct controller_config cfg; struct controller_config cfg;
struct cmdu_ackq cmdu_ack_q; struct cmdu_ackq cmdu_ack_q;
struct steering steer_params;
/* Autoconfig */ /* Autoconfig */
uint16_t mid_5g; uint16_t mid_5g;
... ...
......
...@@ -66,20 +66,19 @@ int handle_topology_notification(void *cntlr, struct cmdu_buff *cmdu) ...@@ -66,20 +66,19 @@ int handle_topology_notification(void *cntlr, struct cmdu_buff *cmdu)
return 0; return 0;
} }
static void _cntlr_update_steer_params(struct controller *c, struct opclass *op) static void _cntlr_get_steer_params(struct opclass *op, struct steering *sp)
{ {
int i, j, k; int i, j, k;
bool found; bool found;
struct opclass_entry *oe; struct opclass_entry *oe;
struct steering *sp;
for (i = 0; i < op->opclass_entry_num; i++) { for (i = 0; i < op->opclass_entry_num; i++) {
oe = &op->opclass_entry[i]; oe = &op->opclass_entry[i];
for (j = 0; j < oe->channels_num; j++) { for (j = 0; j < oe->channels_num; j++) {
sp = &c->steer_params;
found = false; found = false;
for (k = 0; k < sp->channels_num; k++) { for (k = 0; k < sp->channels_num; k++) {
if(sp->channels[k] == oe->channels[j].channel) { if(sp->channels[k] == oe->channels[j].channel) {
/* channel already enlisted */
found = true; found = true;
break; break;
} }
...@@ -97,7 +96,8 @@ static void _cntlr_update_steer_params(struct controller *c, struct opclass *op) ...@@ -97,7 +96,8 @@ static void _cntlr_update_steer_params(struct controller *c, struct opclass *op)
} }
} }
static void cntlr_update_steer_params(struct controller *c, struct sta *s) static void cntlr_get_steer_params(struct controller *c, struct sta *s,
struct steering *sp)
{ {
struct netif_iface *p = NULL; /* fh anf bk iface */ struct netif_iface *p = NULL; /* fh anf bk iface */
struct netif_radio *r = NULL; struct netif_radio *r = NULL;
...@@ -108,7 +108,7 @@ static void cntlr_update_steer_params(struct controller *c, struct sta *s) ...@@ -108,7 +108,7 @@ static void cntlr_update_steer_params(struct controller *c, struct sta *s)
list_for_each_entry(p, &r->iflist, list) { list_for_each_entry(p, &r->iflist, list) {
if (p->ssid && s->fh && s->fh->ssid if (p->ssid && s->fh && s->fh->ssid
&& !memcmp(p->ssid, s->fh->ssid, 33)) && !memcmp(p->ssid, s->fh->ssid, 33))
_cntlr_update_steer_params(c, &r->cur_opclass); _cntlr_get_steer_params(&r->cur_opclass, sp);
} }
} }
} }
...@@ -320,9 +320,6 @@ int handle_topology_response(void *cntlr, struct cmdu_buff *cmdu) ...@@ -320,9 +320,6 @@ int handle_topology_response(void *cntlr, struct cmdu_buff *cmdu)
//s->failed_steer_attempts = 0; //s->failed_steer_attempts = 0;
//timestamp_reset(s->stats.last_steer_time); //timestamp_reset(s->stats.last_steer_time);
} }
/* Get STA data for steering and beacon requests */
cntlr_update_steer_params(c, s);
} }
} }
} }
...@@ -1311,12 +1308,14 @@ static uint8_t cntlr_get_classid_ht20(struct controller *c, uint8_t channel) ...@@ -1311,12 +1308,14 @@ static uint8_t cntlr_get_classid_ht20(struct controller *c, uint8_t channel)
#define STA_CHANNEL_REPORT_MAX_NUM 32 #define STA_CHANNEL_REPORT_MAX_NUM 32
static int cntlr_request_bcn_metrics_sta(struct controller *c, struct sta *s) static int cntlr_request_bcn_metrics_sta(struct controller *c, struct sta *s)
{ {
trace("%s: --->\n", __func__);
struct cmdu_buff *bcn_cmdu; struct cmdu_buff *bcn_cmdu;
uint8_t wildcard[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; uint8_t wildcard[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
uint8_t opclass = 0; uint8_t opclass = 0;
uint8_t channel = 0; uint8_t channel = 0;
struct sta_channel_report *reports = NULL; struct sta_channel_report *reports = NULL;
struct steering *sp; struct steering sp = {};
uint8_t num_report = 0; uint8_t num_report = 0;
struct { struct {
uint8_t opclass; uint8_t opclass;
...@@ -1325,31 +1324,31 @@ static int cntlr_request_bcn_metrics_sta(struct controller *c, struct sta *s) ...@@ -1325,31 +1324,31 @@ static int cntlr_request_bcn_metrics_sta(struct controller *c, struct sta *s)
uint8_t opc; uint8_t opc;
int i; int i;
trace("%s: --->\n", __func__); cntlr_get_steer_params(c, s, &sp);
sp = &c->steer_params;
dbg("|%s:%d| channels_num = %d\n", __func__, __LINE__, sp->channels_num); dbg("|%s:%d| Number of measured channels = %d\n",
__func__, __LINE__, sp.channels_num);
if (sp->channels_num < 1) if (sp.channels_num < 1)
return -1; return -1;
if (sp->channels_num == 1) { if (sp.channels_num == 1) {
/* won't use channel report */ /* use one channel/opclass pair directly */
opclass = cntlr_get_classid_ht20(c, sp->channels[0]); /* /20 */ opclass = cntlr_get_classid_ht20(c, sp.channels[0]); /* /20 */
if (!opclass) if (!opclass)
return -1; return -1;
channel = sp->channels[0]; channel = sp.channels[0];
num_report = 0; num_report = 0;
} else { } else {
/* use channel report - list of opc/ch pairs */
opclass = 0; opclass = 0;
channel = 255; /* use channel report */ channel = 255;
for (i = 0; i < sp->channels_num; i++) { for (i = 0; i < sp.channels_num; i++) {
opc = cntlr_get_classid_ht20(c, sp->channels[i]); opc = cntlr_get_classid_ht20(c, sp.channels[i]);
if (!opc) if (!opc)
continue; continue;
op_ch[num_report].opclass = opc; op_ch[num_report].opclass = opc;
op_ch[num_report].channel = sp->channels[i]; op_ch[num_report].channel = sp.channels[i];
num_report++; num_report++;
if (num_report > STA_CHANNEL_REPORT_MAX_NUM) { if (num_report > STA_CHANNEL_REPORT_MAX_NUM) {
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment