diff options
author | Guennadi Liakhovetski <g.liakhovetski@gmx.de> | 2011-12-26 12:28:08 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-01-03 14:40:45 -0500 |
commit | 09009512e5e7ab341b1554a256f81dd512c1f4bf (patch) | |
tree | 58d8b7a6ab90137138dc4d22ec4b4d85be708b2c | |
parent | b25bfda38236f349cde0d1b28952f4eea2148d3f (diff) |
b43: fix regression in PIO case
This patch fixes the regression, introduced by
commit 17030f48e31adde5b043741c91ba143f5f7db0fd
From: Rafał Miłecki <zajec5@gmail.com>
Date: Thu, 11 Aug 2011 17:16:27 +0200
Subject: [PATCH] b43: support new RX header, noticed to be used in 598.314+ fw
in PIO case.
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/b43/pio.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/net/wireless/b43/pio.c b/drivers/net/wireless/b43/pio.c index fcff923b3c18..279a53eae4c5 100644 --- a/drivers/net/wireless/b43/pio.c +++ b/drivers/net/wireless/b43/pio.c | |||
@@ -617,9 +617,19 @@ static bool pio_rx_frame(struct b43_pio_rxqueue *q) | |||
617 | const char *err_msg = NULL; | 617 | const char *err_msg = NULL; |
618 | struct b43_rxhdr_fw4 *rxhdr = | 618 | struct b43_rxhdr_fw4 *rxhdr = |
619 | (struct b43_rxhdr_fw4 *)wl->pio_scratchspace; | 619 | (struct b43_rxhdr_fw4 *)wl->pio_scratchspace; |
620 | size_t rxhdr_size = sizeof(*rxhdr); | ||
620 | 621 | ||
621 | BUILD_BUG_ON(sizeof(wl->pio_scratchspace) < sizeof(*rxhdr)); | 622 | BUILD_BUG_ON(sizeof(wl->pio_scratchspace) < sizeof(*rxhdr)); |
622 | memset(rxhdr, 0, sizeof(*rxhdr)); | 623 | switch (dev->fw.hdr_format) { |
624 | case B43_FW_HDR_410: | ||
625 | case B43_FW_HDR_351: | ||
626 | rxhdr_size -= sizeof(rxhdr->format_598) - | ||
627 | sizeof(rxhdr->format_351); | ||
628 | break; | ||
629 | case B43_FW_HDR_598: | ||
630 | break; | ||
631 | } | ||
632 | memset(rxhdr, 0, rxhdr_size); | ||
623 | 633 | ||
624 | /* Check if we have data and wait for it to get ready. */ | 634 | /* Check if we have data and wait for it to get ready. */ |
625 | if (q->rev >= 8) { | 635 | if (q->rev >= 8) { |
@@ -657,11 +667,11 @@ data_ready: | |||
657 | 667 | ||
658 | /* Get the preamble (RX header) */ | 668 | /* Get the preamble (RX header) */ |
659 | if (q->rev >= 8) { | 669 | if (q->rev >= 8) { |
660 | b43_block_read(dev, rxhdr, sizeof(*rxhdr), | 670 | b43_block_read(dev, rxhdr, rxhdr_size, |
661 | q->mmio_base + B43_PIO8_RXDATA, | 671 | q->mmio_base + B43_PIO8_RXDATA, |
662 | sizeof(u32)); | 672 | sizeof(u32)); |
663 | } else { | 673 | } else { |
664 | b43_block_read(dev, rxhdr, sizeof(*rxhdr), | 674 | b43_block_read(dev, rxhdr, rxhdr_size, |
665 | q->mmio_base + B43_PIO_RXDATA, | 675 | q->mmio_base + B43_PIO_RXDATA, |
666 | sizeof(u16)); | 676 | sizeof(u16)); |
667 | } | 677 | } |