mac80211: notify upper layers after lower
authorReinette Chatre <reinette.chatre@intel.com>
Thu, 3 Apr 2008 23:08:49 +0000 (16:08 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 8 Apr 2008 20:44:43 +0000 (16:44 -0400)
When drivers receive change notification they may do work that
will enable the changes to take effect. For example, if new association
the device needs to be programmed with this information.
Give the driver chance to make the changes before notifying the
upper layer - thus preventing race condition where upper layer
attempts to utilize state that may not be configured yet.

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/mac80211/ieee80211_sta.c

index 0f2fc9c4703a6ee11fa68b8c9d03bb610cfb7322..9e30333aa81eca7ad7cdf12e28a8fcb6466a6c3c 100644 (file)
@@ -542,13 +542,13 @@ static void ieee80211_set_associated(struct net_device *dev,
 
                memset(wrqu.ap_addr.sa_data, 0, ETH_ALEN);
        }
-       wrqu.ap_addr.sa_family = ARPHRD_ETHER;
-       wireless_send_event(dev, SIOCGIWAP, &wrqu, NULL);
        ifsta->last_probe = jiffies;
        ieee80211_led_assoc(local, assoc);
 
        sdata->bss_conf.assoc = assoc;
        ieee80211_bss_info_change_notify(sdata, changed);
+       wrqu.ap_addr.sa_family = ARPHRD_ETHER;
+       wireless_send_event(dev, SIOCGIWAP, &wrqu, NULL);
 }
 
 static void ieee80211_set_disassoc(struct net_device *dev,