Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
map-controller
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Multi-AP
map-controller
Commits
6d4db686
Commit
6d4db686
authored
6 months ago
by
Anjan Chanda
Browse files
Options
Downloads
Patches
Plain Diff
steer: defer informing steer plugins of the received responses
parent
ccdef96e
No related branches found
No related tags found
No related merge requests found
Pipeline
#202707
passed
6 months ago
Stage: static_code_analysis
Stage: compile_test
Changes
3
Pipelines
2
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/cntlr.c
+22
-0
22 additions, 0 deletions
src/cntlr.c
src/cntlr.h
+6
-0
6 additions, 0 deletions
src/cntlr.h
src/cntlr_map.c
+33
-34
33 additions, 34 deletions
src/cntlr_map.c
with
61 additions
and
34 deletions
src/cntlr.c
+
22
−
0
View file @
6d4db686
...
@@ -53,6 +53,7 @@
...
@@ -53,6 +53,7 @@
#include
"utils/utils.h"
#include
"utils/utils.h"
#include
"wifi_dataelements.h"
#include
"wifi_dataelements.h"
#include
"wifi_opclass.h"
#include
"wifi_opclass.h"
#include
"steer.h"
#define map_plugin "ieee1905.map"
#define map_plugin "ieee1905.map"
...
@@ -1471,6 +1472,26 @@ static void cntlr_dfs_cleanup_run(atimer_t *t)
...
@@ -1471,6 +1472,26 @@ static void cntlr_dfs_cleanup_run(atimer_t *t)
timer_set
(
&
c
->
dfs_cleanup
,
c
->
cfg
.
dfs_cleanup_timeout
*
1000
);
timer_set
(
&
c
->
dfs_cleanup
,
c
->
cfg
.
dfs_cleanup_timeout
*
1000
);
}
}
static
void
cntlr_steer_sched_run
(
atimer_t
*
t
)
{
struct
controller
*
c
=
container_of
(
t
,
struct
controller
,
steer_sched_timer
);
int
i
;
cntlr_dbg
(
LOG_STEER
,
"%s: --->
\n
"
,
__func__
);
for
(
i
=
0
;
i
<
c
->
inform_sta_num
;
i
++
)
{
struct
sta
*
s
=
cntlr_find_sta
(
c
->
sta_table
,
&
c
->
inform_stalist
[
i
*
6
]);
if
(
!
s
)
continue
;
if
(
c
->
cfg
.
steer
.
enable_sta_steer
&&
!
s
->
is_bsta
)
cntlr_inform_steer_modules
(
c
,
s
,
c
->
inform_cmdu_type
);
else
if
(
c
->
cfg
.
steer
.
enable_bsta_steer
&&
s
->
is_bsta
)
cntlr_inform_bsteer_modules
(
c
,
s
,
c
->
inform_cmdu_type
);
}
}
static
void
cntlr_start
(
atimer_t
*
t
)
static
void
cntlr_start
(
atimer_t
*
t
)
{
{
struct
controller
*
c
=
container_of
(
t
,
struct
controller
,
start_timer
);
struct
controller
*
c
=
container_of
(
t
,
struct
controller
,
start_timer
);
...
@@ -1859,6 +1880,7 @@ void run_controller(void *opts)
...
@@ -1859,6 +1880,7 @@ void run_controller(void *opts)
timer_init
(
&
c
->
query_nodes
,
cntlr_query_nodes
);
timer_init
(
&
c
->
query_nodes
,
cntlr_query_nodes
);
timer_init
(
&
c
->
acs
,
cntlr_acs_run
);
timer_init
(
&
c
->
acs
,
cntlr_acs_run
);
timer_init
(
&
c
->
dfs_cleanup
,
cntlr_dfs_cleanup_run
);
timer_init
(
&
c
->
dfs_cleanup
,
cntlr_dfs_cleanup_run
);
timer_init
(
&
c
->
steer_sched_timer
,
cntlr_steer_sched_run
);
timer_set
(
&
c
->
heartbeat
,
1
*
1000
);
timer_set
(
&
c
->
heartbeat
,
1
*
1000
);
timer_set
(
&
c
->
start_timer
,
waitext
?
5
*
1000
:
0
);
timer_set
(
&
c
->
start_timer
,
waitext
?
5
*
1000
:
0
);
...
...
...
...
This diff is collapsed.
Click to expand it.
src/cntlr.h
+
6
−
0
View file @
6d4db686
...
@@ -326,6 +326,12 @@ struct controller {
...
@@ -326,6 +326,12 @@ struct controller {
void
*
subscriber
;
void
*
subscriber
;
bool
subscribed
;
bool
subscribed
;
#define INFORM_STA_MAXNUM 64
atimer_t
steer_sched_timer
;
uint16_t
inform_cmdu_type
;
uint32_t
inform_sta_num
;
uint8_t
inform_stalist
[
INFORM_STA_MAXNUM
*
6
];
struct
list_head
sclist
;
/* struct steer_control list */
struct
list_head
sclist
;
/* struct steer_control list */
#if (EASYMESH_VERSION > 2)
#if (EASYMESH_VERSION > 2)
...
...
...
...
This diff is collapsed.
Click to expand it.
src/cntlr_map.c
+
33
−
34
View file @
6d4db686
...
@@ -292,10 +292,11 @@ inform_steer_plugins:
...
@@ -292,10 +292,11 @@ inform_steer_plugins:
if
(
s
)
{
if
(
s
)
{
cntlr_update_sta_steer_data
(
c
,
s
);
cntlr_update_sta_steer_data
(
c
,
s
);
if
(
c
->
cfg
.
steer
.
enable_sta_steer
&&
!
s
->
is_bsta
)
c
->
inform_cmdu_type
=
CMDU_TYPE_TOPOLOGY_NOTIFICATION
;
cntlr_inform_steer_modules
(
c
,
s
,
CMDU_TYPE_TOPOLOGY_NOTIFICATION
);
c
->
inform_sta_num
=
1
;
else
if
(
c
->
cfg
.
steer
.
enable_bsta_steer
&&
s
->
is_bsta
)
memset
(
c
->
inform_stalist
,
0
,
sizeof
(
c
->
inform_stalist
));
cntlr_inform_bsteer_modules
(
c
,
s
,
CMDU_TYPE_TOPOLOGY_NOTIFICATION
);
memcpy
(
c
->
inform_stalist
,
s
->
macaddr
,
6
);
timer_set
(
&
c
->
steer_sched_timer
,
0
);
}
}
return
0
;
return
0
;
...
@@ -2458,8 +2459,7 @@ int handle_link_metrics_response(struct controller *c, struct cmdu_buff *cmdu,
...
@@ -2458,8 +2459,7 @@ int handle_link_metrics_response(struct controller *c, struct cmdu_buff *cmdu,
int
handle_sta_link_metrics_response
(
void
*
cntlr
,
struct
cmdu_buff
*
cmdu
,
int
handle_sta_link_metrics_response
(
void
*
cntlr
,
struct
cmdu_buff
*
cmdu
,
struct
node
*
n
)
struct
node
*
n
)
{
{
#define INFORM_STA_MAXNUM 64
uint8_t
inform_stalist
[
INFORM_STA_MAXNUM
*
6
]
=
{
0
};
struct
sta
*
inform_stalist
[
INFORM_STA_MAXNUM
]
=
{
0
};
struct
controller
*
c
=
(
struct
controller
*
)
cntlr
;
struct
controller
*
c
=
(
struct
controller
*
)
cntlr
;
struct
tlv
*
tv
[
ASSOC_STA_LINK_METRICS_RESP_NUM_OF_TLV_TYPES
][
TLV_MAXNUM
]
=
{
0
};
struct
tlv
*
tv
[
ASSOC_STA_LINK_METRICS_RESP_NUM_OF_TLV_TYPES
][
TLV_MAXNUM
]
=
{
0
};
int
offset
=
0
;
int
offset
=
0
;
...
@@ -2521,7 +2521,7 @@ int handle_sta_link_metrics_response(void *cntlr, struct cmdu_buff *cmdu,
...
@@ -2521,7 +2521,7 @@ int handle_sta_link_metrics_response(void *cntlr, struct cmdu_buff *cmdu,
}
}
if
(
iidx
<
INFORM_STA_MAXNUM
-
1
)
if
(
iidx
<
INFORM_STA_MAXNUM
-
1
)
inform_stalist
[
iidx
++
]
=
s
;
memcpy
(
&
inform_stalist
[
6
*
iidx
++
]
,
s
->
de_sta
->
macaddr
,
6
)
;
}
}
idx
=
0
;
idx
=
0
;
...
@@ -2574,16 +2574,12 @@ int handle_sta_link_metrics_response(void *cntlr, struct cmdu_buff *cmdu,
...
@@ -2574,16 +2574,12 @@ int handle_sta_link_metrics_response(void *cntlr, struct cmdu_buff *cmdu,
*
*
* For now, inform steer plugins about the STAs.
* For now, inform steer plugins about the STAs.
*/
*/
for
(
i
=
0
;
i
<
iidx
;
i
++
)
{
c
->
inform_cmdu_type
=
CMDU_ASSOC_STA_LINK_METRICS_RESPONSE
;
struct
sta
*
s
=
inform_stalist
[
i
];
c
->
inform_sta_num
=
iidx
;
memset
(
c
->
inform_stalist
,
0
,
sizeof
(
c
->
inform_stalist
));
memcpy
(
c
->
inform_stalist
,
inform_stalist
,
iidx
*
6
);
sta_link_metrics_process
(
s
);
timer_set
(
&
c
->
steer_sched_timer
,
0
);
if
(
c
->
cfg
.
steer
.
enable_sta_steer
&&
!
s
->
is_bsta
)
cntlr_inform_steer_modules
(
c
,
s
,
CMDU_ASSOC_STA_LINK_METRICS_RESPONSE
);
else
if
(
c
->
cfg
.
steer
.
enable_bsta_steer
&&
s
->
is_bsta
)
cntlr_inform_bsteer_modules
(
c
,
s
,
CMDU_ASSOC_STA_LINK_METRICS_RESPONSE
);
}
return
0
;
return
0
;
}
}
...
@@ -2610,8 +2606,7 @@ int handle_unassoc_sta_link_metrics_response(void *cntlr,
...
@@ -2610,8 +2606,7 @@ int handle_unassoc_sta_link_metrics_response(void *cntlr,
struct
cmdu_buff
*
cmdu
,
struct
cmdu_buff
*
cmdu
,
struct
node
*
n
)
struct
node
*
n
)
{
{
#define INFORM_STA_MAXNUM 64
uint8_t
inform_stalist
[
INFORM_STA_MAXNUM
*
6
]
=
{
0
};
struct
sta
*
inform_stalist
[
INFORM_STA_MAXNUM
]
=
{
0
};
struct
controller
*
c
=
(
struct
controller
*
)
cntlr
;
struct
controller
*
c
=
(
struct
controller
*
)
cntlr
;
struct
tlv
*
tv
[
UNASTA_LINK_METRICS_RESP_NUM_OF_TLV_TYPES
][
TLV_MAXNUM
]
=
{
0
};
struct
tlv
*
tv
[
UNASTA_LINK_METRICS_RESP_NUM_OF_TLV_TYPES
][
TLV_MAXNUM
]
=
{
0
};
int
iidx
=
0
;
int
iidx
=
0
;
...
@@ -2706,20 +2701,19 @@ int handle_unassoc_sta_link_metrics_response(void *cntlr,
...
@@ -2706,20 +2701,19 @@ int handle_unassoc_sta_link_metrics_response(void *cntlr,
u
->
ul_rcpi
);
u
->
ul_rcpi
);
if
(
iidx
<
INFORM_STA_MAXNUM
-
1
)
if
(
iidx
<
INFORM_STA_MAXNUM
-
1
)
inform_stalist
[
iidx
++
]
=
s
;
memcpy
(
&
inform_stalist
[
6
*
iidx
++
]
,
s
->
de_sta
->
macaddr
,
6
)
;
offset
+=
sizeof
(
*
b
);
offset
+=
sizeof
(
*
b
);
}
}
}
}
for
(
i
=
0
;
i
<
iidx
;
i
++
)
{
/* inform steer plugins of the responses */
struct
sta
*
s
=
inform_stalist
[
i
];
c
->
inform_cmdu_type
=
CMDU_UNASSOC_STA_LINK_METRIC_RESPONSE
;
c
->
inform_sta_num
=
iidx
;
memset
(
c
->
inform_stalist
,
0
,
sizeof
(
c
->
inform_stalist
));
memcpy
(
c
->
inform_stalist
,
inform_stalist
,
iidx
*
6
);
if
(
!
s
->
is_bsta
)
timer_set
(
&
c
->
steer_sched_timer
,
0
);
cntlr_inform_steer_modules
(
c
,
s
,
CMDU_UNASSOC_STA_LINK_METRIC_RESPONSE
);
else
cntlr_inform_bsteer_modules
(
c
,
s
,
CMDU_UNASSOC_STA_LINK_METRIC_RESPONSE
);
}
return
0
;
return
0
;
}
}
...
@@ -2845,10 +2839,13 @@ int handle_beacon_metrics_response(void *cntlr, struct cmdu_buff *cmdu,
...
@@ -2845,10 +2839,13 @@ int handle_beacon_metrics_response(void *cntlr, struct cmdu_buff *cmdu,
ppos
=
ppos
+
elem
->
tag_length
+
2
;
ppos
=
ppos
+
elem
->
tag_length
+
2
;
}
}
if
(
!
s
->
is_bsta
)
/* inform steer plugins of the responses */
cntlr_inform_steer_modules
(
c
,
s
,
CMDU_BEACON_METRICS_RESPONSE
);
c
->
inform_cmdu_type
=
CMDU_BEACON_METRICS_RESPONSE
;
else
c
->
inform_sta_num
=
1
;
cntlr_inform_bsteer_modules
(
c
,
s
,
CMDU_BEACON_METRICS_RESPONSE
);
memset
(
c
->
inform_stalist
,
0
,
sizeof
(
c
->
inform_stalist
));
memcpy
(
c
->
inform_stalist
,
s
->
de_sta
->
macaddr
,
6
);
timer_set
(
&
c
->
steer_sched_timer
,
0
);
//ret = cntlr_notify_plugins(c, cmdu);
//ret = cntlr_notify_plugins(c, cmdu);
...
@@ -2936,10 +2933,12 @@ int handle_sta_steer_btm_report(void *cntlr, struct cmdu_buff *cmdu,
...
@@ -2936,10 +2933,12 @@ int handle_sta_steer_btm_report(void *cntlr, struct cmdu_buff *cmdu,
}
}
/* Inform steering plugins */
/* Inform steering plugins */
if
(
c
->
cfg
.
steer
.
enable_sta_steer
&&
!
s
->
is_bsta
)
c
->
inform_cmdu_type
=
CMDU_CLIENT_STEERING_BTM_REPORT
;
cntlr_inform_steer_modules
(
c
,
s
,
CMDU_CLIENT_STEERING_BTM_REPORT
);
c
->
inform_sta_num
=
1
;
else
if
(
c
->
cfg
.
steer
.
enable_bsta_steer
&&
s
->
is_bsta
)
memset
(
c
->
inform_stalist
,
0
,
sizeof
(
c
->
inform_stalist
));
cntlr_inform_bsteer_modules
(
c
,
s
,
CMDU_CLIENT_STEERING_BTM_REPORT
);
memcpy
(
c
->
inform_stalist
,
s
->
de_sta
->
macaddr
,
6
);
timer_set
(
&
c
->
steer_sched_timer
,
0
);
return
0
;
return
0
;
}
}
...
...
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment