diff mbox

[1/4] mac80211: let sta_info_get_by_idx get sta by sdata

Message ID 20091116110720.266695628@sipsolutions.net (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Johannes Berg Nov. 16, 2009, 11 a.m. UTC
None
diff mbox

Patch

--- wireless-testing.orig/net/mac80211/cfg.c	2009-11-13 09:33:41.000000000 +0100
+++ wireless-testing/net/mac80211/cfg.c	2009-11-13 09:33:43.000000000 +0100
@@ -398,13 +398,13 @@  static void sta_set_sinfo(struct sta_inf
 static int ieee80211_dump_station(struct wiphy *wiphy, struct net_device *dev,
 				 int idx, u8 *mac, struct station_info *sinfo)
 {
-	struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
+	struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
 	struct sta_info *sta;
 	int ret = -ENOENT;
 
 	rcu_read_lock();
 
-	sta = sta_info_get_by_idx(local, idx, dev);
+	sta = sta_info_get_by_idx(sdata, idx);
 	if (sta) {
 		ret = 0;
 		memcpy(mac, sta->sta.addr, ETH_ALEN);
--- wireless-testing.orig/net/mac80211/sta_info.c	2009-11-13 09:33:41.000000000 +0100
+++ wireless-testing/net/mac80211/sta_info.c	2009-11-13 09:33:43.000000000 +0100
@@ -116,14 +116,15 @@  struct sta_info *sta_info_get(struct iee
 	return sta;
 }
 
-struct sta_info *sta_info_get_by_idx(struct ieee80211_local *local, int idx,
-				     struct net_device *dev)
+struct sta_info *sta_info_get_by_idx(struct ieee80211_sub_if_data *sdata,
+				     int idx)
 {
+	struct ieee80211_local *local = sdata->local;
 	struct sta_info *sta;
 	int i = 0;
 
 	list_for_each_entry_rcu(sta, &local->sta_list, list) {
-		if (dev && dev != sta->sdata->dev)
+		if (sdata != sta->sdata)
 			continue;
 		if (i < idx) {
 			++i;
--- wireless-testing.orig/net/mac80211/sta_info.h	2009-11-13 09:33:41.000000000 +0100
+++ wireless-testing/net/mac80211/sta_info.h	2009-11-13 09:33:43.000000000 +0100
@@ -409,8 +409,8 @@  struct sta_info *sta_info_get(struct iee
 /*
  * Get STA info by index, BROKEN!
  */
-struct sta_info *sta_info_get_by_idx(struct ieee80211_local *local, int idx,
-				      struct net_device *dev);
+struct sta_info *sta_info_get_by_idx(struct ieee80211_sub_if_data *sdata,
+				     int idx);
 /*
  * Create a new STA info, caller owns returned structure
  * until sta_info_insert().