diff options
author | Hauke Mehrtens <hauke@hauke-m.de> | 2013-11-11 22:03:25 +0000 |
---|---|---|
committer | Hauke Mehrtens <hauke@hauke-m.de> | 2013-11-11 22:03:25 +0000 |
commit | df493faf12c4124732beea63863d42536a265359 (patch) | |
tree | a5fea9d7111e11955b2a2e94f89cf4c5057f7238 /package/kernel/broadcom-wl/src/wlc.c | |
parent | c926edd72d57faa839a373dfb29b0537c930c5b4 (diff) | |
download | mtk-20170518-df493faf12c4124732beea63863d42536a265359.zip mtk-20170518-df493faf12c4124732beea63863d42536a265359.tar.gz mtk-20170518-df493faf12c4124732beea63863d42536a265359.tar.bz2 |
broadcom-wl: support more virtual interfaces
Read the number of virtual interfaces to support from the device
capabilities; as some newer devices can support up to 16.
Signed-off-by: Nathan Hintz <nlhintz@hotmail.com>
SVN-Revision: 38759
Diffstat (limited to 'package/kernel/broadcom-wl/src/wlc.c')
-rw-r--r-- | package/kernel/broadcom-wl/src/wlc.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/package/kernel/broadcom-wl/src/wlc.c b/package/kernel/broadcom-wl/src/wlc.c index 21754a7..50c40e8 100644 --- a/package/kernel/broadcom-wl/src/wlc.c +++ b/package/kernel/broadcom-wl/src/wlc.c @@ -391,6 +391,37 @@ static int wlc_wsec_key(wlc_param param, void *null, void *value) return wl_bssiovar_set(interface, "wsec_key", vif, &wsec_key, sizeof(wsec_key)); } +static int wlc_cap(wlc_param param, void *data, void *value) +{ + char *iov = *((char **) data); + + if (param & GET) + return wl_iovar_get(interface, iov, value, BUFSIZE); + + return -1; +} + +static int wlc_bssmax(wlc_param param, void *data, void *value) +{ + int *val = (int *) value; + char *iov = *((char **) data); + int ret = -1; + + if (param & GET) { + ret = wl_iovar_get(interface, iov, wlbuf, BUFSIZE); + if (!ret) { + if (strstr(wlbuf, "mbss4")) + *val = 4; + else if (strstr(wlbuf, "mbss16")) + *val = 16; + else + *val = 1; + } + } + + return ret; +} + static inline int cw2ecw(int cw) { int i; @@ -954,6 +985,20 @@ static const struct wlc_call wlc_calls[] = { .handler = wlc_ioctl, .desc = "Band (0=auto, 1=5Ghz, 2=2.4GHz)" }, + { + .name = "cap", + .param = STRING|NOARG, + .handler = wlc_cap, + .data.str = "cap", + .desc = "Capabilities" + }, + { + .name = "bssmax", + .param = INT|NOARG, + .handler = wlc_bssmax, + .data.str = "cap", + .desc = "Number of VIF's supported" + }, }; #define wlc_calls_size (sizeof(wlc_calls) / sizeof(struct wlc_call)) |