public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cfg80211: fix wext stats
@ 2009-07-10 14:54 Johannes Berg
  0 siblings, 0 replies; only message in thread
From: Johannes Berg @ 2009-07-10 14:54 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless

Instead of using the wext BSSID which may be NULL if
you haven't explicitly set one, we should instead use
the current_bss pointer -- if that's NULL we aren't
connected anyway. Fixes missing signal quality output
reported to me internally at Intel.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
 net/wireless/wext-compat.c |   13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

--- wireless-testing.orig/net/wireless/wext-compat.c	2009-07-10 16:24:14.000000000 +0200
+++ wireless-testing/net/wireless/wext-compat.c	2009-07-10 16:32:04.000000000 +0200
@@ -1209,7 +1209,7 @@ struct iw_statistics *cfg80211_wireless_
 	/* we are under RTNL - globally locked - so can use static structs */
 	static struct iw_statistics wstats;
 	static struct station_info sinfo;
-	u8 *addr;
+	u8 bssid[ETH_ALEN];
 
 	if (dev->ieee80211_ptr->iftype != NL80211_IFTYPE_STATION)
 		return NULL;
@@ -1217,11 +1217,16 @@ struct iw_statistics *cfg80211_wireless_
 	if (!rdev->ops->get_station)
 		return NULL;
 
-	addr = wdev->wext.connect.bssid;
-	if (!addr)
+	/* Grab BSSID of current BSS, if any */
+	wdev_lock(wdev);
+	if (!wdev->current_bss) {
+		wdev_unlock(wdev);
 		return NULL;
+	}
+	memcpy(bssid, wdev->current_bss->pub.bssid, ETH_ALEN);
+	wdev_unlock(wdev);
 
-	if (rdev->ops->get_station(&rdev->wiphy, dev, addr, &sinfo))
+	if (rdev->ops->get_station(&rdev->wiphy, dev, bssid, &sinfo))
 		return NULL;
 
 	memset(&wstats, 0, sizeof(wstats));



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-07-10 15:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-10 14:54 [PATCH] cfg80211: fix wext stats Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox