include $(TOPDIR)/rules.mk
PKG_NAME:=libiwinfo
-PKG_RELEASE:=45
+PKG_RELEASE:=46
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
PKG_CONFIG_DEPENDS := \
int (*hardware_id)(const char *, char *);
int (*hardware_name)(const char *, char *);
int (*encryption)(const char *, char *);
+ int (*phyname)(const char *, char *);
int (*assoclist)(const char *, char *, int *);
int (*txpwrlist)(const char *, char *, int *);
int (*scanlist)(const char *, char *, int *);
int madwifi_get_quality(const char *ifname, int *buf);
int madwifi_get_quality_max(const char *ifname, int *buf);
int madwifi_get_encryption(const char *ifname, char *buf);
+int madwifi_get_phyname(const char *ifname, char *buf);
int madwifi_get_assoclist(const char *ifname, char *buf, int *len);
int madwifi_get_txpwrlist(const char *ifname, char *buf, int *len);
int madwifi_get_scanlist(const char *ifname, char *buf, int *len);
.hardware_id = madwifi_get_hardware_id,
.hardware_name = madwifi_get_hardware_name,
.encryption = madwifi_get_encryption,
+ .phyname = madwifi_get_phyname,
.assoclist = madwifi_get_assoclist,
.txpwrlist = madwifi_get_txpwrlist,
.scanlist = madwifi_get_scanlist,
int nl80211_get_quality(const char *ifname, int *buf);
int nl80211_get_quality_max(const char *ifname, int *buf);
int nl80211_get_encryption(const char *ifname, char *buf);
+int nl80211_get_phyname(const char *ifname, char *buf);
int nl80211_get_assoclist(const char *ifname, char *buf, int *len);
int nl80211_get_txpwrlist(const char *ifname, char *buf, int *len);
int nl80211_get_scanlist(const char *ifname, char *buf, int *len);
.hardware_id = nl80211_get_hardware_id,
.hardware_name = nl80211_get_hardware_name,
.encryption = nl80211_get_encryption,
+ .phyname = nl80211_get_phyname,
.assoclist = nl80211_get_assoclist,
.txpwrlist = nl80211_get_txpwrlist,
.scanlist = nl80211_get_scanlist,
int wext_get_quality(const char *ifname, int *buf);
int wext_get_quality_max(const char *ifname, int *buf);
int wext_get_encryption(const char *ifname, char *buf);
+int wext_get_phyname(const char *ifname, char *buf);
int wext_get_assoclist(const char *ifname, char *buf, int *len);
int wext_get_txpwrlist(const char *ifname, char *buf, int *len);
int wext_get_scanlist(const char *ifname, char *buf, int *len);
.hardware_id = wext_get_hardware_id,
.hardware_name = wext_get_hardware_name,
.encryption = wext_get_encryption,
+ .phyname = wext_get_phyname,
.assoclist = wext_get_assoclist,
.txpwrlist = wext_get_txpwrlist,
.scanlist = wext_get_scanlist,
int wl_get_quality_max(const char *ifname, int *buf);
int wl_get_enctype(const char *ifname, char *buf);
int wl_get_encryption(const char *ifname, char *buf);
+int wl_get_phyname(const char *ifname, char *buf);
int wl_get_assoclist(const char *ifname, char *buf, int *len);
int wl_get_txpwrlist(const char *ifname, char *buf, int *len);
int wl_get_scanlist(const char *ifname, char *buf, int *len);
.hardware_id = wl_get_hardware_id,
.hardware_name = wl_get_hardware_name,
.encryption = wl_get_encryption,
+ .phyname = wl_get_phyname,
.assoclist = wl_get_assoclist,
.txpwrlist = wl_get_txpwrlist,
.scanlist = wl_get_scanlist,
return buf;
}
+static char * print_phyname(const struct iwinfo_ops *iw, const char *ifname)
+{
+ static char buf[32];
+
+ if (!iw->phyname(ifname, buf))
+ return buf;
+
+ return "?";
+}
+
static void print_info(const struct iwinfo_ops *iw, const char *ifname)
{
print_txpower_offset(iw, ifname));
printf(" Frequency offset: %s\n",
print_frequency_offset(iw, ifname));
- printf(" Supports VAPs: %s\n",
- print_mbssid_supp(iw, ifname));
+ printf(" Supports VAPs: %s PHY name: %s\n",
+ print_mbssid_supp(iw, ifname),
+ print_phyname(iw, ifname));
}
LUA_WRAP_STRING(wl,bssid)
LUA_WRAP_STRING(wl,country)
LUA_WRAP_STRING(wl,hardware_name)
+LUA_WRAP_STRING(wl,phyname)
LUA_WRAP_STRUCT(wl,mode)
LUA_WRAP_STRUCT(wl,assoclist)
LUA_WRAP_STRUCT(wl,txpwrlist)
LUA_WRAP_STRING(madwifi,bssid)
LUA_WRAP_STRING(madwifi,country)
LUA_WRAP_STRING(madwifi,hardware_name)
+LUA_WRAP_STRING(madwifi,phyname)
LUA_WRAP_STRUCT(madwifi,mode)
LUA_WRAP_STRUCT(madwifi,assoclist)
LUA_WRAP_STRUCT(madwifi,txpwrlist)
LUA_WRAP_STRING(nl80211,bssid)
LUA_WRAP_STRING(nl80211,country)
LUA_WRAP_STRING(nl80211,hardware_name)
+LUA_WRAP_STRING(nl80211,phyname)
LUA_WRAP_STRUCT(nl80211,mode)
LUA_WRAP_STRUCT(nl80211,assoclist)
LUA_WRAP_STRUCT(nl80211,txpwrlist)
LUA_WRAP_STRING(wext,bssid)
LUA_WRAP_STRING(wext,country)
LUA_WRAP_STRING(wext,hardware_name)
+LUA_WRAP_STRING(wext,phyname)
LUA_WRAP_STRUCT(wext,mode)
LUA_WRAP_STRUCT(wext,assoclist)
LUA_WRAP_STRUCT(wext,txpwrlist)
LUA_REG(wl,mbssid_support),
LUA_REG(wl,hardware_id),
LUA_REG(wl,hardware_name),
+ LUA_REG(wl,phyname),
{ NULL, NULL }
};
#endif
LUA_REG(madwifi,mbssid_support),
LUA_REG(madwifi,hardware_id),
LUA_REG(madwifi,hardware_name),
+ LUA_REG(madwifi,phyname),
{ NULL, NULL }
};
#endif
LUA_REG(nl80211,mbssid_support),
LUA_REG(nl80211,hardware_id),
LUA_REG(nl80211,hardware_name),
+ LUA_REG(nl80211,phyname),
{ NULL, NULL }
};
#endif
LUA_REG(wext,mbssid_support),
LUA_REG(wext,hardware_id),
LUA_REG(wext,hardware_name),
+ LUA_REG(wext,phyname),
{ NULL, NULL }
};
return 0;
}
+int madwifi_get_phyname(const char *ifname, char *buf)
+{
+ const char *wifidev;
+
+ wifidev = madwifi_isvap(ifname, NULL);
+
+ if (wifidev)
+ {
+ strcpy(buf, wifidev);
+ return 0;
+ }
+ else if (madwifi_iswifi(ifname))
+ {
+ strcpy(buf, madwifi_phyname(ifname));
+ return 0;
+ }
+
+ return -1;
+}
+
int madwifi_get_assoclist(const char *ifname, char *buf, int *len)
{
int bl, tl, noise;
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)
{
return -1;
}
+int wext_get_phyname(const char *ifname, char *buf)
+{
+ /* No suitable api in wext */
+ strcpy(buf, ifname);
+ return 0;
+}
+
int wext_get_mbssid_support(const char *ifname, int *buf)
{
/* No multi bssid support atm */
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;