Skip to content

Commit 15ddba5

Browse files
panjaneyjmberg-intel
authored andcommitted
wifi: mac80211: consistently use u64 for BSS changes
Currently, enum ieee80211_bss_change has more than 32 flags. Change the type of the corresponding variables from u32 to u64. Signed-off-by: Anjaneyulu <[email protected]> Signed-off-by: Gregory Greenman <[email protected]> Link: https://lore.kernel.org/r/20230604120651.10354a05eaf1.If19359262fe2728dd523ea6d7c3aa7dc50940411@changeid Signed-off-by: Johannes Berg <[email protected]>
1 parent 92747f1 commit 15ddba5

File tree

12 files changed

+119
-111
lines changed

12 files changed

+119
-111
lines changed

net/mac80211/cfg.c

Lines changed: 38 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,18 +1101,20 @@ ieee80211_copy_rnr_beacon(u8 *pos, struct cfg80211_rnr_elems *dst,
11011101
return offset;
11021102
}
11031103

1104-
static int ieee80211_assign_beacon(struct ieee80211_sub_if_data *sdata,
1105-
struct ieee80211_link_data *link,
1106-
struct cfg80211_beacon_data *params,
1107-
const struct ieee80211_csa_settings *csa,
1108-
const struct ieee80211_color_change_settings *cca)
1104+
static int
1105+
ieee80211_assign_beacon(struct ieee80211_sub_if_data *sdata,
1106+
struct ieee80211_link_data *link,
1107+
struct cfg80211_beacon_data *params,
1108+
const struct ieee80211_csa_settings *csa,
1109+
const struct ieee80211_color_change_settings *cca,
1110+
u64 *changed)
11091111
{
11101112
struct cfg80211_mbssid_elems *mbssid = NULL;
11111113
struct cfg80211_rnr_elems *rnr = NULL;
11121114
struct beacon_data *new, *old;
11131115
int new_head_len, new_tail_len;
11141116
int size, err;
1115-
u32 changed = BSS_CHANGED_BEACON;
1117+
u64 _changed = BSS_CHANGED_BEACON;
11161118
struct ieee80211_bss_conf *link_conf = link->conf;
11171119

11181120
old = sdata_dereference(link->u.ap.beacon, sdata);
@@ -1219,7 +1221,7 @@ static int ieee80211_assign_beacon(struct ieee80211_sub_if_data *sdata,
12191221
return err;
12201222
}
12211223
if (err == 0)
1222-
changed |= BSS_CHANGED_AP_PROBE_RESP;
1224+
_changed |= BSS_CHANGED_AP_PROBE_RESP;
12231225

12241226
if (params->ftm_responder != -1) {
12251227
link_conf->ftm_responder = params->ftm_responder;
@@ -1235,7 +1237,7 @@ static int ieee80211_assign_beacon(struct ieee80211_sub_if_data *sdata,
12351237
return err;
12361238
}
12371239

1238-
changed |= BSS_CHANGED_FTM_RESPONDER;
1240+
_changed |= BSS_CHANGED_FTM_RESPONDER;
12391241
}
12401242

12411243
rcu_assign_pointer(link->u.ap.beacon, new);
@@ -1244,7 +1246,8 @@ static int ieee80211_assign_beacon(struct ieee80211_sub_if_data *sdata,
12441246
if (old)
12451247
kfree_rcu(old, rcu_head);
12461248

1247-
return changed;
1249+
*changed |= _changed;
1250+
return 0;
12481251
}
12491252

12501253
static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev,
@@ -1446,10 +1449,10 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev,
14461449
if (ieee80211_hw_check(&local->hw, HAS_RATE_CONTROL))
14471450
link_conf->beacon_tx_rate = params->beacon_rate;
14481451

1449-
err = ieee80211_assign_beacon(sdata, link, &params->beacon, NULL, NULL);
1452+
err = ieee80211_assign_beacon(sdata, link, &params->beacon, NULL, NULL,
1453+
&changed);
14501454
if (err < 0)
14511455
goto error;
1452-
changed |= err;
14531456

14541457
if (params->fils_discovery.max_interval) {
14551458
err = ieee80211_set_fils_discovery(sdata,
@@ -1506,6 +1509,7 @@ static int ieee80211_change_beacon(struct wiphy *wiphy, struct net_device *dev,
15061509
struct beacon_data *old;
15071510
int err;
15081511
struct ieee80211_bss_conf *link_conf;
1512+
u64 changed = 0;
15091513

15101514
sdata_assert_lock(sdata);
15111515

@@ -1525,17 +1529,18 @@ static int ieee80211_change_beacon(struct wiphy *wiphy, struct net_device *dev,
15251529
if (!old)
15261530
return -ENOENT;
15271531

1528-
err = ieee80211_assign_beacon(sdata, link, params, NULL, NULL);
1532+
err = ieee80211_assign_beacon(sdata, link, params, NULL, NULL,
1533+
&changed);
15291534
if (err < 0)
15301535
return err;
15311536

15321537
if (params->he_bss_color_valid &&
15331538
params->he_bss_color.enabled != link_conf->he_bss_color.enabled) {
15341539
link_conf->he_bss_color.enabled = params->he_bss_color.enabled;
1535-
err |= BSS_CHANGED_HE_BSS_COLOR;
1540+
changed |= BSS_CHANGED_HE_BSS_COLOR;
15361541
}
15371542

1538-
ieee80211_link_info_change_notify(sdata, link, err);
1543+
ieee80211_link_info_change_notify(sdata, link, changed);
15391544
return 0;
15401545
}
15411546

@@ -1717,7 +1722,7 @@ static void sta_apply_mesh_params(struct ieee80211_local *local,
17171722
{
17181723
#ifdef CONFIG_MAC80211_MESH
17191724
struct ieee80211_sub_if_data *sdata = sta->sdata;
1720-
u32 changed = 0;
1725+
u64 changed = 0;
17211726

17221727
if (params->sta_modify_mask & STATION_PARAM_APPLY_PLINK_STATE) {
17231728
switch (params->plink_state) {
@@ -2664,7 +2669,7 @@ static int ieee80211_change_bss(struct wiphy *wiphy,
26642669
struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
26652670
struct ieee80211_link_data *link;
26662671
struct ieee80211_supported_band *sband;
2667-
u32 changed = 0;
2672+
u64 changed = 0;
26682673

26692674
link = ieee80211_link_or_deflink(sdata, params->link_id, true);
26702675
if (IS_ERR(link))
@@ -3589,7 +3594,7 @@ void ieee80211_channel_switch_disconnect(struct ieee80211_vif *vif, bool block_t
35893594
EXPORT_SYMBOL(ieee80211_channel_switch_disconnect);
35903595

35913596
static int ieee80211_set_after_csa_beacon(struct ieee80211_sub_if_data *sdata,
3592-
u32 *changed)
3597+
u64 *changed)
35933598
{
35943599
int err;
35953600

@@ -3600,25 +3605,22 @@ static int ieee80211_set_after_csa_beacon(struct ieee80211_sub_if_data *sdata,
36003605

36013606
err = ieee80211_assign_beacon(sdata, &sdata->deflink,
36023607
sdata->deflink.u.ap.next_beacon,
3603-
NULL, NULL);
3608+
NULL, NULL, changed);
36043609
ieee80211_free_next_beacon(&sdata->deflink);
36053610

36063611
if (err < 0)
36073612
return err;
3608-
*changed |= err;
36093613
break;
36103614
case NL80211_IFTYPE_ADHOC:
3611-
err = ieee80211_ibss_finish_csa(sdata);
3615+
err = ieee80211_ibss_finish_csa(sdata, changed);
36123616
if (err < 0)
36133617
return err;
3614-
*changed |= err;
36153618
break;
36163619
#ifdef CONFIG_MAC80211_MESH
36173620
case NL80211_IFTYPE_MESH_POINT:
3618-
err = ieee80211_mesh_finish_csa(sdata);
3621+
err = ieee80211_mesh_finish_csa(sdata, changed);
36193622
if (err < 0)
36203623
return err;
3621-
*changed |= err;
36223624
break;
36233625
#endif
36243626
default:
@@ -3632,7 +3634,7 @@ static int ieee80211_set_after_csa_beacon(struct ieee80211_sub_if_data *sdata,
36323634
static int __ieee80211_csa_finalize(struct ieee80211_sub_if_data *sdata)
36333635
{
36343636
struct ieee80211_local *local = sdata->local;
3635-
u32 changed = 0;
3637+
u64 changed = 0;
36363638
int err;
36373639

36383640
sdata_assert_lock(sdata);
@@ -3729,7 +3731,7 @@ void ieee80211_csa_finalize_work(struct work_struct *work)
37293731

37303732
static int ieee80211_set_csa_beacon(struct ieee80211_sub_if_data *sdata,
37313733
struct cfg80211_csa_settings *params,
3732-
u32 *changed)
3734+
u64 *changed)
37333735
{
37343736
struct ieee80211_csa_settings csa = {};
37353737
int err;
@@ -3776,12 +3778,11 @@ static int ieee80211_set_csa_beacon(struct ieee80211_sub_if_data *sdata,
37763778

37773779
err = ieee80211_assign_beacon(sdata, &sdata->deflink,
37783780
&params->beacon_csa, &csa,
3779-
NULL);
3781+
NULL, changed);
37803782
if (err < 0) {
37813783
ieee80211_free_next_beacon(&sdata->deflink);
37823784
return err;
37833785
}
3784-
*changed |= err;
37853786

37863787
break;
37873788
case NL80211_IFTYPE_ADHOC:
@@ -3813,10 +3814,9 @@ static int ieee80211_set_csa_beacon(struct ieee80211_sub_if_data *sdata,
38133814

38143815
/* see comments in the NL80211_IFTYPE_AP block */
38153816
if (params->count > 1) {
3816-
err = ieee80211_ibss_csa_beacon(sdata, params);
3817+
err = ieee80211_ibss_csa_beacon(sdata, params, changed);
38173818
if (err < 0)
38183819
return err;
3819-
*changed |= err;
38203820
}
38213821

38223822
ieee80211_send_action_csa(sdata, params);
@@ -3841,12 +3841,11 @@ static int ieee80211_set_csa_beacon(struct ieee80211_sub_if_data *sdata,
38413841

38423842
/* see comments in the NL80211_IFTYPE_AP block */
38433843
if (params->count > 1) {
3844-
err = ieee80211_mesh_csa_beacon(sdata, params);
3844+
err = ieee80211_mesh_csa_beacon(sdata, params, changed);
38453845
if (err < 0) {
38463846
ifmsh->csa_role = IEEE80211_MESH_CSA_ROLE_NONE;
38473847
return err;
38483848
}
3849-
*changed |= err;
38503849
}
38513850

38523851
if (ifmsh->csa_role == IEEE80211_MESH_CSA_ROLE_INIT)
@@ -3880,7 +3879,7 @@ __ieee80211_channel_switch(struct wiphy *wiphy, struct net_device *dev,
38803879
struct ieee80211_channel_switch ch_switch;
38813880
struct ieee80211_chanctx_conf *conf;
38823881
struct ieee80211_chanctx *chanctx;
3883-
u32 changed = 0;
3882+
u64 changed = 0;
38843883
int err;
38853884

38863885
sdata_assert_lock(sdata);
@@ -4613,7 +4612,7 @@ static int ieee80211_set_sar_specs(struct wiphy *wiphy,
46134612

46144613
static int
46154614
ieee80211_set_after_color_change_beacon(struct ieee80211_sub_if_data *sdata,
4616-
u32 *changed)
4615+
u64 *changed)
46174616
{
46184617
switch (sdata->vif.type) {
46194618
case NL80211_IFTYPE_AP: {
@@ -4624,13 +4623,12 @@ ieee80211_set_after_color_change_beacon(struct ieee80211_sub_if_data *sdata,
46244623

46254624
ret = ieee80211_assign_beacon(sdata, &sdata->deflink,
46264625
sdata->deflink.u.ap.next_beacon,
4627-
NULL, NULL);
4626+
NULL, NULL, changed);
46284627
ieee80211_free_next_beacon(&sdata->deflink);
46294628

46304629
if (ret < 0)
46314630
return ret;
46324631

4633-
*changed |= ret;
46344632
break;
46354633
}
46364634
default:
@@ -4644,7 +4642,7 @@ ieee80211_set_after_color_change_beacon(struct ieee80211_sub_if_data *sdata,
46444642
static int
46454643
ieee80211_set_color_change_beacon(struct ieee80211_sub_if_data *sdata,
46464644
struct cfg80211_color_change_settings *params,
4647-
u32 *changed)
4645+
u64 *changed)
46484646
{
46494647
struct ieee80211_color_change_settings color_change = {};
46504648
int err;
@@ -4667,12 +4665,11 @@ ieee80211_set_color_change_beacon(struct ieee80211_sub_if_data *sdata,
46674665

46684666
err = ieee80211_assign_beacon(sdata, &sdata->deflink,
46694667
&params->beacon_color_change,
4670-
NULL, &color_change);
4668+
NULL, &color_change, changed);
46714669
if (err < 0) {
46724670
ieee80211_free_next_beacon(&sdata->deflink);
46734671
return err;
46744672
}
4675-
*changed |= err;
46764673
break;
46774674
default:
46784675
return -EOPNOTSUPP;
@@ -4683,7 +4680,7 @@ ieee80211_set_color_change_beacon(struct ieee80211_sub_if_data *sdata,
46834680

46844681
static void
46854682
ieee80211_color_change_bss_config_notify(struct ieee80211_sub_if_data *sdata,
4686-
u8 color, int enable, u32 changed)
4683+
u8 color, int enable, u64 changed)
46874684
{
46884685
sdata->vif.bss_conf.he_bss_color.color = color;
46894686
sdata->vif.bss_conf.he_bss_color.enabled = enable;
@@ -4711,7 +4708,7 @@ ieee80211_color_change_bss_config_notify(struct ieee80211_sub_if_data *sdata,
47114708
static int ieee80211_color_change_finalize(struct ieee80211_sub_if_data *sdata)
47124709
{
47134710
struct ieee80211_local *local = sdata->local;
4714-
u32 changed = 0;
4711+
u64 changed = 0;
47154712
int err;
47164713

47174714
sdata_assert_lock(sdata);
@@ -4808,7 +4805,7 @@ ieee80211_color_change(struct wiphy *wiphy, struct net_device *dev,
48084805
{
48094806
struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
48104807
struct ieee80211_local *local = sdata->local;
4811-
u32 changed = 0;
4808+
u64 changed = 0;
48124809
int err;
48134810

48144811
sdata_assert_lock(sdata);

net/mac80211/chan.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1238,7 +1238,7 @@ ieee80211_link_use_reserved_reassign(struct ieee80211_link_data *link)
12381238
struct ieee80211_vif_chanctx_switch vif_chsw[1] = {};
12391239
struct ieee80211_chanctx *old_ctx, *new_ctx;
12401240
const struct cfg80211_chan_def *chandef;
1241-
u32 changed = 0;
1241+
u64 changed = 0;
12421242
int err;
12431243

12441244
lockdep_assert_held(&local->mtx);
@@ -1634,7 +1634,7 @@ static int ieee80211_vif_use_reserved_switch(struct ieee80211_local *local)
16341634
reserved_chanctx_list) {
16351635
struct ieee80211_sub_if_data *sdata = link->sdata;
16361636
struct ieee80211_bss_conf *link_conf = link->conf;
1637-
u32 changed = 0;
1637+
u64 changed = 0;
16381638

16391639
if (!ieee80211_link_has_in_place_reservation(link))
16401640
continue;

net/mac80211/ibss.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* Copyright 2009, Johannes Berg <[email protected]>
1010
* Copyright 2013-2014 Intel Mobile Communications GmbH
1111
* Copyright(c) 2016 Intel Deutschland GmbH
12-
* Copyright(c) 2018-2022 Intel Corporation
12+
* Copyright(c) 2018-2023 Intel Corporation
1313
*/
1414

1515
#include <linux/delay.h>
@@ -226,7 +226,7 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
226226
struct ieee80211_local *local = sdata->local;
227227
struct ieee80211_mgmt *mgmt;
228228
struct cfg80211_bss *bss;
229-
u32 bss_change;
229+
u64 bss_change;
230230
struct cfg80211_chan_def chandef;
231231
struct ieee80211_channel *chan;
232232
struct beacon_data *presp;
@@ -478,7 +478,8 @@ static void ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
478478
}
479479

480480
int ieee80211_ibss_csa_beacon(struct ieee80211_sub_if_data *sdata,
481-
struct cfg80211_csa_settings *csa_settings)
481+
struct cfg80211_csa_settings *csa_settings,
482+
u64 *changed)
482483
{
483484
struct ieee80211_if_ibss *ifibss = &sdata->u.ibss;
484485
struct beacon_data *presp, *old_presp;
@@ -520,10 +521,11 @@ int ieee80211_ibss_csa_beacon(struct ieee80211_sub_if_data *sdata,
520521
if (old_presp)
521522
kfree_rcu(old_presp, rcu_head);
522523

523-
return BSS_CHANGED_BEACON;
524+
*changed |= BSS_CHANGED_BEACON;
525+
return 0;
524526
}
525527

526-
int ieee80211_ibss_finish_csa(struct ieee80211_sub_if_data *sdata)
528+
int ieee80211_ibss_finish_csa(struct ieee80211_sub_if_data *sdata, u64 *changed)
527529
{
528530
struct ieee80211_if_ibss *ifibss = &sdata->u.ibss;
529531
struct cfg80211_bss *cbss;
@@ -552,7 +554,7 @@ int ieee80211_ibss_finish_csa(struct ieee80211_sub_if_data *sdata)
552554
ifibss->chandef = sdata->deflink.csa_chandef;
553555

554556
/* generate the beacon */
555-
return ieee80211_ibss_csa_beacon(sdata, NULL);
557+
return ieee80211_ibss_csa_beacon(sdata, NULL, changed);
556558
}
557559

558560
void ieee80211_ibss_stop(struct ieee80211_sub_if_data *sdata)
@@ -1754,7 +1756,7 @@ void ieee80211_ibss_notify_scan_completed(struct ieee80211_local *local)
17541756
int ieee80211_ibss_join(struct ieee80211_sub_if_data *sdata,
17551757
struct cfg80211_ibss_params *params)
17561758
{
1757-
u32 changed = 0;
1759+
u64 changed = 0;
17581760
u32 rate_flags;
17591761
struct ieee80211_supported_band *sband;
17601762
enum ieee80211_chanctx_mode chanmode;

0 commit comments

Comments
 (0)