aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-04-19 10:23:20 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-04-22 16:57:16 -0400
commitd726405af6c8c81d2ee5e6a29301c68b9d4c574f (patch)
tree1d0f1589ab96646353e0d374808b35a7c3c7dc68 /net/wireless
parentfef99929cd6b409a67a35e41f7c177bade5bca34 (diff)
nl80211: send wiphy along with netdev
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> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless')
-rw-r--r--net/wireless/nl80211.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index d33cab0e0fb2..d2cfde659e76 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -538,6 +538,7 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info)
538 538
539 539
540static int nl80211_send_iface(struct sk_buff *msg, u32 pid, u32 seq, int flags, 540static int nl80211_send_iface(struct sk_buff *msg, u32 pid, u32 seq, int flags,
541 struct cfg80211_registered_device *rdev,
541 struct net_device *dev) 542 struct net_device *dev)
542{ 543{
543 void *hdr; 544 void *hdr;
@@ -547,6 +548,7 @@ static int nl80211_send_iface(struct sk_buff *msg, u32 pid, u32 seq, int flags,
547 return -1; 548 return -1;
548 549
549 NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, dev->ifindex); 550 NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, dev->ifindex);
551 NLA_PUT_U32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx);
550 NLA_PUT_STRING(msg, NL80211_ATTR_IFNAME, dev->name); 552 NLA_PUT_STRING(msg, NL80211_ATTR_IFNAME, dev->name);
551 NLA_PUT_U32(msg, NL80211_ATTR_IFTYPE, dev->ieee80211_ptr->iftype); 553 NLA_PUT_U32(msg, NL80211_ATTR_IFTYPE, dev->ieee80211_ptr->iftype);
552 return genlmsg_end(msg, hdr); 554 return genlmsg_end(msg, hdr);
@@ -581,7 +583,7 @@ static int nl80211_dump_interface(struct sk_buff *skb, struct netlink_callback *
581 } 583 }
582 if (nl80211_send_iface(skb, NETLINK_CB(cb->skb).pid, 584 if (nl80211_send_iface(skb, NETLINK_CB(cb->skb).pid,
583 cb->nlh->nlmsg_seq, NLM_F_MULTI, 585 cb->nlh->nlmsg_seq, NLM_F_MULTI,
584 wdev->netdev) < 0) { 586 dev, wdev->netdev) < 0) {
585 mutex_unlock(&dev->devlist_mtx); 587 mutex_unlock(&dev->devlist_mtx);
586 goto out; 588 goto out;
587 } 589 }
@@ -615,7 +617,8 @@ static int nl80211_get_interface(struct sk_buff *skb, struct genl_info *info)
615 if (!msg) 617 if (!msg)
616 goto out_err; 618 goto out_err;
617 619
618 if (nl80211_send_iface(msg, info->snd_pid, info->snd_seq, 0, netdev) < 0) 620 if (nl80211_send_iface(msg, info->snd_pid, info->snd_seq, 0,
621 dev, netdev) < 0)
619 goto out_free; 622 goto out_free;
620 623
621 dev_put(netdev); 624 dev_put(netdev);