diff options
| author | gdt <gdt@NetBSD.org> | 2005-10-14 00:26:45 +0000 |
|---|---|---|
| committer | gdt <gdt@NetBSD.org> | 2005-10-14 00:26:45 +0000 |
| commit | d3aeb92bcb5fb6b8fd86d01a0d115d64febffc0a (patch) | |
| tree | 441d8eee063fcb999a76ad3324735f0e53016af9 /sys/dev | |
| parent | c356c208596514055622906af38eb33696bb6aaf (diff) | |
When bringing an interface up, and thus perhaps having just powered it
on (e.g. cardbus), write the wep keys to the card. Fixes problem of
receiving gibberish if one has set wep keys before bringing the
interface up, and also after ifconfig ath0 down; ifconfig ath0 up.
(Tested with current from 20050926 with local mods, and discussed with
sam@ and dyoung@. This is not 100% right, but significantly better
than before. Really we should have an interator in net80211 to repush
all key state, include per-node keys.)
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/ic/ath.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/sys/dev/ic/ath.c b/sys/dev/ic/ath.c index 4f4e653bf53..20bb21f9544 100644 --- a/sys/dev/ic/ath.c +++ b/sys/dev/ic/ath.c @@ -1,4 +1,4 @@ -/* $NetBSD: ath.c,v 1.59 2005/09/13 05:50:29 martin Exp $ */ +/* $NetBSD: ath.c,v 1.60 2005/10/14 00:26:45 gdt Exp $ */ /*- * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting @@ -41,7 +41,7 @@ __FBSDID("$FreeBSD: src/sys/dev/ath/if_ath.c,v 1.94 2005/07/07 00:04:50 sam Exp $"); #endif #ifdef __NetBSD__ -__KERNEL_RCSID(0, "$NetBSD: ath.c,v 1.59 2005/09/13 05:50:29 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ath.c,v 1.60 2005/10/14 00:26:45 gdt Exp $"); #endif /* @@ -1787,6 +1787,7 @@ ath_mode_init(struct ath_softc *sc) struct ieee80211com *ic = &sc->sc_ic; struct ath_hal *ah = sc->sc_ah; u_int32_t rfilt, mfilt[2]; + int i; /* configure rx filter */ rfilt = ath_calcrxfilter(sc, ic->ic_state); @@ -1795,6 +1796,15 @@ ath_mode_init(struct ath_softc *sc) /* configure operational mode */ ath_hal_setopmode(ah); + /* Write keys to hardware; it may have been powered down. */ + ath_key_update_begin(ic); + for (i = 0; i < IEEE80211_WEP_NKID; i++) { + ath_key_set(ic, + &ic->ic_crypto.cs_nw_keys[i], + ic->ic_myaddr); + } + ath_key_update_end(ic); + /* * Handle any link-level address change. Note that we only * need to force ic_myaddr; any other addresses are handled |
