summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorStefan Sperling <stsp@cvs.openbsd.org>2011-10-14 17:08:11 +0000
committerStefan Sperling <stsp@cvs.openbsd.org>2011-10-14 17:08:11 +0000
commit2f19a725fa3cf8bfa5b993c93bd72116c7ca0180 (patch)
treef5d451a4bf8bd87b2ed6e7df76dcc630e30ed146 /sys
parente0ceabf7b12be93407135f1967c540b592d8e3d0 (diff)
Make ath(4) send multicast frames once, not multiple times.
Fixes TKIP replays seen by STAs connecting to an ath(4) hostap and matches the FreeBSD driver. Tested with several cards by Theo and myself. Thanks mikeb for providing some cards, your next beer in Berlin is on me. ok deraadt
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ic/ar5212.c5
-rw-r--r--sys/dev/ic/ar5xxx.h3
-rw-r--r--sys/dev/ic/ath.c7
3 files changed, 7 insertions, 8 deletions
diff --git a/sys/dev/ic/ar5212.c b/sys/dev/ic/ar5212.c
index 6ede05807c9..514ac1de60b 100644
--- a/sys/dev/ic/ar5212.c
+++ b/sys/dev/ic/ar5212.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ar5212.c,v 1.51 2009/06/02 12:39:02 reyk Exp $ */
+/* $OpenBSD: ar5212.c,v 1.52 2011/10/14 17:08:09 stsp Exp $ */
/*
* Copyright (c) 2004, 2005, 2006, 2007 Reyk Floeter <reyk@openbsd.org>
@@ -1353,8 +1353,7 @@ ar5k_ar5212_setup_tx_desc(struct ath_hal *hal, struct ath_desc *desc,
tx_desc->tx_control_1 =
AR5K_REG_SM(type, AR5K_AR5212_DESC_TX_CTL1_FRAME_TYPE);
tx_desc->tx_control_2 =
- AR5K_REG_SM(tx_tries0 + AR5K_TUNE_HWTXTRIES,
- AR5K_AR5212_DESC_TX_CTL2_XMIT_TRIES0);
+ AR5K_REG_SM(tx_tries0, AR5K_AR5212_DESC_TX_CTL2_XMIT_TRIES0);
tx_desc->tx_control_3 =
tx_rate0 & AR5K_AR5212_DESC_TX_CTL3_XMIT_RATE0;
diff --git a/sys/dev/ic/ar5xxx.h b/sys/dev/ic/ar5xxx.h
index c72772de1d3..cb49ca7003f 100644
--- a/sys/dev/ic/ar5xxx.h
+++ b/sys/dev/ic/ar5xxx.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ar5xxx.h,v 1.48 2010/04/20 22:05:41 tedu Exp $ */
+/* $OpenBSD: ar5xxx.h,v 1.49 2011/10/14 17:08:09 stsp Exp $ */
/*
* Copyright (c) 2004, 2005, 2006, 2007 Reyk Floeter <reyk@openbsd.org>
@@ -1328,7 +1328,6 @@ typedef HAL_BOOL (ar5k_rfgain_t)
#define AR5K_TUNE_DEFAULT_TXPOWER 30
#define AR5K_TUNE_TPC_TXPOWER AH_TRUE
#define AR5K_TUNE_ANT_DIVERSITY AH_TRUE
-#define AR5K_TUNE_HWTXTRIES 4
/* Default regulation domain if stored value EEPROM value is invalid */
#define AR5K_TUNE_REGDOMAIN DMN_FCC2_FCCA /* Canada */
diff --git a/sys/dev/ic/ath.c b/sys/dev/ic/ath.c
index 7e716c45c14..d974679e18d 100644
--- a/sys/dev/ic/ath.c
+++ b/sys/dev/ic/ath.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ath.c,v 1.92 2011/04/17 20:38:10 stsp Exp $ */
+/* $OpenBSD: ath.c,v 1.93 2011/10/14 17:08:10 stsp Exp $ */
/* $NetBSD: ath.c,v 1.37 2004/08/18 21:59:39 dyoung Exp $ */
/*-
@@ -2068,7 +2068,7 @@ ath_tx_start(struct ath_softc *sc, struct ieee80211_node *ni,
struct ieee80211com *ic = &sc->sc_ic;
struct ath_hal *ah = sc->sc_ah;
struct ifnet *ifp = &sc->sc_ic.ic_if;
- int i, error, iswep, hdrlen, pktlen, len, s;
+ int i, error, iswep, hdrlen, pktlen, len, s, tries;
u_int8_t rix, cix, txrate, ctsrate;
struct ath_desc *ds;
struct ieee80211_frame *wh;
@@ -2376,13 +2376,14 @@ ath_tx_start(struct ath_softc *sc, struct ieee80211_node *ni,
/*
* Formulate first tx descriptor with tx controls.
*/
+ tries = IEEE80211_IS_MULTICAST(wh->i_addr1) ? 1 : 15;
/* XXX check return value? */
ath_hal_setup_tx_desc(ah, ds
, pktlen /* packet length */
, hdrlen /* header length */
, atype /* Atheros packet type */
, 60 /* txpower XXX */
- , txrate, 1+10 /* series 0 rate/tries */
+ , txrate, tries /* series 0 rate/tries */
, iswep ? sc->sc_ic.ic_wep_txkey : HAL_TXKEYIX_INVALID
, antenna /* antenna mode */
, flags /* flags */