1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-11-23 23:32:49 +02:00

[package] iwinfo: support nl80211 hardware identification against radioX pseudo interfaces, useful if radio is not up yet

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@29462 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
jow 2011-12-06 13:24:47 +00:00
parent 05a6361449
commit ac75d1363c
2 changed files with 22 additions and 1 deletions

View File

@ -7,7 +7,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=libiwinfo
PKG_RELEASE:=20
PKG_RELEASE:=21
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)

View File

@ -1631,6 +1631,27 @@ int nl80211_get_mbssid_support(const char *ifname, int *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);
}