diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2013-06-09 14:39:14 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2013-06-09 14:39:14 +0000 |
commit | bc73ca56198ce61623db3061e00c1d246d1e20a5 (patch) | |
tree | a43edb26e9ca27496f6d0f412c5a7ce88ecb5079 /package/network/utils/iwinfo/src/iwinfo_nl80211.c | |
parent | cb24c37858e2628c9dba371653779ad2aa771899 (diff) | |
download | master-31e0f0ae-bc73ca56198ce61623db3061e00c1d246d1e20a5.tar.gz master-31e0f0ae-bc73ca56198ce61623db3061e00c1d246d1e20a5.tar.bz2 master-31e0f0ae-bc73ca56198ce61623db3061e00c1d246d1e20a5.zip |
iwinfo: add phyname attribute, this is useful to group networks by radio phy
SVN-Revision: 36889
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) { |