hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/net/mac80211/tdls.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * mac80211 TDLS handling code
34 *
....@@ -5,8 +6,7 @@
56 * Copyright 2014, Intel Corporation
67 * Copyright 2014 Intel Mobile Communications GmbH
78 * Copyright 2015 - 2016 Intel Deutschland GmbH
8
- *
9
- * This file is GPLv2 as found in COPYING.
9
+ * Copyright (C) 2019 Intel Corporation
1010 */
1111
1212 #include <linux/ieee80211.h>
....@@ -226,12 +226,11 @@
226226 static void
227227 ieee80211_tdls_add_aid(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb)
228228 {
229
- struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
230229 u8 *pos = skb_put(skb, 4);
231230
232231 *pos++ = WLAN_EID_AID;
233232 *pos++ = 2; /* len */
234
- put_unaligned_le16(ifmgd->aid, pos);
233
+ put_unaligned_le16(sdata->vif.bss_conf.aid, pos);
235234 }
236235
237236 /* translate numbering in the WMM parameter IE to the mac80211 notation */
....@@ -240,7 +239,7 @@
240239 switch (ac) {
241240 default:
242241 WARN_ON_ONCE(1);
243
- /* fall through */
242
+ fallthrough;
244243 case 0:
245244 return IEEE80211_AC_BE;
246245 case 1:
....@@ -953,7 +952,7 @@
953952 set_sta_flag(sta, WLAN_STA_TDLS_INITIATOR);
954953 sta->sta.tdls_initiator = false;
955954 }
956
- /* fall-through */
955
+ fallthrough;
957956 case WLAN_TDLS_SETUP_CONFIRM:
958957 case WLAN_TDLS_DISCOVERY_REQUEST:
959958 initiator = true;
....@@ -968,7 +967,7 @@
968967 clear_sta_flag(sta, WLAN_STA_TDLS_INITIATOR);
969968 sta->sta.tdls_initiator = true;
970969 }
971
- /* fall-through */
970
+ fallthrough;
972971 case WLAN_PUB_ACTION_TDLS_DISCOVER_RES:
973972 initiator = false;
974973 break;
....@@ -1055,7 +1054,7 @@
10551054
10561055 /* disable bottom halves when entering the Tx path */
10571056 local_bh_disable();
1058
- __ieee80211_subif_start_xmit(skb, dev, flags, 0);
1057
+ __ieee80211_subif_start_xmit(skb, dev, flags, 0, NULL);
10591058 local_bh_enable();
10601059
10611060 return ret;
....@@ -1223,7 +1222,7 @@
12231222 * by the AP.
12241223 */
12251224 drv_mgd_protect_tdls_discover(sdata->local, sdata);
1226
- /* fall-through */
1225
+ fallthrough;
12271226 case WLAN_TDLS_SETUP_CONFIRM:
12281227 case WLAN_PUB_ACTION_TDLS_DISCOVER_RES:
12291228 /* no special handling */
....@@ -1567,6 +1566,10 @@
15671566 u32 ch_sw_tm_ie;
15681567 int ret;
15691568
1569
+ if (chandef->chan->freq_offset)
1570
+ /* this may work, but is untested */
1571
+ return -EOPNOTSUPP;
1572
+
15701573 mutex_lock(&local->sta_mtx);
15711574 sta = sta_info_get(sdata, addr);
15721575 if (!sta) {
....@@ -1716,7 +1719,8 @@
17161719 }
17171720
17181721 ieee802_11_parse_elems(tf->u.chan_switch_resp.variable,
1719
- skb->len - baselen, false, &elems);
1722
+ skb->len - baselen, false, &elems,
1723
+ NULL, NULL);
17201724 if (elems.parse_error) {
17211725 tdls_dbg(sdata, "Invalid IEs in TDLS channel switch resp\n");
17221726 ret = -EINVAL;
....@@ -1828,7 +1832,7 @@
18281832 }
18291833
18301834 ieee802_11_parse_elems(tf->u.chan_switch_req.variable,
1831
- skb->len - baselen, false, &elems);
1835
+ skb->len - baselen, false, &elems, NULL, NULL);
18321836 if (elems.parse_error) {
18331837 tdls_dbg(sdata, "Invalid IEs in TDLS channel switch req\n");
18341838 return -EINVAL;