Skip to content

Commit ce9e660

Browse files
committed
wifi: mac80211: move radar detect work to sdata
At some point we thought perhaps this could be per link, but really that didn't happen, and it's confusing. Radar detection still uses the deflink to allocate the channel, but the work need not be there. Move it back. Reviewed-by: Miriam Rachel Korenblit <[email protected]> Link: https://msgid.link/20240506211311.43bd82c6da04.Ib39bec3aa198d137385f081e7e1910dcbde3aa1b@changeid Signed-off-by: Johannes Berg <[email protected]>
1 parent 48443a4 commit ce9e660

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

net/mac80211/cfg.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1666,7 +1666,7 @@ static int ieee80211_stop_ap(struct wiphy *wiphy, struct net_device *dev,
16661666

16671667
if (sdata->wdev.cac_started) {
16681668
chandef = link_conf->chanreq.oper;
1669-
wiphy_delayed_work_cancel(wiphy, &link->dfs_cac_timer_work);
1669+
wiphy_delayed_work_cancel(wiphy, &sdata->dfs_cac_timer_work);
16701670
cfg80211_cac_event(sdata->dev, &chandef,
16711671
NL80211_RADAR_CAC_ABORTED,
16721672
GFP_KERNEL);
@@ -3466,7 +3466,7 @@ static int ieee80211_start_radar_detection(struct wiphy *wiphy,
34663466
if (err)
34673467
goto out_unlock;
34683468

3469-
wiphy_delayed_work_queue(wiphy, &sdata->deflink.dfs_cac_timer_work,
3469+
wiphy_delayed_work_queue(wiphy, &sdata->dfs_cac_timer_work,
34703470
msecs_to_jiffies(cac_time_ms));
34713471

34723472
out_unlock:
@@ -3483,7 +3483,7 @@ static void ieee80211_end_cac(struct wiphy *wiphy,
34833483

34843484
list_for_each_entry(sdata, &local->interfaces, list) {
34853485
wiphy_delayed_work_cancel(wiphy,
3486-
&sdata->deflink.dfs_cac_timer_work);
3486+
&sdata->dfs_cac_timer_work);
34873487

34883488
if (sdata->wdev.cac_started) {
34893489
ieee80211_link_release_channel(&sdata->deflink);

net/mac80211/ieee80211_i.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1060,7 +1060,6 @@ struct ieee80211_link_data {
10601060
int ap_power_level; /* in dBm */
10611061

10621062
bool radar_required;
1063-
struct wiphy_delayed_work dfs_cac_timer_work;
10641063

10651064
union {
10661065
struct ieee80211_link_data_managed mgd;
@@ -1159,6 +1158,8 @@ struct ieee80211_sub_if_data {
11591158
struct ieee80211_link_data deflink;
11601159
struct ieee80211_link_data __rcu *link[IEEE80211_MLD_MAX_NUM_LINKS];
11611160

1161+
struct wiphy_delayed_work dfs_cac_timer_work;
1162+
11621163
/* for ieee80211_set_active_links_async() */
11631164
struct wiphy_work activate_links_work;
11641165
u16 desired_active_links;

net/mac80211/iface.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, bool going_do
554554
wiphy_work_cancel(local->hw.wiphy,
555555
&sdata->deflink.color_change_finalize_work);
556556
wiphy_delayed_work_cancel(local->hw.wiphy,
557-
&sdata->deflink.dfs_cac_timer_work);
557+
&sdata->dfs_cac_timer_work);
558558

559559
if (sdata->wdev.cac_started) {
560560
chandef = sdata->vif.bss_conf.chanreq.oper;
@@ -1746,6 +1746,8 @@ static void ieee80211_setup_sdata(struct ieee80211_sub_if_data *sdata,
17461746
wiphy_work_init(&sdata->work, ieee80211_iface_work);
17471747
wiphy_work_init(&sdata->activate_links_work,
17481748
ieee80211_activate_links_work);
1749+
wiphy_delayed_work_init(&sdata->dfs_cac_timer_work,
1750+
ieee80211_dfs_cac_timer_work);
17491751

17501752
switch (type) {
17511753
case NL80211_IFTYPE_P2P_GO:

net/mac80211/link.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ void ieee80211_link_init(struct ieee80211_sub_if_data *sdata,
4545
ieee80211_color_collision_detection_work);
4646
INIT_LIST_HEAD(&link->assigned_chanctx_list);
4747
INIT_LIST_HEAD(&link->reserved_chanctx_list);
48-
wiphy_delayed_work_init(&link->dfs_cac_timer_work,
49-
ieee80211_dfs_cac_timer_work);
5048

5149
if (!deflink) {
5250
switch (sdata->vif.type) {

net/mac80211/mlme.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2797,16 +2797,15 @@ void ieee80211_dynamic_ps_timer(struct timer_list *t)
27972797

27982798
void ieee80211_dfs_cac_timer_work(struct wiphy *wiphy, struct wiphy_work *work)
27992799
{
2800-
struct ieee80211_link_data *link =
2801-
container_of(work, struct ieee80211_link_data,
2800+
struct ieee80211_sub_if_data *sdata =
2801+
container_of(work, struct ieee80211_sub_if_data,
28022802
dfs_cac_timer_work.work);
2803-
struct cfg80211_chan_def chandef = link->conf->chanreq.oper;
2804-
struct ieee80211_sub_if_data *sdata = link->sdata;
2803+
struct cfg80211_chan_def chandef = sdata->vif.bss_conf.chanreq.oper;
28052804

28062805
lockdep_assert_wiphy(sdata->local->hw.wiphy);
28072806

28082807
if (sdata->wdev.cac_started) {
2809-
ieee80211_link_release_channel(link);
2808+
ieee80211_link_release_channel(&sdata->deflink);
28102809
cfg80211_cac_event(sdata->dev, &chandef,
28112810
NL80211_RADAR_CAC_FINISHED,
28122811
GFP_KERNEL);

net/mac80211/util.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3457,7 +3457,7 @@ void ieee80211_dfs_cac_cancel(struct ieee80211_local *local)
34573457

34583458
list_for_each_entry(sdata, &local->interfaces, list) {
34593459
wiphy_delayed_work_cancel(local->hw.wiphy,
3460-
&sdata->deflink.dfs_cac_timer_work);
3460+
&sdata->dfs_cac_timer_work);
34613461

34623462
if (sdata->wdev.cac_started) {
34633463
chandef = sdata->vif.bss_conf.chanreq.oper;

0 commit comments

Comments
 (0)