aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2013-03-25 13:29:27 -0400
committerJohannes Berg <johannes.berg@intel.com>2013-04-16 09:29:44 -0400
commit85220d71bf3ca1ba9129e0744247ae5f61bec559 (patch)
tree5bdabc71bc5da27ee71fb1272b86809ac2f95b0d /drivers/net/wireless
parentb4f286a1c0ad0b84c2d502b354d4d98d5a86c64b (diff)
mac80211: support secondary channel offset in CSA
Add support for the secondary channel offset IE in channel switch announcements. This is necessary for proper handling of CSA on HT access points. For this to work it is also necessary to convert everything here to use chandef structs instead of just channels. The driver updates aren't really correct though. In particular, the TI wl18xx driver update can't possibly be right since it just ignores the new channel width for lack of firmware API. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/iwlegacy/4965-mac.c32
-rw-r--r--drivers/net/wireless/iwlegacy/4965.c2
-rw-r--r--drivers/net/wireless/iwlwifi/dvm/devices.c10
-rw-r--r--drivers/net/wireless/iwlwifi/dvm/mac80211.c20
-rw-r--r--drivers/net/wireless/iwlwifi/dvm/rxon.c2
-rw-r--r--drivers/net/wireless/ti/wl12xx/cmd.c2
-rw-r--r--drivers/net/wireless/ti/wl18xx/cmd.c6
7 files changed, 42 insertions, 32 deletions
diff --git a/drivers/net/wireless/iwlegacy/4965-mac.c b/drivers/net/wireless/iwlegacy/4965-mac.c
index c092fcbbe965..cb5882ea5f3a 100644
--- a/drivers/net/wireless/iwlegacy/4965-mac.c
+++ b/drivers/net/wireless/iwlegacy/4965-mac.c
@@ -6057,7 +6057,7 @@ il4965_mac_channel_switch(struct ieee80211_hw *hw,
6057 struct il_priv *il = hw->priv; 6057 struct il_priv *il = hw->priv;
6058 const struct il_channel_info *ch_info; 6058 const struct il_channel_info *ch_info;
6059 struct ieee80211_conf *conf = &hw->conf; 6059 struct ieee80211_conf *conf = &hw->conf;
6060 struct ieee80211_channel *channel = ch_switch->channel; 6060 struct ieee80211_channel *channel = ch_switch->chandef.chan;
6061 struct il_ht_config *ht_conf = &il->current_ht_config; 6061 struct il_ht_config *ht_conf = &il->current_ht_config;
6062 u16 ch; 6062 u16 ch;
6063 6063
@@ -6094,23 +6094,21 @@ il4965_mac_channel_switch(struct ieee80211_hw *hw,
6094 il->current_ht_config.smps = conf->smps_mode; 6094 il->current_ht_config.smps = conf->smps_mode;
6095 6095
6096 /* Configure HT40 channels */ 6096 /* Configure HT40 channels */
6097 il->ht.enabled = conf_is_ht(conf); 6097 switch (cfg80211_get_chandef_type(&ch_switch->chandef)) {
6098 if (il->ht.enabled) { 6098 case NL80211_CHAN_NO_HT:
6099 if (conf_is_ht40_minus(conf)) { 6099 case NL80211_CHAN_HT20:
6100 il->ht.extension_chan_offset =
6101 IEEE80211_HT_PARAM_CHA_SEC_BELOW;
6102 il->ht.is_40mhz = true;
6103 } else if (conf_is_ht40_plus(conf)) {
6104 il->ht.extension_chan_offset =
6105 IEEE80211_HT_PARAM_CHA_SEC_ABOVE;
6106 il->ht.is_40mhz = true;
6107 } else {
6108 il->ht.extension_chan_offset =
6109 IEEE80211_HT_PARAM_CHA_SEC_NONE;
6110 il->ht.is_40mhz = false;
6111 }
6112 } else
6113 il->ht.is_40mhz = false; 6100 il->ht.is_40mhz = false;
6101 il->ht.extension_chan_offset = IEEE80211_HT_PARAM_CHA_SEC_NONE;
6102 break;
6103 case NL80211_CHAN_HT40MINUS:
6104 il->ht.extension_chan_offset = IEEE80211_HT_PARAM_CHA_SEC_BELOW;
6105 il->ht.is_40mhz = true;
6106 break;
6107 case NL80211_CHAN_HT40PLUS:
6108 il->ht.extension_chan_offset = IEEE80211_HT_PARAM_CHA_SEC_ABOVE;
6109 il->ht.is_40mhz = true;
6110 break;
6111 }
6114 6112
6115 if ((le16_to_cpu(il->staging.channel) != ch)) 6113 if ((le16_to_cpu(il->staging.channel) != ch))
6116 il->staging.flags = 0; 6114 il->staging.flags = 0;
diff --git a/drivers/net/wireless/iwlegacy/4965.c b/drivers/net/wireless/iwlegacy/4965.c
index 91eb2d07fdb8..777a578294bd 100644
--- a/drivers/net/wireless/iwlegacy/4965.c
+++ b/drivers/net/wireless/iwlegacy/4965.c
@@ -1493,7 +1493,7 @@ il4965_hw_channel_switch(struct il_priv *il,
1493 1493
1494 cmd.band = band; 1494 cmd.band = band;
1495 cmd.expect_beacon = 0; 1495 cmd.expect_beacon = 0;
1496 ch = ch_switch->channel->hw_value; 1496 ch = ch_switch->chandef.chan->hw_value;
1497 cmd.channel = cpu_to_le16(ch); 1497 cmd.channel = cpu_to_le16(ch);
1498 cmd.rxon_flags = il->staging.flags; 1498 cmd.rxon_flags = il->staging.flags;
1499 cmd.rxon_filter_flags = il->staging.filter_flags; 1499 cmd.rxon_filter_flags = il->staging.filter_flags;
diff --git a/drivers/net/wireless/iwlwifi/dvm/devices.c b/drivers/net/wireless/iwlwifi/dvm/devices.c
index 15cca2ef9294..c48907c8ab43 100644
--- a/drivers/net/wireless/iwlwifi/dvm/devices.c
+++ b/drivers/net/wireless/iwlwifi/dvm/devices.c
@@ -379,7 +379,7 @@ static int iwl5000_hw_channel_switch(struct iwl_priv *priv,
379 }; 379 };
380 380
381 cmd.band = priv->band == IEEE80211_BAND_2GHZ; 381 cmd.band = priv->band == IEEE80211_BAND_2GHZ;
382 ch = ch_switch->channel->hw_value; 382 ch = ch_switch->chandef.chan->hw_value;
383 IWL_DEBUG_11H(priv, "channel switch from %d to %d\n", 383 IWL_DEBUG_11H(priv, "channel switch from %d to %d\n",
384 ctx->active.channel, ch); 384 ctx->active.channel, ch);
385 cmd.channel = cpu_to_le16(ch); 385 cmd.channel = cpu_to_le16(ch);
@@ -414,7 +414,8 @@ static int iwl5000_hw_channel_switch(struct iwl_priv *priv,
414 } 414 }
415 IWL_DEBUG_11H(priv, "uCode time for the switch is 0x%x\n", 415 IWL_DEBUG_11H(priv, "uCode time for the switch is 0x%x\n",
416 cmd.switch_time); 416 cmd.switch_time);
417 cmd.expect_beacon = ch_switch->channel->flags & IEEE80211_CHAN_RADAR; 417 cmd.expect_beacon =
418 ch_switch->chandef.chan->flags & IEEE80211_CHAN_RADAR;
418 419
419 return iwl_dvm_send_cmd(priv, &hcmd); 420 return iwl_dvm_send_cmd(priv, &hcmd);
420} 421}
@@ -540,7 +541,7 @@ static int iwl6000_hw_channel_switch(struct iwl_priv *priv,
540 hcmd.data[0] = cmd; 541 hcmd.data[0] = cmd;
541 542
542 cmd->band = priv->band == IEEE80211_BAND_2GHZ; 543 cmd->band = priv->band == IEEE80211_BAND_2GHZ;
543 ch = ch_switch->channel->hw_value; 544 ch = ch_switch->chandef.chan->hw_value;
544 IWL_DEBUG_11H(priv, "channel switch from %u to %u\n", 545 IWL_DEBUG_11H(priv, "channel switch from %u to %u\n",
545 ctx->active.channel, ch); 546 ctx->active.channel, ch);
546 cmd->channel = cpu_to_le16(ch); 547 cmd->channel = cpu_to_le16(ch);
@@ -575,7 +576,8 @@ static int iwl6000_hw_channel_switch(struct iwl_priv *priv,
575 } 576 }
576 IWL_DEBUG_11H(priv, "uCode time for the switch is 0x%x\n", 577 IWL_DEBUG_11H(priv, "uCode time for the switch is 0x%x\n",
577 cmd->switch_time); 578 cmd->switch_time);
578 cmd->expect_beacon = ch_switch->channel->flags & IEEE80211_CHAN_RADAR; 579 cmd->expect_beacon =
580 ch_switch->chandef.chan->flags & IEEE80211_CHAN_RADAR;
579 581
580 err = iwl_dvm_send_cmd(priv, &hcmd); 582 err = iwl_dvm_send_cmd(priv, &hcmd);
581 kfree(cmd); 583 kfree(cmd);
diff --git a/drivers/net/wireless/iwlwifi/dvm/mac80211.c b/drivers/net/wireless/iwlwifi/dvm/mac80211.c
index a7294fa4d7e5..2dc101fe0d24 100644
--- a/drivers/net/wireless/iwlwifi/dvm/mac80211.c
+++ b/drivers/net/wireless/iwlwifi/dvm/mac80211.c
@@ -967,7 +967,7 @@ static void iwlagn_mac_channel_switch(struct ieee80211_hw *hw,
967{ 967{
968 struct iwl_priv *priv = IWL_MAC80211_GET_DVM(hw); 968 struct iwl_priv *priv = IWL_MAC80211_GET_DVM(hw);
969 struct ieee80211_conf *conf = &hw->conf; 969 struct ieee80211_conf *conf = &hw->conf;
970 struct ieee80211_channel *channel = ch_switch->channel; 970 struct ieee80211_channel *channel = ch_switch->chandef.chan;
971 struct iwl_ht_config *ht_conf = &priv->current_ht_config; 971 struct iwl_ht_config *ht_conf = &priv->current_ht_config;
972 /* 972 /*
973 * MULTI-FIXME 973 * MULTI-FIXME
@@ -1005,11 +1005,21 @@ static void iwlagn_mac_channel_switch(struct ieee80211_hw *hw,
1005 priv->current_ht_config.smps = conf->smps_mode; 1005 priv->current_ht_config.smps = conf->smps_mode;
1006 1006
1007 /* Configure HT40 channels */ 1007 /* Configure HT40 channels */
1008 ctx->ht.enabled = conf_is_ht(conf); 1008 switch (cfg80211_get_chandef_type(&ch_switch->chandef)) {
1009 if (ctx->ht.enabled) 1009 case NL80211_CHAN_NO_HT:
1010 iwlagn_config_ht40(conf, ctx); 1010 case NL80211_CHAN_HT20:
1011 else
1012 ctx->ht.is_40mhz = false; 1011 ctx->ht.is_40mhz = false;
1012 ctx->ht.extension_chan_offset = IEEE80211_HT_PARAM_CHA_SEC_NONE;
1013 break;
1014 case NL80211_CHAN_HT40MINUS:
1015 ctx->ht.extension_chan_offset = IEEE80211_HT_PARAM_CHA_SEC_BELOW;
1016 ctx->ht.is_40mhz = true;
1017 break;
1018 case NL80211_CHAN_HT40PLUS:
1019 ctx->ht.extension_chan_offset = IEEE80211_HT_PARAM_CHA_SEC_ABOVE;
1020 ctx->ht.is_40mhz = true;
1021 break;
1022 }
1013 1023
1014 if ((le16_to_cpu(ctx->staging.channel) != ch)) 1024 if ((le16_to_cpu(ctx->staging.channel) != ch))
1015 ctx->staging.flags = 0; 1025 ctx->staging.flags = 0;
diff --git a/drivers/net/wireless/iwlwifi/dvm/rxon.c b/drivers/net/wireless/iwlwifi/dvm/rxon.c
index 085c589e7149..acbb50b5f1e8 100644
--- a/drivers/net/wireless/iwlwifi/dvm/rxon.c
+++ b/drivers/net/wireless/iwlwifi/dvm/rxon.c
@@ -1160,7 +1160,7 @@ int iwlagn_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx)
1160} 1160}
1161 1161
1162void iwlagn_config_ht40(struct ieee80211_conf *conf, 1162void iwlagn_config_ht40(struct ieee80211_conf *conf,
1163 struct iwl_rxon_context *ctx) 1163 struct iwl_rxon_context *ctx)
1164{ 1164{
1165 if (conf_is_ht40_minus(conf)) { 1165 if (conf_is_ht40_minus(conf)) {
1166 ctx->ht.extension_chan_offset = 1166 ctx->ht.extension_chan_offset =
diff --git a/drivers/net/wireless/ti/wl12xx/cmd.c b/drivers/net/wireless/ti/wl12xx/cmd.c
index 7dc9f965037d..7485dbae8c4b 100644
--- a/drivers/net/wireless/ti/wl12xx/cmd.c
+++ b/drivers/net/wireless/ti/wl12xx/cmd.c
@@ -301,7 +301,7 @@ int wl12xx_cmd_channel_switch(struct wl1271 *wl,
301 } 301 }
302 302
303 cmd->role_id = wlvif->role_id; 303 cmd->role_id = wlvif->role_id;
304 cmd->channel = ch_switch->channel->hw_value; 304 cmd->channel = ch_switch->chandef.chan->hw_value;
305 cmd->switch_time = ch_switch->count; 305 cmd->switch_time = ch_switch->count;
306 cmd->stop_tx = ch_switch->block_tx; 306 cmd->stop_tx = ch_switch->block_tx;
307 307
diff --git a/drivers/net/wireless/ti/wl18xx/cmd.c b/drivers/net/wireless/ti/wl18xx/cmd.c
index 1d1f6cc7a50a..7649c75cd68d 100644
--- a/drivers/net/wireless/ti/wl18xx/cmd.c
+++ b/drivers/net/wireless/ti/wl18xx/cmd.c
@@ -42,11 +42,11 @@ int wl18xx_cmd_channel_switch(struct wl1271 *wl,
42 } 42 }
43 43
44 cmd->role_id = wlvif->role_id; 44 cmd->role_id = wlvif->role_id;
45 cmd->channel = ch_switch->channel->hw_value; 45 cmd->channel = ch_switch->chandef.chan->hw_value;
46 cmd->switch_time = ch_switch->count; 46 cmd->switch_time = ch_switch->count;
47 cmd->stop_tx = ch_switch->block_tx; 47 cmd->stop_tx = ch_switch->block_tx;
48 48
49 switch (ch_switch->channel->band) { 49 switch (ch_switch->chandef.chan->band) {
50 case IEEE80211_BAND_2GHZ: 50 case IEEE80211_BAND_2GHZ:
51 cmd->band = WLCORE_BAND_2_4GHZ; 51 cmd->band = WLCORE_BAND_2_4GHZ;
52 break; 52 break;
@@ -55,7 +55,7 @@ int wl18xx_cmd_channel_switch(struct wl1271 *wl,
55 break; 55 break;
56 default: 56 default:
57 wl1271_error("invalid channel switch band: %d", 57 wl1271_error("invalid channel switch band: %d",
58 ch_switch->channel->band); 58 ch_switch->chandef.chan->band);
59 ret = -EINVAL; 59 ret = -EINVAL;
60 goto out_free; 60 goto out_free;
61 } 61 }