From 5039b43e953c16c8510ff89b2c90470882ec55c3 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 19 Oct 2010 20:58:48 +0000 Subject: libiwinfo: implement hwmodelist() --- contrib/package/iwinfo/src/iwinfo_madwifi.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'contrib/package/iwinfo/src/iwinfo_madwifi.c') diff --git a/contrib/package/iwinfo/src/iwinfo_madwifi.c b/contrib/package/iwinfo/src/iwinfo_madwifi.c index 5289f42e0f..aad4b42576 100644 --- a/contrib/package/iwinfo/src/iwinfo_madwifi.c +++ b/contrib/package/iwinfo/src/iwinfo_madwifi.c @@ -886,6 +886,33 @@ int madwifi_get_countrylist(const char *ifname, char *buf, int *len) return 0; } +int madwifi_get_hwmodelist(const char *ifname, int *buf) +{ + char chans[IWINFO_BUFSIZE] = { 0 }; + struct iwinfo_freqlist_entry *e = NULL; + int len = 0; + + if( !madwifi_get_freqlist(ifname, &chans, &len) ) + { + for( e = (struct iwinfo_freqlist_entry *)chans; e->channel; e++ ) + { + if( e->channel <= 14 ) + { + *buf |= IWINFO_80211_B; + *buf |= IWINFO_80211_G; + } + else + { + *buf |= IWINFO_80211_A; + } + } + + return 0; + } + + return -1; +} + int madwifi_get_mbssid_support(const char *ifname, int *buf) { /* We assume that multi bssid is always possible */ -- cgit v1.2.3