From cf716c04e697f13d8fd6373a76a5ba57f540f64e Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Sun, 4 Dec 2011 03:42:17 +0000 Subject: [package] iwinfo: add initial hardware detection capabilities git-svn-id: svn://svn.openwrt.org/openwrt/trunk@29421 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/iwinfo/src/iwinfo_nl80211.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'package/iwinfo/src/iwinfo_nl80211.c') diff --git a/package/iwinfo/src/iwinfo_nl80211.c b/package/iwinfo/src/iwinfo_nl80211.c index b3da8384e7..d3726821fc 100644 --- a/package/iwinfo/src/iwinfo_nl80211.c +++ b/package/iwinfo/src/iwinfo_nl80211.c @@ -1628,3 +1628,26 @@ int nl80211_get_mbssid_support(const char *ifname, int *buf) return -1; } + +int nl80211_get_hardware_id(const char *ifname, char *buf) +{ + return wext_get_hardware_id(ifname, buf); +} + +int nl80211_get_hardware_name(const char *ifname, char *buf) +{ + struct iwinfo_hardware_id id; + struct iwinfo_hardware_entry *hw; + + if (nl80211_get_hardware_id(ifname, (char *)&id)) + return -1; + + hw = iwinfo_hardware(&id); + + if (hw) + sprintf(buf, "%s %s", hw->vendor_name, hw->device_name); + else + sprintf(buf, "Generic MAC80211"); + + return 0; +} -- cgit v1.2.3