cfg80211/wext: fix message ordering
[pandora-kernel.git] / net / wireless / core.c
index c148651..4043f71 100644 (file)
@@ -548,8 +548,7 @@ int wiphy_register(struct wiphy *wiphy)
                for (i = 0; i < sband->n_channels; i++) {
                        sband->channels[i].orig_flags =
                                sband->channels[i].flags;
-                       sband->channels[i].orig_mag =
-                               sband->channels[i].max_antenna_gain;
+                       sband->channels[i].orig_mag = INT_MAX;
                        sband->channels[i].orig_mpwr =
                                sband->channels[i].max_power;
                        sband->channels[i].band = band;
@@ -582,7 +581,7 @@ int wiphy_register(struct wiphy *wiphy)
        }
 
        /* set up regulatory info */
-       wiphy_update_regulatory(wiphy, NL80211_REGDOM_SET_BY_CORE);
+       regulatory_update(wiphy, NL80211_REGDOM_SET_BY_CORE);
 
        list_add_rcu(&rdev->list, &cfg80211_rdev_list);
        cfg80211_rdev_list_generation++;
@@ -971,6 +970,11 @@ static int cfg80211_netdev_notifier_call(struct notifier_block * nb,
                 */
                synchronize_rcu();
                INIT_LIST_HEAD(&wdev->list);
+               /*
+                * Ensure that all events have been processed and
+                * freed.
+                */
+               cfg80211_process_wdev_events(wdev);
                break;
        case NETDEV_PRE_UP:
                if (!(wdev->wiphy->interface_modes & BIT(wdev->iftype)))
@@ -981,8 +985,12 @@ static int cfg80211_netdev_notifier_call(struct notifier_block * nb,
                if (ret)
                        return notifier_from_errno(ret);
                break;
+       default:
+               return NOTIFY_DONE;
        }
 
+       wireless_nlevent_flush();
+
        return NOTIFY_DONE;
 }