-/* $OpenBSD: bwfm.c,v 1.106 2022/12/30 16:49:34 kettenis Exp $ */
+/* $OpenBSD: bwfm.c,v 1.107 2023/03/15 22:47:35 stsp Exp $ */
/*
* Copyright (c) 2010-2016 Broadcom Corporation
* Copyright (c) 2016,2017 Patrick Wildt <patrick@blueri.se>
ic->ic_state = IEEE80211_S_INIT;
ic->ic_caps =
+ IEEE80211_C_WEP |
#ifndef IEEE80211_STA_ONLY
IEEE80211_C_HOSTAP | /* Access Point */
#endif
uint8_t *frm;
/*
- * OPEN: Open or WPA/WPA2 on newer Chips/Firmware.
- * SHARED KEY: WEP.
+ * OPEN: Open or WEP or WPA/WPA2 on newer Chips/Firmware.
* AUTO: Automatic, probably for older Chips/Firmware.
*/
if (ic->ic_flags & IEEE80211_F_RSNON) {
bwfm_fwvar_var_set_int(sc, "wpa_auth", wpa);
bwfm_fwvar_var_set_int(sc, "wsec", wsec);
+ } else if (ic->ic_flags & IEEE80211_F_WEPON) {
+ bwfm_fwvar_var_set_int(sc, "wpa_auth", BWFM_WPA_AUTH_DISABLED);
+ bwfm_fwvar_var_set_int(sc, "wsec", BWFM_WSEC_WEP);
} else {
bwfm_fwvar_var_set_int(sc, "wpa_auth", BWFM_WPA_AUTH_DISABLED);
bwfm_fwvar_var_set_int(sc, "wsec", BWFM_WSEC_NONE);
struct bwfm_join_params join;
/*
- * OPEN: Open or WPA/WPA2 on newer Chips/Firmware.
- * SHARED KEY: WEP.
+ * OPEN: Open or WEP or WPA/WPA2 on newer Chips/Firmware.
* AUTO: Automatic, probably for older Chips/Firmware.
*/
if (ic->ic_flags & IEEE80211_F_RSNON) {
bwfm_fwvar_var_set_data(sc, "wsec_key", &key, sizeof(key));
bwfm_fwvar_var_get_int(sc, "wsec", &wsec);
+ wsec &= ~(BWFM_WSEC_WEP | BWFM_WSEC_TKIP | BWFM_WSEC_AES);
wsec |= wsec_enable;
bwfm_fwvar_var_set_int(sc, "wsec", wsec);
- if (sc->sc_key_tasks == 0) {
+ if (wsec_enable != BWFM_WSEC_WEP && cmd->ni != NULL &&
+ sc->sc_key_tasks == 0) {
DPRINTF(("%s: marking port %s valid\n", DEVNAME(sc),
ether_sprintf(cmd->ni->ni_macaddr)));
cmd->ni->ni_port_valid = 1;