Search Linux Wireless

[patch 7/9] b43: Fix frame retry count for suppressed frames

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



(u8)0 - 1 == 255
which is wrong. Should be 0.

Signed-off-by: Michael Buesch <mb@xxxxxxxxx>

Index: wireless-dev-new/drivers/net/wireless/b43/dma.c
===================================================================
--- wireless-dev-new.orig/drivers/net/wireless/b43/dma.c	2007-08-12 16:38:51.000000000 +0200
+++ wireless-dev-new/drivers/net/wireless/b43/dma.c	2007-08-13 16:01:07.000000000 +0200
@@ -1276,12 +1276,15 @@ void b43_dma_handle_txstatus(struct b43_
 			if (status->acked) {
 				meta->txstat.flags |= IEEE80211_TX_STATUS_ACK;
 			} else {
-				if (!
-				    (meta->txstat.control.
-				     flags & IEEE80211_TXCTL_NO_ACK))
+				if (!(meta->txstat.control.flags
+				      & IEEE80211_TXCTL_NO_ACK))
 					meta->txstat.excessive_retries = 1;
 			}
-			meta->txstat.retry_count = status->frame_count - 1;
+			if (status->frame_count == 0) {
+				/* The frame was not transmitted at all. */
+				meta->txstat.retry_count = 0;
+			} else
+				meta->txstat.retry_count = status->frame_count - 1;
 			ieee80211_tx_status_irqsafe(dev->wl->hw, meta->skb,
 						    &(meta->txstat));
 			/* skb is freed by ieee80211_tx_status_irqsafe() */
Index: wireless-dev-new/drivers/net/wireless/b43/pio.c
===================================================================
--- wireless-dev-new.orig/drivers/net/wireless/b43/pio.c	2007-08-12 16:38:52.000000000 +0200
+++ wireless-dev-new/drivers/net/wireless/b43/pio.c	2007-08-13 16:02:24.000000000 +0200
@@ -469,7 +469,11 @@ void b43_pio_handle_txstatus(struct b43_
 		if (!(packet->txstat.control.flags & IEEE80211_TXCTL_NO_ACK))
 			packet->txstat.excessive_retries = 1;
 	}
-	packet->txstat.retry_count = status->frame_count - 1;
+	if (status->frame_count == 0) {
+		/* The frame was not transmitted at all. */
+		packet->txstat.retry_count = 0;
+	} else
+		packet->txstat.retry_count = status->frame_count - 1;
 	ieee80211_tx_status_irqsafe(dev->wl->hw, packet->skb,
 				    &(packet->txstat));
 	packet->skb = NULL;

-- 

-
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux