diff options
author | Johannes Berg <johannes.berg@intel.com> | 2012-11-09 05:39:59 -0500 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2012-11-26 06:42:59 -0500 |
commit | 4bf88530be971bf95a7830ca61b4120980bf4347 (patch) | |
tree | 405d426806cb76551d09f427dafeeee79dac0dea /net/mac80211/mesh_plink.c | |
parent | 3d9d1d6656a73ea8407734cfb00b81d14ef62d4b (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 'net/mac80211/mesh_plink.c')
-rw-r--r-- | net/mac80211/mesh_plink.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c index 7a47f4063d0a..ca52dfdd5375 100644 --- a/net/mac80211/mesh_plink.c +++ b/net/mac80211/mesh_plink.c | |||
@@ -111,7 +111,7 @@ static u32 mesh_set_ht_prot_mode(struct ieee80211_sub_if_data *sdata) | |||
111 | u16 ht_opmode; | 111 | u16 ht_opmode; |
112 | bool non_ht_sta = false, ht20_sta = false; | 112 | bool non_ht_sta = false, ht20_sta = false; |
113 | 113 | ||
114 | if (sdata->vif.bss_conf.channel_type == NL80211_CHAN_NO_HT) | 114 | if (sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_20_NOHT) |
115 | return 0; | 115 | return 0; |
116 | 116 | ||
117 | rcu_read_lock(); | 117 | rcu_read_lock(); |
@@ -120,14 +120,14 @@ static u32 mesh_set_ht_prot_mode(struct ieee80211_sub_if_data *sdata) | |||
120 | sta->plink_state != NL80211_PLINK_ESTAB) | 120 | sta->plink_state != NL80211_PLINK_ESTAB) |
121 | continue; | 121 | continue; |
122 | 122 | ||
123 | switch (sta->ch_type) { | 123 | switch (sta->ch_width) { |
124 | case NL80211_CHAN_NO_HT: | 124 | case NL80211_CHAN_WIDTH_20_NOHT: |
125 | mpl_dbg(sdata, | 125 | mpl_dbg(sdata, |
126 | "mesh_plink %pM: nonHT sta (%pM) is present\n", | 126 | "mesh_plink %pM: nonHT sta (%pM) is present\n", |
127 | sdata->vif.addr, sta->sta.addr); | 127 | sdata->vif.addr, sta->sta.addr); |
128 | non_ht_sta = true; | 128 | non_ht_sta = true; |
129 | goto out; | 129 | goto out; |
130 | case NL80211_CHAN_HT20: | 130 | case NL80211_CHAN_WIDTH_20: |
131 | mpl_dbg(sdata, | 131 | mpl_dbg(sdata, |
132 | "mesh_plink %pM: HT20 sta (%pM) is present\n", | 132 | "mesh_plink %pM: HT20 sta (%pM) is present\n", |
133 | sdata->vif.addr, sta->sta.addr); | 133 | sdata->vif.addr, sta->sta.addr); |
@@ -142,7 +142,7 @@ out: | |||
142 | if (non_ht_sta) | 142 | if (non_ht_sta) |
143 | ht_opmode = IEEE80211_HT_OP_MODE_PROTECTION_NONHT_MIXED; | 143 | ht_opmode = IEEE80211_HT_OP_MODE_PROTECTION_NONHT_MIXED; |
144 | else if (ht20_sta && | 144 | else if (ht20_sta && |
145 | sdata->vif.bss_conf.channel_type > NL80211_CHAN_HT20) | 145 | sdata->vif.bss_conf.chandef.width > NL80211_CHAN_WIDTH_20) |
146 | ht_opmode = IEEE80211_HT_OP_MODE_PROTECTION_20MHZ; | 146 | ht_opmode = IEEE80211_HT_OP_MODE_PROTECTION_20MHZ; |
147 | else | 147 | else |
148 | ht_opmode = IEEE80211_HT_OP_MODE_PROTECTION_NONE; | 148 | ht_opmode = IEEE80211_HT_OP_MODE_PROTECTION_NONE; |
@@ -372,7 +372,7 @@ static struct sta_info *mesh_peer_init(struct ieee80211_sub_if_data *sdata, | |||
372 | 372 | ||
373 | sta->sta.supp_rates[band] = rates; | 373 | sta->sta.supp_rates[band] = rates; |
374 | if (elems->ht_cap_elem && | 374 | if (elems->ht_cap_elem && |
375 | sdata->vif.bss_conf.channel_type != NL80211_CHAN_NO_HT) | 375 | sdata->vif.bss_conf.chandef.width != NL80211_CHAN_WIDTH_20_NOHT) |
376 | ieee80211_ht_cap_ie_to_sta_ht_cap(sdata, sband, | 376 | ieee80211_ht_cap_ie_to_sta_ht_cap(sdata, sband, |
377 | elems->ht_cap_elem, | 377 | elems->ht_cap_elem, |
378 | &sta->sta.ht_cap); | 378 | &sta->sta.ht_cap); |
@@ -380,12 +380,15 @@ static struct sta_info *mesh_peer_init(struct ieee80211_sub_if_data *sdata, | |||
380 | memset(&sta->sta.ht_cap, 0, sizeof(sta->sta.ht_cap)); | 380 | memset(&sta->sta.ht_cap, 0, sizeof(sta->sta.ht_cap)); |
381 | 381 | ||
382 | if (elems->ht_operation) { | 382 | if (elems->ht_operation) { |
383 | struct cfg80211_chan_def chandef; | ||
384 | |||
383 | if (!(elems->ht_operation->ht_param & | 385 | if (!(elems->ht_operation->ht_param & |
384 | IEEE80211_HT_PARAM_CHAN_WIDTH_ANY)) | 386 | IEEE80211_HT_PARAM_CHAN_WIDTH_ANY)) |
385 | sta->sta.ht_cap.cap &= | 387 | sta->sta.ht_cap.cap &= |
386 | ~IEEE80211_HT_CAP_SUP_WIDTH_20_40; | 388 | ~IEEE80211_HT_CAP_SUP_WIDTH_20_40; |
387 | sta->ch_type = | 389 | ieee80211_ht_oper_to_chandef(sdata->vif.bss_conf.chandef.chan, |
388 | ieee80211_ht_oper_to_channel_type(elems->ht_operation); | 390 | elems->ht_operation, &chandef); |
391 | sta->ch_width = chandef.width; | ||
389 | } | 392 | } |
390 | 393 | ||
391 | rate_control_rate_init(sta); | 394 | rate_control_rate_init(sta); |