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

map-controller: use threshold defines

parent 3b7de3c3
No related branches found
No related tags found
1 merge request!55map-controller: rebase bk-steer branch to devel
......@@ -752,7 +752,9 @@ int handle_ap_metrics_response(void *cntlr, struct cmdu_buff *cmdu)
return 0;
}
#define STA_LINK_UL_RCPI_THRESHOLD 170
#define STA_LINK_UL_RCPI_TH_1905 170
#define STA_LINK_UL_RCPI_TH_NON1905 220
int handle_sta_link_metrics_response(void *cntlr, struct cmdu_buff *cmdu)
{
int i;
......@@ -799,14 +801,14 @@ int handle_sta_link_metrics_response(void *cntlr, struct cmdu_buff *cmdu)
offset += sizeof(*b);
}
if (s->type == IEEE1905 && s->ul_rcpi < STA_LINK_UL_RCPI_THRESHOLD) {
if (s->type == IEEE1905 && s->ul_rcpi < STA_LINK_UL_RCPI_TH_1905) {
struct cmdu_buff *bcn_cmdu;
uint8_t wildcard[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
if (!c->cfg.enable_bsta_steer) {
trace("|%s:%d| rcpi below %d, but will not query for beacon \
metrics to steer as 'enable_bsta_steer' not set!\n",
__func__, __LINE__, STA_LINK_UL_RCPI_THRESHOLD);
__func__, __LINE__, STA_LINK_UL_RCPI_TH_1905);
return 0;
}
......@@ -819,7 +821,7 @@ int handle_sta_link_metrics_response(void *cntlr, struct cmdu_buff *cmdu)
send_cmdu(c, bcn_cmdu);
cmdu_free(bcn_cmdu);
}
} else if (s->type == NON_IEEE1905 && s->ul_rcpi < 220) {
} else if (s->type == NON_IEEE1905 && s->ul_rcpi < STA_LINK_UL_RCPI_TH_NON1905) {
struct cmdu_buff *bcn_cmdu;
int i;
uint8_t wildcard[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
......@@ -849,6 +851,11 @@ int handle_sta_link_metrics_response(void *cntlr, struct cmdu_buff *cmdu)
return -1;
free_bcn_metrics(c, s);
/* TODO: use one query with num_report & report instead
* of sending separate bmq for each opclass
* as in ubus call: "channel_report":[{"opclass":
* 81, "channels": [1, 6, 13]}, {"opclass":82, ...
*/
for (i = 0; i < num_opclasses; i++) {
bcn_cmdu = cntlr_gen_beacon_metrics_query(c,
s->fh->agent->alid,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment