Skip to content

Commit 0900951

Browse files
lyakhlinvjw
authored andcommitted
b43: fix regression in PIO case
This patch fixes the regression, introduced by commit 17030f4 From: Rafał Miłecki <[email protected]> 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 <[email protected]> Signed-off-by: John W. Linville <[email protected]>
1 parent b25bfda commit 0900951

File tree

1 file changed

+13
-3
lines changed
  • drivers/net/wireless/b43

1 file changed

+13
-3
lines changed

drivers/net/wireless/b43/pio.c

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -617,9 +617,19 @@ static bool pio_rx_frame(struct b43_pio_rxqueue *q)
617617
const char *err_msg = NULL;
618618
struct b43_rxhdr_fw4 *rxhdr =
619619
(struct b43_rxhdr_fw4 *)wl->pio_scratchspace;
620+
size_t rxhdr_size = sizeof(*rxhdr);
620621

621622
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);
623633

624634
/* Check if we have data and wait for it to get ready. */
625635
if (q->rev >= 8) {
@@ -657,11 +667,11 @@ static bool pio_rx_frame(struct b43_pio_rxqueue *q)
657667

658668
/* Get the preamble (RX header) */
659669
if (q->rev >= 8) {
660-
b43_block_read(dev, rxhdr, sizeof(*rxhdr),
670+
b43_block_read(dev, rxhdr, rxhdr_size,
661671
q->mmio_base + B43_PIO8_RXDATA,
662672
sizeof(u32));
663673
} else {
664-
b43_block_read(dev, rxhdr, sizeof(*rxhdr),
674+
b43_block_read(dev, rxhdr, rxhdr_size,
665675
q->mmio_base + B43_PIO_RXDATA,
666676
sizeof(u16));
667677
}

0 commit comments

Comments
 (0)