aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/spectmgmt.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/spectmgmt.c')
-rw-r--r--net/mac80211/spectmgmt.c45
1 files changed, 17 insertions, 28 deletions
diff --git a/net/mac80211/spectmgmt.c b/net/mac80211/spectmgmt.c
index 2ddc661f0988..97f4c9d6b54c 100644
--- a/net/mac80211/spectmgmt.c
+++ b/net/mac80211/spectmgmt.c
@@ -129,42 +129,31 @@ int ieee80211_parse_ch_switch_ie(struct ieee80211_sub_if_data *sdata,
129 } 129 }
130 130
131 if (wide_bw_chansw_ie) { 131 if (wide_bw_chansw_ie) {
132 new_vht_chandef.chan = new_chan; 132 struct ieee80211_vht_operation vht_oper = {
133 new_vht_chandef.center_freq1 = 133 .chan_width =
134 ieee80211_channel_to_frequency( 134 wide_bw_chansw_ie->new_channel_width,
135 .center_freq_seg1_idx =
135 wide_bw_chansw_ie->new_center_freq_seg0, 136 wide_bw_chansw_ie->new_center_freq_seg0,
136 new_band); 137 .center_freq_seg2_idx =
137 138 wide_bw_chansw_ie->new_center_freq_seg1,
138 switch (wide_bw_chansw_ie->new_channel_width) { 139 /* .basic_mcs_set doesn't matter */
139 default: 140 };
140 /* hmmm, ignore VHT and use HT if present */ 141
141 case IEEE80211_VHT_CHANWIDTH_USE_HT: 142 /* default, for the case of IEEE80211_VHT_CHANWIDTH_USE_HT,
143 * to the previously parsed chandef
144 */
145 new_vht_chandef = csa_ie->chandef;
146
147 /* ignore if parsing fails */
148 if (!ieee80211_chandef_vht_oper(&vht_oper, &new_vht_chandef))
142 new_vht_chandef.chan = NULL; 149 new_vht_chandef.chan = NULL;
143 break; 150
144 case IEEE80211_VHT_CHANWIDTH_80MHZ:
145 new_vht_chandef.width = NL80211_CHAN_WIDTH_80;
146 break;
147 case IEEE80211_VHT_CHANWIDTH_160MHZ:
148 new_vht_chandef.width = NL80211_CHAN_WIDTH_160;
149 break;
150 case IEEE80211_VHT_CHANWIDTH_80P80MHZ:
151 /* field is otherwise reserved */
152 new_vht_chandef.center_freq2 =
153 ieee80211_channel_to_frequency(
154 wide_bw_chansw_ie->new_center_freq_seg1,
155 new_band);
156 new_vht_chandef.width = NL80211_CHAN_WIDTH_80P80;
157 break;
158 }
159 if (sta_flags & IEEE80211_STA_DISABLE_80P80MHZ && 151 if (sta_flags & IEEE80211_STA_DISABLE_80P80MHZ &&
160 new_vht_chandef.width == NL80211_CHAN_WIDTH_80P80) 152 new_vht_chandef.width == NL80211_CHAN_WIDTH_80P80)
161 ieee80211_chandef_downgrade(&new_vht_chandef); 153 ieee80211_chandef_downgrade(&new_vht_chandef);
162 if (sta_flags & IEEE80211_STA_DISABLE_160MHZ && 154 if (sta_flags & IEEE80211_STA_DISABLE_160MHZ &&
163 new_vht_chandef.width == NL80211_CHAN_WIDTH_160) 155 new_vht_chandef.width == NL80211_CHAN_WIDTH_160)
164 ieee80211_chandef_downgrade(&new_vht_chandef); 156 ieee80211_chandef_downgrade(&new_vht_chandef);
165 if (sta_flags & IEEE80211_STA_DISABLE_40MHZ &&
166 new_vht_chandef.width > NL80211_CHAN_WIDTH_20)
167 ieee80211_chandef_downgrade(&new_vht_chandef);
168 } 157 }
169 158
170 /* if VHT data is there validate & use it */ 159 /* if VHT data is there validate & use it */