linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iw: add support for NL80211_CMD_SET_STATION event
@ 2012-01-29 14:50 Antonio Quartulli
  2012-01-30  1:04 ` Johannes Berg
  0 siblings, 1 reply; 3+ messages in thread
From: Antonio Quartulli @ 2012-01-29 14:50 UTC (permalink / raw)
  To: John W. Linville; +Cc: linux-wireless, Johannes Berg, Antonio Quartulli

This patch makes iw print an appropriate message in case of
NL80211_CMD_SET_STATION event. Involved flag with their values are printed too.

Signed-off-by: Antonio Quartulli <ordex@autistici.org>
---
 event.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/event.c b/event.c
index bc39662..21cd426 100644
--- a/event.c
+++ b/event.c
@@ -188,6 +188,7 @@ static int print_event(struct nl_msg *msg, void *arg)
 	struct genlmsghdr *gnlh = nlmsg_data(nlmsg_hdr(msg));
 	struct nlattr *tb[NL80211_ATTR_MAX + 1], *nst;
 	struct print_event_args *args = arg;
+	struct nl80211_sta_flag_update *sta_flags_upd;
 	char ifname[100];
 	char macbuf[6*3];
 	__u8 reg_type;
@@ -317,6 +318,17 @@ static int print_event(struct nl_msg *msg, void *arg)
 			printf("\to beaconing enabled\n");
 
 		break;
+	case NL80211_CMD_SET_STATION:
+		mac_addr_n2a(macbuf, nla_data(tb[NL80211_ATTR_MAC]));
+		printf("set station %s\n", macbuf);
+		if (tb[NL80211_ATTR_STA_FLAGS2]) {
+			sta_flags_upd = nla_data(tb[NL80211_ATTR_STA_FLAGS2]);
+			printf("\tflag_mask =\t0x%.8x\n"
+			       "\tflag_set =\t0x%.8x\n",
+			       sta_flags_upd->mask, sta_flags_upd->set);
+		} else
+			printf("\tno flags set\n");
+		break;
 	case NL80211_CMD_NEW_STATION:
 		mac_addr_n2a(macbuf, nla_data(tb[NL80211_ATTR_MAC]));
 		printf("new station %s\n", macbuf);
-- 
1.7.3.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-01-30  9:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-29 14:50 [PATCH] iw: add support for NL80211_CMD_SET_STATION event Antonio Quartulli
2012-01-30  1:04 ` Johannes Berg
2012-01-30  9:53   ` Antonio Quartulli

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