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

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
...@@ -351,10 +351,8 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata, ...@@ -351,10 +351,8 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
bss_change |= BSS_CHANGED_ERP_SLOT; bss_change |= BSS_CHANGED_ERP_SLOT;
/* cf. IEEE 802.11 9.2.12 */ /* cf. IEEE 802.11 9.2.12 */
if (chan->band == NL80211_BAND_2GHZ && have_higher_than_11mbit) sdata->deflink.operating_11g_mode =
sdata->flags |= IEEE80211_SDATA_OPERATING_GMODE; chan->band == NL80211_BAND_2GHZ && have_higher_than_11mbit;
else
sdata->flags &= ~IEEE80211_SDATA_OPERATING_GMODE;
ieee80211_set_wmm_default(&sdata->deflink, true, false); ieee80211_set_wmm_default(&sdata->deflink, true, false);
......
...@@ -726,7 +726,6 @@ struct ieee80211_if_mesh { ...@@ -726,7 +726,6 @@ struct ieee80211_if_mesh {
* enum ieee80211_sub_if_data_flags - virtual interface flags * enum ieee80211_sub_if_data_flags - virtual interface flags
* *
* @IEEE80211_SDATA_ALLMULTI: interface wants all multicast packets * @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 * @IEEE80211_SDATA_DONT_BRIDGE_PACKETS: bridge packets between
* associated stations and deliver multicast frames both * associated stations and deliver multicast frames both
* back to wireless media and to the local net stack. * back to wireless media and to the local net stack.
...@@ -737,7 +736,6 @@ struct ieee80211_if_mesh { ...@@ -737,7 +736,6 @@ struct ieee80211_if_mesh {
*/ */
enum ieee80211_sub_if_data_flags { enum ieee80211_sub_if_data_flags {
IEEE80211_SDATA_ALLMULTI = BIT(0), IEEE80211_SDATA_ALLMULTI = BIT(0),
IEEE80211_SDATA_OPERATING_GMODE = BIT(2),
IEEE80211_SDATA_DONT_BRIDGE_PACKETS = BIT(3), IEEE80211_SDATA_DONT_BRIDGE_PACKETS = BIT(3),
IEEE80211_SDATA_DISCONNECT_RESUME = BIT(4), IEEE80211_SDATA_DISCONNECT_RESUME = BIT(4),
IEEE80211_SDATA_IN_DRIVER = BIT(5), IEEE80211_SDATA_IN_DRIVER = BIT(5),
...@@ -884,6 +882,7 @@ struct ieee80211_link_data_managed { ...@@ -884,6 +882,7 @@ struct ieee80211_link_data_managed {
bool have_beacon; bool have_beacon;
bool tracking_signal_avg; bool tracking_signal_avg;
bool disable_wmm_tracking; bool disable_wmm_tracking;
bool operating_11g_mode;
bool csa_waiting_bcn; bool csa_waiting_bcn;
bool csa_ignored_same_chan; bool csa_ignored_same_chan;
...@@ -946,6 +945,9 @@ struct ieee80211_link_data { ...@@ -946,6 +945,9 @@ struct ieee80211_link_data {
struct work_struct csa_finalize_work; struct work_struct csa_finalize_work;
bool csa_block_tx; /* write-protected by sdata_lock and local->mtx */ bool csa_block_tx; /* write-protected by sdata_lock and local->mtx */
bool operating_11g_mode;
struct cfg80211_chan_def csa_chandef; struct cfg80211_chan_def csa_chandef;
struct work_struct color_change_finalize_work; struct work_struct color_change_finalize_work;
......
...@@ -5811,11 +5811,8 @@ static int ieee80211_prep_connection(struct ieee80211_sub_if_data *sdata, ...@@ -5811,11 +5811,8 @@ static int ieee80211_prep_connection(struct ieee80211_sub_if_data *sdata,
link->conf->basic_rates = basic_rates; link->conf->basic_rates = basic_rates;
/* cf. IEEE 802.11 9.2.12 */ /* cf. IEEE 802.11 9.2.12 */
if (cbss->channel->band == NL80211_BAND_2GHZ && link->operating_11g_mode = sband->band == NL80211_BAND_2GHZ &&
have_higher_than_11mbit) have_higher_than_11mbit;
sdata->flags |= IEEE80211_SDATA_OPERATING_GMODE;
else
sdata->flags &= ~IEEE80211_SDATA_OPERATING_GMODE;
skip_rates: skip_rates:
memcpy(link->u.mgd.bssid, cbss->bssid, ETH_ALEN); memcpy(link->u.mgd.bssid, cbss->bssid, ETH_ALEN);
......
...@@ -181,7 +181,7 @@ int ieee80211_ocb_join(struct ieee80211_sub_if_data *sdata, ...@@ -181,7 +181,7 @@ int ieee80211_ocb_join(struct ieee80211_sub_if_data *sdata,
if (ifocb->joined == true) if (ifocb->joined == true)
return -EINVAL; return -EINVAL;
sdata->flags |= IEEE80211_SDATA_OPERATING_GMODE; sdata->deflink.operating_11g_mode = true;
sdata->deflink.smps_mode = IEEE80211_SMPS_OFF; sdata->deflink.smps_mode = IEEE80211_SMPS_OFF;
sdata->deflink.needed_rx_chains = sdata->local->rx_chains; sdata->deflink.needed_rx_chains = sdata->local->rx_chains;
......
...@@ -148,7 +148,7 @@ static __le16 ieee80211_duration(struct ieee80211_tx_data *tx, ...@@ -148,7 +148,7 @@ static __le16 ieee80211_duration(struct ieee80211_tx_data *tx,
case NL80211_BAND_2GHZ: case NL80211_BAND_2GHZ:
case NL80211_BAND_LC: { case NL80211_BAND_LC: {
u32 flag; u32 flag;
if (tx->sdata->flags & IEEE80211_SDATA_OPERATING_GMODE) if (tx->sdata->deflink.operating_11g_mode)
flag = IEEE80211_RATE_MANDATORY_G; flag = IEEE80211_RATE_MANDATORY_G;
else else
flag = IEEE80211_RATE_MANDATORY_B; flag = IEEE80211_RATE_MANDATORY_B;
......
...@@ -191,7 +191,7 @@ __le16 ieee80211_generic_frame_duration(struct ieee80211_hw *hw, ...@@ -191,7 +191,7 @@ __le16 ieee80211_generic_frame_duration(struct ieee80211_hw *hw,
if (vif) { if (vif) {
sdata = vif_to_sdata(vif); sdata = vif_to_sdata(vif);
short_preamble = sdata->vif.bss_conf.use_short_preamble; short_preamble = sdata->vif.bss_conf.use_short_preamble;
if (sdata->flags & IEEE80211_SDATA_OPERATING_GMODE) if (sdata->deflink.operating_11g_mode)
erp = rate->flags & IEEE80211_RATE_ERP_G; erp = rate->flags & IEEE80211_RATE_ERP_G;
shift = ieee80211_vif_get_shift(vif); shift = ieee80211_vif_get_shift(vif);
} }
...@@ -225,7 +225,7 @@ __le16 ieee80211_rts_duration(struct ieee80211_hw *hw, ...@@ -225,7 +225,7 @@ __le16 ieee80211_rts_duration(struct ieee80211_hw *hw,
if (vif) { if (vif) {
sdata = vif_to_sdata(vif); sdata = vif_to_sdata(vif);
short_preamble = sdata->vif.bss_conf.use_short_preamble; short_preamble = sdata->vif.bss_conf.use_short_preamble;
if (sdata->flags & IEEE80211_SDATA_OPERATING_GMODE) if (sdata->deflink.operating_11g_mode)
erp = rate->flags & IEEE80211_RATE_ERP_G; erp = rate->flags & IEEE80211_RATE_ERP_G;
shift = ieee80211_vif_get_shift(vif); shift = ieee80211_vif_get_shift(vif);
} }
...@@ -268,7 +268,7 @@ __le16 ieee80211_ctstoself_duration(struct ieee80211_hw *hw, ...@@ -268,7 +268,7 @@ __le16 ieee80211_ctstoself_duration(struct ieee80211_hw *hw,
if (vif) { if (vif) {
sdata = vif_to_sdata(vif); sdata = vif_to_sdata(vif);
short_preamble = sdata->vif.bss_conf.use_short_preamble; short_preamble = sdata->vif.bss_conf.use_short_preamble;
if (sdata->flags & IEEE80211_SDATA_OPERATING_GMODE) if (sdata->deflink.operating_11g_mode)
erp = rate->flags & IEEE80211_RATE_ERP_G; erp = rate->flags & IEEE80211_RATE_ERP_G;
shift = ieee80211_vif_get_shift(vif); shift = ieee80211_vif_get_shift(vif);
} }
...@@ -1617,7 +1617,7 @@ void ieee80211_set_wmm_default(struct ieee80211_link_data *link, ...@@ -1617,7 +1617,7 @@ void ieee80211_set_wmm_default(struct ieee80211_link_data *link,
chanctx_conf = rcu_dereference(link->conf->chanctx_conf); chanctx_conf = rcu_dereference(link->conf->chanctx_conf);
use_11b = (chanctx_conf && use_11b = (chanctx_conf &&
chanctx_conf->def.chan->band == NL80211_BAND_2GHZ) && chanctx_conf->def.chan->band == NL80211_BAND_2GHZ) &&
!(sdata->flags & IEEE80211_SDATA_OPERATING_GMODE); !link->operating_11g_mode;
rcu_read_unlock(); rcu_read_unlock();
is_ocb = (sdata->vif.type == NL80211_IFTYPE_OCB); is_ocb = (sdata->vif.type == NL80211_IFTYPE_OCB);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment