linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: John Linville <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org, Jouni Malinen <j@w1.fi>
Subject: [PATCH 1/4] mac80211: let sta_info_get_by_idx get sta by sdata
Date: Mon, 16 Nov 2009 12:00:37 +0100	[thread overview]
Message-ID: <20091116110720.266695628@sipsolutions.net> (raw)
In-Reply-To: 20091116110036.010062226@sipsolutions.net

Instead of filtering by device, directly look up by sdata.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
 net/mac80211/cfg.c      |    4 ++--
 net/mac80211/sta_info.c |    7 ++++---
 net/mac80211/sta_info.h |    4 ++--
 3 files changed, 8 insertions(+), 7 deletions(-)

--- 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().



  reply	other threads:[~2009-11-16 11:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-16 11:00 [PATCH 0/4] preparations for stations per vif Johannes Berg
2009-11-16 11:00 ` Johannes Berg [this message]
2009-11-16 11:00 ` [PATCH 2/4] mac80211: convert aggregation to operate on vifs/stas Johannes Berg
2009-11-16 11:00 ` [PATCH 3/4] mac80211: push michael MIC report after DA check Johannes Berg
2009-11-16 11:00 ` [PATCH 4/4] mac80211: cleanup reorder buffer handling Johannes Berg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091116110720.266695628@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=j@w1.fi \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).