summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorMarcus Glocker <mglocker@cvs.openbsd.org>2006-08-07 10:46:13 +0000
committerMarcus Glocker <mglocker@cvs.openbsd.org>2006-08-07 10:46:13 +0000
commit8ce17d27da8f5c47bf3bb232e111cf4eff19ba7d (patch)
tree2ae8f50946f3448cd6913c0285d1f6750645cc61 /sys/dev
parent0a7c49ff94acd04683188648daa1443b8e5ddcad (diff)
Enable WEP.
ok jsg@
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ic/acx.c28
-rw-r--r--sys/dev/ic/acx100.c18
-rw-r--r--sys/dev/ic/acxvar.h6
3 files changed, 19 insertions, 33 deletions
diff --git a/sys/dev/ic/acx.c b/sys/dev/ic/acx.c
index 067ae373c15..beeb7ade2b5 100644
--- a/sys/dev/ic/acx.c
+++ b/sys/dev/ic/acx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acx.c,v 1.29 2006/08/07 00:23:20 mglocker Exp $ */
+/* $OpenBSD: acx.c,v 1.30 2006/08/07 10:46:12 mglocker Exp $ */
/*
* Copyright (c) 2006 Jonathan Gray <jsg@openbsd.org>
@@ -496,41 +496,35 @@ acx_init_info_reg(struct acx_softc *sc)
int
acx_set_crypt_keys(struct acx_softc *sc)
{
-#if 0
struct ieee80211com *ic = &sc->sc_ic;
struct acx_conf_wep_txkey wep_txkey;
int i, error, got_wk = 0;
for (i = 0; i < IEEE80211_WEP_NKID; ++i) {
- struct ieee80211_key *wk = &ic->ic_nw_keys[i];
+ struct ieee80211_wepkey *wk = &ic->ic_nw_keys[i];
- if (wk->wk_keylen == 0)
+ if (wk->wk_len == 0)
continue;
if (sc->chip_hw_crypt) {
error = sc->chip_set_wepkey(sc, wk, i);
if (error)
- return error;
+ return (error);
got_wk = 1;
- } else if (wk->wk_flags & IEEE80211_KEY_XMIT) {
- wk->wk_flags |= IEEE80211_KEY_SWCRYPT;
}
}
- if (!got_wk || sc->chip_hw_crypt ||
- ic->ic_def_txkey == IEEE80211_KEYIX_NONE)
- return 0;
+ if (!got_wk)
+ return (0);
/* Set current WEP key index */
- wep_txkey.wep_txkey = ic->ic_def_txkey;
+ wep_txkey.wep_txkey = ic->ic_wep_txkey;
if (acx_set_wep_txkey_conf(sc, &wep_txkey) != 0) {
- printf("%s: set WEP txkey failed\n",
- sc->sc_dev.dv_xname);
- return ENXIO;
+ printf("%s: set WEP txkey failed\n", sc->sc_dev.dv_xname);
+ return (ENXIO);
}
- return 0;
-#endif
- return (ENXIO);
+
+ return (0);
}
void
diff --git a/sys/dev/ic/acx100.c b/sys/dev/ic/acx100.c
index 4c0965d7fd8..0c3497c2fc7 100644
--- a/sys/dev/ic/acx100.c
+++ b/sys/dev/ic/acx100.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acx100.c,v 1.7 2006/08/06 13:03:03 mglocker Exp $ */
+/* $OpenBSD: acx100.c,v 1.8 2006/08/07 10:46:12 mglocker Exp $ */
/*
* Copyright (c) 2006 Jonathan Gray <jsg@openbsd.org>
@@ -113,10 +113,8 @@ int acx100_set_txpower(struct acx_softc *);
void acx100_set_fw_txdesc_rate(struct acx_softc *,
struct acx_txbuf *, int);
void acx100_set_bss_join_param(struct acx_softc *, void *, int);
-#if 0
-int acx100_set_wepkey(struct acx_softc *, struct ieee80211_key *,
+int acx100_set_wepkey(struct acx_softc *, struct ieee80211_wepkey *,
int);
-#endif
void acx100_proc_wep_rxbuf(struct acx_softc *, struct mbuf *, int *);
/*
@@ -302,9 +300,7 @@ acx100_set_param(struct acx_softc *sc)
sc->sc_ic.ic_sup_rates[IEEE80211_MODE_11B] = acx_rates_11b;
sc->chip_init = acx100_init;
-#if 0
sc->chip_set_wepkey = acx100_set_wepkey;
-#endif
sc->chip_read_config = acx100_read_config;
sc->chip_write_config = acx100_write_config;
sc->chip_set_fw_txdesc_rate = acx100_set_fw_txdesc_rate;
@@ -722,23 +718,22 @@ acx100_set_bss_join_param(struct acx_softc *sc, void *param, int dtim_intvl)
bj->all_rates = 31; /* XXX */
}
-#if 0
int
-acx100_set_wepkey(struct acx_softc *sc, struct ieee80211_key *wk, int wk_idx)
+acx100_set_wepkey(struct acx_softc *sc, struct ieee80211_wepkey *wk, int wk_idx)
{
struct acx100_conf_wepkey conf_wk;
struct ifnet *ifp = &sc->sc_ic.ic_if;
- if (wk->wk_keylen > ACX100_WEPKEY_LEN) {
+ if (wk->wk_len > ACX100_WEPKEY_LEN) {
printf("%s: %dth WEP key size beyond %d\n",
ifp->if_xname, wk_idx, ACX100_WEPKEY_LEN);
return EINVAL;
}
conf_wk.action = ACX100_WEPKEY_ACT_ADD;
- conf_wk.key_len = wk->wk_keylen;
+ conf_wk.key_len = wk->wk_len;
conf_wk.key_idx = wk_idx;
- bcopy(wk->wk_key, conf_wk.key, wk->wk_keylen);
+ bcopy(wk->wk_key, conf_wk.key, wk->wk_len);
if (acx100_set_wepkey_conf(sc, &conf_wk) != 0) {
printf("%s: %s set %dth WEP key failed\n",
ifp->if_xname, __func__, wk_idx);
@@ -746,7 +741,6 @@ acx100_set_wepkey(struct acx_softc *sc, struct ieee80211_key *wk, int wk_idx)
}
return 0;
}
-#endif
void
acx100_proc_wep_rxbuf(struct acx_softc *sc, struct mbuf *m, int *len)
diff --git a/sys/dev/ic/acxvar.h b/sys/dev/ic/acxvar.h
index 22cf0b4133e..fa76785ebcd 100644
--- a/sys/dev/ic/acxvar.h
+++ b/sys/dev/ic/acxvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: acxvar.h,v 1.9 2006/08/06 13:03:03 mglocker Exp $ */
+/* $OpenBSD: acxvar.h,v 1.10 2006/08/07 10:46:12 mglocker Exp $ */
/*
* Copyright (c) 2006 Jonathan Gray <jsg@openbsd.org>
@@ -443,11 +443,9 @@ struct acx_softc {
int (*chip_init) /* non-NULL */
(struct acx_softc *);
-#if 0
int (*chip_set_wepkey)
(struct acx_softc *,
- struct ieee80211_key *, int);
-#endif
+ struct ieee80211_wepkey *, int);
int (*chip_read_config)
(struct acx_softc *, struct acx_config *);