Commit 39eac2de authored by Johannes Berg's avatar Johannes Berg
Browse files

wifi: mac80211: move IEEE80211_SDATA_OPERATING_GMODE to link



The flag here is currently per interface, but the way we
set and clear it means it should be per link, so change
it.

Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent de03f8ac
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -351,10 +351,8 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
	bss_change |= BSS_CHANGED_ERP_SLOT;

	/* cf. IEEE 802.11 9.2.12 */
	if (chan->band == NL80211_BAND_2GHZ && have_higher_than_11mbit)
		sdata->flags |= IEEE80211_SDATA_OPERATING_GMODE;
	else
		sdata->flags &= ~IEEE80211_SDATA_OPERATING_GMODE;
	sdata->deflink.operating_11g_mode =
		chan->band == NL80211_BAND_2GHZ && have_higher_than_11mbit;

	ieee80211_set_wmm_default(&sdata->deflink, true, false);

+4 −2
Original line number Diff line number Diff line
@@ -726,7 +726,6 @@ struct ieee80211_if_mesh {
 * enum ieee80211_sub_if_data_flags - virtual interface flags
 *
 * @IEEE80211_SDATA_ALLMULTI: interface wants all multicast packets
 * @IEEE80211_SDATA_OPERATING_GMODE: operating in G-only mode
 * @IEEE80211_SDATA_DONT_BRIDGE_PACKETS: bridge packets between
 *	associated stations and deliver multicast frames both
 *	back to wireless media and to the local net stack.
@@ -737,7 +736,6 @@ struct ieee80211_if_mesh {
 */
enum ieee80211_sub_if_data_flags {
	IEEE80211_SDATA_ALLMULTI		= BIT(0),
	IEEE80211_SDATA_OPERATING_GMODE		= BIT(2),
	IEEE80211_SDATA_DONT_BRIDGE_PACKETS	= BIT(3),
	IEEE80211_SDATA_DISCONNECT_RESUME	= BIT(4),
	IEEE80211_SDATA_IN_DRIVER		= BIT(5),
@@ -884,6 +882,7 @@ struct ieee80211_link_data_managed {
	bool have_beacon;
	bool tracking_signal_avg;
	bool disable_wmm_tracking;
	bool operating_11g_mode;

	bool csa_waiting_bcn;
	bool csa_ignored_same_chan;
@@ -946,6 +945,9 @@ struct ieee80211_link_data {

	struct work_struct csa_finalize_work;
	bool csa_block_tx; /* write-protected by sdata_lock and local->mtx */

	bool operating_11g_mode;

	struct cfg80211_chan_def csa_chandef;

	struct work_struct color_change_finalize_work;
+2 −5
Original line number Diff line number Diff line
@@ -5811,11 +5811,8 @@ static int ieee80211_prep_connection(struct ieee80211_sub_if_data *sdata,
		link->conf->basic_rates = basic_rates;

		/* cf. IEEE 802.11 9.2.12 */
		if (cbss->channel->band == NL80211_BAND_2GHZ &&
		    have_higher_than_11mbit)
			sdata->flags |= IEEE80211_SDATA_OPERATING_GMODE;
		else
			sdata->flags &= ~IEEE80211_SDATA_OPERATING_GMODE;
		link->operating_11g_mode = sband->band == NL80211_BAND_2GHZ &&
					   have_higher_than_11mbit;

skip_rates:
		memcpy(link->u.mgd.bssid, cbss->bssid, ETH_ALEN);
+1 −1
Original line number Diff line number Diff line
@@ -181,7 +181,7 @@ int ieee80211_ocb_join(struct ieee80211_sub_if_data *sdata,
	if (ifocb->joined == true)
		return -EINVAL;

	sdata->flags |= IEEE80211_SDATA_OPERATING_GMODE;
	sdata->deflink.operating_11g_mode = true;
	sdata->deflink.smps_mode = IEEE80211_SMPS_OFF;
	sdata->deflink.needed_rx_chains = sdata->local->rx_chains;

+1 −1
Original line number Diff line number Diff line
@@ -148,7 +148,7 @@ static __le16 ieee80211_duration(struct ieee80211_tx_data *tx,
		case NL80211_BAND_2GHZ:
		case NL80211_BAND_LC: {
			u32 flag;
			if (tx->sdata->flags & IEEE80211_SDATA_OPERATING_GMODE)
			if (tx->sdata->deflink.operating_11g_mode)
				flag = IEEE80211_RATE_MANDATORY_G;
			else
				flag = IEEE80211_RATE_MANDATORY_B;
Loading