From e3a5401fb20a17ea3749dedac2219e8f0ca44a4b Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Mon, 11 Nov 2013 21:54:25 +0000 Subject: iwinfo: fix hwmodelist reporting for broadcom wl Modify the hwmodelist reporting for broadcom devices to include proper reporting of 802.11n support. Signed-off-by: Nathan Hintz SVN-Revision: 38745 --- package/network/utils/iwinfo/src/iwinfo_wl.c | 41 +++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) (limited to 'package/network/utils/iwinfo/src/iwinfo_wl.c') diff --git a/package/network/utils/iwinfo/src/iwinfo_wl.c b/package/network/utils/iwinfo/src/iwinfo_wl.c index 0a1439b..f5f0d4b 100644 --- a/package/network/utils/iwinfo/src/iwinfo_wl.c +++ b/package/network/utils/iwinfo/src/iwinfo_wl.c @@ -583,7 +583,46 @@ int wl_get_countrylist(const char *ifname, char *buf, int *len) int wl_get_hwmodelist(const char *ifname, int *buf) { - return wext_get_hwmodelist(ifname, buf); + int phytype; + uint i, band[WLC_BAND_ALL], bands; + + if (!wl_ioctl(ifname, WLC_GET_PHYTYPE, &phytype, sizeof(phytype)) && + !wl_ioctl(ifname, WLC_GET_BANDLIST, band, sizeof(band))) + { + switch (phytype) + { + case WLC_PHY_TYPE_A: + *buf = IWINFO_80211_A; + break; + case WLC_PHY_TYPE_B: + *buf = IWINFO_80211_B; + break; + case WLC_PHY_TYPE_LP: + case WLC_PHY_TYPE_G: + case WLC_PHY_TYPE_N: + bands = 0; + for (i = 1; i <= band[0]; i++) + { + bands |= band[i]; + } + *buf = 0; + if (bands & WLC_BAND_5G) + *buf |= IWINFO_80211_A; + if (bands & WLC_BAND_2G) + { + *buf |= IWINFO_80211_B; + *buf |= IWINFO_80211_G; + } + if (phytype == WLC_PHY_TYPE_N) + *buf |= IWINFO_80211_N; + break; + default: + return -1; + break; + } + return 0; + } + return -1; } int wl_get_mbssid_support(const char *ifname, int *buf) -- cgit v1.1