iwinfo: add phyname attribute, this is useful to group networks by radio phy
[openwrt/svn-archive/archive.git] / package / network / utils / iwinfo / src / iwinfo_wl.c
index 3d15fc9ca7518b76c1ee6b3ede2d5536c4a212b2..0a1439bb893aeaa541dab7123f5617da80ec6b8a 100644 (file)
@@ -321,6 +321,18 @@ int wl_get_encryption(const char *ifname, char *buf)
        return 0;
 }
 
+int wl_get_phyname(const char *ifname, char *buf)
+{
+       char *p;
+
+       strcpy(buf, ifname);
+
+       if ((p = strchr(buf, '.')) != NULL)
+               *p = 0;
+
+       return 0;
+}
+
 int wl_get_enctype(const char *ifname, char *buf)
 {
        uint32_t wsec, wpa;