From c263a155875d0d68a21ef3ada65dd0e92fbb9933 Mon Sep 17 00:00:00 2001 From: jow Date: Sun, 9 Jun 2013 14:39:14 +0000 Subject: iwinfo: add phyname attribute, this is useful to group networks by radio phy git-svn-id: svn://svn.openwrt.org/openwrt/trunk@36889 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/network/utils/iwinfo/src/iwinfo_nl80211.c | 25 +++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'package/network/utils/iwinfo/src/iwinfo_nl80211.c') diff --git a/package/network/utils/iwinfo/src/iwinfo_nl80211.c b/package/network/utils/iwinfo/src/iwinfo_nl80211.c index 051d34dd1c..9486ffc3f9 100644 --- a/package/network/utils/iwinfo/src/iwinfo_nl80211.c +++ b/package/network/utils/iwinfo/src/iwinfo_nl80211.c @@ -1407,6 +1407,31 @@ int nl80211_get_encryption(const char *ifname, char *buf) return -1; } +int nl80211_get_phyname(const char *ifname, char *buf) +{ + const char *name; + + name = nl80211_ifname2phy(ifname); + + if (name) + { + strcpy(buf, name); + return 0; + } + else if ((name = nl80211_phy2ifname(ifname)) != NULL) + { + name = nl80211_ifname2phy(name); + + if (name) + { + strcpy(buf, ifname); + return 0; + } + } + + return -1; +} + static int nl80211_get_assoclist_cb(struct nl_msg *msg, void *arg) { -- cgit v1.2.3