mac80211 : fix for iwconfig in ad-hoc mode
authorAbhijeet Kolekar <abhijeet.kolekar@intel.com>
Thu, 12 Jun 2008 01:47:16 +0000 (09:47 +0800)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 13 Jun 2008 20:14:53 +0000 (16:14 -0400)
The patch checks interface status, if it is in IBSS_JOINED mode
show cell id it is associated with.

Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/mac80211/wext.c

index a8bb8e31b1ec790c2e1e4e160ca81f8be1719d5c..6106cb79060c928f65e7d5a5d2154f280b55bf5f 100644 (file)
@@ -496,7 +496,8 @@ static int ieee80211_ioctl_giwap(struct net_device *dev,
        sdata = IEEE80211_DEV_TO_SUB_IF(dev);
        if (sdata->vif.type == IEEE80211_IF_TYPE_STA ||
            sdata->vif.type == IEEE80211_IF_TYPE_IBSS) {
-               if (sdata->u.sta.state == IEEE80211_ASSOCIATED) {
+               if (sdata->u.sta.state == IEEE80211_ASSOCIATED ||
+                   sdata->u.sta.state == IEEE80211_IBSS_JOINED) {
                        ap_addr->sa_family = ARPHRD_ETHER;
                        memcpy(&ap_addr->sa_data, sdata->u.sta.bssid, ETH_ALEN);
                        return 0;