diff options
Diffstat (limited to 'net/wireless/core.c')
-rw-r--r-- | net/wireless/core.c | 66 |
1 files changed, 12 insertions, 54 deletions
diff --git a/net/wireless/core.c b/net/wireless/core.c index d6d046b9f6f2..9c21ebf9780e 100644 --- a/net/wireless/core.c +++ b/net/wireless/core.c | |||
@@ -253,11 +253,16 @@ int cfg80211_switch_netns(struct cfg80211_registered_device *rdev, | |||
253 | WARN_ON(err); | 253 | WARN_ON(err); |
254 | wdev->netdev->features |= NETIF_F_NETNS_LOCAL; | 254 | wdev->netdev->features |= NETIF_F_NETNS_LOCAL; |
255 | } | 255 | } |
256 | |||
257 | return err; | ||
256 | } | 258 | } |
257 | 259 | ||
258 | wiphy_net_set(&rdev->wiphy, net); | 260 | wiphy_net_set(&rdev->wiphy, net); |
259 | 261 | ||
260 | return err; | 262 | err = device_rename(&rdev->wiphy.dev, dev_name(&rdev->wiphy.dev)); |
263 | WARN_ON(err); | ||
264 | |||
265 | return 0; | ||
261 | } | 266 | } |
262 | 267 | ||
263 | static void cfg80211_rfkill_poll(struct rfkill *rfkill, void *data) | 268 | static void cfg80211_rfkill_poll(struct rfkill *rfkill, void *data) |
@@ -428,7 +433,7 @@ int wiphy_register(struct wiphy *wiphy) | |||
428 | 433 | ||
429 | /* sanity check ifmodes */ | 434 | /* sanity check ifmodes */ |
430 | WARN_ON(!ifmodes); | 435 | WARN_ON(!ifmodes); |
431 | ifmodes &= ((1 << __NL80211_IFTYPE_AFTER_LAST) - 1) & ~1; | 436 | ifmodes &= ((1 << NUM_NL80211_IFTYPES) - 1) & ~1; |
432 | if (WARN_ON(ifmodes != wiphy->interface_modes)) | 437 | if (WARN_ON(ifmodes != wiphy->interface_modes)) |
433 | wiphy->interface_modes = ifmodes; | 438 | wiphy->interface_modes = ifmodes; |
434 | 439 | ||
@@ -683,8 +688,8 @@ static int cfg80211_netdev_notifier_call(struct notifier_block * nb, | |||
683 | INIT_WORK(&wdev->cleanup_work, wdev_cleanup_work); | 688 | INIT_WORK(&wdev->cleanup_work, wdev_cleanup_work); |
684 | INIT_LIST_HEAD(&wdev->event_list); | 689 | INIT_LIST_HEAD(&wdev->event_list); |
685 | spin_lock_init(&wdev->event_lock); | 690 | spin_lock_init(&wdev->event_lock); |
686 | INIT_LIST_HEAD(&wdev->action_registrations); | 691 | INIT_LIST_HEAD(&wdev->mgmt_registrations); |
687 | spin_lock_init(&wdev->action_registrations_lock); | 692 | spin_lock_init(&wdev->mgmt_registrations_lock); |
688 | 693 | ||
689 | mutex_lock(&rdev->devlist_mtx); | 694 | mutex_lock(&rdev->devlist_mtx); |
690 | list_add_rcu(&wdev->list, &rdev->netdev_list); | 695 | list_add_rcu(&wdev->list, &rdev->netdev_list); |
@@ -724,6 +729,7 @@ static int cfg80211_netdev_notifier_call(struct notifier_block * nb, | |||
724 | dev->ethtool_ops = &cfg80211_ethtool_ops; | 729 | dev->ethtool_ops = &cfg80211_ethtool_ops; |
725 | 730 | ||
726 | if ((wdev->iftype == NL80211_IFTYPE_STATION || | 731 | if ((wdev->iftype == NL80211_IFTYPE_STATION || |
732 | wdev->iftype == NL80211_IFTYPE_P2P_CLIENT || | ||
727 | wdev->iftype == NL80211_IFTYPE_ADHOC) && !wdev->use_4addr) | 733 | wdev->iftype == NL80211_IFTYPE_ADHOC) && !wdev->use_4addr) |
728 | dev->priv_flags |= IFF_DONT_BRIDGE; | 734 | dev->priv_flags |= IFF_DONT_BRIDGE; |
729 | break; | 735 | break; |
@@ -732,6 +738,7 @@ static int cfg80211_netdev_notifier_call(struct notifier_block * nb, | |||
732 | case NL80211_IFTYPE_ADHOC: | 738 | case NL80211_IFTYPE_ADHOC: |
733 | cfg80211_leave_ibss(rdev, dev, true); | 739 | cfg80211_leave_ibss(rdev, dev, true); |
734 | break; | 740 | break; |
741 | case NL80211_IFTYPE_P2P_CLIENT: | ||
735 | case NL80211_IFTYPE_STATION: | 742 | case NL80211_IFTYPE_STATION: |
736 | wdev_lock(wdev); | 743 | wdev_lock(wdev); |
737 | #ifdef CONFIG_CFG80211_WEXT | 744 | #ifdef CONFIG_CFG80211_WEXT |
@@ -804,7 +811,7 @@ static int cfg80211_netdev_notifier_call(struct notifier_block * nb, | |||
804 | sysfs_remove_link(&dev->dev.kobj, "phy80211"); | 811 | sysfs_remove_link(&dev->dev.kobj, "phy80211"); |
805 | list_del_rcu(&wdev->list); | 812 | list_del_rcu(&wdev->list); |
806 | rdev->devlist_generation++; | 813 | rdev->devlist_generation++; |
807 | cfg80211_mlme_purge_actions(wdev); | 814 | cfg80211_mlme_purge_registrations(wdev); |
808 | #ifdef CONFIG_CFG80211_WEXT | 815 | #ifdef CONFIG_CFG80211_WEXT |
809 | kfree(wdev->wext.keys); | 816 | kfree(wdev->wext.keys); |
810 | #endif | 817 | #endif |
@@ -910,52 +917,3 @@ static void __exit cfg80211_exit(void) | |||
910 | destroy_workqueue(cfg80211_wq); | 917 | destroy_workqueue(cfg80211_wq); |
911 | } | 918 | } |
912 | module_exit(cfg80211_exit); | 919 | module_exit(cfg80211_exit); |
913 | |||
914 | static int ___wiphy_printk(const char *level, const struct wiphy *wiphy, | ||
915 | struct va_format *vaf) | ||
916 | { | ||
917 | if (!wiphy) | ||
918 | return printk("%s(NULL wiphy *): %pV", level, vaf); | ||
919 | |||
920 | return printk("%s%s: %pV", level, wiphy_name(wiphy), vaf); | ||
921 | } | ||
922 | |||
923 | int __wiphy_printk(const char *level, const struct wiphy *wiphy, | ||
924 | const char *fmt, ...) | ||
925 | { | ||
926 | struct va_format vaf; | ||
927 | va_list args; | ||
928 | int r; | ||
929 | |||
930 | va_start(args, fmt); | ||
931 | |||
932 | vaf.fmt = fmt; | ||
933 | vaf.va = &args; | ||
934 | |||
935 | r = ___wiphy_printk(level, wiphy, &vaf); | ||
936 | va_end(args); | ||
937 | |||
938 | return r; | ||
939 | } | ||
940 | EXPORT_SYMBOL(__wiphy_printk); | ||
941 | |||
942 | #define define_wiphy_printk_level(func, kern_level) \ | ||
943 | int func(const struct wiphy *wiphy, const char *fmt, ...) \ | ||
944 | { \ | ||
945 | struct va_format vaf; \ | ||
946 | va_list args; \ | ||
947 | int r; \ | ||
948 | \ | ||
949 | va_start(args, fmt); \ | ||
950 | \ | ||
951 | vaf.fmt = fmt; \ | ||
952 | vaf.va = &args; \ | ||
953 | \ | ||
954 | r = ___wiphy_printk(kern_level, wiphy, &vaf); \ | ||
955 | va_end(args); \ | ||
956 | \ | ||
957 | return r; \ | ||
958 | } \ | ||
959 | EXPORT_SYMBOL(func); | ||
960 | |||
961 | define_wiphy_printk_level(wiphy_debug, KERN_DEBUG); | ||