All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nl80211: send wiphy along with netdev
@ 2009-04-19 14:23 Johannes Berg
  0 siblings, 0 replies; only message in thread
From: Johannes Berg @ 2009-04-19 14:23 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless

When listing all wireless netdevs in the system this
is useful to print which wiphy they belong to. Just
add the attribute, any program that doesn't care will
just ignore it.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
 net/wireless/nl80211.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

--- wireless-testing.orig/net/wireless/nl80211.c	2009-04-19 16:18:50.000000000 +0200
+++ wireless-testing/net/wireless/nl80211.c	2009-04-19 16:21:28.000000000 +0200
@@ -542,6 +542,7 @@ static int nl80211_set_wiphy(struct sk_b
 
 
 static int nl80211_send_iface(struct sk_buff *msg, u32 pid, u32 seq, int flags,
+			      struct cfg80211_registered_device *rdev,
 			      struct net_device *dev)
 {
 	void *hdr;
@@ -551,6 +552,7 @@ static int nl80211_send_iface(struct sk_
 		return -1;
 
 	NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, dev->ifindex);
+	NLA_PUT_U32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx);
 	NLA_PUT_STRING(msg, NL80211_ATTR_IFNAME, dev->name);
 	NLA_PUT_U32(msg, NL80211_ATTR_IFTYPE, dev->ieee80211_ptr->iftype);
 	return genlmsg_end(msg, hdr);
@@ -585,7 +587,7 @@ static int nl80211_dump_interface(struct
 			}
 			if (nl80211_send_iface(skb, NETLINK_CB(cb->skb).pid,
 					       cb->nlh->nlmsg_seq, NLM_F_MULTI,
-					       wdev->netdev) < 0) {
+					       dev, wdev->netdev) < 0) {
 				mutex_unlock(&dev->devlist_mtx);
 				goto out;
 			}
@@ -619,7 +621,8 @@ static int nl80211_get_interface(struct 
 	if (!msg)
 		goto out_err;
 
-	if (nl80211_send_iface(msg, info->snd_pid, info->snd_seq, 0, netdev) < 0)
+	if (nl80211_send_iface(msg, info->snd_pid, info->snd_seq, 0,
+			       dev, netdev) < 0)
 		goto out_free;
 
 	dev_put(netdev);



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-04-19 14:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-19 14:23 [PATCH] nl80211: send wiphy along with netdev Johannes Berg

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.