aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-11-09 05:39:59 -0500
committerJohannes Berg <johannes.berg@intel.com>2012-11-26 06:42:59 -0500
commit4bf88530be971bf95a7830ca61b4120980bf4347 (patch)
tree405d426806cb76551d09f427dafeeee79dac0dea /drivers
parent3d9d1d6656a73ea8407734cfb00b81d14ef62d4b (diff)
mac80211: convert to channel definition struct
Convert mac80211 (and where necessary, some drivers a little bit) to the new channel definition struct. This will allow extending mac80211 for VHT, which is currently restricted to channel contexts since there are no drivers using that which makes it easier. As I also don't care about VHT for drivers not using the channel context API, I won't convert the previous API to VHT support. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/mac80211_hwsim.c33
-rw-r--r--drivers/net/wireless/ti/wlcore/main.c9
2 files changed, 24 insertions, 18 deletions
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index b0338543547b..6be3faeaa59a 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -681,7 +681,7 @@ static void mac80211_hwsim_tx_iter(void *_data, u8 *addr,
681 return; 681 return;
682 682
683 if (!hwsim_chans_compat(data->channel, 683 if (!hwsim_chans_compat(data->channel,
684 rcu_dereference(vif->chanctx_conf)->channel)) 684 rcu_dereference(vif->chanctx_conf)->def.chan))
685 return; 685 return;
686 686
687 data->receive = true; 687 data->receive = true;
@@ -832,7 +832,7 @@ static void mac80211_hwsim_tx(struct ieee80211_hw *hw,
832 } else { 832 } else {
833 chanctx_conf = rcu_dereference(txi->control.vif->chanctx_conf); 833 chanctx_conf = rcu_dereference(txi->control.vif->chanctx_conf);
834 if (chanctx_conf) 834 if (chanctx_conf)
835 channel = chanctx_conf->channel; 835 channel = chanctx_conf->def.chan;
836 else 836 else
837 channel = NULL; 837 channel = NULL;
838 } 838 }
@@ -977,7 +977,7 @@ static void mac80211_hwsim_beacon_tx(void *arg, u8 *mac,
977 return; 977 return;
978 978
979 mac80211_hwsim_tx_frame(hw, skb, 979 mac80211_hwsim_tx_frame(hw, skb,
980 rcu_dereference(vif->chanctx_conf)->channel); 980 rcu_dereference(vif->chanctx_conf)->def.chan);
981} 981}
982 982
983 983
@@ -1107,9 +1107,8 @@ static void mac80211_hwsim_bss_info_changed(struct ieee80211_hw *hw,
1107 } 1107 }
1108 1108
1109 if (changed & BSS_CHANGED_HT) { 1109 if (changed & BSS_CHANGED_HT) {
1110 wiphy_debug(hw->wiphy, " HT: op_mode=0x%x, chantype=%s\n", 1110 wiphy_debug(hw->wiphy, " HT: op_mode=0x%x\n",
1111 info->ht_operation_mode, 1111 info->ht_operation_mode);
1112 hwsim_chantypes[info->channel_type]);
1113 } 1112 }
1114 1113
1115 if (changed & BSS_CHANGED_BASIC_RATES) { 1114 if (changed & BSS_CHANGED_BASIC_RATES) {
@@ -1497,16 +1496,20 @@ static int mac80211_hwsim_add_chanctx(struct ieee80211_hw *hw,
1497 struct ieee80211_chanctx_conf *ctx) 1496 struct ieee80211_chanctx_conf *ctx)
1498{ 1497{
1499 hwsim_set_chanctx_magic(ctx); 1498 hwsim_set_chanctx_magic(ctx);
1500 wiphy_debug(hw->wiphy, "add channel context %d MHz/%d\n", 1499 wiphy_debug(hw->wiphy,
1501 ctx->channel->center_freq, ctx->channel_type); 1500 "add channel context control: %d MHz/width: %d/cfreqs:%d/%d MHz\n",
1501 ctx->def.chan->center_freq, ctx->def.width,
1502 ctx->def.center_freq1, ctx->def.center_freq2);
1502 return 0; 1503 return 0;
1503} 1504}
1504 1505
1505static void mac80211_hwsim_remove_chanctx(struct ieee80211_hw *hw, 1506static void mac80211_hwsim_remove_chanctx(struct ieee80211_hw *hw,
1506 struct ieee80211_chanctx_conf *ctx) 1507 struct ieee80211_chanctx_conf *ctx)
1507{ 1508{
1508 wiphy_debug(hw->wiphy, "remove channel context %d MHz/%d\n", 1509 wiphy_debug(hw->wiphy,
1509 ctx->channel->center_freq, ctx->channel_type); 1510 "remove channel context control: %d MHz/width: %d/cfreqs:%d/%d MHz\n",
1511 ctx->def.chan->center_freq, ctx->def.width,
1512 ctx->def.center_freq1, ctx->def.center_freq2);
1510 hwsim_check_chanctx_magic(ctx); 1513 hwsim_check_chanctx_magic(ctx);
1511 hwsim_clear_chanctx_magic(ctx); 1514 hwsim_clear_chanctx_magic(ctx);
1512} 1515}
@@ -1516,8 +1519,10 @@ static void mac80211_hwsim_change_chanctx(struct ieee80211_hw *hw,
1516 u32 changed) 1519 u32 changed)
1517{ 1520{
1518 hwsim_check_chanctx_magic(ctx); 1521 hwsim_check_chanctx_magic(ctx);
1519 wiphy_debug(hw->wiphy, "change channel context %#x (%d MHz/%d)\n", 1522 wiphy_debug(hw->wiphy,
1520 changed, ctx->channel->center_freq, ctx->channel_type); 1523 "change channel context control: %d MHz/width: %d/cfreqs:%d/%d MHz\n",
1524 ctx->def.chan->center_freq, ctx->def.width,
1525 ctx->def.center_freq1, ctx->def.center_freq2);
1521} 1526}
1522 1527
1523static int mac80211_hwsim_assign_vif_chanctx(struct ieee80211_hw *hw, 1528static int mac80211_hwsim_assign_vif_chanctx(struct ieee80211_hw *hw,
@@ -1639,7 +1644,7 @@ static void hwsim_send_ps_poll(void *dat, u8 *mac, struct ieee80211_vif *vif)
1639 1644
1640 rcu_read_lock(); 1645 rcu_read_lock();
1641 mac80211_hwsim_tx_frame(data->hw, skb, 1646 mac80211_hwsim_tx_frame(data->hw, skb,
1642 rcu_dereference(vif->chanctx_conf)->channel); 1647 rcu_dereference(vif->chanctx_conf)->def.chan);
1643 rcu_read_unlock(); 1648 rcu_read_unlock();
1644} 1649}
1645 1650
@@ -1671,7 +1676,7 @@ static void hwsim_send_nullfunc(struct mac80211_hwsim_data *data, u8 *mac,
1671 1676
1672 rcu_read_lock(); 1677 rcu_read_lock();
1673 mac80211_hwsim_tx_frame(data->hw, skb, 1678 mac80211_hwsim_tx_frame(data->hw, skb,
1674 rcu_dereference(vif->chanctx_conf)->channel); 1679 rcu_dereference(vif->chanctx_conf)->def.chan);
1675 rcu_read_unlock(); 1680 rcu_read_unlock();
1676} 1681}
1677 1682
diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c
index 380cf1ff6cd1..4f1a05b92d2d 100644
--- a/drivers/net/wireless/ti/wlcore/main.c
+++ b/drivers/net/wireless/ti/wlcore/main.c
@@ -3791,7 +3791,7 @@ static void wl1271_bss_info_changed_ap(struct wl1271 *wl,
3791 3791
3792 /* Handle HT information change */ 3792 /* Handle HT information change */
3793 if ((changed & BSS_CHANGED_HT) && 3793 if ((changed & BSS_CHANGED_HT) &&
3794 (bss_conf->channel_type != NL80211_CHAN_NO_HT)) { 3794 (bss_conf->chandef.width != NL80211_CHAN_WIDTH_20_NOHT)) {
3795 ret = wl1271_acx_set_ht_information(wl, wlvif, 3795 ret = wl1271_acx_set_ht_information(wl, wlvif,
3796 bss_conf->ht_operation_mode); 3796 bss_conf->ht_operation_mode);
3797 if (ret < 0) { 3797 if (ret < 0) {
@@ -3905,7 +3905,8 @@ sta_not_found:
3905 u32 rates; 3905 u32 rates;
3906 int ieoffset; 3906 int ieoffset;
3907 wlvif->aid = bss_conf->aid; 3907 wlvif->aid = bss_conf->aid;
3908 wlvif->channel_type = bss_conf->channel_type; 3908 wlvif->channel_type =
3909 cfg80211_get_chandef_type(&bss_conf->chandef);
3909 wlvif->beacon_int = bss_conf->beacon_int; 3910 wlvif->beacon_int = bss_conf->beacon_int;
3910 do_join = true; 3911 do_join = true;
3911 set_assoc = true; 3912 set_assoc = true;
@@ -4071,7 +4072,7 @@ sta_not_found:
4071 /* Handle new association with HT. Do this after join. */ 4072 /* Handle new association with HT. Do this after join. */
4072 if (sta_exists) { 4073 if (sta_exists) {
4073 if ((changed & BSS_CHANGED_HT) && 4074 if ((changed & BSS_CHANGED_HT) &&
4074 (bss_conf->channel_type != NL80211_CHAN_NO_HT)) { 4075 (bss_conf->chandef.width != NL80211_CHAN_WIDTH_20_NOHT)) {
4075 ret = wl1271_acx_set_ht_capabilities(wl, 4076 ret = wl1271_acx_set_ht_capabilities(wl,
4076 &sta_ht_cap, 4077 &sta_ht_cap,
4077 true, 4078 true,
@@ -4098,7 +4099,7 @@ sta_not_found:
4098 4099
4099 /* Handle HT information change. Done after join. */ 4100 /* Handle HT information change. Done after join. */
4100 if ((changed & BSS_CHANGED_HT) && 4101 if ((changed & BSS_CHANGED_HT) &&
4101 (bss_conf->channel_type != NL80211_CHAN_NO_HT)) { 4102 (bss_conf->chandef.width != NL80211_CHAN_WIDTH_20_NOHT)) {
4102 ret = wl1271_acx_set_ht_information(wl, wlvif, 4103 ret = wl1271_acx_set_ht_information(wl, wlvif,
4103 bss_conf->ht_operation_mode); 4104 bss_conf->ht_operation_mode);
4104 if (ret < 0) { 4105 if (ret < 0) {