diff options
author | Zhao, Gang <gamerh2o@gmail.com> | 2014-04-21 00:53:03 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2014-04-25 11:33:04 -0400 |
commit | f26cbf401be935eec13da6fca7088b50d797d78b (patch) | |
tree | de83a716467102d1b674805ad94879a779c1683f /net | |
parent | 1b8ec87aa077c527c9e3525e16098ca7efbc853d (diff) |
cfg80211: change wiphy_to_dev function name
Name wiphy_to_rdev is more accurate to describe what the function
does, i.e., return a pointer pointing to struct
cfg80211_registered_device.
Signed-off-by: Zhao, Gang <gamerh2o@gmail.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/wireless/chan.c | 2 | ||||
-rw-r--r-- | net/wireless/core.c | 16 | ||||
-rw-r--r-- | net/wireless/core.h | 2 | ||||
-rw-r--r-- | net/wireless/ethtool.c | 10 | ||||
-rw-r--r-- | net/wireless/ibss.c | 12 | ||||
-rw-r--r-- | net/wireless/mlme.c | 24 | ||||
-rw-r--r-- | net/wireless/nl80211.c | 64 | ||||
-rw-r--r-- | net/wireless/scan.c | 24 | ||||
-rw-r--r-- | net/wireless/sme.c | 37 | ||||
-rw-r--r-- | net/wireless/util.c | 2 | ||||
-rw-r--r-- | net/wireless/wext-compat.c | 32 | ||||
-rw-r--r-- | net/wireless/wext-sme.c | 10 |
12 files changed, 118 insertions, 117 deletions
diff --git a/net/wireless/chan.c b/net/wireless/chan.c index fb8f6a3c9ec5..2adf7b2eccbc 100644 --- a/net/wireless/chan.c +++ b/net/wireless/chan.c | |||
@@ -777,7 +777,7 @@ bool cfg80211_reg_can_beacon(struct wiphy *wiphy, | |||
777 | struct cfg80211_chan_def *chandef, | 777 | struct cfg80211_chan_def *chandef, |
778 | enum nl80211_iftype iftype) | 778 | enum nl80211_iftype iftype) |
779 | { | 779 | { |
780 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); | 780 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); |
781 | bool res; | 781 | bool res; |
782 | u32 prohibited_flags = IEEE80211_CHAN_DISABLED | | 782 | u32 prohibited_flags = IEEE80211_CHAN_DISABLED | |
783 | IEEE80211_CHAN_RADAR; | 783 | IEEE80211_CHAN_RADAR; |
diff --git a/net/wireless/core.c b/net/wireless/core.c index 33d12e23771c..5f33462e10ec 100644 --- a/net/wireless/core.c +++ b/net/wireless/core.c | |||
@@ -69,7 +69,7 @@ struct cfg80211_registered_device *cfg80211_rdev_by_wiphy_idx(int wiphy_idx) | |||
69 | 69 | ||
70 | int get_wiphy_idx(struct wiphy *wiphy) | 70 | int get_wiphy_idx(struct wiphy *wiphy) |
71 | { | 71 | { |
72 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); | 72 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); |
73 | 73 | ||
74 | return rdev->wiphy_idx; | 74 | return rdev->wiphy_idx; |
75 | } | 75 | } |
@@ -475,7 +475,7 @@ static int wiphy_verify_combinations(struct wiphy *wiphy) | |||
475 | 475 | ||
476 | int wiphy_register(struct wiphy *wiphy) | 476 | int wiphy_register(struct wiphy *wiphy) |
477 | { | 477 | { |
478 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); | 478 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); |
479 | int res; | 479 | int res; |
480 | enum ieee80211_band band; | 480 | enum ieee80211_band band; |
481 | struct ieee80211_supported_band *sband; | 481 | struct ieee80211_supported_band *sband; |
@@ -656,7 +656,7 @@ EXPORT_SYMBOL(wiphy_register); | |||
656 | 656 | ||
657 | void wiphy_rfkill_start_polling(struct wiphy *wiphy) | 657 | void wiphy_rfkill_start_polling(struct wiphy *wiphy) |
658 | { | 658 | { |
659 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); | 659 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); |
660 | 660 | ||
661 | if (!rdev->ops->rfkill_poll) | 661 | if (!rdev->ops->rfkill_poll) |
662 | return; | 662 | return; |
@@ -667,7 +667,7 @@ EXPORT_SYMBOL(wiphy_rfkill_start_polling); | |||
667 | 667 | ||
668 | void wiphy_rfkill_stop_polling(struct wiphy *wiphy) | 668 | void wiphy_rfkill_stop_polling(struct wiphy *wiphy) |
669 | { | 669 | { |
670 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); | 670 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); |
671 | 671 | ||
672 | rfkill_pause_polling(rdev->rfkill); | 672 | rfkill_pause_polling(rdev->rfkill); |
673 | } | 673 | } |
@@ -675,7 +675,7 @@ EXPORT_SYMBOL(wiphy_rfkill_stop_polling); | |||
675 | 675 | ||
676 | void wiphy_unregister(struct wiphy *wiphy) | 676 | void wiphy_unregister(struct wiphy *wiphy) |
677 | { | 677 | { |
678 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); | 678 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); |
679 | 679 | ||
680 | wait_event(rdev->dev_wait, ({ | 680 | wait_event(rdev->dev_wait, ({ |
681 | int __count; | 681 | int __count; |
@@ -748,7 +748,7 @@ EXPORT_SYMBOL(wiphy_free); | |||
748 | 748 | ||
749 | void wiphy_rfkill_set_hw_state(struct wiphy *wiphy, bool blocked) | 749 | void wiphy_rfkill_set_hw_state(struct wiphy *wiphy, bool blocked) |
750 | { | 750 | { |
751 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); | 751 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); |
752 | 752 | ||
753 | if (rfkill_set_hw_state(rdev->rfkill, blocked)) | 753 | if (rfkill_set_hw_state(rdev->rfkill, blocked)) |
754 | schedule_work(&rdev->rfkill_sync); | 754 | schedule_work(&rdev->rfkill_sync); |
@@ -757,7 +757,7 @@ EXPORT_SYMBOL(wiphy_rfkill_set_hw_state); | |||
757 | 757 | ||
758 | void cfg80211_unregister_wdev(struct wireless_dev *wdev) | 758 | void cfg80211_unregister_wdev(struct wireless_dev *wdev) |
759 | { | 759 | { |
760 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | 760 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); |
761 | 761 | ||
762 | ASSERT_RTNL(); | 762 | ASSERT_RTNL(); |
763 | 763 | ||
@@ -841,7 +841,7 @@ static int cfg80211_netdev_notifier_call(struct notifier_block *nb, | |||
841 | if (!wdev) | 841 | if (!wdev) |
842 | return NOTIFY_DONE; | 842 | return NOTIFY_DONE; |
843 | 843 | ||
844 | rdev = wiphy_to_dev(wdev->wiphy); | 844 | rdev = wiphy_to_rdev(wdev->wiphy); |
845 | 845 | ||
846 | WARN_ON(wdev->iftype == NL80211_IFTYPE_UNSPECIFIED); | 846 | WARN_ON(wdev->iftype == NL80211_IFTYPE_UNSPECIFIED); |
847 | 847 | ||
diff --git a/net/wireless/core.h b/net/wireless/core.h index c65f4a92710c..681b8fa4355b 100644 --- a/net/wireless/core.h +++ b/net/wireless/core.h | |||
@@ -90,7 +90,7 @@ struct cfg80211_registered_device { | |||
90 | }; | 90 | }; |
91 | 91 | ||
92 | static inline | 92 | static inline |
93 | struct cfg80211_registered_device *wiphy_to_dev(struct wiphy *wiphy) | 93 | struct cfg80211_registered_device *wiphy_to_rdev(struct wiphy *wiphy) |
94 | { | 94 | { |
95 | BUG_ON(!wiphy); | 95 | BUG_ON(!wiphy); |
96 | return container_of(wiphy, struct cfg80211_registered_device, wiphy); | 96 | return container_of(wiphy, struct cfg80211_registered_device, wiphy); |
diff --git a/net/wireless/ethtool.c b/net/wireless/ethtool.c index e37862f1b127..d4860bfc020e 100644 --- a/net/wireless/ethtool.c +++ b/net/wireless/ethtool.c | |||
@@ -43,7 +43,7 @@ static void cfg80211_get_ringparam(struct net_device *dev, | |||
43 | struct ethtool_ringparam *rp) | 43 | struct ethtool_ringparam *rp) |
44 | { | 44 | { |
45 | struct wireless_dev *wdev = dev->ieee80211_ptr; | 45 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
46 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | 46 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); |
47 | 47 | ||
48 | memset(rp, 0, sizeof(*rp)); | 48 | memset(rp, 0, sizeof(*rp)); |
49 | 49 | ||
@@ -56,7 +56,7 @@ static int cfg80211_set_ringparam(struct net_device *dev, | |||
56 | struct ethtool_ringparam *rp) | 56 | struct ethtool_ringparam *rp) |
57 | { | 57 | { |
58 | struct wireless_dev *wdev = dev->ieee80211_ptr; | 58 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
59 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | 59 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); |
60 | 60 | ||
61 | if (rp->rx_mini_pending != 0 || rp->rx_jumbo_pending != 0) | 61 | if (rp->rx_mini_pending != 0 || rp->rx_jumbo_pending != 0) |
62 | return -EINVAL; | 62 | return -EINVAL; |
@@ -70,7 +70,7 @@ static int cfg80211_set_ringparam(struct net_device *dev, | |||
70 | static int cfg80211_get_sset_count(struct net_device *dev, int sset) | 70 | static int cfg80211_get_sset_count(struct net_device *dev, int sset) |
71 | { | 71 | { |
72 | struct wireless_dev *wdev = dev->ieee80211_ptr; | 72 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
73 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | 73 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); |
74 | if (rdev->ops->get_et_sset_count) | 74 | if (rdev->ops->get_et_sset_count) |
75 | return rdev_get_et_sset_count(rdev, dev, sset); | 75 | return rdev_get_et_sset_count(rdev, dev, sset); |
76 | return -EOPNOTSUPP; | 76 | return -EOPNOTSUPP; |
@@ -80,7 +80,7 @@ static void cfg80211_get_stats(struct net_device *dev, | |||
80 | struct ethtool_stats *stats, u64 *data) | 80 | struct ethtool_stats *stats, u64 *data) |
81 | { | 81 | { |
82 | struct wireless_dev *wdev = dev->ieee80211_ptr; | 82 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
83 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | 83 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); |
84 | if (rdev->ops->get_et_stats) | 84 | if (rdev->ops->get_et_stats) |
85 | rdev_get_et_stats(rdev, dev, stats, data); | 85 | rdev_get_et_stats(rdev, dev, stats, data); |
86 | } | 86 | } |
@@ -88,7 +88,7 @@ static void cfg80211_get_stats(struct net_device *dev, | |||
88 | static void cfg80211_get_strings(struct net_device *dev, u32 sset, u8 *data) | 88 | static void cfg80211_get_strings(struct net_device *dev, u32 sset, u8 *data) |
89 | { | 89 | { |
90 | struct wireless_dev *wdev = dev->ieee80211_ptr; | 90 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
91 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | 91 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); |
92 | if (rdev->ops->get_et_strings) | 92 | if (rdev->ops->get_et_strings) |
93 | rdev_get_et_strings(rdev, dev, sset, data); | 93 | rdev_get_et_strings(rdev, dev, sset, data); |
94 | } | 94 | } |
diff --git a/net/wireless/ibss.c b/net/wireless/ibss.c index f55f6ffcfcec..6b50588b709f 100644 --- a/net/wireless/ibss.c +++ b/net/wireless/ibss.c | |||
@@ -45,7 +45,7 @@ void __cfg80211_ibss_joined(struct net_device *dev, const u8 *bssid, | |||
45 | 45 | ||
46 | cfg80211_upload_connect_keys(wdev); | 46 | cfg80211_upload_connect_keys(wdev); |
47 | 47 | ||
48 | nl80211_send_ibss_bssid(wiphy_to_dev(wdev->wiphy), dev, bssid, | 48 | nl80211_send_ibss_bssid(wiphy_to_rdev(wdev->wiphy), dev, bssid, |
49 | GFP_KERNEL); | 49 | GFP_KERNEL); |
50 | #ifdef CONFIG_CFG80211_WEXT | 50 | #ifdef CONFIG_CFG80211_WEXT |
51 | memset(&wrqu, 0, sizeof(wrqu)); | 51 | memset(&wrqu, 0, sizeof(wrqu)); |
@@ -58,7 +58,7 @@ void cfg80211_ibss_joined(struct net_device *dev, const u8 *bssid, | |||
58 | struct ieee80211_channel *channel, gfp_t gfp) | 58 | struct ieee80211_channel *channel, gfp_t gfp) |
59 | { | 59 | { |
60 | struct wireless_dev *wdev = dev->ieee80211_ptr; | 60 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
61 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | 61 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); |
62 | struct cfg80211_event *ev; | 62 | struct cfg80211_event *ev; |
63 | unsigned long flags; | 63 | unsigned long flags; |
64 | 64 | ||
@@ -156,7 +156,7 @@ int cfg80211_join_ibss(struct cfg80211_registered_device *rdev, | |||
156 | static void __cfg80211_clear_ibss(struct net_device *dev, bool nowext) | 156 | static void __cfg80211_clear_ibss(struct net_device *dev, bool nowext) |
157 | { | 157 | { |
158 | struct wireless_dev *wdev = dev->ieee80211_ptr; | 158 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
159 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | 159 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); |
160 | int i; | 160 | int i; |
161 | 161 | ||
162 | ASSERT_WDEV_LOCK(wdev); | 162 | ASSERT_WDEV_LOCK(wdev); |
@@ -311,7 +311,7 @@ int cfg80211_ibss_wext_siwfreq(struct net_device *dev, | |||
311 | struct iw_freq *wextfreq, char *extra) | 311 | struct iw_freq *wextfreq, char *extra) |
312 | { | 312 | { |
313 | struct wireless_dev *wdev = dev->ieee80211_ptr; | 313 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
314 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | 314 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); |
315 | struct ieee80211_channel *chan = NULL; | 315 | struct ieee80211_channel *chan = NULL; |
316 | int err, freq; | 316 | int err, freq; |
317 | 317 | ||
@@ -396,7 +396,7 @@ int cfg80211_ibss_wext_siwessid(struct net_device *dev, | |||
396 | struct iw_point *data, char *ssid) | 396 | struct iw_point *data, char *ssid) |
397 | { | 397 | { |
398 | struct wireless_dev *wdev = dev->ieee80211_ptr; | 398 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
399 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | 399 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); |
400 | size_t len = data->length; | 400 | size_t len = data->length; |
401 | int err; | 401 | int err; |
402 | 402 | ||
@@ -463,7 +463,7 @@ int cfg80211_ibss_wext_siwap(struct net_device *dev, | |||
463 | struct sockaddr *ap_addr, char *extra) | 463 | struct sockaddr *ap_addr, char *extra) |
464 | { | 464 | { |
465 | struct wireless_dev *wdev = dev->ieee80211_ptr; | 465 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
466 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | 466 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); |
467 | u8 *bssid = ap_addr->sa_data; | 467 | u8 *bssid = ap_addr->sa_data; |
468 | int err; | 468 | int err; |
469 | 469 | ||
diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c index 4b4ba707fab9..266766b8d80b 100644 --- a/net/wireless/mlme.c +++ b/net/wireless/mlme.c | |||
@@ -23,7 +23,7 @@ void cfg80211_rx_assoc_resp(struct net_device *dev, struct cfg80211_bss *bss, | |||
23 | { | 23 | { |
24 | struct wireless_dev *wdev = dev->ieee80211_ptr; | 24 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
25 | struct wiphy *wiphy = wdev->wiphy; | 25 | struct wiphy *wiphy = wdev->wiphy; |
26 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); | 26 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); |
27 | struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)buf; | 27 | struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)buf; |
28 | u8 *ie = mgmt->u.assoc_resp.variable; | 28 | u8 *ie = mgmt->u.assoc_resp.variable; |
29 | int ieoffs = offsetof(struct ieee80211_mgmt, u.assoc_resp.variable); | 29 | int ieoffs = offsetof(struct ieee80211_mgmt, u.assoc_resp.variable); |
@@ -54,7 +54,7 @@ EXPORT_SYMBOL(cfg80211_rx_assoc_resp); | |||
54 | static void cfg80211_process_auth(struct wireless_dev *wdev, | 54 | static void cfg80211_process_auth(struct wireless_dev *wdev, |
55 | const u8 *buf, size_t len) | 55 | const u8 *buf, size_t len) |
56 | { | 56 | { |
57 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | 57 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); |
58 | 58 | ||
59 | nl80211_send_rx_auth(rdev, wdev->netdev, buf, len, GFP_KERNEL); | 59 | nl80211_send_rx_auth(rdev, wdev->netdev, buf, len, GFP_KERNEL); |
60 | cfg80211_sme_rx_auth(wdev, buf, len); | 60 | cfg80211_sme_rx_auth(wdev, buf, len); |
@@ -63,7 +63,7 @@ static void cfg80211_process_auth(struct wireless_dev *wdev, | |||
63 | static void cfg80211_process_deauth(struct wireless_dev *wdev, | 63 | static void cfg80211_process_deauth(struct wireless_dev *wdev, |
64 | const u8 *buf, size_t len) | 64 | const u8 *buf, size_t len) |
65 | { | 65 | { |
66 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | 66 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); |
67 | struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)buf; | 67 | struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)buf; |
68 | const u8 *bssid = mgmt->bssid; | 68 | const u8 *bssid = mgmt->bssid; |
69 | u16 reason_code = le16_to_cpu(mgmt->u.deauth.reason_code); | 69 | u16 reason_code = le16_to_cpu(mgmt->u.deauth.reason_code); |
@@ -82,7 +82,7 @@ static void cfg80211_process_deauth(struct wireless_dev *wdev, | |||
82 | static void cfg80211_process_disassoc(struct wireless_dev *wdev, | 82 | static void cfg80211_process_disassoc(struct wireless_dev *wdev, |
83 | const u8 *buf, size_t len) | 83 | const u8 *buf, size_t len) |
84 | { | 84 | { |
85 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | 85 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); |
86 | struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)buf; | 86 | struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)buf; |
87 | const u8 *bssid = mgmt->bssid; | 87 | const u8 *bssid = mgmt->bssid; |
88 | u16 reason_code = le16_to_cpu(mgmt->u.disassoc.reason_code); | 88 | u16 reason_code = le16_to_cpu(mgmt->u.disassoc.reason_code); |
@@ -123,7 +123,7 @@ void cfg80211_auth_timeout(struct net_device *dev, const u8 *addr) | |||
123 | { | 123 | { |
124 | struct wireless_dev *wdev = dev->ieee80211_ptr; | 124 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
125 | struct wiphy *wiphy = wdev->wiphy; | 125 | struct wiphy *wiphy = wdev->wiphy; |
126 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); | 126 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); |
127 | 127 | ||
128 | trace_cfg80211_send_auth_timeout(dev, addr); | 128 | trace_cfg80211_send_auth_timeout(dev, addr); |
129 | 129 | ||
@@ -136,7 +136,7 @@ void cfg80211_assoc_timeout(struct net_device *dev, struct cfg80211_bss *bss) | |||
136 | { | 136 | { |
137 | struct wireless_dev *wdev = dev->ieee80211_ptr; | 137 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
138 | struct wiphy *wiphy = wdev->wiphy; | 138 | struct wiphy *wiphy = wdev->wiphy; |
139 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); | 139 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); |
140 | 140 | ||
141 | trace_cfg80211_send_assoc_timeout(dev, bss->bssid); | 141 | trace_cfg80211_send_assoc_timeout(dev, bss->bssid); |
142 | 142 | ||
@@ -172,7 +172,7 @@ void cfg80211_michael_mic_failure(struct net_device *dev, const u8 *addr, | |||
172 | const u8 *tsc, gfp_t gfp) | 172 | const u8 *tsc, gfp_t gfp) |
173 | { | 173 | { |
174 | struct wiphy *wiphy = dev->ieee80211_ptr->wiphy; | 174 | struct wiphy *wiphy = dev->ieee80211_ptr->wiphy; |
175 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); | 175 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); |
176 | #ifdef CONFIG_CFG80211_WEXT | 176 | #ifdef CONFIG_CFG80211_WEXT |
177 | union iwreq_data wrqu; | 177 | union iwreq_data wrqu; |
178 | char *buf = kmalloc(128, gfp); | 178 | char *buf = kmalloc(128, gfp); |
@@ -402,7 +402,7 @@ int cfg80211_mlme_register_mgmt(struct wireless_dev *wdev, u32 snd_portid, | |||
402 | int match_len) | 402 | int match_len) |
403 | { | 403 | { |
404 | struct wiphy *wiphy = wdev->wiphy; | 404 | struct wiphy *wiphy = wdev->wiphy; |
405 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); | 405 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); |
406 | struct cfg80211_mgmt_registration *reg, *nreg; | 406 | struct cfg80211_mgmt_registration *reg, *nreg; |
407 | int err = 0; | 407 | int err = 0; |
408 | u16 mgmt_type; | 408 | u16 mgmt_type; |
@@ -461,7 +461,7 @@ int cfg80211_mlme_register_mgmt(struct wireless_dev *wdev, u32 snd_portid, | |||
461 | void cfg80211_mlme_unregister_socket(struct wireless_dev *wdev, u32 nlportid) | 461 | void cfg80211_mlme_unregister_socket(struct wireless_dev *wdev, u32 nlportid) |
462 | { | 462 | { |
463 | struct wiphy *wiphy = wdev->wiphy; | 463 | struct wiphy *wiphy = wdev->wiphy; |
464 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); | 464 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); |
465 | struct cfg80211_mgmt_registration *reg, *tmp; | 465 | struct cfg80211_mgmt_registration *reg, *tmp; |
466 | 466 | ||
467 | spin_lock_bh(&wdev->mgmt_registrations_lock); | 467 | spin_lock_bh(&wdev->mgmt_registrations_lock); |
@@ -608,7 +608,7 @@ bool cfg80211_rx_mgmt(struct wireless_dev *wdev, int freq, int sig_mbm, | |||
608 | const u8 *buf, size_t len, u32 flags, gfp_t gfp) | 608 | const u8 *buf, size_t len, u32 flags, gfp_t gfp) |
609 | { | 609 | { |
610 | struct wiphy *wiphy = wdev->wiphy; | 610 | struct wiphy *wiphy = wdev->wiphy; |
611 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); | 611 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); |
612 | struct cfg80211_mgmt_registration *reg; | 612 | struct cfg80211_mgmt_registration *reg; |
613 | const struct ieee80211_txrx_stypes *stypes = | 613 | const struct ieee80211_txrx_stypes *stypes = |
614 | &wiphy->mgmt_stypes[wdev->iftype]; | 614 | &wiphy->mgmt_stypes[wdev->iftype]; |
@@ -727,7 +727,7 @@ void cfg80211_radar_event(struct wiphy *wiphy, | |||
727 | struct cfg80211_chan_def *chandef, | 727 | struct cfg80211_chan_def *chandef, |
728 | gfp_t gfp) | 728 | gfp_t gfp) |
729 | { | 729 | { |
730 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); | 730 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); |
731 | unsigned long timeout; | 731 | unsigned long timeout; |
732 | 732 | ||
733 | trace_cfg80211_radar_event(wiphy, chandef); | 733 | trace_cfg80211_radar_event(wiphy, chandef); |
@@ -752,7 +752,7 @@ void cfg80211_cac_event(struct net_device *netdev, | |||
752 | { | 752 | { |
753 | struct wireless_dev *wdev = netdev->ieee80211_ptr; | 753 | struct wireless_dev *wdev = netdev->ieee80211_ptr; |
754 | struct wiphy *wiphy = wdev->wiphy; | 754 | struct wiphy *wiphy = wdev->wiphy; |
755 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); | 755 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); |
756 | unsigned long timeout; | 756 | unsigned long timeout; |
757 | 757 | ||
758 | trace_cfg80211_cac_event(netdev, event); | 758 | trace_cfg80211_cac_event(netdev, event); |
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 9edbb5f7b1bb..6550e20c8e49 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -168,8 +168,8 @@ __cfg80211_rdev_from_attrs(struct net *netns, struct nlattr **attrs) | |||
168 | netdev = __dev_get_by_index(netns, ifindex); | 168 | netdev = __dev_get_by_index(netns, ifindex); |
169 | if (netdev) { | 169 | if (netdev) { |
170 | if (netdev->ieee80211_ptr) | 170 | if (netdev->ieee80211_ptr) |
171 | tmp = wiphy_to_dev( | 171 | tmp = wiphy_to_rdev( |
172 | netdev->ieee80211_ptr->wiphy); | 172 | netdev->ieee80211_ptr->wiphy); |
173 | else | 173 | else |
174 | tmp = NULL; | 174 | tmp = NULL; |
175 | 175 | ||
@@ -485,7 +485,7 @@ static int nl80211_prepare_wdev_dump(struct sk_buff *skb, | |||
485 | err = PTR_ERR(*wdev); | 485 | err = PTR_ERR(*wdev); |
486 | goto out_unlock; | 486 | goto out_unlock; |
487 | } | 487 | } |
488 | *rdev = wiphy_to_dev((*wdev)->wiphy); | 488 | *rdev = wiphy_to_rdev((*wdev)->wiphy); |
489 | /* 0 is the first index - add 1 to parse only once */ | 489 | /* 0 is the first index - add 1 to parse only once */ |
490 | cb->args[0] = (*rdev)->wiphy_idx + 1; | 490 | cb->args[0] = (*rdev)->wiphy_idx + 1; |
491 | cb->args[1] = (*wdev)->identifier; | 491 | cb->args[1] = (*wdev)->identifier; |
@@ -498,7 +498,7 @@ static int nl80211_prepare_wdev_dump(struct sk_buff *skb, | |||
498 | err = -ENODEV; | 498 | err = -ENODEV; |
499 | goto out_unlock; | 499 | goto out_unlock; |
500 | } | 500 | } |
501 | *rdev = wiphy_to_dev(wiphy); | 501 | *rdev = wiphy_to_rdev(wiphy); |
502 | *wdev = NULL; | 502 | *wdev = NULL; |
503 | 503 | ||
504 | list_for_each_entry(tmp, &(*rdev)->wdev_list, list) { | 504 | list_for_each_entry(tmp, &(*rdev)->wdev_list, list) { |
@@ -1691,7 +1691,7 @@ static int nl80211_dump_wiphy_parse(struct sk_buff *skb, | |||
1691 | if (!netdev) | 1691 | if (!netdev) |
1692 | return -ENODEV; | 1692 | return -ENODEV; |
1693 | if (netdev->ieee80211_ptr) { | 1693 | if (netdev->ieee80211_ptr) { |
1694 | rdev = wiphy_to_dev( | 1694 | rdev = wiphy_to_rdev( |
1695 | netdev->ieee80211_ptr->wiphy); | 1695 | netdev->ieee80211_ptr->wiphy); |
1696 | state->filter_wiphy = rdev->wiphy_idx; | 1696 | state->filter_wiphy = rdev->wiphy_idx; |
1697 | } | 1697 | } |
@@ -2020,7 +2020,7 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info) | |||
2020 | 2020 | ||
2021 | netdev = __dev_get_by_index(genl_info_net(info), ifindex); | 2021 | netdev = __dev_get_by_index(genl_info_net(info), ifindex); |
2022 | if (netdev && netdev->ieee80211_ptr) | 2022 | if (netdev && netdev->ieee80211_ptr) |
2023 | rdev = wiphy_to_dev(netdev->ieee80211_ptr->wiphy); | 2023 | rdev = wiphy_to_rdev(netdev->ieee80211_ptr->wiphy); |
2024 | else | 2024 | else |
2025 | netdev = NULL; | 2025 | netdev = NULL; |
2026 | } | 2026 | } |
@@ -2236,7 +2236,7 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info) | |||
2236 | static inline u64 wdev_id(struct wireless_dev *wdev) | 2236 | static inline u64 wdev_id(struct wireless_dev *wdev) |
2237 | { | 2237 | { |
2238 | return (u64)wdev->identifier | | 2238 | return (u64)wdev->identifier | |
2239 | ((u64)wiphy_to_dev(wdev->wiphy)->wiphy_idx << 32); | 2239 | ((u64)wiphy_to_rdev(wdev->wiphy)->wiphy_idx << 32); |
2240 | } | 2240 | } |
2241 | 2241 | ||
2242 | static int nl80211_send_chandef(struct sk_buff *msg, | 2242 | static int nl80211_send_chandef(struct sk_buff *msg, |
@@ -6867,7 +6867,7 @@ struct sk_buff *__cfg80211_alloc_event_skb(struct wiphy *wiphy, | |||
6867 | int vendor_event_idx, | 6867 | int vendor_event_idx, |
6868 | int approxlen, gfp_t gfp) | 6868 | int approxlen, gfp_t gfp) |
6869 | { | 6869 | { |
6870 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); | 6870 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); |
6871 | const struct nl80211_vendor_cmd_info *info; | 6871 | const struct nl80211_vendor_cmd_info *info; |
6872 | 6872 | ||
6873 | switch (cmd) { | 6873 | switch (cmd) { |
@@ -9179,7 +9179,7 @@ struct sk_buff *__cfg80211_alloc_reply_skb(struct wiphy *wiphy, | |||
9179 | enum nl80211_attrs attr, | 9179 | enum nl80211_attrs attr, |
9180 | int approxlen) | 9180 | int approxlen) |
9181 | { | 9181 | { |
9182 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); | 9182 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); |
9183 | 9183 | ||
9184 | if (WARN_ON(!rdev->cur_cmd_info)) | 9184 | if (WARN_ON(!rdev->cur_cmd_info)) |
9185 | return NULL; | 9185 | return NULL; |
@@ -9303,7 +9303,7 @@ static int nl80211_pre_doit(const struct genl_ops *ops, struct sk_buff *skb, | |||
9303 | } | 9303 | } |
9304 | 9304 | ||
9305 | dev = wdev->netdev; | 9305 | dev = wdev->netdev; |
9306 | rdev = wiphy_to_dev(wdev->wiphy); | 9306 | rdev = wiphy_to_rdev(wdev->wiphy); |
9307 | 9307 | ||
9308 | if (ops->internal_flags & NL80211_FLAG_NEED_NETDEV) { | 9308 | if (ops->internal_flags & NL80211_FLAG_NEED_NETDEV) { |
9309 | if (!dev) { | 9309 | if (!dev) { |
@@ -10332,7 +10332,7 @@ void cfg80211_rx_unprot_mlme_mgmt(struct net_device *dev, const u8 *buf, | |||
10332 | { | 10332 | { |
10333 | struct wireless_dev *wdev = dev->ieee80211_ptr; | 10333 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
10334 | struct wiphy *wiphy = wdev->wiphy; | 10334 | struct wiphy *wiphy = wdev->wiphy; |
10335 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); | 10335 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); |
10336 | const struct ieee80211_mgmt *mgmt = (void *)buf; | 10336 | const struct ieee80211_mgmt *mgmt = (void *)buf; |
10337 | u32 cmd; | 10337 | u32 cmd; |
10338 | 10338 | ||
@@ -10554,7 +10554,7 @@ void cfg80211_notify_new_peer_candidate(struct net_device *dev, const u8 *addr, | |||
10554 | const u8* ie, u8 ie_len, gfp_t gfp) | 10554 | const u8* ie, u8 ie_len, gfp_t gfp) |
10555 | { | 10555 | { |
10556 | struct wireless_dev *wdev = dev->ieee80211_ptr; | 10556 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
10557 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | 10557 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); |
10558 | struct sk_buff *msg; | 10558 | struct sk_buff *msg; |
10559 | void *hdr; | 10559 | void *hdr; |
10560 | 10560 | ||
@@ -10734,7 +10734,7 @@ void cfg80211_ready_on_channel(struct wireless_dev *wdev, u64 cookie, | |||
10734 | unsigned int duration, gfp_t gfp) | 10734 | unsigned int duration, gfp_t gfp) |
10735 | { | 10735 | { |
10736 | struct wiphy *wiphy = wdev->wiphy; | 10736 | struct wiphy *wiphy = wdev->wiphy; |
10737 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); | 10737 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); |
10738 | 10738 | ||
10739 | trace_cfg80211_ready_on_channel(wdev, cookie, chan, duration); | 10739 | trace_cfg80211_ready_on_channel(wdev, cookie, chan, duration); |
10740 | nl80211_send_remain_on_chan_event(NL80211_CMD_REMAIN_ON_CHANNEL, | 10740 | nl80211_send_remain_on_chan_event(NL80211_CMD_REMAIN_ON_CHANNEL, |
@@ -10748,7 +10748,7 @@ void cfg80211_remain_on_channel_expired(struct wireless_dev *wdev, u64 cookie, | |||
10748 | gfp_t gfp) | 10748 | gfp_t gfp) |
10749 | { | 10749 | { |
10750 | struct wiphy *wiphy = wdev->wiphy; | 10750 | struct wiphy *wiphy = wdev->wiphy; |
10751 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); | 10751 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); |
10752 | 10752 | ||
10753 | trace_cfg80211_ready_on_channel_expired(wdev, cookie, chan); | 10753 | trace_cfg80211_ready_on_channel_expired(wdev, cookie, chan); |
10754 | nl80211_send_remain_on_chan_event(NL80211_CMD_CANCEL_REMAIN_ON_CHANNEL, | 10754 | nl80211_send_remain_on_chan_event(NL80211_CMD_CANCEL_REMAIN_ON_CHANNEL, |
@@ -10760,7 +10760,7 @@ void cfg80211_new_sta(struct net_device *dev, const u8 *mac_addr, | |||
10760 | struct station_info *sinfo, gfp_t gfp) | 10760 | struct station_info *sinfo, gfp_t gfp) |
10761 | { | 10761 | { |
10762 | struct wiphy *wiphy = dev->ieee80211_ptr->wiphy; | 10762 | struct wiphy *wiphy = dev->ieee80211_ptr->wiphy; |
10763 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); | 10763 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); |
10764 | struct sk_buff *msg; | 10764 | struct sk_buff *msg; |
10765 | 10765 | ||
10766 | trace_cfg80211_new_sta(dev, mac_addr, sinfo); | 10766 | trace_cfg80211_new_sta(dev, mac_addr, sinfo); |
@@ -10783,7 +10783,7 @@ EXPORT_SYMBOL(cfg80211_new_sta); | |||
10783 | void cfg80211_del_sta(struct net_device *dev, const u8 *mac_addr, gfp_t gfp) | 10783 | void cfg80211_del_sta(struct net_device *dev, const u8 *mac_addr, gfp_t gfp) |
10784 | { | 10784 | { |
10785 | struct wiphy *wiphy = dev->ieee80211_ptr->wiphy; | 10785 | struct wiphy *wiphy = dev->ieee80211_ptr->wiphy; |
10786 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); | 10786 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); |
10787 | struct sk_buff *msg; | 10787 | struct sk_buff *msg; |
10788 | void *hdr; | 10788 | void *hdr; |
10789 | 10789 | ||
@@ -10820,7 +10820,7 @@ void cfg80211_conn_failed(struct net_device *dev, const u8 *mac_addr, | |||
10820 | gfp_t gfp) | 10820 | gfp_t gfp) |
10821 | { | 10821 | { |
10822 | struct wiphy *wiphy = dev->ieee80211_ptr->wiphy; | 10822 | struct wiphy *wiphy = dev->ieee80211_ptr->wiphy; |
10823 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); | 10823 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); |
10824 | struct sk_buff *msg; | 10824 | struct sk_buff *msg; |
10825 | void *hdr; | 10825 | void *hdr; |
10826 | 10826 | ||
@@ -10855,7 +10855,7 @@ static bool __nl80211_unexpected_frame(struct net_device *dev, u8 cmd, | |||
10855 | const u8 *addr, gfp_t gfp) | 10855 | const u8 *addr, gfp_t gfp) |
10856 | { | 10856 | { |
10857 | struct wireless_dev *wdev = dev->ieee80211_ptr; | 10857 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
10858 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | 10858 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); |
10859 | struct sk_buff *msg; | 10859 | struct sk_buff *msg; |
10860 | void *hdr; | 10860 | void *hdr; |
10861 | u32 nlportid = ACCESS_ONCE(wdev->ap_unexpected_nlportid); | 10861 | u32 nlportid = ACCESS_ONCE(wdev->ap_unexpected_nlportid); |
@@ -10975,7 +10975,7 @@ void cfg80211_mgmt_tx_status(struct wireless_dev *wdev, u64 cookie, | |||
10975 | const u8 *buf, size_t len, bool ack, gfp_t gfp) | 10975 | const u8 *buf, size_t len, bool ack, gfp_t gfp) |
10976 | { | 10976 | { |
10977 | struct wiphy *wiphy = wdev->wiphy; | 10977 | struct wiphy *wiphy = wdev->wiphy; |
10978 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); | 10978 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); |
10979 | struct net_device *netdev = wdev->netdev; | 10979 | struct net_device *netdev = wdev->netdev; |
10980 | struct sk_buff *msg; | 10980 | struct sk_buff *msg; |
10981 | void *hdr; | 10981 | void *hdr; |
@@ -11019,7 +11019,7 @@ void cfg80211_cqm_rssi_notify(struct net_device *dev, | |||
11019 | { | 11019 | { |
11020 | struct wireless_dev *wdev = dev->ieee80211_ptr; | 11020 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
11021 | struct wiphy *wiphy = wdev->wiphy; | 11021 | struct wiphy *wiphy = wdev->wiphy; |
11022 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); | 11022 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); |
11023 | struct sk_buff *msg; | 11023 | struct sk_buff *msg; |
11024 | struct nlattr *pinfoattr; | 11024 | struct nlattr *pinfoattr; |
11025 | void *hdr; | 11025 | void *hdr; |
@@ -11111,7 +11111,7 @@ void cfg80211_gtk_rekey_notify(struct net_device *dev, const u8 *bssid, | |||
11111 | { | 11111 | { |
11112 | struct wireless_dev *wdev = dev->ieee80211_ptr; | 11112 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
11113 | struct wiphy *wiphy = wdev->wiphy; | 11113 | struct wiphy *wiphy = wdev->wiphy; |
11114 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); | 11114 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); |
11115 | 11115 | ||
11116 | trace_cfg80211_gtk_rekey_notify(dev, bssid); | 11116 | trace_cfg80211_gtk_rekey_notify(dev, bssid); |
11117 | nl80211_gtk_rekey_notify(rdev, dev, bssid, replay_ctr, gfp); | 11117 | nl80211_gtk_rekey_notify(rdev, dev, bssid, replay_ctr, gfp); |
@@ -11169,7 +11169,7 @@ void cfg80211_pmksa_candidate_notify(struct net_device *dev, int index, | |||
11169 | { | 11169 | { |
11170 | struct wireless_dev *wdev = dev->ieee80211_ptr; | 11170 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
11171 | struct wiphy *wiphy = wdev->wiphy; | 11171 | struct wiphy *wiphy = wdev->wiphy; |
11172 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); | 11172 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); |
11173 | 11173 | ||
11174 | trace_cfg80211_pmksa_candidate_notify(dev, index, bssid, preauth); | 11174 | trace_cfg80211_pmksa_candidate_notify(dev, index, bssid, preauth); |
11175 | nl80211_pmksa_candidate_notify(rdev, dev, index, bssid, preauth, gfp); | 11175 | nl80211_pmksa_candidate_notify(rdev, dev, index, bssid, preauth, gfp); |
@@ -11216,7 +11216,7 @@ void cfg80211_ch_switch_notify(struct net_device *dev, | |||
11216 | { | 11216 | { |
11217 | struct wireless_dev *wdev = dev->ieee80211_ptr; | 11217 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
11218 | struct wiphy *wiphy = wdev->wiphy; | 11218 | struct wiphy *wiphy = wdev->wiphy; |
11219 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); | 11219 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); |
11220 | 11220 | ||
11221 | ASSERT_WDEV_LOCK(wdev); | 11221 | ASSERT_WDEV_LOCK(wdev); |
11222 | 11222 | ||
@@ -11240,7 +11240,7 @@ void cfg80211_cqm_txe_notify(struct net_device *dev, | |||
11240 | { | 11240 | { |
11241 | struct wireless_dev *wdev = dev->ieee80211_ptr; | 11241 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
11242 | struct wiphy *wiphy = wdev->wiphy; | 11242 | struct wiphy *wiphy = wdev->wiphy; |
11243 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); | 11243 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); |
11244 | struct sk_buff *msg; | 11244 | struct sk_buff *msg; |
11245 | struct nlattr *pinfoattr; | 11245 | struct nlattr *pinfoattr; |
11246 | void *hdr; | 11246 | void *hdr; |
@@ -11340,7 +11340,7 @@ void cfg80211_cqm_pktloss_notify(struct net_device *dev, | |||
11340 | { | 11340 | { |
11341 | struct wireless_dev *wdev = dev->ieee80211_ptr; | 11341 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
11342 | struct wiphy *wiphy = wdev->wiphy; | 11342 | struct wiphy *wiphy = wdev->wiphy; |
11343 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); | 11343 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); |
11344 | struct sk_buff *msg; | 11344 | struct sk_buff *msg; |
11345 | struct nlattr *pinfoattr; | 11345 | struct nlattr *pinfoattr; |
11346 | void *hdr; | 11346 | void *hdr; |
@@ -11387,7 +11387,7 @@ void cfg80211_probe_status(struct net_device *dev, const u8 *addr, | |||
11387 | u64 cookie, bool acked, gfp_t gfp) | 11387 | u64 cookie, bool acked, gfp_t gfp) |
11388 | { | 11388 | { |
11389 | struct wireless_dev *wdev = dev->ieee80211_ptr; | 11389 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
11390 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | 11390 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); |
11391 | struct sk_buff *msg; | 11391 | struct sk_buff *msg; |
11392 | void *hdr; | 11392 | void *hdr; |
11393 | 11393 | ||
@@ -11427,7 +11427,7 @@ void cfg80211_report_obss_beacon(struct wiphy *wiphy, | |||
11427 | const u8 *frame, size_t len, | 11427 | const u8 *frame, size_t len, |
11428 | int freq, int sig_dbm) | 11428 | int freq, int sig_dbm) |
11429 | { | 11429 | { |
11430 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); | 11430 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); |
11431 | struct sk_buff *msg; | 11431 | struct sk_buff *msg; |
11432 | void *hdr; | 11432 | void *hdr; |
11433 | struct cfg80211_beacon_registration *reg; | 11433 | struct cfg80211_beacon_registration *reg; |
@@ -11474,7 +11474,7 @@ void cfg80211_report_wowlan_wakeup(struct wireless_dev *wdev, | |||
11474 | struct cfg80211_wowlan_wakeup *wakeup, | 11474 | struct cfg80211_wowlan_wakeup *wakeup, |
11475 | gfp_t gfp) | 11475 | gfp_t gfp) |
11476 | { | 11476 | { |
11477 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | 11477 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); |
11478 | struct sk_buff *msg; | 11478 | struct sk_buff *msg; |
11479 | void *hdr; | 11479 | void *hdr; |
11480 | int size = 200; | 11480 | int size = 200; |
@@ -11584,7 +11584,7 @@ void cfg80211_tdls_oper_request(struct net_device *dev, const u8 *peer, | |||
11584 | u16 reason_code, gfp_t gfp) | 11584 | u16 reason_code, gfp_t gfp) |
11585 | { | 11585 | { |
11586 | struct wireless_dev *wdev = dev->ieee80211_ptr; | 11586 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
11587 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | 11587 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); |
11588 | struct sk_buff *msg; | 11588 | struct sk_buff *msg; |
11589 | void *hdr; | 11589 | void *hdr; |
11590 | 11590 | ||
@@ -11683,7 +11683,7 @@ void cfg80211_ft_event(struct net_device *netdev, | |||
11683 | struct cfg80211_ft_event_params *ft_event) | 11683 | struct cfg80211_ft_event_params *ft_event) |
11684 | { | 11684 | { |
11685 | struct wiphy *wiphy = netdev->ieee80211_ptr->wiphy; | 11685 | struct wiphy *wiphy = netdev->ieee80211_ptr->wiphy; |
11686 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); | 11686 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); |
11687 | struct sk_buff *msg; | 11687 | struct sk_buff *msg; |
11688 | void *hdr; | 11688 | void *hdr; |
11689 | 11689 | ||
@@ -11730,7 +11730,7 @@ void cfg80211_crit_proto_stopped(struct wireless_dev *wdev, gfp_t gfp) | |||
11730 | void *hdr; | 11730 | void *hdr; |
11731 | u32 nlportid; | 11731 | u32 nlportid; |
11732 | 11732 | ||
11733 | rdev = wiphy_to_dev(wdev->wiphy); | 11733 | rdev = wiphy_to_rdev(wdev->wiphy); |
11734 | if (!rdev->crit_proto_nlportid) | 11734 | if (!rdev->crit_proto_nlportid) |
11735 | return; | 11735 | return; |
11736 | 11736 | ||
@@ -11765,7 +11765,7 @@ EXPORT_SYMBOL(cfg80211_crit_proto_stopped); | |||
11765 | void nl80211_send_ap_stopped(struct wireless_dev *wdev) | 11765 | void nl80211_send_ap_stopped(struct wireless_dev *wdev) |
11766 | { | 11766 | { |
11767 | struct wiphy *wiphy = wdev->wiphy; | 11767 | struct wiphy *wiphy = wdev->wiphy; |
11768 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); | 11768 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); |
11769 | struct sk_buff *msg; | 11769 | struct sk_buff *msg; |
11770 | void *hdr; | 11770 | void *hdr; |
11771 | 11771 | ||
diff --git a/net/wireless/scan.c b/net/wireless/scan.c index 6d6f082b7bb8..0f5da18cc619 100644 --- a/net/wireless/scan.c +++ b/net/wireless/scan.c | |||
@@ -238,11 +238,11 @@ void __cfg80211_scan_done(struct work_struct *wk) | |||
238 | void cfg80211_scan_done(struct cfg80211_scan_request *request, bool aborted) | 238 | void cfg80211_scan_done(struct cfg80211_scan_request *request, bool aborted) |
239 | { | 239 | { |
240 | trace_cfg80211_scan_done(request, aborted); | 240 | trace_cfg80211_scan_done(request, aborted); |
241 | WARN_ON(request != wiphy_to_dev(request->wiphy)->scan_req); | 241 | WARN_ON(request != wiphy_to_rdev(request->wiphy)->scan_req); |
242 | 242 | ||
243 | request->aborted = aborted; | 243 | request->aborted = aborted; |
244 | request->notified = true; | 244 | request->notified = true; |
245 | queue_work(cfg80211_wq, &wiphy_to_dev(request->wiphy)->scan_done_wk); | 245 | queue_work(cfg80211_wq, &wiphy_to_rdev(request->wiphy)->scan_done_wk); |
246 | } | 246 | } |
247 | EXPORT_SYMBOL(cfg80211_scan_done); | 247 | EXPORT_SYMBOL(cfg80211_scan_done); |
248 | 248 | ||
@@ -278,15 +278,15 @@ void cfg80211_sched_scan_results(struct wiphy *wiphy) | |||
278 | { | 278 | { |
279 | trace_cfg80211_sched_scan_results(wiphy); | 279 | trace_cfg80211_sched_scan_results(wiphy); |
280 | /* ignore if we're not scanning */ | 280 | /* ignore if we're not scanning */ |
281 | if (wiphy_to_dev(wiphy)->sched_scan_req) | 281 | if (wiphy_to_rdev(wiphy)->sched_scan_req) |
282 | queue_work(cfg80211_wq, | 282 | queue_work(cfg80211_wq, |
283 | &wiphy_to_dev(wiphy)->sched_scan_results_wk); | 283 | &wiphy_to_rdev(wiphy)->sched_scan_results_wk); |
284 | } | 284 | } |
285 | EXPORT_SYMBOL(cfg80211_sched_scan_results); | 285 | EXPORT_SYMBOL(cfg80211_sched_scan_results); |
286 | 286 | ||
287 | void cfg80211_sched_scan_stopped(struct wiphy *wiphy) | 287 | void cfg80211_sched_scan_stopped(struct wiphy *wiphy) |
288 | { | 288 | { |
289 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); | 289 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); |
290 | 290 | ||
291 | trace_cfg80211_sched_scan_stopped(wiphy); | 291 | trace_cfg80211_sched_scan_stopped(wiphy); |
292 | 292 | ||
@@ -526,7 +526,7 @@ struct cfg80211_bss *cfg80211_get_bss(struct wiphy *wiphy, | |||
526 | const u8 *ssid, size_t ssid_len, | 526 | const u8 *ssid, size_t ssid_len, |
527 | u16 capa_mask, u16 capa_val) | 527 | u16 capa_mask, u16 capa_val) |
528 | { | 528 | { |
529 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); | 529 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); |
530 | struct cfg80211_internal_bss *bss, *res = NULL; | 530 | struct cfg80211_internal_bss *bss, *res = NULL; |
531 | unsigned long now = jiffies; | 531 | unsigned long now = jiffies; |
532 | 532 | ||
@@ -919,7 +919,7 @@ cfg80211_inform_bss_width(struct wiphy *wiphy, | |||
919 | rcu_assign_pointer(tmp.pub.beacon_ies, ies); | 919 | rcu_assign_pointer(tmp.pub.beacon_ies, ies); |
920 | rcu_assign_pointer(tmp.pub.ies, ies); | 920 | rcu_assign_pointer(tmp.pub.ies, ies); |
921 | 921 | ||
922 | res = cfg80211_bss_update(wiphy_to_dev(wiphy), &tmp, | 922 | res = cfg80211_bss_update(wiphy_to_rdev(wiphy), &tmp, |
923 | rx_channel == channel); | 923 | rx_channel == channel); |
924 | if (!res) | 924 | if (!res) |
925 | return NULL; | 925 | return NULL; |
@@ -991,7 +991,7 @@ cfg80211_inform_bss_width_frame(struct wiphy *wiphy, | |||
991 | tmp.pub.beacon_interval = le16_to_cpu(mgmt->u.probe_resp.beacon_int); | 991 | tmp.pub.beacon_interval = le16_to_cpu(mgmt->u.probe_resp.beacon_int); |
992 | tmp.pub.capability = le16_to_cpu(mgmt->u.probe_resp.capab_info); | 992 | tmp.pub.capability = le16_to_cpu(mgmt->u.probe_resp.capab_info); |
993 | 993 | ||
994 | res = cfg80211_bss_update(wiphy_to_dev(wiphy), &tmp, | 994 | res = cfg80211_bss_update(wiphy_to_rdev(wiphy), &tmp, |
995 | rx_channel == channel); | 995 | rx_channel == channel); |
996 | if (!res) | 996 | if (!res) |
997 | return NULL; | 997 | return NULL; |
@@ -1007,7 +1007,7 @@ EXPORT_SYMBOL(cfg80211_inform_bss_width_frame); | |||
1007 | 1007 | ||
1008 | void cfg80211_ref_bss(struct wiphy *wiphy, struct cfg80211_bss *pub) | 1008 | void cfg80211_ref_bss(struct wiphy *wiphy, struct cfg80211_bss *pub) |
1009 | { | 1009 | { |
1010 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); | 1010 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); |
1011 | struct cfg80211_internal_bss *bss; | 1011 | struct cfg80211_internal_bss *bss; |
1012 | 1012 | ||
1013 | if (!pub) | 1013 | if (!pub) |
@@ -1023,7 +1023,7 @@ EXPORT_SYMBOL(cfg80211_ref_bss); | |||
1023 | 1023 | ||
1024 | void cfg80211_put_bss(struct wiphy *wiphy, struct cfg80211_bss *pub) | 1024 | void cfg80211_put_bss(struct wiphy *wiphy, struct cfg80211_bss *pub) |
1025 | { | 1025 | { |
1026 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); | 1026 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); |
1027 | struct cfg80211_internal_bss *bss; | 1027 | struct cfg80211_internal_bss *bss; |
1028 | 1028 | ||
1029 | if (!pub) | 1029 | if (!pub) |
@@ -1039,7 +1039,7 @@ EXPORT_SYMBOL(cfg80211_put_bss); | |||
1039 | 1039 | ||
1040 | void cfg80211_unlink_bss(struct wiphy *wiphy, struct cfg80211_bss *pub) | 1040 | void cfg80211_unlink_bss(struct wiphy *wiphy, struct cfg80211_bss *pub) |
1041 | { | 1041 | { |
1042 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); | 1042 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); |
1043 | struct cfg80211_internal_bss *bss; | 1043 | struct cfg80211_internal_bss *bss; |
1044 | 1044 | ||
1045 | if (WARN_ON(!pub)) | 1045 | if (WARN_ON(!pub)) |
@@ -1069,7 +1069,7 @@ cfg80211_get_dev_from_ifindex(struct net *net, int ifindex) | |||
1069 | if (!dev) | 1069 | if (!dev) |
1070 | return ERR_PTR(-ENODEV); | 1070 | return ERR_PTR(-ENODEV); |
1071 | if (dev->ieee80211_ptr) | 1071 | if (dev->ieee80211_ptr) |
1072 | rdev = wiphy_to_dev(dev->ieee80211_ptr->wiphy); | 1072 | rdev = wiphy_to_rdev(dev->ieee80211_ptr->wiphy); |
1073 | else | 1073 | else |
1074 | rdev = ERR_PTR(-ENODEV); | 1074 | rdev = ERR_PTR(-ENODEV); |
1075 | dev_put(dev); | 1075 | dev_put(dev); |
diff --git a/net/wireless/sme.c b/net/wireless/sme.c index 998674f9cc80..e2923a3f2e5c 100644 --- a/net/wireless/sme.c +++ b/net/wireless/sme.c | |||
@@ -59,7 +59,7 @@ static void cfg80211_sme_free(struct wireless_dev *wdev) | |||
59 | 59 | ||
60 | static int cfg80211_conn_scan(struct wireless_dev *wdev) | 60 | static int cfg80211_conn_scan(struct wireless_dev *wdev) |
61 | { | 61 | { |
62 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | 62 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); |
63 | struct cfg80211_scan_request *request; | 63 | struct cfg80211_scan_request *request; |
64 | int n_channels, err; | 64 | int n_channels, err; |
65 | 65 | ||
@@ -130,7 +130,7 @@ static int cfg80211_conn_scan(struct wireless_dev *wdev) | |||
130 | 130 | ||
131 | static int cfg80211_conn_do_work(struct wireless_dev *wdev) | 131 | static int cfg80211_conn_do_work(struct wireless_dev *wdev) |
132 | { | 132 | { |
133 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | 133 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); |
134 | struct cfg80211_connect_params *params; | 134 | struct cfg80211_connect_params *params; |
135 | struct cfg80211_assoc_request req = {}; | 135 | struct cfg80211_assoc_request req = {}; |
136 | int err; | 136 | int err; |
@@ -245,7 +245,7 @@ void cfg80211_conn_work(struct work_struct *work) | |||
245 | /* Returned bss is reference counted and must be cleaned up appropriately. */ | 245 | /* Returned bss is reference counted and must be cleaned up appropriately. */ |
246 | static struct cfg80211_bss *cfg80211_get_conn_bss(struct wireless_dev *wdev) | 246 | static struct cfg80211_bss *cfg80211_get_conn_bss(struct wireless_dev *wdev) |
247 | { | 247 | { |
248 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | 248 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); |
249 | struct cfg80211_bss *bss; | 249 | struct cfg80211_bss *bss; |
250 | u16 capa = WLAN_CAPABILITY_ESS; | 250 | u16 capa = WLAN_CAPABILITY_ESS; |
251 | 251 | ||
@@ -275,7 +275,7 @@ static struct cfg80211_bss *cfg80211_get_conn_bss(struct wireless_dev *wdev) | |||
275 | static void __cfg80211_sme_scan_done(struct net_device *dev) | 275 | static void __cfg80211_sme_scan_done(struct net_device *dev) |
276 | { | 276 | { |
277 | struct wireless_dev *wdev = dev->ieee80211_ptr; | 277 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
278 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | 278 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); |
279 | struct cfg80211_bss *bss; | 279 | struct cfg80211_bss *bss; |
280 | 280 | ||
281 | ASSERT_WDEV_LOCK(wdev); | 281 | ASSERT_WDEV_LOCK(wdev); |
@@ -306,7 +306,7 @@ void cfg80211_sme_scan_done(struct net_device *dev) | |||
306 | void cfg80211_sme_rx_auth(struct wireless_dev *wdev, const u8 *buf, size_t len) | 306 | void cfg80211_sme_rx_auth(struct wireless_dev *wdev, const u8 *buf, size_t len) |
307 | { | 307 | { |
308 | struct wiphy *wiphy = wdev->wiphy; | 308 | struct wiphy *wiphy = wdev->wiphy; |
309 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); | 309 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); |
310 | struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)buf; | 310 | struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)buf; |
311 | u16 status_code = le16_to_cpu(mgmt->u.auth.status_code); | 311 | u16 status_code = le16_to_cpu(mgmt->u.auth.status_code); |
312 | 312 | ||
@@ -352,7 +352,7 @@ void cfg80211_sme_rx_auth(struct wireless_dev *wdev, const u8 *buf, size_t len) | |||
352 | 352 | ||
353 | bool cfg80211_sme_rx_assoc_resp(struct wireless_dev *wdev, u16 status) | 353 | bool cfg80211_sme_rx_assoc_resp(struct wireless_dev *wdev, u16 status) |
354 | { | 354 | { |
355 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | 355 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); |
356 | 356 | ||
357 | if (!wdev->conn) | 357 | if (!wdev->conn) |
358 | return false; | 358 | return false; |
@@ -386,7 +386,7 @@ void cfg80211_sme_deauth(struct wireless_dev *wdev) | |||
386 | 386 | ||
387 | void cfg80211_sme_auth_timeout(struct wireless_dev *wdev) | 387 | void cfg80211_sme_auth_timeout(struct wireless_dev *wdev) |
388 | { | 388 | { |
389 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | 389 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); |
390 | 390 | ||
391 | if (!wdev->conn) | 391 | if (!wdev->conn) |
392 | return; | 392 | return; |
@@ -397,7 +397,7 @@ void cfg80211_sme_auth_timeout(struct wireless_dev *wdev) | |||
397 | 397 | ||
398 | void cfg80211_sme_disassoc(struct wireless_dev *wdev) | 398 | void cfg80211_sme_disassoc(struct wireless_dev *wdev) |
399 | { | 399 | { |
400 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | 400 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); |
401 | 401 | ||
402 | if (!wdev->conn) | 402 | if (!wdev->conn) |
403 | return; | 403 | return; |
@@ -408,7 +408,7 @@ void cfg80211_sme_disassoc(struct wireless_dev *wdev) | |||
408 | 408 | ||
409 | void cfg80211_sme_assoc_timeout(struct wireless_dev *wdev) | 409 | void cfg80211_sme_assoc_timeout(struct wireless_dev *wdev) |
410 | { | 410 | { |
411 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | 411 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); |
412 | 412 | ||
413 | if (!wdev->conn) | 413 | if (!wdev->conn) |
414 | return; | 414 | return; |
@@ -421,7 +421,7 @@ static int cfg80211_sme_connect(struct wireless_dev *wdev, | |||
421 | struct cfg80211_connect_params *connect, | 421 | struct cfg80211_connect_params *connect, |
422 | const u8 *prev_bssid) | 422 | const u8 *prev_bssid) |
423 | { | 423 | { |
424 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | 424 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); |
425 | struct cfg80211_bss *bss; | 425 | struct cfg80211_bss *bss; |
426 | int err; | 426 | int err; |
427 | 427 | ||
@@ -505,7 +505,7 @@ static int cfg80211_sme_connect(struct wireless_dev *wdev, | |||
505 | 505 | ||
506 | static int cfg80211_sme_disconnect(struct wireless_dev *wdev, u16 reason) | 506 | static int cfg80211_sme_disconnect(struct wireless_dev *wdev, u16 reason) |
507 | { | 507 | { |
508 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | 508 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); |
509 | int err; | 509 | int err; |
510 | 510 | ||
511 | if (!wdev->conn) | 511 | if (!wdev->conn) |
@@ -593,7 +593,7 @@ void __cfg80211_connect_result(struct net_device *dev, const u8 *bssid, | |||
593 | return; | 593 | return; |
594 | } | 594 | } |
595 | 595 | ||
596 | nl80211_send_connect_result(wiphy_to_dev(wdev->wiphy), dev, | 596 | nl80211_send_connect_result(wiphy_to_rdev(wdev->wiphy), dev, |
597 | bssid, req_ie, req_ie_len, | 597 | bssid, req_ie, req_ie_len, |
598 | resp_ie, resp_ie_len, | 598 | resp_ie, resp_ie_len, |
599 | status, GFP_KERNEL); | 599 | status, GFP_KERNEL); |
@@ -624,7 +624,7 @@ void __cfg80211_connect_result(struct net_device *dev, const u8 *bssid, | |||
624 | #endif | 624 | #endif |
625 | 625 | ||
626 | if (!bss && (status == WLAN_STATUS_SUCCESS)) { | 626 | if (!bss && (status == WLAN_STATUS_SUCCESS)) { |
627 | WARN_ON_ONCE(!wiphy_to_dev(wdev->wiphy)->ops->connect); | 627 | WARN_ON_ONCE(!wiphy_to_rdev(wdev->wiphy)->ops->connect); |
628 | bss = cfg80211_get_bss(wdev->wiphy, NULL, bssid, | 628 | bss = cfg80211_get_bss(wdev->wiphy, NULL, bssid, |
629 | wdev->ssid, wdev->ssid_len, | 629 | wdev->ssid, wdev->ssid_len, |
630 | WLAN_CAPABILITY_ESS, | 630 | WLAN_CAPABILITY_ESS, |
@@ -686,7 +686,7 @@ void cfg80211_connect_result(struct net_device *dev, const u8 *bssid, | |||
686 | u16 status, gfp_t gfp) | 686 | u16 status, gfp_t gfp) |
687 | { | 687 | { |
688 | struct wireless_dev *wdev = dev->ieee80211_ptr; | 688 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
689 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | 689 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); |
690 | struct cfg80211_event *ev; | 690 | struct cfg80211_event *ev; |
691 | unsigned long flags; | 691 | unsigned long flags; |
692 | 692 | ||
@@ -741,7 +741,8 @@ void __cfg80211_roamed(struct wireless_dev *wdev, | |||
741 | cfg80211_hold_bss(bss_from_pub(bss)); | 741 | cfg80211_hold_bss(bss_from_pub(bss)); |
742 | wdev->current_bss = bss_from_pub(bss); | 742 | wdev->current_bss = bss_from_pub(bss); |
743 | 743 | ||
744 | nl80211_send_roamed(wiphy_to_dev(wdev->wiphy), wdev->netdev, bss->bssid, | 744 | nl80211_send_roamed(wiphy_to_rdev(wdev->wiphy), |
745 | wdev->netdev, bss->bssid, | ||
745 | req_ie, req_ie_len, resp_ie, resp_ie_len, | 746 | req_ie, req_ie_len, resp_ie, resp_ie_len, |
746 | GFP_KERNEL); | 747 | GFP_KERNEL); |
747 | 748 | ||
@@ -800,7 +801,7 @@ void cfg80211_roamed_bss(struct net_device *dev, | |||
800 | size_t resp_ie_len, gfp_t gfp) | 801 | size_t resp_ie_len, gfp_t gfp) |
801 | { | 802 | { |
802 | struct wireless_dev *wdev = dev->ieee80211_ptr; | 803 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
803 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | 804 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); |
804 | struct cfg80211_event *ev; | 805 | struct cfg80211_event *ev; |
805 | unsigned long flags; | 806 | unsigned long flags; |
806 | 807 | ||
@@ -833,7 +834,7 @@ void __cfg80211_disconnected(struct net_device *dev, const u8 *ie, | |||
833 | size_t ie_len, u16 reason, bool from_ap) | 834 | size_t ie_len, u16 reason, bool from_ap) |
834 | { | 835 | { |
835 | struct wireless_dev *wdev = dev->ieee80211_ptr; | 836 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
836 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | 837 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); |
837 | int i; | 838 | int i; |
838 | #ifdef CONFIG_CFG80211_WEXT | 839 | #ifdef CONFIG_CFG80211_WEXT |
839 | union iwreq_data wrqu; | 840 | union iwreq_data wrqu; |
@@ -879,7 +880,7 @@ void cfg80211_disconnected(struct net_device *dev, u16 reason, | |||
879 | u8 *ie, size_t ie_len, gfp_t gfp) | 880 | u8 *ie, size_t ie_len, gfp_t gfp) |
880 | { | 881 | { |
881 | struct wireless_dev *wdev = dev->ieee80211_ptr; | 882 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
882 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | 883 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); |
883 | struct cfg80211_event *ev; | 884 | struct cfg80211_event *ev; |
884 | unsigned long flags; | 885 | unsigned long flags; |
885 | 886 | ||
diff --git a/net/wireless/util.c b/net/wireless/util.c index d8b599575a5e..7c47fa07b276 100644 --- a/net/wireless/util.c +++ b/net/wireless/util.c | |||
@@ -770,7 +770,7 @@ EXPORT_SYMBOL(ieee80211_bss_get_ie); | |||
770 | 770 | ||
771 | void cfg80211_upload_connect_keys(struct wireless_dev *wdev) | 771 | void cfg80211_upload_connect_keys(struct wireless_dev *wdev) |
772 | { | 772 | { |
773 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | 773 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); |
774 | struct net_device *dev = wdev->netdev; | 774 | struct net_device *dev = wdev->netdev; |
775 | int i; | 775 | int i; |
776 | 776 | ||
diff --git a/net/wireless/wext-compat.c b/net/wireless/wext-compat.c index 836b006ab066..11120bb14162 100644 --- a/net/wireless/wext-compat.c +++ b/net/wireless/wext-compat.c | |||
@@ -73,7 +73,7 @@ int cfg80211_wext_siwmode(struct net_device *dev, struct iw_request_info *info, | |||
73 | struct vif_params vifparams; | 73 | struct vif_params vifparams; |
74 | enum nl80211_iftype type; | 74 | enum nl80211_iftype type; |
75 | 75 | ||
76 | rdev = wiphy_to_dev(wdev->wiphy); | 76 | rdev = wiphy_to_rdev(wdev->wiphy); |
77 | 77 | ||
78 | switch (*mode) { | 78 | switch (*mode) { |
79 | case IW_MODE_INFRA: | 79 | case IW_MODE_INFRA: |
@@ -286,7 +286,7 @@ int cfg80211_wext_siwrts(struct net_device *dev, | |||
286 | struct iw_param *rts, char *extra) | 286 | struct iw_param *rts, char *extra) |
287 | { | 287 | { |
288 | struct wireless_dev *wdev = dev->ieee80211_ptr; | 288 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
289 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | 289 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); |
290 | u32 orts = wdev->wiphy->rts_threshold; | 290 | u32 orts = wdev->wiphy->rts_threshold; |
291 | int err; | 291 | int err; |
292 | 292 | ||
@@ -324,7 +324,7 @@ int cfg80211_wext_siwfrag(struct net_device *dev, | |||
324 | struct iw_param *frag, char *extra) | 324 | struct iw_param *frag, char *extra) |
325 | { | 325 | { |
326 | struct wireless_dev *wdev = dev->ieee80211_ptr; | 326 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
327 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | 327 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); |
328 | u32 ofrag = wdev->wiphy->frag_threshold; | 328 | u32 ofrag = wdev->wiphy->frag_threshold; |
329 | int err; | 329 | int err; |
330 | 330 | ||
@@ -364,7 +364,7 @@ static int cfg80211_wext_siwretry(struct net_device *dev, | |||
364 | struct iw_param *retry, char *extra) | 364 | struct iw_param *retry, char *extra) |
365 | { | 365 | { |
366 | struct wireless_dev *wdev = dev->ieee80211_ptr; | 366 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
367 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | 367 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); |
368 | u32 changed = 0; | 368 | u32 changed = 0; |
369 | u8 olong = wdev->wiphy->retry_long; | 369 | u8 olong = wdev->wiphy->retry_long; |
370 | u8 oshort = wdev->wiphy->retry_short; | 370 | u8 oshort = wdev->wiphy->retry_short; |
@@ -587,7 +587,7 @@ static int cfg80211_wext_siwencode(struct net_device *dev, | |||
587 | struct iw_point *erq, char *keybuf) | 587 | struct iw_point *erq, char *keybuf) |
588 | { | 588 | { |
589 | struct wireless_dev *wdev = dev->ieee80211_ptr; | 589 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
590 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | 590 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); |
591 | int idx, err; | 591 | int idx, err; |
592 | bool remove = false; | 592 | bool remove = false; |
593 | struct key_params params; | 593 | struct key_params params; |
@@ -647,7 +647,7 @@ static int cfg80211_wext_siwencodeext(struct net_device *dev, | |||
647 | struct iw_point *erq, char *extra) | 647 | struct iw_point *erq, char *extra) |
648 | { | 648 | { |
649 | struct wireless_dev *wdev = dev->ieee80211_ptr; | 649 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
650 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | 650 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); |
651 | struct iw_encode_ext *ext = (struct iw_encode_ext *) extra; | 651 | struct iw_encode_ext *ext = (struct iw_encode_ext *) extra; |
652 | const u8 *addr; | 652 | const u8 *addr; |
653 | int idx; | 653 | int idx; |
@@ -775,7 +775,7 @@ static int cfg80211_wext_siwfreq(struct net_device *dev, | |||
775 | struct iw_freq *wextfreq, char *extra) | 775 | struct iw_freq *wextfreq, char *extra) |
776 | { | 776 | { |
777 | struct wireless_dev *wdev = dev->ieee80211_ptr; | 777 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
778 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | 778 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); |
779 | struct cfg80211_chan_def chandef = { | 779 | struct cfg80211_chan_def chandef = { |
780 | .width = NL80211_CHAN_WIDTH_20_NOHT, | 780 | .width = NL80211_CHAN_WIDTH_20_NOHT, |
781 | }; | 781 | }; |
@@ -818,7 +818,7 @@ static int cfg80211_wext_giwfreq(struct net_device *dev, | |||
818 | struct iw_freq *freq, char *extra) | 818 | struct iw_freq *freq, char *extra) |
819 | { | 819 | { |
820 | struct wireless_dev *wdev = dev->ieee80211_ptr; | 820 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
821 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | 821 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); |
822 | struct cfg80211_chan_def chandef; | 822 | struct cfg80211_chan_def chandef; |
823 | int ret; | 823 | int ret; |
824 | 824 | ||
@@ -847,7 +847,7 @@ static int cfg80211_wext_siwtxpower(struct net_device *dev, | |||
847 | union iwreq_data *data, char *extra) | 847 | union iwreq_data *data, char *extra) |
848 | { | 848 | { |
849 | struct wireless_dev *wdev = dev->ieee80211_ptr; | 849 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
850 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | 850 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); |
851 | enum nl80211_tx_power_setting type; | 851 | enum nl80211_tx_power_setting type; |
852 | int dbm = 0; | 852 | int dbm = 0; |
853 | 853 | ||
@@ -899,7 +899,7 @@ static int cfg80211_wext_giwtxpower(struct net_device *dev, | |||
899 | union iwreq_data *data, char *extra) | 899 | union iwreq_data *data, char *extra) |
900 | { | 900 | { |
901 | struct wireless_dev *wdev = dev->ieee80211_ptr; | 901 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
902 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | 902 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); |
903 | int err, val; | 903 | int err, val; |
904 | 904 | ||
905 | if ((data->txpower.flags & IW_TXPOW_TYPE) != IW_TXPOW_DBM) | 905 | if ((data->txpower.flags & IW_TXPOW_TYPE) != IW_TXPOW_DBM) |
@@ -1119,7 +1119,7 @@ static int cfg80211_wext_siwpower(struct net_device *dev, | |||
1119 | struct iw_param *wrq, char *extra) | 1119 | struct iw_param *wrq, char *extra) |
1120 | { | 1120 | { |
1121 | struct wireless_dev *wdev = dev->ieee80211_ptr; | 1121 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
1122 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | 1122 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); |
1123 | bool ps = wdev->ps; | 1123 | bool ps = wdev->ps; |
1124 | int timeout = wdev->ps_timeout; | 1124 | int timeout = wdev->ps_timeout; |
1125 | int err; | 1125 | int err; |
@@ -1177,7 +1177,7 @@ static int cfg80211_wds_wext_siwap(struct net_device *dev, | |||
1177 | struct sockaddr *addr, char *extra) | 1177 | struct sockaddr *addr, char *extra) |
1178 | { | 1178 | { |
1179 | struct wireless_dev *wdev = dev->ieee80211_ptr; | 1179 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
1180 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | 1180 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); |
1181 | int err; | 1181 | int err; |
1182 | 1182 | ||
1183 | if (WARN_ON(wdev->iftype != NL80211_IFTYPE_WDS)) | 1183 | if (WARN_ON(wdev->iftype != NL80211_IFTYPE_WDS)) |
@@ -1221,7 +1221,7 @@ static int cfg80211_wext_siwrate(struct net_device *dev, | |||
1221 | struct iw_param *rate, char *extra) | 1221 | struct iw_param *rate, char *extra) |
1222 | { | 1222 | { |
1223 | struct wireless_dev *wdev = dev->ieee80211_ptr; | 1223 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
1224 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | 1224 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); |
1225 | struct cfg80211_bitrate_mask mask; | 1225 | struct cfg80211_bitrate_mask mask; |
1226 | u32 fixed, maxrate; | 1226 | u32 fixed, maxrate; |
1227 | struct ieee80211_supported_band *sband; | 1227 | struct ieee80211_supported_band *sband; |
@@ -1272,7 +1272,7 @@ static int cfg80211_wext_giwrate(struct net_device *dev, | |||
1272 | struct iw_param *rate, char *extra) | 1272 | struct iw_param *rate, char *extra) |
1273 | { | 1273 | { |
1274 | struct wireless_dev *wdev = dev->ieee80211_ptr; | 1274 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
1275 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | 1275 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); |
1276 | /* we are under RTNL - globally locked - so can use a static struct */ | 1276 | /* we are under RTNL - globally locked - so can use a static struct */ |
1277 | static struct station_info sinfo; | 1277 | static struct station_info sinfo; |
1278 | u8 addr[ETH_ALEN]; | 1278 | u8 addr[ETH_ALEN]; |
@@ -1310,7 +1310,7 @@ static int cfg80211_wext_giwrate(struct net_device *dev, | |||
1310 | static struct iw_statistics *cfg80211_wireless_stats(struct net_device *dev) | 1310 | static struct iw_statistics *cfg80211_wireless_stats(struct net_device *dev) |
1311 | { | 1311 | { |
1312 | struct wireless_dev *wdev = dev->ieee80211_ptr; | 1312 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
1313 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | 1313 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); |
1314 | /* we are under RTNL - globally locked - so can use static structs */ | 1314 | /* we are under RTNL - globally locked - so can use static structs */ |
1315 | static struct iw_statistics wstats; | 1315 | static struct iw_statistics wstats; |
1316 | static struct station_info sinfo; | 1316 | static struct station_info sinfo; |
@@ -1449,7 +1449,7 @@ static int cfg80211_wext_siwpmksa(struct net_device *dev, | |||
1449 | struct iw_point *data, char *extra) | 1449 | struct iw_point *data, char *extra) |
1450 | { | 1450 | { |
1451 | struct wireless_dev *wdev = dev->ieee80211_ptr; | 1451 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
1452 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | 1452 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); |
1453 | struct cfg80211_pmksa cfg_pmksa; | 1453 | struct cfg80211_pmksa cfg_pmksa; |
1454 | struct iw_pmksa *pmksa = (struct iw_pmksa *)extra; | 1454 | struct iw_pmksa *pmksa = (struct iw_pmksa *)extra; |
1455 | 1455 | ||
diff --git a/net/wireless/wext-sme.c b/net/wireless/wext-sme.c index c05a0183df31..c7e5c8eb4f24 100644 --- a/net/wireless/wext-sme.c +++ b/net/wireless/wext-sme.c | |||
@@ -67,7 +67,7 @@ int cfg80211_mgd_wext_siwfreq(struct net_device *dev, | |||
67 | struct iw_freq *wextfreq, char *extra) | 67 | struct iw_freq *wextfreq, char *extra) |
68 | { | 68 | { |
69 | struct wireless_dev *wdev = dev->ieee80211_ptr; | 69 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
70 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | 70 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); |
71 | struct ieee80211_channel *chan = NULL; | 71 | struct ieee80211_channel *chan = NULL; |
72 | int err, freq; | 72 | int err, freq; |
73 | 73 | ||
@@ -169,7 +169,7 @@ int cfg80211_mgd_wext_siwessid(struct net_device *dev, | |||
169 | struct iw_point *data, char *ssid) | 169 | struct iw_point *data, char *ssid) |
170 | { | 170 | { |
171 | struct wireless_dev *wdev = dev->ieee80211_ptr; | 171 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
172 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | 172 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); |
173 | size_t len = data->length; | 173 | size_t len = data->length; |
174 | int err; | 174 | int err; |
175 | 175 | ||
@@ -260,7 +260,7 @@ int cfg80211_mgd_wext_siwap(struct net_device *dev, | |||
260 | struct sockaddr *ap_addr, char *extra) | 260 | struct sockaddr *ap_addr, char *extra) |
261 | { | 261 | { |
262 | struct wireless_dev *wdev = dev->ieee80211_ptr; | 262 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
263 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | 263 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); |
264 | u8 *bssid = ap_addr->sa_data; | 264 | u8 *bssid = ap_addr->sa_data; |
265 | int err; | 265 | int err; |
266 | 266 | ||
@@ -333,7 +333,7 @@ int cfg80211_wext_siwgenie(struct net_device *dev, | |||
333 | struct iw_point *data, char *extra) | 333 | struct iw_point *data, char *extra) |
334 | { | 334 | { |
335 | struct wireless_dev *wdev = dev->ieee80211_ptr; | 335 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
336 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | 336 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); |
337 | u8 *ie = extra; | 337 | u8 *ie = extra; |
338 | int ie_len = data->length, err; | 338 | int ie_len = data->length, err; |
339 | 339 | ||
@@ -390,7 +390,7 @@ int cfg80211_wext_siwmlme(struct net_device *dev, | |||
390 | if (!wdev) | 390 | if (!wdev) |
391 | return -EOPNOTSUPP; | 391 | return -EOPNOTSUPP; |
392 | 392 | ||
393 | rdev = wiphy_to_dev(wdev->wiphy); | 393 | rdev = wiphy_to_rdev(wdev->wiphy); |
394 | 394 | ||
395 | if (wdev->iftype != NL80211_IFTYPE_STATION) | 395 | if (wdev->iftype != NL80211_IFTYPE_STATION) |
396 | return -EINVAL; | 396 | return -EINVAL; |