aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/b43/b43.h
diff options
context:
space:
mode:
authorMichael Buesch <mb@bu3sch.de>2008-03-29 16:01:16 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-04-08 15:05:56 -0400
commit5100d5ac81b9330dc57e35adbe50923ba6107b8f (patch)
tree48224236b50703606c97c05ec077fde4880fc3b9 /drivers/net/wireless/b43/b43.h
parent3109ece1114293b8201d9c140d02d7ce9a9fa387 (diff)
b43: Add PIO support for PCMCIA devices
This adds PIO support back (D'oh!) for PCMCIA devices. This is a complete rewrite of the old PIO code. It does actually work and we get reasonable performance out of it on a modern machine. On a PowerBook G4 I get a few MBit for TX and a few more for RX. So it doesn't work as well as DMA (of course), but it's a _lot_ faster than the old PIO code (only got a few kBit with that). The limiting factor is the host CPU speed. So it will generate 100% CPU usage when the network interface is heavily loaded. A voluntary preemption point in the RX path makes sure Desktop Latency isn't hurt. PIO is needed for 16bit PCMCIA devices, as we really don't want to poke with the braindead DMA mechanisms on PCMCIA sockets. Additionally, not all PCMCIA sockets do actually support DMA in 16bit mode (mine doesn't). Signed-off-by: Michael Buesch <mb@bu3sch.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/b43/b43.h')
-rw-r--r--drivers/net/wireless/b43/b43.h59
1 files changed, 56 insertions, 3 deletions
diff --git a/drivers/net/wireless/b43/b43.h b/drivers/net/wireless/b43/b43.h
index d40be1568517..ef8ae385835a 100644
--- a/drivers/net/wireless/b43/b43.h
+++ b/drivers/net/wireless/b43/b43.h
@@ -75,6 +75,23 @@
75#define B43_MMIO_DMA64_BASE4 0x300 75#define B43_MMIO_DMA64_BASE4 0x300
76#define B43_MMIO_DMA64_BASE5 0x340 76#define B43_MMIO_DMA64_BASE5 0x340
77 77
78/* PIO on core rev < 11 */
79#define B43_MMIO_PIO_BASE0 0x300
80#define B43_MMIO_PIO_BASE1 0x310
81#define B43_MMIO_PIO_BASE2 0x320
82#define B43_MMIO_PIO_BASE3 0x330
83#define B43_MMIO_PIO_BASE4 0x340
84#define B43_MMIO_PIO_BASE5 0x350
85#define B43_MMIO_PIO_BASE6 0x360
86#define B43_MMIO_PIO_BASE7 0x370
87/* PIO on core rev >= 11 */
88#define B43_MMIO_PIO11_BASE0 0x200
89#define B43_MMIO_PIO11_BASE1 0x240
90#define B43_MMIO_PIO11_BASE2 0x280
91#define B43_MMIO_PIO11_BASE3 0x2C0
92#define B43_MMIO_PIO11_BASE4 0x300
93#define B43_MMIO_PIO11_BASE5 0x340
94
78#define B43_MMIO_PHY_VER 0x3E0 95#define B43_MMIO_PHY_VER 0x3E0
79#define B43_MMIO_PHY_RADIO 0x3E2 96#define B43_MMIO_PHY_RADIO 0x3E2
80#define B43_MMIO_PHY0 0x3E6 97#define B43_MMIO_PHY0 0x3E6
@@ -442,7 +459,6 @@ enum {
442}; 459};
443 460
444struct b43_dmaring; 461struct b43_dmaring;
445struct b43_pioqueue;
446 462
447/* The firmware file header */ 463/* The firmware file header */
448#define B43_FW_TYPE_UCODE 'u' 464#define B43_FW_TYPE_UCODE 'u'
@@ -598,6 +614,20 @@ struct b43_dma {
598 struct b43_dmaring *rx_ring; 614 struct b43_dmaring *rx_ring;
599}; 615};
600 616
617struct b43_pio_txqueue;
618struct b43_pio_rxqueue;
619
620/* Data structures for PIO transmission, per 80211 core. */
621struct b43_pio {
622 struct b43_pio_txqueue *tx_queue_AC_BK; /* Background */
623 struct b43_pio_txqueue *tx_queue_AC_BE; /* Best Effort */
624 struct b43_pio_txqueue *tx_queue_AC_VI; /* Video */
625 struct b43_pio_txqueue *tx_queue_AC_VO; /* Voice */
626 struct b43_pio_txqueue *tx_queue_mcast; /* Multicast */
627
628 struct b43_pio_rxqueue *rx_queue;
629};
630
601/* Context information for a noise calculation (Link Quality). */ 631/* Context information for a noise calculation (Link Quality). */
602struct b43_noise_calculation { 632struct b43_noise_calculation {
603 u8 channel_at_start; 633 u8 channel_at_start;
@@ -773,8 +803,15 @@ struct b43_wldev {
773 /* PHY/Radio device. */ 803 /* PHY/Radio device. */
774 struct b43_phy phy; 804 struct b43_phy phy;
775 805
776 /* DMA engines. */ 806 union {
777 struct b43_dma dma; 807 /* DMA engines. */
808 struct b43_dma dma;
809 /* PIO engines. */
810 struct b43_pio pio;
811 };
812 /* Use b43_using_pio_transfers() to check whether we are using
813 * DMA or PIO data transfers. */
814 bool __using_pio_transfers;
778 815
779 /* Various statistics about the physical device. */ 816 /* Various statistics about the physical device. */
780 struct b43_stats stats; 817 struct b43_stats stats;
@@ -858,6 +895,22 @@ static inline void b43_write32(struct b43_wldev *dev, u16 offset, u32 value)
858 ssb_write32(dev->dev, offset, value); 895 ssb_write32(dev->dev, offset, value);
859} 896}
860 897
898static inline bool b43_using_pio_transfers(struct b43_wldev *dev)
899{
900#ifdef CONFIG_B43_PIO
901 return dev->__using_pio_transfers;
902#else
903 return 0;
904#endif
905}
906
907#ifdef CONFIG_B43_FORCE_PIO
908# define B43_FORCE_PIO 1
909#else
910# define B43_FORCE_PIO 0
911#endif
912
913
861/* Message printing */ 914/* Message printing */
862void b43info(struct b43_wl *wl, const char *fmt, ...) 915void b43info(struct b43_wl *wl, const char *fmt, ...)
863 __attribute__ ((format(printf, 2, 3))); 916 __attribute__ ((format(printf, 2, 3)));