linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Question on why ieee80211_prep_channel clears the IEEE80211_CONN_DISABLE_160MHZ flag.
@ 2023-03-30 23:55 Ben Greear
  2023-04-24 16:58 ` Johannes Berg
  0 siblings, 1 reply; 4+ messages in thread
From: Ben Greear @ 2023-03-30 23:55 UTC (permalink / raw)
  To: linux-wireless, Johannes Berg

Hello,

I'm trying to have supplicant tell the STA to not allow 160Mhz.

In the method below, in my setup, *conn_flags has IEEE80211_CONN_DISABLE_160MHZ
set when entering the method, but this method clears that and some related flags.
The clear logic dates back to 2012, effectively, but I guess in 5.19 kernel era somehow my hacks worked.

So question is, should it still be clearing the flags here?  I can add more
hack-around logic, but possibly those lines should just be removed for everyone?

static int ieee80211_prep_channel(struct ieee80211_sub_if_data *sdata,
				  struct ieee80211_link_data *link,
				  struct cfg80211_bss *cbss,
				  ieee80211_conn_flags_t *conn_flags)
{
	struct ieee80211_local *local = sdata->local;
	const struct ieee80211_ht_cap *ht_cap = NULL;
	const struct ieee80211_ht_operation *ht_oper = NULL;
	const struct ieee80211_vht_operation *vht_oper = NULL;
	const struct ieee80211_he_operation *he_oper = NULL;
	const struct ieee80211_eht_operation *eht_oper = NULL;
	const struct ieee80211_s1g_oper_ie *s1g_oper = NULL;
	struct ieee80211_supported_band *sband;
	struct cfg80211_chan_def chandef;
	bool is_6ghz = cbss->channel->band == NL80211_BAND_6GHZ;
	bool is_5ghz = cbss->channel->band == NL80211_BAND_5GHZ;
	struct ieee80211_bss *bss = (void *)cbss->priv;
	struct ieee80211_elems_parse_params parse_params = {
		.bss = cbss,
		.link_id = -1,
		.from_ap = true,
	};
	struct ieee802_11_elems *elems;
	const struct cfg80211_bss_ies *ies;
	int ret;
	u32 i;

	pr_info("prep-channel-0, CONN_DISABLE_160MHZ: %d\n",
		!!(*conn_flags & IEEE80211_CONN_DISABLE_160MHZ));

	rcu_read_lock();

	ies = rcu_dereference(cbss->ies);
	parse_params.start = ies->data;
	parse_params.len = ies->len;
	elems = ieee802_11_parse_elems_full(&parse_params);
	if (!elems) {
		rcu_read_unlock();
		return -ENOMEM;
	}

	sband = local->hw.wiphy->bands[cbss->channel->band];

	*conn_flags &= ~(IEEE80211_CONN_DISABLE_40MHZ |
			 IEEE80211_CONN_DISABLE_80P80MHZ |
			 IEEE80211_CONN_DISABLE_160MHZ);

Thanks,
Ben

-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-04-25 18:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-30 23:55 Question on why ieee80211_prep_channel clears the IEEE80211_CONN_DISABLE_160MHZ flag Ben Greear
2023-04-24 16:58 ` Johannes Berg
2023-04-24 19:58   ` Ben Greear
2023-04-25 18:32     ` Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).