| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * mac80211 TDLS handling code |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 5 | 6 | * Copyright 2014, Intel Corporation |
|---|
| 6 | 7 | * Copyright 2014 Intel Mobile Communications GmbH |
|---|
| 7 | 8 | * Copyright 2015 - 2016 Intel Deutschland GmbH |
|---|
| 8 | | - * |
|---|
| 9 | | - * This file is GPLv2 as found in COPYING. |
|---|
| 9 | + * Copyright (C) 2019 Intel Corporation |
|---|
| 10 | 10 | */ |
|---|
| 11 | 11 | |
|---|
| 12 | 12 | #include <linux/ieee80211.h> |
|---|
| .. | .. |
|---|
| 226 | 226 | static void |
|---|
| 227 | 227 | ieee80211_tdls_add_aid(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb) |
|---|
| 228 | 228 | { |
|---|
| 229 | | - struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; |
|---|
| 230 | 229 | u8 *pos = skb_put(skb, 4); |
|---|
| 231 | 230 | |
|---|
| 232 | 231 | *pos++ = WLAN_EID_AID; |
|---|
| 233 | 232 | *pos++ = 2; /* len */ |
|---|
| 234 | | - put_unaligned_le16(ifmgd->aid, pos); |
|---|
| 233 | + put_unaligned_le16(sdata->vif.bss_conf.aid, pos); |
|---|
| 235 | 234 | } |
|---|
| 236 | 235 | |
|---|
| 237 | 236 | /* translate numbering in the WMM parameter IE to the mac80211 notation */ |
|---|
| .. | .. |
|---|
| 240 | 239 | switch (ac) { |
|---|
| 241 | 240 | default: |
|---|
| 242 | 241 | WARN_ON_ONCE(1); |
|---|
| 243 | | - /* fall through */ |
|---|
| 242 | + fallthrough; |
|---|
| 244 | 243 | case 0: |
|---|
| 245 | 244 | return IEEE80211_AC_BE; |
|---|
| 246 | 245 | case 1: |
|---|
| .. | .. |
|---|
| 953 | 952 | set_sta_flag(sta, WLAN_STA_TDLS_INITIATOR); |
|---|
| 954 | 953 | sta->sta.tdls_initiator = false; |
|---|
| 955 | 954 | } |
|---|
| 956 | | - /* fall-through */ |
|---|
| 955 | + fallthrough; |
|---|
| 957 | 956 | case WLAN_TDLS_SETUP_CONFIRM: |
|---|
| 958 | 957 | case WLAN_TDLS_DISCOVERY_REQUEST: |
|---|
| 959 | 958 | initiator = true; |
|---|
| .. | .. |
|---|
| 968 | 967 | clear_sta_flag(sta, WLAN_STA_TDLS_INITIATOR); |
|---|
| 969 | 968 | sta->sta.tdls_initiator = true; |
|---|
| 970 | 969 | } |
|---|
| 971 | | - /* fall-through */ |
|---|
| 970 | + fallthrough; |
|---|
| 972 | 971 | case WLAN_PUB_ACTION_TDLS_DISCOVER_RES: |
|---|
| 973 | 972 | initiator = false; |
|---|
| 974 | 973 | break; |
|---|
| .. | .. |
|---|
| 1055 | 1054 | |
|---|
| 1056 | 1055 | /* disable bottom halves when entering the Tx path */ |
|---|
| 1057 | 1056 | local_bh_disable(); |
|---|
| 1058 | | - __ieee80211_subif_start_xmit(skb, dev, flags, 0); |
|---|
| 1057 | + __ieee80211_subif_start_xmit(skb, dev, flags, 0, NULL); |
|---|
| 1059 | 1058 | local_bh_enable(); |
|---|
| 1060 | 1059 | |
|---|
| 1061 | 1060 | return ret; |
|---|
| .. | .. |
|---|
| 1223 | 1222 | * by the AP. |
|---|
| 1224 | 1223 | */ |
|---|
| 1225 | 1224 | drv_mgd_protect_tdls_discover(sdata->local, sdata); |
|---|
| 1226 | | - /* fall-through */ |
|---|
| 1225 | + fallthrough; |
|---|
| 1227 | 1226 | case WLAN_TDLS_SETUP_CONFIRM: |
|---|
| 1228 | 1227 | case WLAN_PUB_ACTION_TDLS_DISCOVER_RES: |
|---|
| 1229 | 1228 | /* no special handling */ |
|---|
| .. | .. |
|---|
| 1567 | 1566 | u32 ch_sw_tm_ie; |
|---|
| 1568 | 1567 | int ret; |
|---|
| 1569 | 1568 | |
|---|
| 1569 | + if (chandef->chan->freq_offset) |
|---|
| 1570 | + /* this may work, but is untested */ |
|---|
| 1571 | + return -EOPNOTSUPP; |
|---|
| 1572 | + |
|---|
| 1570 | 1573 | mutex_lock(&local->sta_mtx); |
|---|
| 1571 | 1574 | sta = sta_info_get(sdata, addr); |
|---|
| 1572 | 1575 | if (!sta) { |
|---|
| .. | .. |
|---|
| 1716 | 1719 | } |
|---|
| 1717 | 1720 | |
|---|
| 1718 | 1721 | 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); |
|---|
| 1720 | 1724 | if (elems.parse_error) { |
|---|
| 1721 | 1725 | tdls_dbg(sdata, "Invalid IEs in TDLS channel switch resp\n"); |
|---|
| 1722 | 1726 | ret = -EINVAL; |
|---|
| .. | .. |
|---|
| 1828 | 1832 | } |
|---|
| 1829 | 1833 | |
|---|
| 1830 | 1834 | ieee802_11_parse_elems(tf->u.chan_switch_req.variable, |
|---|
| 1831 | | - skb->len - baselen, false, &elems); |
|---|
| 1835 | + skb->len - baselen, false, &elems, NULL, NULL); |
|---|
| 1832 | 1836 | if (elems.parse_error) { |
|---|
| 1833 | 1837 | tdls_dbg(sdata, "Invalid IEs in TDLS channel switch req\n"); |
|---|
| 1834 | 1838 | return -EINVAL; |
|---|