bcm43xx PIO mode
Subsystems (3)
PATCH 1/1 bcm43xx PIO mode
Hi,
Here is a patch to get PIO mode working in the bcm43xx driver for cards that support it. Supporting cards are all the "older" ones like 4306 (Apple Airport Extreme).
Please test this patch on a little endian machine, such as i386. This patch works on PPC, but I am not 100% sure, if I got the endianess right. So please someone test it for me.
I would like to get this into mainline kernel before 2.6.17 (if it works correctly on LE), because this could be used as a tempoary solution for people with the >1G problem.
drivers/net/wireless/bcm43xx/bcm43xx_dma.h +8 -0
@@ -213,6 +213,14 @@void bcm43xx_dma_rx (struct bcm43xx_dmaring *ring) { } +static inline +void bcm43xx_dma_tx_suspend (struct bcm43xx_dmaring *ring) +{ +} +static inline +void bcm43xx_dma_tx_resume (struct bcm43xx_dmaring *ring) +{ +}#endif /* CONFIG_BCM43XX_DMA */ #endif /* BCM43xx_DMA_H_ */
drivers/net/wireless/bcm43xx/bcm43xx_pio.c +53 -29
200 lines not on this page · raw message
drivers/net/wireless/bcm43xx/bcm43xx_pio.h +14 -2
@@ -14,8 +14,8 @@#define BCM43xx_PIO_RXCTL 0x08#define BCM43xx_PIO_RXDATA 0x0A -#define BCM43xx_PIO_TXCTL_WRITEHI (1 << 0) -#define BCM43xx_PIO_TXCTL_WRITELO (1 << 1) +#define BCM43xx_PIO_TXCTL_WRITELO (1 << 0) +#define BCM43xx_PIO_TXCTL_WRITEHI (1 << 1)#define BCM43xx_PIO_TXCTL_COMPLETE (1 << 2)#define BCM43xx_PIO_TXCTL_INIT (1 << 3)#define BCM43xx_PIO_TXCTL_SUSPEND (1 << 7)
@@ -95,6 +95,7 @@ u16 offset, u16 value) {bcm43xx_write16 (queue->bcm, queue->mmio_base + offset, value); +mmiowb (); }
@@ -107,6 +108,9 @@ struct bcm43xx_xmitstatus *status);void bcm43xx_pio_rx (struct bcm43xx_pioqueue *queue); +void bcm43xx_pio_tx_suspend (struct bcm43xx_pioqueue *queue); +void bcm43xx_pio_tx_resume (struct bcm43xx_pioqueue *queue); +#else /* CONFIG_BCM43XX_PIO */ static inline
@@ -133,6 +137,14 @@void bcm43xx_pio_rx (struct bcm43xx_pioqueue *queue) { } +static inline +void bcm43xx_pio_tx_suspend (struct bcm43xx_pioqueue *queue) +{ +} +static inline +void bcm43xx_pio_tx_resume (struct bcm43xx_pioqueue *queue) +{ +}#endif /* CONFIG_BCM43XX_PIO */ #endif /* BCM43xx_PIO_H_ */
Signature · 1 line
Greetings Michael.
drivers/net/wireless/bcm43xx/bcm43xx_dma.h +8 -0
@@ -213,6 +213,14 @@void bcm43xx_dma_rx (struct bcm43xx_dmaring *ring) { } +static inline +void bcm43xx_dma_tx_suspend (struct bcm43xx_dmaring *ring) +{ +} +static inline +void bcm43xx_dma_tx_resume (struct bcm43xx_dmaring *ring) +{ +}#endif /* CONFIG_BCM43XX_DMA */ #endif /* BCM43xx_DMA_H_ */
drivers/net/wireless/bcm43xx/bcm43xx_pio.c +53 -29
200 lines not on this page · raw message
drivers/net/wireless/bcm43xx/bcm43xx_pio.h +14 -2
@@ -14,8 +14,8 @@#define BCM43xx_PIO_RXCTL 0x08#define BCM43xx_PIO_RXDATA 0x0A -#define BCM43xx_PIO_TXCTL_WRITEHI (1 << 0) -#define BCM43xx_PIO_TXCTL_WRITELO (1 << 1) +#define BCM43xx_PIO_TXCTL_WRITELO (1 << 0) +#define BCM43xx_PIO_TXCTL_WRITEHI (1 << 1)#define BCM43xx_PIO_TXCTL_COMPLETE (1 << 2)#define BCM43xx_PIO_TXCTL_INIT (1 << 3)#define BCM43xx_PIO_TXCTL_SUSPEND (1 << 7)
@@ -95,6 +95,7 @@ u16 offset, u16 value) {bcm43xx_write16 (queue->bcm, queue->mmio_base + offset, value); +mmiowb (); }
@@ -107,6 +108,9 @@ struct bcm43xx_xmitstatus *status);void bcm43xx_pio_rx (struct bcm43xx_pioqueue *queue); +void bcm43xx_pio_tx_suspend (struct bcm43xx_pioqueue *queue); +void bcm43xx_pio_tx_resume (struct bcm43xx_pioqueue *queue); +#else /* CONFIG_BCM43XX_PIO */ static inline
@@ -133,6 +137,14 @@void bcm43xx_pio_rx (struct bcm43xx_pioqueue *queue) { } +static inline +void bcm43xx_pio_tx_suspend (struct bcm43xx_pioqueue *queue) +{ +} +static inline +void bcm43xx_pio_tx_resume (struct bcm43xx_pioqueue *queue) +{ +}#endif /* CONFIG_BCM43XX_PIO */ #endif /* BCM43xx_PIO_H_ */
drivers/net/wireless/bcm43xx/bcm43xx_pio.c line 269
Quoted 5 lines · you
drivers/net/wireless/bcm43xx/bcm43xx_pio.c +4
-0bcm43xx_lock_mmio (bcm, flags); + + txctl =bcm43xx_pio_read (queue, BCM43xx_PIO_TXCTL); +if (txctl & BCM43xx_PIO_TXCTL_SUSPEND) +return ;
Ah, and yes, I see the bug here. :)
But that normally does not trigger anyway. So no problem for testing.
And I forgot to say that PIO mode is enabled by module parameter pio=1
Signature · 1 line
Greetings Michael.