Commit 15ddba5f authored by Anjaneyulu's avatar Anjaneyulu Committed by Johannes Berg
Browse files

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: default avatarAnjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
Signed-off-by: default avatarGregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230604120651.10354a05eaf1.If19359262fe2728dd523ea6d7c3aa7dc50940411@changeid


Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 92747f17
Loading
Loading
Loading
Loading
+38 −41
Original line number Diff line number Diff line
@@ -1101,18 +1101,20 @@ ieee80211_copy_rnr_beacon(u8 *pos, struct cfg80211_rnr_elems *dst,
	return offset;
}

static int ieee80211_assign_beacon(struct ieee80211_sub_if_data *sdata,
static int
ieee80211_assign_beacon(struct ieee80211_sub_if_data *sdata,
			struct ieee80211_link_data *link,
			struct cfg80211_beacon_data *params,
			const struct ieee80211_csa_settings *csa,
				   const struct ieee80211_color_change_settings *cca)
			const struct ieee80211_color_change_settings *cca,
			u64 *changed)
{
	struct cfg80211_mbssid_elems *mbssid = NULL;
	struct cfg80211_rnr_elems *rnr = NULL;
	struct beacon_data *new, *old;
	int new_head_len, new_tail_len;
	int size, err;
	u32 changed = BSS_CHANGED_BEACON;
	u64 _changed = BSS_CHANGED_BEACON;
	struct ieee80211_bss_conf *link_conf = link->conf;

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

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

		changed |= BSS_CHANGED_FTM_RESPONDER;
		_changed |= BSS_CHANGED_FTM_RESPONDER;
	}

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

	return changed;
	*changed |= _changed;
	return 0;
}

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,
	if (ieee80211_hw_check(&local->hw, HAS_RATE_CONTROL))
		link_conf->beacon_tx_rate = params->beacon_rate;

	err = ieee80211_assign_beacon(sdata, link, &params->beacon, NULL, NULL);
	err = ieee80211_assign_beacon(sdata, link, &params->beacon, NULL, NULL,
				      &changed);
	if (err < 0)
		goto error;
	changed |= err;

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

	sdata_assert_lock(sdata);

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

	err = ieee80211_assign_beacon(sdata, link, params, NULL, NULL);
	err = ieee80211_assign_beacon(sdata, link, params, NULL, NULL,
				      &changed);
	if (err < 0)
		return err;

	if (params->he_bss_color_valid &&
	    params->he_bss_color.enabled != link_conf->he_bss_color.enabled) {
		link_conf->he_bss_color.enabled = params->he_bss_color.enabled;
		err |= BSS_CHANGED_HE_BSS_COLOR;
		changed |= BSS_CHANGED_HE_BSS_COLOR;
	}

	ieee80211_link_info_change_notify(sdata, link, err);
	ieee80211_link_info_change_notify(sdata, link, changed);
	return 0;
}

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

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

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

static int ieee80211_set_after_csa_beacon(struct ieee80211_sub_if_data *sdata,
					  u32 *changed)
					  u64 *changed)
{
	int err;

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

		err = ieee80211_assign_beacon(sdata, &sdata->deflink,
					      sdata->deflink.u.ap.next_beacon,
					      NULL, NULL);
					      NULL, NULL, changed);
		ieee80211_free_next_beacon(&sdata->deflink);

		if (err < 0)
			return err;
		*changed |= err;
		break;
	case NL80211_IFTYPE_ADHOC:
		err = ieee80211_ibss_finish_csa(sdata);
		err = ieee80211_ibss_finish_csa(sdata, changed);
		if (err < 0)
			return err;
		*changed |= err;
		break;
#ifdef CONFIG_MAC80211_MESH
	case NL80211_IFTYPE_MESH_POINT:
		err = ieee80211_mesh_finish_csa(sdata);
		err = ieee80211_mesh_finish_csa(sdata, changed);
		if (err < 0)
			return err;
		*changed |= err;
		break;
#endif
	default:
@@ -3632,7 +3634,7 @@ static int ieee80211_set_after_csa_beacon(struct ieee80211_sub_if_data *sdata,
static int __ieee80211_csa_finalize(struct ieee80211_sub_if_data *sdata)
{
	struct ieee80211_local *local = sdata->local;
	u32 changed = 0;
	u64 changed = 0;
	int err;

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

static int ieee80211_set_csa_beacon(struct ieee80211_sub_if_data *sdata,
				    struct cfg80211_csa_settings *params,
				    u32 *changed)
				    u64 *changed)
{
	struct ieee80211_csa_settings csa = {};
	int err;
@@ -3776,12 +3778,11 @@ static int ieee80211_set_csa_beacon(struct ieee80211_sub_if_data *sdata,

		err = ieee80211_assign_beacon(sdata, &sdata->deflink,
					      &params->beacon_csa, &csa,
					      NULL);
					      NULL, changed);
		if (err < 0) {
			ieee80211_free_next_beacon(&sdata->deflink);
			return err;
		}
		*changed |= err;

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

		/* see comments in the NL80211_IFTYPE_AP block */
		if (params->count > 1) {
			err = ieee80211_ibss_csa_beacon(sdata, params);
			err = ieee80211_ibss_csa_beacon(sdata, params, changed);
			if (err < 0)
				return err;
			*changed |= err;
		}

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

		/* see comments in the NL80211_IFTYPE_AP block */
		if (params->count > 1) {
			err = ieee80211_mesh_csa_beacon(sdata, params);
			err = ieee80211_mesh_csa_beacon(sdata, params, changed);
			if (err < 0) {
				ifmsh->csa_role = IEEE80211_MESH_CSA_ROLE_NONE;
				return err;
			}
			*changed |= err;
		}

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

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

static int
ieee80211_set_after_color_change_beacon(struct ieee80211_sub_if_data *sdata,
					u32 *changed)
					u64 *changed)
{
	switch (sdata->vif.type) {
	case NL80211_IFTYPE_AP: {
@@ -4624,13 +4623,12 @@ ieee80211_set_after_color_change_beacon(struct ieee80211_sub_if_data *sdata,

		ret = ieee80211_assign_beacon(sdata, &sdata->deflink,
					      sdata->deflink.u.ap.next_beacon,
					      NULL, NULL);
					      NULL, NULL, changed);
		ieee80211_free_next_beacon(&sdata->deflink);

		if (ret < 0)
			return ret;

		*changed |= ret;
		break;
	}
	default:
@@ -4644,7 +4642,7 @@ ieee80211_set_after_color_change_beacon(struct ieee80211_sub_if_data *sdata,
static int
ieee80211_set_color_change_beacon(struct ieee80211_sub_if_data *sdata,
				  struct cfg80211_color_change_settings *params,
				  u32 *changed)
				  u64 *changed)
{
	struct ieee80211_color_change_settings color_change = {};
	int err;
@@ -4667,12 +4665,11 @@ ieee80211_set_color_change_beacon(struct ieee80211_sub_if_data *sdata,

		err = ieee80211_assign_beacon(sdata, &sdata->deflink,
					      &params->beacon_color_change,
					      NULL, &color_change);
					      NULL, &color_change, changed);
		if (err < 0) {
			ieee80211_free_next_beacon(&sdata->deflink);
			return err;
		}
		*changed |= err;
		break;
	default:
		return -EOPNOTSUPP;
@@ -4683,7 +4680,7 @@ ieee80211_set_color_change_beacon(struct ieee80211_sub_if_data *sdata,

static void
ieee80211_color_change_bss_config_notify(struct ieee80211_sub_if_data *sdata,
					 u8 color, int enable, u32 changed)
					 u8 color, int enable, u64 changed)
{
	sdata->vif.bss_conf.he_bss_color.color = color;
	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,
static int ieee80211_color_change_finalize(struct ieee80211_sub_if_data *sdata)
{
	struct ieee80211_local *local = sdata->local;
	u32 changed = 0;
	u64 changed = 0;
	int err;

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

	sdata_assert_lock(sdata);
+2 −2
Original line number Diff line number Diff line
@@ -1238,7 +1238,7 @@ ieee80211_link_use_reserved_reassign(struct ieee80211_link_data *link)
	struct ieee80211_vif_chanctx_switch vif_chsw[1] = {};
	struct ieee80211_chanctx *old_ctx, *new_ctx;
	const struct cfg80211_chan_def *chandef;
	u32 changed = 0;
	u64 changed = 0;
	int err;

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

			if (!ieee80211_link_has_in_place_reservation(link))
				continue;
+9 −7
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@
 * Copyright 2009, Johannes Berg <johannes@sipsolutions.net>
 * Copyright 2013-2014  Intel Mobile Communications GmbH
 * Copyright(c) 2016 Intel Deutschland GmbH
 * Copyright(c) 2018-2022 Intel Corporation
 * Copyright(c) 2018-2023 Intel Corporation
 */

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

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

	return BSS_CHANGED_BEACON;
	*changed |= BSS_CHANGED_BEACON;
	return 0;
}

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

	/* generate the beacon */
	return ieee80211_ibss_csa_beacon(sdata, NULL);
	return ieee80211_ibss_csa_beacon(sdata, NULL, changed);
}

void ieee80211_ibss_stop(struct ieee80211_sub_if_data *sdata)
@@ -1754,7 +1756,7 @@ void ieee80211_ibss_notify_scan_completed(struct ieee80211_local *local)
int ieee80211_ibss_join(struct ieee80211_sub_if_data *sdata,
			struct cfg80211_ibss_params *params)
{
	u32 changed = 0;
	u64 changed = 0;
	u32 rate_flags;
	struct ieee80211_supported_band *sband;
	enum ieee80211_chanctx_mode chanmode;
+9 −5
Original line number Diff line number Diff line
@@ -1827,7 +1827,7 @@ void ieee80211_link_info_change_notify(struct ieee80211_sub_if_data *sdata,
				       struct ieee80211_link_data *link,
				       u64 changed);
void ieee80211_configure_filter(struct ieee80211_local *local);
u32 ieee80211_reset_erp_info(struct ieee80211_sub_if_data *sdata);
u64 ieee80211_reset_erp_info(struct ieee80211_sub_if_data *sdata);

u64 ieee80211_mgmt_tx_cookie(struct ieee80211_local *local);
int ieee80211_attach_ack_skb(struct ieee80211_local *local, struct sk_buff *skb,
@@ -1887,8 +1887,10 @@ void ieee80211_ibss_work(struct ieee80211_sub_if_data *sdata);
void ieee80211_ibss_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata,
				   struct sk_buff *skb);
int ieee80211_ibss_csa_beacon(struct ieee80211_sub_if_data *sdata,
			      struct cfg80211_csa_settings *csa_settings);
int ieee80211_ibss_finish_csa(struct ieee80211_sub_if_data *sdata);
			      struct cfg80211_csa_settings *csa_settings,
			      u64 *changed);
int ieee80211_ibss_finish_csa(struct ieee80211_sub_if_data *sdata,
			      u64 *changed);
void ieee80211_ibss_stop(struct ieee80211_sub_if_data *sdata);

/* OCB code */
@@ -1905,8 +1907,10 @@ void ieee80211_mesh_work(struct ieee80211_sub_if_data *sdata);
void ieee80211_mesh_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata,
				   struct sk_buff *skb);
int ieee80211_mesh_csa_beacon(struct ieee80211_sub_if_data *sdata,
			      struct cfg80211_csa_settings *csa_settings);
int ieee80211_mesh_finish_csa(struct ieee80211_sub_if_data *sdata);
			      struct cfg80211_csa_settings *csa_settings,
			      u64 *changed);
int ieee80211_mesh_finish_csa(struct ieee80211_sub_if_data *sdata,
			      u64 *changed);

/* scan/BSS handling */
void ieee80211_scan_work(struct work_struct *work);
+2 −2
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@
 * Copyright 2008, Johannes Berg <johannes@sipsolutions.net>
 * Copyright 2013-2014  Intel Mobile Communications GmbH
 * Copyright (c) 2016        Intel Deutschland GmbH
 * Copyright (C) 2018-2022 Intel Corporation
 * Copyright (C) 2018-2023 Intel Corporation
 */
#include <linux/slab.h>
#include <linux/kernel.h>
@@ -1221,7 +1221,7 @@ int ieee80211_do_open(struct wireless_dev *wdev, bool coming_up)
	struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev);
	struct net_device *dev = wdev->netdev;
	struct ieee80211_local *local = sdata->local;
	u32 changed = 0;
	u64 changed = 0;
	int res;
	u32 hw_reconf_flags = 0;

Loading