diff options
author | Mike Baker <mbm@openwrt.org> | 2007-07-04 16:49:08 +0000 |
---|---|---|
committer | Mike Baker <mbm@openwrt.org> | 2007-07-04 16:49:08 +0000 |
commit | ee0977d0d3a8b68a9c572540c7a51ca7766f5487 (patch) | |
tree | 341cf2394b4224c4b190b4ffde5e5d702d80492e /package/broadcom-wl | |
parent | 37a404a6e8d957a61b8beae5957844fec213b2a2 (diff) | |
download | mtk-20170518-ee0977d0d3a8b68a9c572540c7a51ca7766f5487.zip mtk-20170518-ee0977d0d3a8b68a9c572540c7a51ca7766f5487.tar.gz mtk-20170518-ee0977d0d3a8b68a9c572540c7a51ca7766f5487.tar.bz2 |
patch wlc and scripts to control wl's builtin wpa supplicant
SVN-Revision: 7875
Diffstat (limited to 'package/broadcom-wl')
-rw-r--r-- | package/broadcom-wl/files/lib/wifi/broadcom.sh | 10 | ||||
-rw-r--r-- | package/broadcom-wl/src/wlc/wlc.c | 29 |
2 files changed, 38 insertions, 1 deletions
diff --git a/package/broadcom-wl/files/lib/wifi/broadcom.sh b/package/broadcom-wl/files/lib/wifi/broadcom.sh index 4f11a51..c6444d6 100644 --- a/package/broadcom-wl/files/lib/wifi/broadcom.sh +++ b/package/broadcom-wl/files/lib/wifi/broadcom.sh @@ -201,7 +201,15 @@ enable_broadcom() { [ -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)) diff --git a/package/broadcom-wl/src/wlc/wlc.c b/package/broadcom-wl/src/wlc/wlc.c index 382e83a..f5db9a7 100644 --- a/package/broadcom-wl/src/wlc/wlc.c +++ b/package/broadcom-wl/src/wlc/wlc.c @@ -679,6 +679,29 @@ static int wlc_wdsmac(wlc_param param, void *data, void *value) 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", @@ -865,6 +888,12 @@ static const struct wlc_call wlc_calls[] = { .desc = "Built-in WPA supplicant" }, { + .name = "passphrase", + .param = STRING, + .handler = wlc_pmk, + .desc = "Passphrase for built-in WPA supplicant", + }, + { .name = "maxassoc", .param = INT, .handler = wlc_iovar, |