diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2010-10-19 20:58:48 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2010-10-19 20:58:48 +0000 |
commit | 5039b43e953c16c8510ff89b2c90470882ec55c3 (patch) | |
tree | aebe491e91803460e74e697e6a41ece5533e60d5 /contrib/package/iwinfo/src/iwinfo_wext.c | |
parent | 687861c498f15b76eed192401911c0b00c714597 (diff) |
libiwinfo: implement hwmodelist()
Diffstat (limited to 'contrib/package/iwinfo/src/iwinfo_wext.c')
-rw-r--r-- | contrib/package/iwinfo/src/iwinfo_wext.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/contrib/package/iwinfo/src/iwinfo_wext.c b/contrib/package/iwinfo/src/iwinfo_wext.c index 298fd9317..5eecd0da4 100644 --- a/contrib/package/iwinfo/src/iwinfo_wext.c +++ b/contrib/package/iwinfo/src/iwinfo_wext.c @@ -471,6 +471,33 @@ int wext_get_countrylist(const char *ifname, char *buf, int *len) return -1; } +int wext_get_hwmodelist(const char *ifname, int *buf) +{ + char chans[IWINFO_BUFSIZE] = { 0 }; + struct iwinfo_freqlist_entry *e = NULL; + int len = 0; + + if( !wext_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 wext_get_encryption(const char *ifname, char *buf) { /* No reliable crypto info in wext */ |