From: Johannes Berg <johannes@sipsolutions.net>
To: John Linville <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org
Subject: [PATCH 3/4] mac80211_hwsim: convert to new station add/remove callbacks
Date: Fri, 19 Feb 2010 19:06:55 +0100 [thread overview]
Message-ID: <20100219180736.990884119@sipsolutions.net> (raw)
In-Reply-To: 20100219180652.409890561@sipsolutions.net
This converts mac80211_hwsim to use the new
station add/remove callbacks instead of using
the old sta_notify callback.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
drivers/net/wireless/mac80211_hwsim.c | 32 ++++++++++++++++++++++++++------
1 file changed, 26 insertions(+), 6 deletions(-)
--- wireless-testing.orig/drivers/net/wireless/mac80211_hwsim.c 2010-02-19 18:55:53.000000000 +0100
+++ wireless-testing/drivers/net/wireless/mac80211_hwsim.c 2010-02-19 18:57:57.000000000 +0100
@@ -771,23 +771,41 @@ static void mac80211_hwsim_bss_info_chan
}
}
+static int mac80211_hwsim_sta_add(struct ieee80211_hw *hw,
+ struct ieee80211_vif *vif,
+ struct ieee80211_sta *sta)
+{
+ hwsim_check_magic(vif);
+ hwsim_set_sta_magic(sta);
+
+ return 0;
+}
+
+static int mac80211_hwsim_sta_remove(struct ieee80211_hw *hw,
+ struct ieee80211_vif *vif,
+ struct ieee80211_sta *sta)
+{
+ hwsim_check_magic(vif);
+ hwsim_clear_sta_magic(sta);
+
+ return 0;
+}
+
static void mac80211_hwsim_sta_notify(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
enum sta_notify_cmd cmd,
struct ieee80211_sta *sta)
{
hwsim_check_magic(vif);
+
switch (cmd) {
- case STA_NOTIFY_ADD:
- hwsim_set_sta_magic(sta);
- break;
- case STA_NOTIFY_REMOVE:
- hwsim_clear_sta_magic(sta);
- break;
case STA_NOTIFY_SLEEP:
case STA_NOTIFY_AWAKE:
/* TODO: make good use of these flags */
break;
+ default:
+ WARN(1, "Invalid sta notify: %d\n", cmd);
+ break;
}
}
@@ -958,6 +976,8 @@ static struct ieee80211_ops mac80211_hws
.config = mac80211_hwsim_config,
.configure_filter = mac80211_hwsim_configure_filter,
.bss_info_changed = mac80211_hwsim_bss_info_changed,
+ .sta_add = mac80211_hwsim_sta_add,
+ .sta_remove = mac80211_hwsim_sta_remove,
.sta_notify = mac80211_hwsim_sta_notify,
.set_tim = mac80211_hwsim_set_tim,
.conf_tx = mac80211_hwsim_conf_tx,
next prev parent reply other threads:[~2010-02-19 18:08 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-19 18:06 [PATCH 0/4] convert drivers to new sta add/remove callbacks Johannes Berg
2010-02-19 18:06 ` [PATCH 1/4] ar9170: convert to new station " Johannes Berg
2010-02-19 18:06 ` [PATCH 2/4] p54: " Johannes Berg
2010-02-19 18:06 ` Johannes Berg [this message]
2010-02-19 18:06 ` [PATCH 4/4] ath9k: " Johannes Berg
2010-02-19 18:18 ` [RFC/RFT] mwl8k: " Johannes Berg
2010-02-20 9:03 ` Lennert Buytenhek
2010-02-20 12:21 ` 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=20100219180736.990884119@sipsolutions.net \
--to=johannes@sipsolutions.net \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.