summaryrefslogtreecommitdiff
path: root/sys/dev/ic
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2007-10-29 09:39:36 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2007-10-29 09:39:36 +0000
commitafc37bbe5b87760713f1a1e565f8896de20889af (patch)
tree52f450d7c9b390d2f4997499b278e407e46bb854 /sys/dev/ic
parent38536885dd950bd41fe734e28bb74ddd109125c5 (diff)
fix the setup of Tx descriptors. the frame type and "no ack" bits were
initialized in ar5k_ar521*_setup_tx_desc() but cleared in ar5k_ar521*_fill_tx_desc() by setting the segment length incorrectly. From ath5k via Nick Kossifidis (mickflemm at gmail dot com)* ---snip--- The missing no_ack in broadcast frames caused them to be retried up to the retry_limit(1+4=5 transmissions by default). ---snap--- * it was explicitly mentioned that it is ISC-licensed now
Diffstat (limited to 'sys/dev/ic')
-rw-r--r--sys/dev/ic/ar5210.c8
-rw-r--r--sys/dev/ic/ar5211.c8
-rw-r--r--sys/dev/ic/ar5212.c8
3 files changed, 15 insertions, 9 deletions
diff --git a/sys/dev/ic/ar5210.c b/sys/dev/ic/ar5210.c
index 6840669a704..e38913e547e 100644
--- a/sys/dev/ic/ar5210.c
+++ b/sys/dev/ic/ar5210.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ar5210.c,v 1.39 2007/04/10 17:47:55 miod Exp $ */
+/* $OpenBSD: ar5210.c,v 1.40 2007/10/29 09:39:35 reyk Exp $ */
/*
* Copyright (c) 2004, 2005, 2006, 2007 Reyk Floeter <reyk@openbsd.org>
@@ -1080,9 +1080,11 @@ ar5k_ar5210_fill_tx_desc(struct ath_hal *hal, struct ath_desc *desc,
bzero(desc->ds_hw, sizeof(desc->ds_hw));
/* Validate segment length and initialize the descriptor */
- if ((tx_desc->tx_control_1 = (segment_length &
- AR5K_AR5210_DESC_TX_CTL1_BUF_LEN)) != segment_length)
+ if (segment_length & ~AR5K_AR5210_DESC_TX_CTL1_BUF_LEN)
return (AH_FALSE);
+ tx_desc->tx_control_1 =
+ (tx_desc->tx_control_1 & ~AR5K_AR5210_DESC_TX_CTL1_BUF_LEN) |
+ segment_length;
if (first_segment != AH_TRUE)
tx_desc->tx_control_0 &= ~AR5K_AR5210_DESC_TX_CTL0_FRAME_LEN;
diff --git a/sys/dev/ic/ar5211.c b/sys/dev/ic/ar5211.c
index 9ea1e4ccb09..d9b2d5d7137 100644
--- a/sys/dev/ic/ar5211.c
+++ b/sys/dev/ic/ar5211.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ar5211.c,v 1.34 2007/04/10 17:47:55 miod Exp $ */
+/* $OpenBSD: ar5211.c,v 1.35 2007/10/29 09:39:35 reyk Exp $ */
/*
* Copyright (c) 2004, 2005, 2006, 2007 Reyk Floeter <reyk@openbsd.org>
@@ -1192,9 +1192,11 @@ ar5k_ar5211_fill_tx_desc(struct ath_hal *hal, struct ath_desc *desc,
bzero(desc->ds_hw, sizeof(desc->ds_hw));
/* Validate segment length and initialize the descriptor */
- if ((tx_desc->tx_control_1 = (segment_length &
- AR5K_AR5211_DESC_TX_CTL1_BUF_LEN)) != segment_length)
+ if (segment_length & ~AR5K_AR5211_DESC_TX_CTL1_BUF_LEN)
return (AH_FALSE);
+ tx_desc->tx_control_1 =
+ (tx_desc->tx_control_1 & ~AR5K_AR5211_DESC_TX_CTL1_BUF_LEN) |
+ segment_length;
if (first_segment != AH_TRUE)
tx_desc->tx_control_0 &= ~AR5K_AR5211_DESC_TX_CTL0_FRAME_LEN;
diff --git a/sys/dev/ic/ar5212.c b/sys/dev/ic/ar5212.c
index 11988d7d3fd..95f28a36b2f 100644
--- a/sys/dev/ic/ar5212.c
+++ b/sys/dev/ic/ar5212.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ar5212.c,v 1.40 2007/04/10 17:47:55 miod Exp $ */
+/* $OpenBSD: ar5212.c,v 1.41 2007/10/29 09:39:35 reyk Exp $ */
/*
* Copyright (c) 2004, 2005, 2006, 2007 Reyk Floeter <reyk@openbsd.org>
@@ -1373,9 +1373,11 @@ ar5k_ar5212_fill_tx_desc(struct ath_hal *hal, struct ath_desc *desc,
bzero(tx_status, sizeof(struct ar5k_ar5212_tx_status));
/* Validate segment length and initialize the descriptor */
- if ((tx_desc->tx_control_1 = (segment_length &
- AR5K_AR5212_DESC_TX_CTL1_BUF_LEN)) != segment_length)
+ if (segment_length & ~AR5K_AR5212_DESC_TX_CTL1_BUF_LEN)
return (AH_FALSE);
+ tx_desc->tx_control_1 =
+ (tx_desc->tx_control_1 & ~AR5K_AR5212_DESC_TX_CTL1_BUF_LEN) |
+ segment_length;
if (first_segment != AH_TRUE)
tx_desc->tx_control_0 &= ~AR5K_AR5212_DESC_TX_CTL0_FRAME_LEN;