提交 c56c5714 编写于 作者: J Johannes Berg 提交者: John W. Linville

cfg80211: fix wext stats

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: NJohannes Berg <johannes@sipsolutions.net>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 ca3dbc20
...@@ -1209,7 +1209,7 @@ struct iw_statistics *cfg80211_wireless_stats(struct net_device *dev) ...@@ -1209,7 +1209,7 @@ struct iw_statistics *cfg80211_wireless_stats(struct net_device *dev)
/* we are under RTNL - globally locked - so can use static structs */ /* we are under RTNL - globally locked - so can use static structs */
static struct iw_statistics wstats; static struct iw_statistics wstats;
static struct station_info sinfo; static struct station_info sinfo;
u8 *addr; u8 bssid[ETH_ALEN];
if (dev->ieee80211_ptr->iftype != NL80211_IFTYPE_STATION) if (dev->ieee80211_ptr->iftype != NL80211_IFTYPE_STATION)
return NULL; return NULL;
...@@ -1217,11 +1217,16 @@ struct iw_statistics *cfg80211_wireless_stats(struct net_device *dev) ...@@ -1217,11 +1217,16 @@ struct iw_statistics *cfg80211_wireless_stats(struct net_device *dev)
if (!rdev->ops->get_station) if (!rdev->ops->get_station)
return NULL; return NULL;
addr = wdev->wext.connect.bssid; /* Grab BSSID of current BSS, if any */
if (!addr) wdev_lock(wdev);
if (!wdev->current_bss) {
wdev_unlock(wdev);
return NULL; 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; return NULL;
memset(&wstats, 0, sizeof(wstats)); memset(&wstats, 0, sizeof(wstats));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册