.. | .. |
---|
7 | 7 | * we directly assign the wireless handlers of wireless interfaces. |
---|
8 | 8 | * |
---|
9 | 9 | * Copyright 2008-2009 Johannes Berg <johannes@sipsolutions.net> |
---|
| 10 | + * Copyright (C) 2019 Intel Corporation |
---|
10 | 11 | */ |
---|
11 | 12 | |
---|
12 | 13 | #include <linux/export.h> |
---|
.. | .. |
---|
219 | 220 | |
---|
220 | 221 | /** |
---|
221 | 222 | * cfg80211_wext_freq - get wext frequency for non-"auto" |
---|
222 | | - * @dev: the net device |
---|
223 | 223 | * @freq: the wext freq encoding |
---|
224 | 224 | * |
---|
225 | 225 | * Returns a frequency, or a negative error code, or 0 for auto. |
---|
.. | .. |
---|
352 | 352 | changed |= WIPHY_PARAM_RETRY_LONG; |
---|
353 | 353 | changed |= WIPHY_PARAM_RETRY_SHORT; |
---|
354 | 354 | } |
---|
355 | | - |
---|
356 | | - if (!changed) |
---|
357 | | - return 0; |
---|
358 | 355 | |
---|
359 | 356 | err = rdev_set_wiphy_params(rdev, changed); |
---|
360 | 357 | if (err) { |
---|
.. | .. |
---|
500 | 497 | |
---|
501 | 498 | /* |
---|
502 | 499 | * We only need to store WEP keys, since they're the only keys that |
---|
503 | | - * can be be set before a connection is established and persist after |
---|
| 500 | + * can be set before a connection is established and persist after |
---|
504 | 501 | * disconnecting. |
---|
505 | 502 | */ |
---|
506 | 503 | if (!addr && (params->cipher == WLAN_CIPHER_SUITE_WEP40 || |
---|
.. | .. |
---|
867 | 864 | } |
---|
868 | 865 | } |
---|
869 | 866 | } else { |
---|
870 | | - rfkill_set_sw_state(rdev->rfkill, true); |
---|
871 | | - schedule_work(&rdev->rfkill_sync); |
---|
| 867 | + if (rfkill_set_sw_state(rdev->rfkill, true)) |
---|
| 868 | + schedule_work(&rdev->rfkill_block); |
---|
872 | 869 | return 0; |
---|
873 | 870 | } |
---|
874 | 871 | |
---|
.. | .. |
---|
1337 | 1334 | wstats.qual.qual = sig + 110; |
---|
1338 | 1335 | break; |
---|
1339 | 1336 | } |
---|
| 1337 | + fallthrough; |
---|
1340 | 1338 | case CFG80211_SIGNAL_TYPE_UNSPEC: |
---|
1341 | 1339 | if (sinfo.filled & BIT_ULL(NL80211_STA_INFO_SIGNAL)) { |
---|
1342 | 1340 | wstats.qual.updated |= IW_QUAL_LEVEL_UPDATED; |
---|
.. | .. |
---|
1345 | 1343 | wstats.qual.qual = sinfo.signal; |
---|
1346 | 1344 | break; |
---|
1347 | 1345 | } |
---|
| 1346 | + fallthrough; |
---|
1348 | 1347 | default: |
---|
1349 | 1348 | wstats.qual.updated |= IW_QUAL_LEVEL_INVALID; |
---|
1350 | 1349 | wstats.qual.updated |= IW_QUAL_QUAL_INVALID; |
---|
.. | .. |
---|
1473 | 1472 | } |
---|
1474 | 1473 | } |
---|
1475 | 1474 | |
---|
| 1475 | +#define DEFINE_WEXT_COMPAT_STUB(func, type) \ |
---|
| 1476 | + static int __ ## func(struct net_device *dev, \ |
---|
| 1477 | + struct iw_request_info *info, \ |
---|
| 1478 | + union iwreq_data *wrqu, \ |
---|
| 1479 | + char *extra) \ |
---|
| 1480 | + { \ |
---|
| 1481 | + return func(dev, info, (type *)wrqu, extra); \ |
---|
| 1482 | + } |
---|
| 1483 | + |
---|
| 1484 | +DEFINE_WEXT_COMPAT_STUB(cfg80211_wext_giwname, char) |
---|
| 1485 | +DEFINE_WEXT_COMPAT_STUB(cfg80211_wext_siwfreq, struct iw_freq) |
---|
| 1486 | +DEFINE_WEXT_COMPAT_STUB(cfg80211_wext_giwfreq, struct iw_freq) |
---|
| 1487 | +DEFINE_WEXT_COMPAT_STUB(cfg80211_wext_siwmode, u32) |
---|
| 1488 | +DEFINE_WEXT_COMPAT_STUB(cfg80211_wext_giwmode, u32) |
---|
| 1489 | +DEFINE_WEXT_COMPAT_STUB(cfg80211_wext_giwrange, struct iw_point) |
---|
| 1490 | +DEFINE_WEXT_COMPAT_STUB(cfg80211_wext_siwap, struct sockaddr) |
---|
| 1491 | +DEFINE_WEXT_COMPAT_STUB(cfg80211_wext_giwap, struct sockaddr) |
---|
| 1492 | +DEFINE_WEXT_COMPAT_STUB(cfg80211_wext_siwmlme, struct iw_point) |
---|
| 1493 | +DEFINE_WEXT_COMPAT_STUB(cfg80211_wext_giwscan, struct iw_point) |
---|
| 1494 | +DEFINE_WEXT_COMPAT_STUB(cfg80211_wext_siwessid, struct iw_point) |
---|
| 1495 | +DEFINE_WEXT_COMPAT_STUB(cfg80211_wext_giwessid, struct iw_point) |
---|
| 1496 | +DEFINE_WEXT_COMPAT_STUB(cfg80211_wext_siwrate, struct iw_param) |
---|
| 1497 | +DEFINE_WEXT_COMPAT_STUB(cfg80211_wext_giwrate, struct iw_param) |
---|
| 1498 | +DEFINE_WEXT_COMPAT_STUB(cfg80211_wext_siwrts, struct iw_param) |
---|
| 1499 | +DEFINE_WEXT_COMPAT_STUB(cfg80211_wext_giwrts, struct iw_param) |
---|
| 1500 | +DEFINE_WEXT_COMPAT_STUB(cfg80211_wext_siwfrag, struct iw_param) |
---|
| 1501 | +DEFINE_WEXT_COMPAT_STUB(cfg80211_wext_giwfrag, struct iw_param) |
---|
| 1502 | +DEFINE_WEXT_COMPAT_STUB(cfg80211_wext_siwretry, struct iw_param) |
---|
| 1503 | +DEFINE_WEXT_COMPAT_STUB(cfg80211_wext_giwretry, struct iw_param) |
---|
| 1504 | +DEFINE_WEXT_COMPAT_STUB(cfg80211_wext_siwencode, struct iw_point) |
---|
| 1505 | +DEFINE_WEXT_COMPAT_STUB(cfg80211_wext_giwencode, struct iw_point) |
---|
| 1506 | +DEFINE_WEXT_COMPAT_STUB(cfg80211_wext_giwpower, struct iw_param) |
---|
| 1507 | +DEFINE_WEXT_COMPAT_STUB(cfg80211_wext_siwpower, struct iw_param) |
---|
| 1508 | +DEFINE_WEXT_COMPAT_STUB(cfg80211_wext_siwgenie, struct iw_point) |
---|
| 1509 | +DEFINE_WEXT_COMPAT_STUB(cfg80211_wext_giwauth, struct iw_param) |
---|
| 1510 | +DEFINE_WEXT_COMPAT_STUB(cfg80211_wext_siwauth, struct iw_param) |
---|
| 1511 | +DEFINE_WEXT_COMPAT_STUB(cfg80211_wext_siwencodeext, struct iw_point) |
---|
| 1512 | +DEFINE_WEXT_COMPAT_STUB(cfg80211_wext_siwpmksa, struct iw_point) |
---|
| 1513 | + |
---|
1476 | 1514 | static const iw_handler cfg80211_handlers[] = { |
---|
1477 | | - [IW_IOCTL_IDX(SIOCGIWNAME)] = (iw_handler) cfg80211_wext_giwname, |
---|
1478 | | - [IW_IOCTL_IDX(SIOCSIWFREQ)] = (iw_handler) cfg80211_wext_siwfreq, |
---|
1479 | | - [IW_IOCTL_IDX(SIOCGIWFREQ)] = (iw_handler) cfg80211_wext_giwfreq, |
---|
1480 | | - [IW_IOCTL_IDX(SIOCSIWMODE)] = (iw_handler) cfg80211_wext_siwmode, |
---|
1481 | | - [IW_IOCTL_IDX(SIOCGIWMODE)] = (iw_handler) cfg80211_wext_giwmode, |
---|
1482 | | - [IW_IOCTL_IDX(SIOCGIWRANGE)] = (iw_handler) cfg80211_wext_giwrange, |
---|
1483 | | - [IW_IOCTL_IDX(SIOCSIWAP)] = (iw_handler) cfg80211_wext_siwap, |
---|
1484 | | - [IW_IOCTL_IDX(SIOCGIWAP)] = (iw_handler) cfg80211_wext_giwap, |
---|
1485 | | - [IW_IOCTL_IDX(SIOCSIWMLME)] = (iw_handler) cfg80211_wext_siwmlme, |
---|
1486 | | - [IW_IOCTL_IDX(SIOCSIWSCAN)] = (iw_handler) cfg80211_wext_siwscan, |
---|
1487 | | - [IW_IOCTL_IDX(SIOCGIWSCAN)] = (iw_handler) cfg80211_wext_giwscan, |
---|
1488 | | - [IW_IOCTL_IDX(SIOCSIWESSID)] = (iw_handler) cfg80211_wext_siwessid, |
---|
1489 | | - [IW_IOCTL_IDX(SIOCGIWESSID)] = (iw_handler) cfg80211_wext_giwessid, |
---|
1490 | | - [IW_IOCTL_IDX(SIOCSIWRATE)] = (iw_handler) cfg80211_wext_siwrate, |
---|
1491 | | - [IW_IOCTL_IDX(SIOCGIWRATE)] = (iw_handler) cfg80211_wext_giwrate, |
---|
1492 | | - [IW_IOCTL_IDX(SIOCSIWRTS)] = (iw_handler) cfg80211_wext_siwrts, |
---|
1493 | | - [IW_IOCTL_IDX(SIOCGIWRTS)] = (iw_handler) cfg80211_wext_giwrts, |
---|
1494 | | - [IW_IOCTL_IDX(SIOCSIWFRAG)] = (iw_handler) cfg80211_wext_siwfrag, |
---|
1495 | | - [IW_IOCTL_IDX(SIOCGIWFRAG)] = (iw_handler) cfg80211_wext_giwfrag, |
---|
1496 | | - [IW_IOCTL_IDX(SIOCSIWTXPOW)] = (iw_handler) cfg80211_wext_siwtxpower, |
---|
1497 | | - [IW_IOCTL_IDX(SIOCGIWTXPOW)] = (iw_handler) cfg80211_wext_giwtxpower, |
---|
1498 | | - [IW_IOCTL_IDX(SIOCSIWRETRY)] = (iw_handler) cfg80211_wext_siwretry, |
---|
1499 | | - [IW_IOCTL_IDX(SIOCGIWRETRY)] = (iw_handler) cfg80211_wext_giwretry, |
---|
1500 | | - [IW_IOCTL_IDX(SIOCSIWENCODE)] = (iw_handler) cfg80211_wext_siwencode, |
---|
1501 | | - [IW_IOCTL_IDX(SIOCGIWENCODE)] = (iw_handler) cfg80211_wext_giwencode, |
---|
1502 | | - [IW_IOCTL_IDX(SIOCSIWPOWER)] = (iw_handler) cfg80211_wext_siwpower, |
---|
1503 | | - [IW_IOCTL_IDX(SIOCGIWPOWER)] = (iw_handler) cfg80211_wext_giwpower, |
---|
1504 | | - [IW_IOCTL_IDX(SIOCSIWGENIE)] = (iw_handler) cfg80211_wext_siwgenie, |
---|
1505 | | - [IW_IOCTL_IDX(SIOCSIWAUTH)] = (iw_handler) cfg80211_wext_siwauth, |
---|
1506 | | - [IW_IOCTL_IDX(SIOCGIWAUTH)] = (iw_handler) cfg80211_wext_giwauth, |
---|
1507 | | - [IW_IOCTL_IDX(SIOCSIWENCODEEXT)]= (iw_handler) cfg80211_wext_siwencodeext, |
---|
1508 | | - [IW_IOCTL_IDX(SIOCSIWPMKSA)] = (iw_handler) cfg80211_wext_siwpmksa, |
---|
| 1515 | + [IW_IOCTL_IDX(SIOCGIWNAME)] = __cfg80211_wext_giwname, |
---|
| 1516 | + [IW_IOCTL_IDX(SIOCSIWFREQ)] = __cfg80211_wext_siwfreq, |
---|
| 1517 | + [IW_IOCTL_IDX(SIOCGIWFREQ)] = __cfg80211_wext_giwfreq, |
---|
| 1518 | + [IW_IOCTL_IDX(SIOCSIWMODE)] = __cfg80211_wext_siwmode, |
---|
| 1519 | + [IW_IOCTL_IDX(SIOCGIWMODE)] = __cfg80211_wext_giwmode, |
---|
| 1520 | + [IW_IOCTL_IDX(SIOCGIWRANGE)] = __cfg80211_wext_giwrange, |
---|
| 1521 | + [IW_IOCTL_IDX(SIOCSIWAP)] = __cfg80211_wext_siwap, |
---|
| 1522 | + [IW_IOCTL_IDX(SIOCGIWAP)] = __cfg80211_wext_giwap, |
---|
| 1523 | + [IW_IOCTL_IDX(SIOCSIWMLME)] = __cfg80211_wext_siwmlme, |
---|
| 1524 | + [IW_IOCTL_IDX(SIOCSIWSCAN)] = cfg80211_wext_siwscan, |
---|
| 1525 | + [IW_IOCTL_IDX(SIOCGIWSCAN)] = __cfg80211_wext_giwscan, |
---|
| 1526 | + [IW_IOCTL_IDX(SIOCSIWESSID)] = __cfg80211_wext_siwessid, |
---|
| 1527 | + [IW_IOCTL_IDX(SIOCGIWESSID)] = __cfg80211_wext_giwessid, |
---|
| 1528 | + [IW_IOCTL_IDX(SIOCSIWRATE)] = __cfg80211_wext_siwrate, |
---|
| 1529 | + [IW_IOCTL_IDX(SIOCGIWRATE)] = __cfg80211_wext_giwrate, |
---|
| 1530 | + [IW_IOCTL_IDX(SIOCSIWRTS)] = __cfg80211_wext_siwrts, |
---|
| 1531 | + [IW_IOCTL_IDX(SIOCGIWRTS)] = __cfg80211_wext_giwrts, |
---|
| 1532 | + [IW_IOCTL_IDX(SIOCSIWFRAG)] = __cfg80211_wext_siwfrag, |
---|
| 1533 | + [IW_IOCTL_IDX(SIOCGIWFRAG)] = __cfg80211_wext_giwfrag, |
---|
| 1534 | + [IW_IOCTL_IDX(SIOCSIWTXPOW)] = cfg80211_wext_siwtxpower, |
---|
| 1535 | + [IW_IOCTL_IDX(SIOCGIWTXPOW)] = cfg80211_wext_giwtxpower, |
---|
| 1536 | + [IW_IOCTL_IDX(SIOCSIWRETRY)] = __cfg80211_wext_siwretry, |
---|
| 1537 | + [IW_IOCTL_IDX(SIOCGIWRETRY)] = __cfg80211_wext_giwretry, |
---|
| 1538 | + [IW_IOCTL_IDX(SIOCSIWENCODE)] = __cfg80211_wext_siwencode, |
---|
| 1539 | + [IW_IOCTL_IDX(SIOCGIWENCODE)] = __cfg80211_wext_giwencode, |
---|
| 1540 | + [IW_IOCTL_IDX(SIOCSIWPOWER)] = __cfg80211_wext_siwpower, |
---|
| 1541 | + [IW_IOCTL_IDX(SIOCGIWPOWER)] = __cfg80211_wext_giwpower, |
---|
| 1542 | + [IW_IOCTL_IDX(SIOCSIWGENIE)] = __cfg80211_wext_siwgenie, |
---|
| 1543 | + [IW_IOCTL_IDX(SIOCSIWAUTH)] = __cfg80211_wext_siwauth, |
---|
| 1544 | + [IW_IOCTL_IDX(SIOCGIWAUTH)] = __cfg80211_wext_giwauth, |
---|
| 1545 | + [IW_IOCTL_IDX(SIOCSIWENCODEEXT)]= __cfg80211_wext_siwencodeext, |
---|
| 1546 | + [IW_IOCTL_IDX(SIOCSIWPMKSA)] = __cfg80211_wext_siwpmksa, |
---|
1509 | 1547 | }; |
---|
1510 | 1548 | |
---|
1511 | 1549 | const struct iw_handler_def cfg80211_wext_handler = { |
---|