| .. | .. |
|---|
| 1 | 1 | /* |
|---|
| 2 | | - * Marvell Wireless LAN device driver: CFG80211 |
|---|
| 2 | + * NXP Wireless LAN device driver: CFG80211 |
|---|
| 3 | 3 | * |
|---|
| 4 | | - * Copyright (C) 2011-2014, Marvell International Ltd. |
|---|
| 4 | + * Copyright 2011-2020 NXP |
|---|
| 5 | 5 | * |
|---|
| 6 | | - * This software file (the "File") is distributed by Marvell International |
|---|
| 7 | | - * Ltd. under the terms of the GNU General Public License Version 2, June 1991 |
|---|
| 6 | + * This software file (the "File") is distributed by NXP |
|---|
| 7 | + * under the terms of the GNU General Public License Version 2, June 1991 |
|---|
| 8 | 8 | * (the "License"). You may use, redistribute and/or modify this File in |
|---|
| 9 | 9 | * accordance with the terms and conditions of the License, a copy of which |
|---|
| 10 | 10 | * is available by writing to the Free Software Foundation, Inc., |
|---|
| .. | .. |
|---|
| 27 | 27 | |
|---|
| 28 | 28 | static const struct ieee80211_iface_limit mwifiex_ap_sta_limits[] = { |
|---|
| 29 | 29 | { |
|---|
| 30 | | - .max = 3, .types = BIT(NL80211_IFTYPE_STATION) | |
|---|
| 30 | + .max = MWIFIEX_MAX_BSS_NUM, |
|---|
| 31 | + .types = BIT(NL80211_IFTYPE_STATION) | |
|---|
| 31 | 32 | BIT(NL80211_IFTYPE_P2P_GO) | |
|---|
| 32 | 33 | BIT(NL80211_IFTYPE_P2P_CLIENT) | |
|---|
| 33 | 34 | BIT(NL80211_IFTYPE_AP), |
|---|
| .. | .. |
|---|
| 269 | 270 | * CFG802.11 operation handler to register a mgmt frame. |
|---|
| 270 | 271 | */ |
|---|
| 271 | 272 | static void |
|---|
| 272 | | -mwifiex_cfg80211_mgmt_frame_register(struct wiphy *wiphy, |
|---|
| 273 | | - struct wireless_dev *wdev, |
|---|
| 274 | | - u16 frame_type, bool reg) |
|---|
| 273 | +mwifiex_cfg80211_update_mgmt_frame_registrations(struct wiphy *wiphy, |
|---|
| 274 | + struct wireless_dev *wdev, |
|---|
| 275 | + struct mgmt_frame_regs *upd) |
|---|
| 275 | 276 | { |
|---|
| 276 | 277 | struct mwifiex_private *priv = mwifiex_netdev_get_priv(wdev->netdev); |
|---|
| 277 | | - u32 mask; |
|---|
| 278 | | - |
|---|
| 279 | | - if (reg) |
|---|
| 280 | | - mask = priv->mgmt_frame_mask | BIT(frame_type >> 4); |
|---|
| 281 | | - else |
|---|
| 282 | | - mask = priv->mgmt_frame_mask & ~BIT(frame_type >> 4); |
|---|
| 278 | + u32 mask = upd->interface_stypes; |
|---|
| 283 | 279 | |
|---|
| 284 | 280 | if (mask != priv->mgmt_frame_mask) { |
|---|
| 285 | 281 | priv->mgmt_frame_mask = mask; |
|---|
| .. | .. |
|---|
| 876 | 872 | spin_unlock_irqrestore(&adapter->main_proc_lock, flags); |
|---|
| 877 | 873 | } |
|---|
| 878 | 874 | |
|---|
| 879 | | - spin_lock_irqsave(&adapter->rx_proc_lock, flags); |
|---|
| 875 | + spin_lock_bh(&adapter->rx_proc_lock); |
|---|
| 880 | 876 | adapter->rx_locked = true; |
|---|
| 881 | 877 | if (adapter->rx_processing) { |
|---|
| 882 | | - spin_unlock_irqrestore(&adapter->rx_proc_lock, flags); |
|---|
| 878 | + spin_unlock_bh(&adapter->rx_proc_lock); |
|---|
| 883 | 879 | flush_workqueue(adapter->rx_workqueue); |
|---|
| 884 | 880 | } else { |
|---|
| 885 | | - spin_unlock_irqrestore(&adapter->rx_proc_lock, flags); |
|---|
| 881 | + spin_unlock_bh(&adapter->rx_proc_lock); |
|---|
| 886 | 882 | } |
|---|
| 887 | 883 | |
|---|
| 888 | 884 | mwifiex_free_priv(priv); |
|---|
| .. | .. |
|---|
| 938 | 934 | adapter->main_locked = false; |
|---|
| 939 | 935 | spin_unlock_irqrestore(&adapter->main_proc_lock, flags); |
|---|
| 940 | 936 | |
|---|
| 941 | | - spin_lock_irqsave(&adapter->rx_proc_lock, flags); |
|---|
| 937 | + spin_lock_bh(&adapter->rx_proc_lock); |
|---|
| 942 | 938 | adapter->rx_locked = false; |
|---|
| 943 | | - spin_unlock_irqrestore(&adapter->rx_proc_lock, flags); |
|---|
| 939 | + spin_unlock_bh(&adapter->rx_proc_lock); |
|---|
| 944 | 940 | |
|---|
| 945 | 941 | mwifiex_set_mac_address(priv, dev, false, NULL); |
|---|
| 946 | 942 | |
|---|
| .. | .. |
|---|
| 1171 | 1167 | case NL80211_IFTYPE_UNSPECIFIED: |
|---|
| 1172 | 1168 | mwifiex_dbg(priv->adapter, INFO, |
|---|
| 1173 | 1169 | "%s: kept type as IBSS\n", dev->name); |
|---|
| 1174 | | - /* fall through */ |
|---|
| 1170 | + fallthrough; |
|---|
| 1175 | 1171 | case NL80211_IFTYPE_ADHOC: /* This shouldn't happen */ |
|---|
| 1176 | 1172 | return 0; |
|---|
| 1177 | 1173 | default: |
|---|
| .. | .. |
|---|
| 1202 | 1198 | case NL80211_IFTYPE_UNSPECIFIED: |
|---|
| 1203 | 1199 | mwifiex_dbg(priv->adapter, INFO, |
|---|
| 1204 | 1200 | "%s: kept type as STA\n", dev->name); |
|---|
| 1205 | | - /* fall through */ |
|---|
| 1201 | + fallthrough; |
|---|
| 1206 | 1202 | case NL80211_IFTYPE_STATION: /* This shouldn't happen */ |
|---|
| 1207 | 1203 | return 0; |
|---|
| 1208 | 1204 | default: |
|---|
| .. | .. |
|---|
| 1225 | 1221 | case NL80211_IFTYPE_UNSPECIFIED: |
|---|
| 1226 | 1222 | mwifiex_dbg(priv->adapter, INFO, |
|---|
| 1227 | 1223 | "%s: kept type as AP\n", dev->name); |
|---|
| 1228 | | - /* fall through */ |
|---|
| 1224 | + fallthrough; |
|---|
| 1229 | 1225 | case NL80211_IFTYPE_AP: /* This shouldn't happen */ |
|---|
| 1230 | 1226 | return 0; |
|---|
| 1231 | 1227 | default: |
|---|
| .. | .. |
|---|
| 1251 | 1247 | case NL80211_IFTYPE_UNSPECIFIED: |
|---|
| 1252 | 1248 | mwifiex_dbg(priv->adapter, INFO, |
|---|
| 1253 | 1249 | "%s: kept type as P2P\n", dev->name); |
|---|
| 1254 | | - /* fall through */ |
|---|
| 1250 | + fallthrough; |
|---|
| 1255 | 1251 | case NL80211_IFTYPE_P2P_CLIENT: |
|---|
| 1256 | 1252 | case NL80211_IFTYPE_P2P_GO: |
|---|
| 1257 | 1253 | return 0; |
|---|
| .. | .. |
|---|
| 1274 | 1270 | } |
|---|
| 1275 | 1271 | |
|---|
| 1276 | 1272 | static void |
|---|
| 1277 | | -mwifiex_parse_htinfo(struct mwifiex_private *priv, u8 tx_htinfo, |
|---|
| 1273 | +mwifiex_parse_htinfo(struct mwifiex_private *priv, u8 rateinfo, u8 htinfo, |
|---|
| 1278 | 1274 | struct rate_info *rate) |
|---|
| 1279 | 1275 | { |
|---|
| 1280 | 1276 | struct mwifiex_adapter *adapter = priv->adapter; |
|---|
| 1281 | 1277 | |
|---|
| 1282 | 1278 | if (adapter->is_hw_11ac_capable) { |
|---|
| 1283 | 1279 | /* bit[1-0]: 00=LG 01=HT 10=VHT */ |
|---|
| 1284 | | - if (tx_htinfo & BIT(0)) { |
|---|
| 1280 | + if (htinfo & BIT(0)) { |
|---|
| 1285 | 1281 | /* HT */ |
|---|
| 1286 | | - rate->mcs = priv->tx_rate; |
|---|
| 1282 | + rate->mcs = rateinfo; |
|---|
| 1287 | 1283 | rate->flags |= RATE_INFO_FLAGS_MCS; |
|---|
| 1288 | 1284 | } |
|---|
| 1289 | | - if (tx_htinfo & BIT(1)) { |
|---|
| 1285 | + if (htinfo & BIT(1)) { |
|---|
| 1290 | 1286 | /* VHT */ |
|---|
| 1291 | | - rate->mcs = priv->tx_rate & 0x0F; |
|---|
| 1287 | + rate->mcs = rateinfo & 0x0F; |
|---|
| 1292 | 1288 | rate->flags |= RATE_INFO_FLAGS_VHT_MCS; |
|---|
| 1293 | 1289 | } |
|---|
| 1294 | 1290 | |
|---|
| 1295 | | - if (tx_htinfo & (BIT(1) | BIT(0))) { |
|---|
| 1291 | + if (htinfo & (BIT(1) | BIT(0))) { |
|---|
| 1296 | 1292 | /* HT or VHT */ |
|---|
| 1297 | | - switch (tx_htinfo & (BIT(3) | BIT(2))) { |
|---|
| 1293 | + switch (htinfo & (BIT(3) | BIT(2))) { |
|---|
| 1298 | 1294 | case 0: |
|---|
| 1299 | 1295 | rate->bw = RATE_INFO_BW_20; |
|---|
| 1300 | 1296 | break; |
|---|
| .. | .. |
|---|
| 1309 | 1305 | break; |
|---|
| 1310 | 1306 | } |
|---|
| 1311 | 1307 | |
|---|
| 1312 | | - if (tx_htinfo & BIT(4)) |
|---|
| 1308 | + if (htinfo & BIT(4)) |
|---|
| 1313 | 1309 | rate->flags |= RATE_INFO_FLAGS_SHORT_GI; |
|---|
| 1314 | 1310 | |
|---|
| 1315 | | - if ((priv->tx_rate >> 4) == 1) |
|---|
| 1311 | + if ((rateinfo >> 4) == 1) |
|---|
| 1316 | 1312 | rate->nss = 2; |
|---|
| 1317 | 1313 | else |
|---|
| 1318 | 1314 | rate->nss = 1; |
|---|
| 1319 | 1315 | } |
|---|
| 1320 | 1316 | } else { |
|---|
| 1321 | 1317 | /* |
|---|
| 1322 | | - * Bit 0 in tx_htinfo indicates that current Tx rate |
|---|
| 1323 | | - * is 11n rate. Valid MCS index values for us are 0 to 15. |
|---|
| 1318 | + * Bit 0 in htinfo indicates that current rate is 11n. Valid |
|---|
| 1319 | + * MCS index values for us are 0 to 15. |
|---|
| 1324 | 1320 | */ |
|---|
| 1325 | | - if ((tx_htinfo & BIT(0)) && (priv->tx_rate < 16)) { |
|---|
| 1326 | | - rate->mcs = priv->tx_rate; |
|---|
| 1321 | + if ((htinfo & BIT(0)) && (rateinfo < 16)) { |
|---|
| 1322 | + rate->mcs = rateinfo; |
|---|
| 1327 | 1323 | rate->flags |= RATE_INFO_FLAGS_MCS; |
|---|
| 1328 | 1324 | rate->bw = RATE_INFO_BW_20; |
|---|
| 1329 | | - if (tx_htinfo & BIT(1)) |
|---|
| 1325 | + if (htinfo & BIT(1)) |
|---|
| 1330 | 1326 | rate->bw = RATE_INFO_BW_40; |
|---|
| 1331 | | - if (tx_htinfo & BIT(2)) |
|---|
| 1327 | + if (htinfo & BIT(2)) |
|---|
| 1332 | 1328 | rate->flags |= RATE_INFO_FLAGS_SHORT_GI; |
|---|
| 1333 | 1329 | } |
|---|
| 1330 | + } |
|---|
| 1331 | + |
|---|
| 1332 | + /* Decode legacy rates for non-HT. */ |
|---|
| 1333 | + if (!(htinfo & (BIT(0) | BIT(1)))) { |
|---|
| 1334 | + /* Bitrates in multiples of 100kb/s. */ |
|---|
| 1335 | + static const int legacy_rates[] = { |
|---|
| 1336 | + [0] = 10, |
|---|
| 1337 | + [1] = 20, |
|---|
| 1338 | + [2] = 55, |
|---|
| 1339 | + [3] = 110, |
|---|
| 1340 | + [4] = 60, /* MWIFIEX_RATE_INDEX_OFDM0 */ |
|---|
| 1341 | + [5] = 60, |
|---|
| 1342 | + [6] = 90, |
|---|
| 1343 | + [7] = 120, |
|---|
| 1344 | + [8] = 180, |
|---|
| 1345 | + [9] = 240, |
|---|
| 1346 | + [10] = 360, |
|---|
| 1347 | + [11] = 480, |
|---|
| 1348 | + [12] = 540, |
|---|
| 1349 | + }; |
|---|
| 1350 | + if (rateinfo < ARRAY_SIZE(legacy_rates)) |
|---|
| 1351 | + rate->legacy = legacy_rates[rateinfo]; |
|---|
| 1334 | 1352 | } |
|---|
| 1335 | 1353 | } |
|---|
| 1336 | 1354 | |
|---|
| .. | .. |
|---|
| 1374 | 1392 | sinfo->tx_packets = node->stats.tx_packets; |
|---|
| 1375 | 1393 | sinfo->tx_failed = node->stats.tx_failed; |
|---|
| 1376 | 1394 | |
|---|
| 1377 | | - mwifiex_parse_htinfo(priv, node->stats.last_tx_htinfo, |
|---|
| 1395 | + mwifiex_parse_htinfo(priv, priv->tx_rate, |
|---|
| 1396 | + node->stats.last_tx_htinfo, |
|---|
| 1378 | 1397 | &sinfo->txrate); |
|---|
| 1379 | 1398 | sinfo->txrate.legacy = node->stats.last_tx_rate * 5; |
|---|
| 1380 | 1399 | |
|---|
| .. | .. |
|---|
| 1400 | 1419 | HostCmd_ACT_GEN_GET, DTIM_PERIOD_I, |
|---|
| 1401 | 1420 | &priv->dtim_period, true); |
|---|
| 1402 | 1421 | |
|---|
| 1403 | | - mwifiex_parse_htinfo(priv, priv->tx_htinfo, &sinfo->txrate); |
|---|
| 1422 | + mwifiex_parse_htinfo(priv, priv->tx_rate, priv->tx_htinfo, |
|---|
| 1423 | + &sinfo->txrate); |
|---|
| 1404 | 1424 | |
|---|
| 1405 | 1425 | sinfo->signal_avg = priv->bcn_rssi_avg; |
|---|
| 1406 | 1426 | sinfo->rx_bytes = priv->stats.rx_bytes; |
|---|
| .. | .. |
|---|
| 1410 | 1430 | sinfo->signal = priv->bcn_rssi_avg; |
|---|
| 1411 | 1431 | /* bit rate is in 500 kb/s units. Convert it to 100kb/s units */ |
|---|
| 1412 | 1432 | sinfo->txrate.legacy = rate * 5; |
|---|
| 1433 | + |
|---|
| 1434 | + sinfo->filled |= BIT(NL80211_STA_INFO_RX_BITRATE); |
|---|
| 1435 | + mwifiex_parse_htinfo(priv, priv->rxpd_rate, priv->rxpd_htinfo, |
|---|
| 1436 | + &sinfo->rxrate); |
|---|
| 1413 | 1437 | |
|---|
| 1414 | 1438 | if (priv->bss_mode == NL80211_IFTYPE_STATION) { |
|---|
| 1415 | 1439 | sinfo->filled |= BIT_ULL(NL80211_STA_INFO_BSS_PARAM); |
|---|
| .. | .. |
|---|
| 1787 | 1811 | struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev); |
|---|
| 1788 | 1812 | struct mwifiex_sta_node *sta_node; |
|---|
| 1789 | 1813 | u8 deauth_mac[ETH_ALEN]; |
|---|
| 1790 | | - unsigned long flags; |
|---|
| 1791 | 1814 | |
|---|
| 1792 | 1815 | if (!priv->bss_started && priv->wdev.cac_started) { |
|---|
| 1793 | 1816 | mwifiex_dbg(priv->adapter, INFO, "%s: abort CAC!\n", __func__); |
|---|
| .. | .. |
|---|
| 1805 | 1828 | |
|---|
| 1806 | 1829 | eth_zero_addr(deauth_mac); |
|---|
| 1807 | 1830 | |
|---|
| 1808 | | - spin_lock_irqsave(&priv->sta_list_spinlock, flags); |
|---|
| 1831 | + spin_lock_bh(&priv->sta_list_spinlock); |
|---|
| 1809 | 1832 | sta_node = mwifiex_get_sta_entry(priv, params->mac); |
|---|
| 1810 | 1833 | if (sta_node) |
|---|
| 1811 | 1834 | ether_addr_copy(deauth_mac, params->mac); |
|---|
| 1812 | | - spin_unlock_irqrestore(&priv->sta_list_spinlock, flags); |
|---|
| 1835 | + spin_unlock_bh(&priv->sta_list_spinlock); |
|---|
| 1813 | 1836 | |
|---|
| 1814 | 1837 | if (is_valid_ether_addr(deauth_mac)) { |
|---|
| 1815 | 1838 | if (mwifiex_send_cmd(priv, HostCmd_CMD_UAP_STA_DEAUTH, |
|---|
| .. | .. |
|---|
| 3013 | 3036 | |
|---|
| 3014 | 3037 | dev->flags |= IFF_BROADCAST | IFF_MULTICAST; |
|---|
| 3015 | 3038 | dev->watchdog_timeo = MWIFIEX_DEFAULT_WATCHDOG_TIMEOUT; |
|---|
| 3016 | | - dev->hard_header_len += MWIFIEX_MIN_DATA_HEADER_LEN; |
|---|
| 3039 | + dev->needed_headroom = MWIFIEX_MIN_DATA_HEADER_LEN; |
|---|
| 3017 | 3040 | dev->ethtool_ops = &mwifiex_ethtool_ops; |
|---|
| 3018 | 3041 | |
|---|
| 3019 | 3042 | mdev_priv = netdev_priv(dev); |
|---|
| .. | .. |
|---|
| 3228 | 3251 | in_dev = __in_dev_get_rtnl(adapter->priv[i]->netdev); |
|---|
| 3229 | 3252 | if (!in_dev) |
|---|
| 3230 | 3253 | continue; |
|---|
| 3231 | | - ifa = in_dev->ifa_list; |
|---|
| 3254 | + ifa = rtnl_dereference(in_dev->ifa_list); |
|---|
| 3232 | 3255 | if (!ifa || !ifa->ifa_local) |
|---|
| 3233 | 3256 | continue; |
|---|
| 3234 | 3257 | ips[i] = ifa->ifa_local; |
|---|
| .. | .. |
|---|
| 3694 | 3717 | int ret; |
|---|
| 3695 | 3718 | |
|---|
| 3696 | 3719 | if (!(wiphy->flags & WIPHY_FLAG_SUPPORTS_TDLS)) |
|---|
| 3697 | | - return -ENOTSUPP; |
|---|
| 3720 | + return -EOPNOTSUPP; |
|---|
| 3698 | 3721 | |
|---|
| 3699 | 3722 | /* make sure we are in station mode and connected */ |
|---|
| 3700 | 3723 | if (!(priv->bss_type == MWIFIEX_BSS_TYPE_STA && priv->media_connected)) |
|---|
| 3701 | | - return -ENOTSUPP; |
|---|
| 3724 | + return -EOPNOTSUPP; |
|---|
| 3702 | 3725 | |
|---|
| 3703 | 3726 | switch (action_code) { |
|---|
| 3704 | 3727 | case WLAN_TDLS_SETUP_REQUEST: |
|---|
| .. | .. |
|---|
| 3766 | 3789 | |
|---|
| 3767 | 3790 | if (!(wiphy->flags & WIPHY_FLAG_SUPPORTS_TDLS) || |
|---|
| 3768 | 3791 | !(wiphy->flags & WIPHY_FLAG_TDLS_EXTERNAL_SETUP)) |
|---|
| 3769 | | - return -ENOTSUPP; |
|---|
| 3792 | + return -EOPNOTSUPP; |
|---|
| 3770 | 3793 | |
|---|
| 3771 | 3794 | /* make sure we are in station mode and connected */ |
|---|
| 3772 | 3795 | if (!(priv->bss_type == MWIFIEX_BSS_TYPE_STA && priv->media_connected)) |
|---|
| 3773 | | - return -ENOTSUPP; |
|---|
| 3796 | + return -EOPNOTSUPP; |
|---|
| 3774 | 3797 | |
|---|
| 3775 | 3798 | mwifiex_dbg(priv->adapter, MSG, |
|---|
| 3776 | 3799 | "TDLS peer=%pM, oper=%d\n", peer, action); |
|---|
| .. | .. |
|---|
| 3800 | 3823 | default: |
|---|
| 3801 | 3824 | mwifiex_dbg(priv->adapter, ERROR, |
|---|
| 3802 | 3825 | "tdls_oper: operation not supported\n"); |
|---|
| 3803 | | - return -ENOTSUPP; |
|---|
| 3826 | + return -EOPNOTSUPP; |
|---|
| 3804 | 3827 | } |
|---|
| 3805 | 3828 | |
|---|
| 3806 | 3829 | return mwifiex_tdls_oper(priv, peer, action); |
|---|
| .. | .. |
|---|
| 3812 | 3835 | struct cfg80211_chan_def *chandef) |
|---|
| 3813 | 3836 | { |
|---|
| 3814 | 3837 | struct mwifiex_sta_node *sta_ptr; |
|---|
| 3815 | | - unsigned long flags; |
|---|
| 3816 | 3838 | u16 chan; |
|---|
| 3817 | 3839 | u8 second_chan_offset, band; |
|---|
| 3818 | 3840 | struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev); |
|---|
| 3819 | 3841 | |
|---|
| 3820 | | - spin_lock_irqsave(&priv->sta_list_spinlock, flags); |
|---|
| 3842 | + spin_lock_bh(&priv->sta_list_spinlock); |
|---|
| 3821 | 3843 | sta_ptr = mwifiex_get_sta_entry(priv, addr); |
|---|
| 3822 | 3844 | if (!sta_ptr) { |
|---|
| 3823 | | - spin_unlock_irqrestore(&priv->sta_list_spinlock, flags); |
|---|
| 3845 | + spin_unlock_bh(&priv->sta_list_spinlock); |
|---|
| 3824 | 3846 | wiphy_err(wiphy, "%s: Invalid TDLS peer %pM\n", |
|---|
| 3825 | 3847 | __func__, addr); |
|---|
| 3826 | 3848 | return -ENOENT; |
|---|
| .. | .. |
|---|
| 3828 | 3850 | |
|---|
| 3829 | 3851 | if (!(sta_ptr->tdls_cap.extcap.ext_capab[3] & |
|---|
| 3830 | 3852 | WLAN_EXT_CAPA4_TDLS_CHAN_SWITCH)) { |
|---|
| 3831 | | - spin_unlock_irqrestore(&priv->sta_list_spinlock, flags); |
|---|
| 3853 | + spin_unlock_bh(&priv->sta_list_spinlock); |
|---|
| 3832 | 3854 | wiphy_err(wiphy, "%pM do not support tdls cs\n", addr); |
|---|
| 3833 | 3855 | return -ENOENT; |
|---|
| 3834 | 3856 | } |
|---|
| 3835 | 3857 | |
|---|
| 3836 | 3858 | if (sta_ptr->tdls_status == TDLS_CHAN_SWITCHING || |
|---|
| 3837 | 3859 | sta_ptr->tdls_status == TDLS_IN_OFF_CHAN) { |
|---|
| 3838 | | - spin_unlock_irqrestore(&priv->sta_list_spinlock, flags); |
|---|
| 3860 | + spin_unlock_bh(&priv->sta_list_spinlock); |
|---|
| 3839 | 3861 | wiphy_err(wiphy, "channel switch is running, abort request\n"); |
|---|
| 3840 | 3862 | return -EALREADY; |
|---|
| 3841 | 3863 | } |
|---|
| 3842 | | - spin_unlock_irqrestore(&priv->sta_list_spinlock, flags); |
|---|
| 3864 | + spin_unlock_bh(&priv->sta_list_spinlock); |
|---|
| 3843 | 3865 | |
|---|
| 3844 | 3866 | chan = chandef->chan->hw_value; |
|---|
| 3845 | 3867 | second_chan_offset = mwifiex_get_sec_chan_offset(chan); |
|---|
| .. | .. |
|---|
| 3855 | 3877 | const u8 *addr) |
|---|
| 3856 | 3878 | { |
|---|
| 3857 | 3879 | struct mwifiex_sta_node *sta_ptr; |
|---|
| 3858 | | - unsigned long flags; |
|---|
| 3859 | 3880 | struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev); |
|---|
| 3860 | 3881 | |
|---|
| 3861 | | - spin_lock_irqsave(&priv->sta_list_spinlock, flags); |
|---|
| 3882 | + spin_lock_bh(&priv->sta_list_spinlock); |
|---|
| 3862 | 3883 | sta_ptr = mwifiex_get_sta_entry(priv, addr); |
|---|
| 3863 | 3884 | if (!sta_ptr) { |
|---|
| 3864 | | - spin_unlock_irqrestore(&priv->sta_list_spinlock, flags); |
|---|
| 3885 | + spin_unlock_bh(&priv->sta_list_spinlock); |
|---|
| 3865 | 3886 | wiphy_err(wiphy, "%s: Invalid TDLS peer %pM\n", |
|---|
| 3866 | 3887 | __func__, addr); |
|---|
| 3867 | 3888 | } else if (!(sta_ptr->tdls_status == TDLS_CHAN_SWITCHING || |
|---|
| 3868 | 3889 | sta_ptr->tdls_status == TDLS_IN_BASE_CHAN || |
|---|
| 3869 | 3890 | sta_ptr->tdls_status == TDLS_IN_OFF_CHAN)) { |
|---|
| 3870 | | - spin_unlock_irqrestore(&priv->sta_list_spinlock, flags); |
|---|
| 3891 | + spin_unlock_bh(&priv->sta_list_spinlock); |
|---|
| 3871 | 3892 | wiphy_err(wiphy, "tdls chan switch not initialize by %pM\n", |
|---|
| 3872 | 3893 | addr); |
|---|
| 3873 | 3894 | } else { |
|---|
| 3874 | | - spin_unlock_irqrestore(&priv->sta_list_spinlock, flags); |
|---|
| 3895 | + spin_unlock_bh(&priv->sta_list_spinlock); |
|---|
| 3875 | 3896 | mwifiex_stop_tdls_cs(priv, addr); |
|---|
| 3876 | 3897 | } |
|---|
| 3877 | 3898 | } |
|---|
| .. | .. |
|---|
| 3883 | 3904 | struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev); |
|---|
| 3884 | 3905 | |
|---|
| 3885 | 3906 | if (!(params->sta_flags_set & BIT(NL80211_STA_FLAG_TDLS_PEER))) |
|---|
| 3886 | | - return -ENOTSUPP; |
|---|
| 3907 | + return -EOPNOTSUPP; |
|---|
| 3887 | 3908 | |
|---|
| 3888 | 3909 | /* make sure we are in station mode and connected */ |
|---|
| 3889 | 3910 | if ((priv->bss_type != MWIFIEX_BSS_TYPE_STA) || !priv->media_connected) |
|---|
| 3890 | | - return -ENOTSUPP; |
|---|
| 3911 | + return -EOPNOTSUPP; |
|---|
| 3891 | 3912 | |
|---|
| 3892 | 3913 | return mwifiex_tdls_oper(priv, mac, MWIFIEX_TDLS_CREATE_LINK); |
|---|
| 3893 | 3914 | } |
|---|
| .. | .. |
|---|
| 4019 | 4040 | if (!priv) |
|---|
| 4020 | 4041 | return -EINVAL; |
|---|
| 4021 | 4042 | |
|---|
| 4022 | | - err = nla_parse(tb, MWIFIEX_TM_ATTR_MAX, data, len, mwifiex_tm_policy, |
|---|
| 4023 | | - NULL); |
|---|
| 4043 | + err = nla_parse_deprecated(tb, MWIFIEX_TM_ATTR_MAX, data, len, |
|---|
| 4044 | + mwifiex_tm_policy, NULL); |
|---|
| 4024 | 4045 | if (err) |
|---|
| 4025 | 4046 | return err; |
|---|
| 4026 | 4047 | |
|---|
| .. | .. |
|---|
| 4120 | 4141 | |
|---|
| 4121 | 4142 | /* we support change_station handler only for TDLS peers*/ |
|---|
| 4122 | 4143 | if (!(params->sta_flags_set & BIT(NL80211_STA_FLAG_TDLS_PEER))) |
|---|
| 4123 | | - return -ENOTSUPP; |
|---|
| 4144 | + return -EOPNOTSUPP; |
|---|
| 4124 | 4145 | |
|---|
| 4125 | 4146 | /* make sure we are in station mode and connected */ |
|---|
| 4126 | 4147 | if ((priv->bss_type != MWIFIEX_BSS_TYPE_STA) || !priv->media_connected) |
|---|
| 4127 | | - return -ENOTSUPP; |
|---|
| 4148 | + return -EOPNOTSUPP; |
|---|
| 4128 | 4149 | |
|---|
| 4129 | 4150 | priv->sta_params = params; |
|---|
| 4130 | 4151 | |
|---|
| .. | .. |
|---|
| 4152 | 4173 | .del_key = mwifiex_cfg80211_del_key, |
|---|
| 4153 | 4174 | .set_default_mgmt_key = mwifiex_cfg80211_set_default_mgmt_key, |
|---|
| 4154 | 4175 | .mgmt_tx = mwifiex_cfg80211_mgmt_tx, |
|---|
| 4155 | | - .mgmt_frame_register = mwifiex_cfg80211_mgmt_frame_register, |
|---|
| 4176 | + .update_mgmt_frame_registrations = |
|---|
| 4177 | + mwifiex_cfg80211_update_mgmt_frame_registrations, |
|---|
| 4156 | 4178 | .remain_on_channel = mwifiex_cfg80211_remain_on_channel, |
|---|
| 4157 | 4179 | .cancel_remain_on_channel = mwifiex_cfg80211_cancel_remain_on_channel, |
|---|
| 4158 | 4180 | .set_default_key = mwifiex_cfg80211_set_default_key, |
|---|
| .. | .. |
|---|
| 4304 | 4326 | wiphy->iface_combinations = &mwifiex_iface_comb_ap_sta; |
|---|
| 4305 | 4327 | wiphy->n_iface_combinations = 1; |
|---|
| 4306 | 4328 | |
|---|
| 4329 | + if (adapter->max_sta_conn > adapter->max_p2p_conn) |
|---|
| 4330 | + wiphy->max_ap_assoc_sta = adapter->max_sta_conn; |
|---|
| 4331 | + else |
|---|
| 4332 | + wiphy->max_ap_assoc_sta = adapter->max_p2p_conn; |
|---|
| 4333 | + |
|---|
| 4307 | 4334 | /* Initialize cipher suits */ |
|---|
| 4308 | 4335 | wiphy->cipher_suites = mwifiex_cipher_suites; |
|---|
| 4309 | 4336 | wiphy->n_cipher_suites = ARRAY_SIZE(mwifiex_cipher_suites); |
|---|