diff options
author | jow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2013-06-09 14:39:14 +0000 |
---|---|---|
committer | jow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2013-06-09 14:39:14 +0000 |
commit | c263a155875d0d68a21ef3ada65dd0e92fbb9933 (patch) | |
tree | 746495933f37bdd922b3e2d7bb7e0848d334efa2 /package/network/utils/iwinfo/src/iwinfo_nl80211.c | |
parent | 62b32c53435deabb77d850b7ac492f7d25c3c830 (diff) |
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
Diffstat (limited to 'package/network/utils/iwinfo/src/iwinfo_nl80211.c')
-rw-r--r-- | package/network/utils/iwinfo/src/iwinfo_nl80211.c | 25 |
1 files changed, 25 insertions, 0 deletions
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) { |