diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2011-12-04 03:42:17 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2011-12-04 03:42:17 +0000 |
commit | 0d587a173c3ab39ea95719110d8e6791bd3dfbb1 (patch) | |
tree | 96b02527f41c9a14ec51ec7d631e3785930d9e8f /package/iwinfo/src/iwinfo_nl80211.c | |
parent | 83e6c14f82f6c2d9028f4ec9f4da943c0e524345 (diff) | |
download | mtk-20170518-0d587a173c3ab39ea95719110d8e6791bd3dfbb1.zip mtk-20170518-0d587a173c3ab39ea95719110d8e6791bd3dfbb1.tar.gz mtk-20170518-0d587a173c3ab39ea95719110d8e6791bd3dfbb1.tar.bz2 |
iwinfo: add initial hardware detection capabilities
SVN-Revision: 29421
Diffstat (limited to 'package/iwinfo/src/iwinfo_nl80211.c')
-rw-r--r-- | package/iwinfo/src/iwinfo_nl80211.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/package/iwinfo/src/iwinfo_nl80211.c b/package/iwinfo/src/iwinfo_nl80211.c index b3da838..d372682 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; +} |