hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/net/mac80211/spectmgmt.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * spectrum management
34 *
....@@ -8,11 +9,7 @@
89 * Copyright 2007, Michael Wu <flamingice@sourmilk.net>
910 * Copyright 2007-2008, Intel Corporation
1011 * Copyright 2008, Johannes Berg <johannes@sipsolutions.net>
11
- * Copyright (C) 2018 Intel Corporation
12
- *
13
- * This program is free software; you can redistribute it and/or modify
14
- * it under the terms of the GNU General Public License version 2 as
15
- * published by the Free Software Foundation.
12
+ * Copyright (C) 2018, 2020 Intel Corporation
1613 */
1714
1815 #include <linux/ieee80211.h>
....@@ -25,6 +22,7 @@
2522 int ieee80211_parse_ch_switch_ie(struct ieee80211_sub_if_data *sdata,
2623 struct ieee802_11_elems *elems,
2724 enum nl80211_band current_band,
25
+ u32 vht_cap_info,
2826 u32 sta_flags, u8 *bssid,
2927 struct ieee80211_csa_ie *csa_ie)
3028 {
....@@ -135,14 +133,19 @@
135133 }
136134
137135 if (wide_bw_chansw_ie) {
136
+ u8 new_seg1 = wide_bw_chansw_ie->new_center_freq_seg1;
138137 struct ieee80211_vht_operation vht_oper = {
139138 .chan_width =
140139 wide_bw_chansw_ie->new_channel_width,
141140 .center_freq_seg0_idx =
142141 wide_bw_chansw_ie->new_center_freq_seg0,
143
- .center_freq_seg1_idx =
144
- wide_bw_chansw_ie->new_center_freq_seg1,
142
+ .center_freq_seg1_idx = new_seg1,
145143 /* .basic_mcs_set doesn't matter */
144
+ };
145
+ struct ieee80211_ht_operation ht_oper = {
146
+ .operation_mode =
147
+ cpu_to_le16(new_seg1 <<
148
+ IEEE80211_HT_OP_MODE_CCFS2_SHIFT),
146149 };
147150
148151 /* default, for the case of IEEE80211_VHT_CHANWIDTH_USE_HT,
....@@ -151,7 +154,10 @@
151154 new_vht_chandef = csa_ie->chandef;
152155
153156 /* ignore if parsing fails */
154
- if (!ieee80211_chandef_vht_oper(&vht_oper, &new_vht_chandef))
157
+ if (!ieee80211_chandef_vht_oper(&sdata->local->hw,
158
+ vht_cap_info,
159
+ &vht_oper, &ht_oper,
160
+ &new_vht_chandef))
155161 new_vht_chandef.chan = NULL;
156162
157163 if (sta_flags & IEEE80211_STA_DISABLE_80P80MHZ &&
....@@ -174,6 +180,12 @@
174180 csa_ie->chandef = new_vht_chandef;
175181 }
176182
183
+ if (elems->max_channel_switch_time)
184
+ csa_ie->max_switch_time =
185
+ (elems->max_channel_switch_time[0] << 0) |
186
+ (elems->max_channel_switch_time[1] << 8) |
187
+ (elems->max_channel_switch_time[2] << 16);
188
+
177189 return 0;
178190 }
179191