tools: clean up Makefiles / make ccache work
[openwrt.git] / package / iwinfo / src / iwinfo_nl80211.c
index 4b8b37d..4f3390f 100644 (file)
@@ -559,6 +559,9 @@ void nl80211_close(void)
 {
        if (nls)
        {
 {
        if (nls)
        {
+               if (nls->nl80211)
+                       genl_family_put(nls->nl80211);
+
                if (nls->nl_sock)
                        nl_socket_free(nls->nl_sock);
 
                if (nls->nl_sock)
                        nl_socket_free(nls->nl_sock);
 
@@ -1631,6 +1634,27 @@ int nl80211_get_mbssid_support(const char *ifname, int *buf)
 
 int nl80211_get_hardware_id(const char *ifname, char *buf)
 {
 
 int nl80211_get_hardware_id(const char *ifname, char *buf)
 {
+       int rv;
+       char *res;
+
+       /* Got a radioX pseudo interface, find some interface on it or create one */
+       if (!strncmp(ifname, "radio", 5))
+       {
+               /* Reuse existing interface */
+               if ((res = nl80211_phy2ifname(ifname)) != NULL)
+               {
+                       return wext_get_hardware_id(res, buf);
+               }
+
+               /* Need to spawn a temporary iface for finding IDs */
+               else if ((res = nl80211_ifadd(ifname)) != NULL)
+               {
+                       rv = wext_get_hardware_id(res, buf);
+                       nl80211_ifdel(res);
+                       return rv;
+               }
+       }
+
        return wext_get_hardware_id(ifname, buf);
 }
 
        return wext_get_hardware_id(ifname, buf);
 }
 
This page took 0.021933 seconds and 4 git commands to generate.