# make sure all of the devices are disabled in the driver
local ifdown=
- local vif
+ local bssmax=$(wlc ifname "$device" bssmax)
+ local vif=$((${bssmax:-4} - 1))
append ifdown "down" "$N"
append ifdown "wds none" "$N"
- for vif in 3 2 1 0; do
+ while [ $vif -ge 0 ]; do
append ifdown "vif $vif" "$N"
append ifdown "enabled 0" "$N"
+ vif=$(($vif - 1))
done
wlc ifname "$device" stdin <<EOF
local nas="$(which nas)"
local if_pre_up if_up nas_cmd
local vif vif_pre_up vif_post_up vif_do_up vif_txpower
+ local bssmax=$(wlc ifname "$device" bssmax)
+ bssmax=${bssmax:-4}
for vif in $vifs; do
+ [ $_c -ge $bssmax ] && break
+
config_get vif_txpower "$vif" txpower
local mode
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;
.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))