]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - net/wireless/core.c
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
[net-next-2.6.git] / net / wireless / core.c
index b8191cf86226ec50f88a3ed7701bb8bce758426d..9c21ebf9780ea21ff22c9326da29a423061d088b 100644 (file)
@@ -480,12 +480,10 @@ int wiphy_register(struct wiphy *wiphy)
        mutex_lock(&cfg80211_mutex);
 
        res = device_add(&rdev->wiphy.dev);
-       if (res)
-               goto out_unlock;
-
-       res = rfkill_register(rdev->rfkill);
-       if (res)
-               goto out_rm_dev;
+       if (res) {
+               mutex_unlock(&cfg80211_mutex);
+               return res;
+       }
 
        /* set up regulatory info */
        wiphy_update_regulatory(wiphy, NL80211_REGDOM_SET_BY_CORE);
@@ -514,13 +512,18 @@ int wiphy_register(struct wiphy *wiphy)
        cfg80211_debugfs_rdev_add(rdev);
        mutex_unlock(&cfg80211_mutex);
 
+       /*
+        * due to a locking dependency this has to be outside of the
+        * cfg80211_mutex lock
+        */
+       res = rfkill_register(rdev->rfkill);
+       if (res)
+               goto out_rm_dev;
+
        return 0;
 
 out_rm_dev:
        device_del(&rdev->wiphy.dev);
-
-out_unlock:
-       mutex_unlock(&cfg80211_mutex);
        return res;
 }
 EXPORT_SYMBOL(wiphy_register);
@@ -726,6 +729,7 @@ static int cfg80211_netdev_notifier_call(struct notifier_block * nb,
                        dev->ethtool_ops = &cfg80211_ethtool_ops;
 
                if ((wdev->iftype == NL80211_IFTYPE_STATION ||
+                    wdev->iftype == NL80211_IFTYPE_P2P_CLIENT ||
                     wdev->iftype == NL80211_IFTYPE_ADHOC) && !wdev->use_4addr)
                        dev->priv_flags |= IFF_DONT_BRIDGE;
                break;
@@ -734,6 +738,7 @@ static int cfg80211_netdev_notifier_call(struct notifier_block * nb,
                case NL80211_IFTYPE_ADHOC:
                        cfg80211_leave_ibss(rdev, dev, true);
                        break;
+               case NL80211_IFTYPE_P2P_CLIENT:
                case NL80211_IFTYPE_STATION:
                        wdev_lock(wdev);
 #ifdef CONFIG_CFG80211_WEXT