goto out;
- send(sock, "ATTACH", 6, 0);
+ if (event)
+ {
+ send(sock, "ATTACH", 6, 0);
- if (nl80211_wpactl_recv(sock, buffer, sizeof(buffer)) <= 0)
- goto out;
+ if (nl80211_wpactl_recv(sock, buffer, sizeof(buffer)) <= 0)
+ goto out;
+ }
send(sock, cmd, strlen(cmd), 0);
break;
}
- if ((!event && buffer[0] != '<') || strstr(buffer, event))
+ if ((!event && buffer[0] != '<') || (event && strstr(buffer, event)))
break;
}
{
if (nls)
{
+ if (nls->nl80211)
+ genl_family_put(nls->nl80211);
+
if (nls->nl_sock)
nl_socket_free(nls->nl_sock);
/* Reuse existing interface */
if ((res = nl80211_phy2ifname(ifname)) != NULL)
{
- return wext_get_hardware_id(res, buf);
+ rv = wext_get_hardware_id(res, buf);
}
/* Need to spawn a temporary iface for finding IDs */
{
rv = wext_get_hardware_id(res, buf);
nl80211_ifdel(res);
- return rv;
}
}
+ else
+ {
+ rv = wext_get_hardware_id(ifname, buf);
+ }
+
+ /* Failed to obtain hardware IDs, search board config */
+ if (rv)
+ {
+ rv = iwinfo_hardware_id_from_mtd(buf);
+ }
- return wext_get_hardware_id(ifname, buf);
+ return rv;
}
static const struct iwinfo_hardware_entry *