aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/nl80211.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2008-09-16 08:55:09 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-09-24 16:18:00 -0400
commit60719ffd721f6764b7d07ca188c0d944a4330b69 (patch)
treea224d5a7538e070430aac3a8a8f9abb4b0cd9152 /net/wireless/nl80211.c
parent133b822638ff01eb1e32e1917b197c40ed095ddd (diff)
cfg80211: show interface type
This patch makes cfg80211 show the interface in the nl80211 information about a specific interface. API users are required to keep the type updated (everything else is fairly complicated) but you will get a warning if you fail to keep it updated. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless/nl80211.c')
-rw-r--r--net/wireless/nl80211.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 1221d726ed50..44771a690d53 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -299,7 +299,7 @@ static int nl80211_send_iface(struct sk_buff *msg, u32 pid, u32 seq, int flags,
299 299
300 NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, dev->ifindex); 300 NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, dev->ifindex);
301 NLA_PUT_STRING(msg, NL80211_ATTR_IFNAME, dev->name); 301 NLA_PUT_STRING(msg, NL80211_ATTR_IFNAME, dev->name);
302 /* TODO: interface type */ 302 NLA_PUT_U32(msg, NL80211_ATTR_IFTYPE, dev->ieee80211_ptr->iftype);
303 return genlmsg_end(msg, hdr); 303 return genlmsg_end(msg, hdr);
304 304
305 nla_put_failure: 305 nla_put_failure:
@@ -453,6 +453,10 @@ static int nl80211_set_interface(struct sk_buff *skb, struct genl_info *info)
453 &flags); 453 &flags);
454 err = drv->ops->change_virtual_intf(&drv->wiphy, ifindex, 454 err = drv->ops->change_virtual_intf(&drv->wiphy, ifindex,
455 type, err ? NULL : &flags, &params); 455 type, err ? NULL : &flags, &params);
456
457 dev = __dev_get_by_index(&init_net, ifindex);
458 WARN_ON(!dev || (!err && dev->ieee80211_ptr->iftype != type));
459
456 rtnl_unlock(); 460 rtnl_unlock();
457 461
458 unlock: 462 unlock: