[ -z "$nasopts" ] || {
eval "${vif}_ssid=\"\$ssid\""
mode="-A"
- [ "$vif" = "$sta_if" ] && mode="-S"
+ [ "$ap" = "0" ] && {
+ mode="-S"
+ [ -z "$bridge" ] || {
+ append vif_pre_up "supplicant 1" "$N"
+ append vif_pre_up "passphrase $key" "$N"
+
+ nas=""
+ }
+ }
[ -z "$nas" ] || nas_cmd="${nas_cmd:+$nas_cmd$N}$nas -P /var/run/nas.$ifname.pid -H 34954 ${bridge:+ -l $bridge} -i $ifname $mode -m $auth -w $wsec -s \"\$${vif}_ssid\" -g 3600 $nasopts &"
}
_c=$(($_c + 1))
return ret;
}
+static int wlc_pmk(wlc_param param, void *data, void *value)
+{
+ int ret = -1;
+ char *str = (char *) value;
+ wsec_pmk_t pmk;
+
+ /* driver doesn't support GET */
+
+ if ((param & PARAM_MODE) == SET) {
+ strncpy(pmk.key, value, WSEC_MAX_PSK_LEN);
+ pmk.key_len = strlen(value);
+
+ if (pmk.key_len > WSEC_MAX_PSK_LEN)
+ pmk.key_len = WSEC_MAX_PSK_LEN;
+
+ pmk.flags = WSEC_PASSPHRASE;
+
+ ret = wl_ioctl(interface, WLC_SET_WSEC_PMK, &pmk, sizeof(pmk));
+ }
+
+ return ret;
+}
+
static const struct wlc_call wlc_calls[] = {
{
.name = "version",
.data.str = "sup_wpa",
.desc = "Built-in WPA supplicant"
},
+ {
+ .name = "passphrase",
+ .param = STRING,
+ .handler = wlc_pmk,
+ .desc = "Passphrase for built-in WPA supplicant",
+ },
{
.name = "maxassoc",
.param = INT,