diff options
Diffstat (limited to 'drivers/net/wireless/b43/b43.h')
-rw-r--r-- | drivers/net/wireless/b43/b43.h | 195 |
1 files changed, 144 insertions, 51 deletions
diff --git a/drivers/net/wireless/b43/b43.h b/drivers/net/wireless/b43/b43.h index f13346ba9dd2..eff2a158a411 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 |
@@ -94,11 +111,14 @@ | |||
94 | #define B43_MMIO_GPIO_MASK 0x49E | 111 | #define B43_MMIO_GPIO_MASK 0x49E |
95 | #define B43_MMIO_TSF_CFP_START_LOW 0x604 | 112 | #define B43_MMIO_TSF_CFP_START_LOW 0x604 |
96 | #define B43_MMIO_TSF_CFP_START_HIGH 0x606 | 113 | #define B43_MMIO_TSF_CFP_START_HIGH 0x606 |
114 | #define B43_MMIO_TSF_CFP_PRETBTT 0x612 | ||
97 | #define B43_MMIO_TSF_0 0x632 /* core rev < 3 only */ | 115 | #define B43_MMIO_TSF_0 0x632 /* core rev < 3 only */ |
98 | #define B43_MMIO_TSF_1 0x634 /* core rev < 3 only */ | 116 | #define B43_MMIO_TSF_1 0x634 /* core rev < 3 only */ |
99 | #define B43_MMIO_TSF_2 0x636 /* core rev < 3 only */ | 117 | #define B43_MMIO_TSF_2 0x636 /* core rev < 3 only */ |
100 | #define B43_MMIO_TSF_3 0x638 /* core rev < 3 only */ | 118 | #define B43_MMIO_TSF_3 0x638 /* core rev < 3 only */ |
101 | #define B43_MMIO_RNG 0x65A | 119 | #define B43_MMIO_RNG 0x65A |
120 | #define B43_MMIO_IFSCTL 0x688 /* Interframe space control */ | ||
121 | #define B43_MMIO_IFSCTL_USE_EDCF 0x0004 | ||
102 | #define B43_MMIO_POWERUP_DELAY 0x6A8 | 122 | #define B43_MMIO_POWERUP_DELAY 0x6A8 |
103 | 123 | ||
104 | /* SPROM boardflags_lo values */ | 124 | /* SPROM boardflags_lo values */ |
@@ -144,7 +164,8 @@ enum { | |||
144 | #define B43_SHM_SH_PHYTYPE 0x0052 /* PHY type */ | 164 | #define B43_SHM_SH_PHYTYPE 0x0052 /* PHY type */ |
145 | #define B43_SHM_SH_ANTSWAP 0x005C /* Antenna swap threshold */ | 165 | #define B43_SHM_SH_ANTSWAP 0x005C /* Antenna swap threshold */ |
146 | #define B43_SHM_SH_HOSTFLO 0x005E /* Hostflags for ucode options (low) */ | 166 | #define B43_SHM_SH_HOSTFLO 0x005E /* Hostflags for ucode options (low) */ |
147 | #define B43_SHM_SH_HOSTFHI 0x0060 /* Hostflags for ucode options (high) */ | 167 | #define B43_SHM_SH_HOSTFMI 0x0060 /* Hostflags for ucode options (middle) */ |
168 | #define B43_SHM_SH_HOSTFHI 0x0062 /* Hostflags for ucode options (high) */ | ||
148 | #define B43_SHM_SH_RFATT 0x0064 /* Current radio attenuation value */ | 169 | #define B43_SHM_SH_RFATT 0x0064 /* Current radio attenuation value */ |
149 | #define B43_SHM_SH_RADAR 0x0066 /* Radar register */ | 170 | #define B43_SHM_SH_RADAR 0x0066 /* Radar register */ |
150 | #define B43_SHM_SH_PHYTXNOI 0x006E /* PHY noise directly after TX (lower 8bit only) */ | 171 | #define B43_SHM_SH_PHYTXNOI 0x006E /* PHY noise directly after TX (lower 8bit only) */ |
@@ -232,31 +253,41 @@ enum { | |||
232 | #define B43_MMIO_RADIO_HWENABLED_LO_MASK (1 << 4) | 253 | #define B43_MMIO_RADIO_HWENABLED_LO_MASK (1 << 4) |
233 | 254 | ||
234 | /* HostFlags. See b43_hf_read/write() */ | 255 | /* HostFlags. See b43_hf_read/write() */ |
235 | #define B43_HF_ANTDIVHELP 0x00000001 /* ucode antenna div helper */ | 256 | #define B43_HF_ANTDIVHELP 0x000000000001ULL /* ucode antenna div helper */ |
236 | #define B43_HF_SYMW 0x00000002 /* G-PHY SYM workaround */ | 257 | #define B43_HF_SYMW 0x000000000002ULL /* G-PHY SYM workaround */ |
237 | #define B43_HF_RXPULLW 0x00000004 /* RX pullup workaround */ | 258 | #define B43_HF_RXPULLW 0x000000000004ULL /* RX pullup workaround */ |
238 | #define B43_HF_CCKBOOST 0x00000008 /* 4dB CCK power boost (exclusive with OFDM boost) */ | 259 | #define B43_HF_CCKBOOST 0x000000000008ULL /* 4dB CCK power boost (exclusive with OFDM boost) */ |
239 | #define B43_HF_BTCOEX 0x00000010 /* Bluetooth coexistance */ | 260 | #define B43_HF_BTCOEX 0x000000000010ULL /* Bluetooth coexistance */ |
240 | #define B43_HF_GDCW 0x00000020 /* G-PHY DV canceller filter bw workaround */ | 261 | #define B43_HF_GDCW 0x000000000020ULL /* G-PHY DC canceller filter bw workaround */ |
241 | #define B43_HF_OFDMPABOOST 0x00000040 /* Enable PA gain boost for OFDM */ | 262 | #define B43_HF_OFDMPABOOST 0x000000000040ULL /* Enable PA gain boost for OFDM */ |
242 | #define B43_HF_ACPR 0x00000080 /* Disable for Japan, channel 14 */ | 263 | #define B43_HF_ACPR 0x000000000080ULL /* Disable for Japan, channel 14 */ |
243 | #define B43_HF_EDCF 0x00000100 /* on if WME and MAC suspended */ | 264 | #define B43_HF_EDCF 0x000000000100ULL /* on if WME and MAC suspended */ |
244 | #define B43_HF_TSSIRPSMW 0x00000200 /* TSSI reset PSM ucode workaround */ | 265 | #define B43_HF_TSSIRPSMW 0x000000000200ULL /* TSSI reset PSM ucode workaround */ |
245 | #define B43_HF_DSCRQ 0x00000400 /* Disable slow clock request in ucode */ | 266 | #define B43_HF_20IN40IQW 0x000000000200ULL /* 20 in 40 MHz I/Q workaround (rev >= 13 only) */ |
246 | #define B43_HF_ACIW 0x00000800 /* ACI workaround: shift bits by 2 on PHY CRS */ | 267 | #define B43_HF_DSCRQ 0x000000000400ULL /* Disable slow clock request in ucode */ |
247 | #define B43_HF_2060W 0x00001000 /* 2060 radio workaround */ | 268 | #define B43_HF_ACIW 0x000000000800ULL /* ACI workaround: shift bits by 2 on PHY CRS */ |
248 | #define B43_HF_RADARW 0x00002000 /* Radar workaround */ | 269 | #define B43_HF_2060W 0x000000001000ULL /* 2060 radio workaround */ |
249 | #define B43_HF_USEDEFKEYS 0x00004000 /* Enable use of default keys */ | 270 | #define B43_HF_RADARW 0x000000002000ULL /* Radar workaround */ |
250 | #define B43_HF_BT4PRIOCOEX 0x00010000 /* Bluetooth 2-priority coexistance */ | 271 | #define B43_HF_USEDEFKEYS 0x000000004000ULL /* Enable use of default keys */ |
251 | #define B43_HF_FWKUP 0x00020000 /* Fast wake-up ucode */ | 272 | #define B43_HF_AFTERBURNER 0x000000008000ULL /* Afterburner enabled */ |
252 | #define B43_HF_VCORECALC 0x00040000 /* Force VCO recalculation when powering up synthpu */ | 273 | #define B43_HF_BT4PRIOCOEX 0x000000010000ULL /* Bluetooth 4-priority coexistance */ |
253 | #define B43_HF_PCISCW 0x00080000 /* PCI slow clock workaround */ | 274 | #define B43_HF_FWKUP 0x000000020000ULL /* Fast wake-up ucode */ |
254 | #define B43_HF_4318TSSI 0x00200000 /* 4318 TSSI */ | 275 | #define B43_HF_VCORECALC 0x000000040000ULL /* Force VCO recalculation when powering up synthpu */ |
255 | #define B43_HF_FBCMCFIFO 0x00400000 /* Flush bcast/mcast FIFO immediately */ | 276 | #define B43_HF_PCISCW 0x000000080000ULL /* PCI slow clock workaround */ |
256 | #define B43_HF_HWPCTL 0x00800000 /* Enable hardwarre power control */ | 277 | #define B43_HF_4318TSSI 0x000000200000ULL /* 4318 TSSI */ |
257 | #define B43_HF_BTCOEXALT 0x01000000 /* Bluetooth coexistance in alternate pins */ | 278 | #define B43_HF_FBCMCFIFO 0x000000400000ULL /* Flush bcast/mcast FIFO immediately */ |
258 | #define B43_HF_TXBTCHECK 0x02000000 /* Bluetooth check during transmission */ | 279 | #define B43_HF_HWPCTL 0x000000800000ULL /* Enable hardwarre power control */ |
259 | #define B43_HF_SKCFPUP 0x04000000 /* Skip CFP update */ | 280 | #define B43_HF_BTCOEXALT 0x000001000000ULL /* Bluetooth coexistance in alternate pins */ |
281 | #define B43_HF_TXBTCHECK 0x000002000000ULL /* Bluetooth check during transmission */ | ||
282 | #define B43_HF_SKCFPUP 0x000004000000ULL /* Skip CFP update */ | ||
283 | #define B43_HF_N40W 0x000008000000ULL /* N PHY 40 MHz workaround (rev >= 13 only) */ | ||
284 | #define B43_HF_ANTSEL 0x000020000000ULL /* Antenna selection (for testing antenna div.) */ | ||
285 | #define B43_HF_BT3COEXT 0x000020000000ULL /* Bluetooth 3-wire coexistence (rev >= 13 only) */ | ||
286 | #define B43_HF_BTCANT 0x000040000000ULL /* Bluetooth coexistence (antenna mode) (rev >= 13 only) */ | ||
287 | #define B43_HF_ANTSELEN 0x000100000000ULL /* Antenna selection enabled (rev >= 13 only) */ | ||
288 | #define B43_HF_ANTSELMODE 0x000200000000ULL /* Antenna selection mode (rev >= 13 only) */ | ||
289 | #define B43_HF_MLADVW 0x001000000000ULL /* N PHY ML ADV workaround (rev >= 13 only) */ | ||
290 | #define B43_HF_PR45960W 0x080000000000ULL /* PR 45960 workaround (rev >= 13 only) */ | ||
260 | 291 | ||
261 | /* MacFilter offsets. */ | 292 | /* MacFilter offsets. */ |
262 | #define B43_MACFILTER_SELF 0x0000 | 293 | #define B43_MACFILTER_SELF 0x0000 |
@@ -380,7 +411,6 @@ enum { | |||
380 | 411 | ||
381 | #define B43_IRQ_ALL 0xFFFFFFFF | 412 | #define B43_IRQ_ALL 0xFFFFFFFF |
382 | #define B43_IRQ_MASKTEMPLATE (B43_IRQ_MAC_SUSPENDED | \ | 413 | #define B43_IRQ_MASKTEMPLATE (B43_IRQ_MAC_SUSPENDED | \ |
383 | B43_IRQ_BEACON | \ | ||
384 | B43_IRQ_TBTT_INDI | \ | 414 | B43_IRQ_TBTT_INDI | \ |
385 | B43_IRQ_ATIM_END | \ | 415 | B43_IRQ_ATIM_END | \ |
386 | B43_IRQ_PMQ | \ | 416 | B43_IRQ_PMQ | \ |
@@ -429,7 +459,6 @@ enum { | |||
429 | }; | 459 | }; |
430 | 460 | ||
431 | struct b43_dmaring; | 461 | struct b43_dmaring; |
432 | struct b43_pioqueue; | ||
433 | 462 | ||
434 | /* The firmware file header */ | 463 | /* The firmware file header */ |
435 | #define B43_FW_TYPE_UCODE 'u' | 464 | #define B43_FW_TYPE_UCODE 'u' |
@@ -458,20 +487,13 @@ struct b43_iv { | |||
458 | } __attribute__((__packed__)); | 487 | } __attribute__((__packed__)); |
459 | 488 | ||
460 | 489 | ||
461 | #define B43_PHYMODE(phytype) (1 << (phytype)) | ||
462 | #define B43_PHYMODE_A B43_PHYMODE(B43_PHYTYPE_A) | ||
463 | #define B43_PHYMODE_B B43_PHYMODE(B43_PHYTYPE_B) | ||
464 | #define B43_PHYMODE_G B43_PHYMODE(B43_PHYTYPE_G) | ||
465 | |||
466 | struct b43_phy { | 490 | struct b43_phy { |
467 | /* Possible PHYMODEs on this PHY */ | 491 | /* Band support flags. */ |
468 | u8 possible_phymodes; | 492 | bool supports_2ghz; |
493 | bool supports_5ghz; | ||
494 | |||
469 | /* GMODE bit enabled? */ | 495 | /* GMODE bit enabled? */ |
470 | bool gmode; | 496 | bool gmode; |
471 | /* Possible ieee80211 subsystem hwmodes for this PHY. | ||
472 | * Which mode is selected, depends on thr GMODE enabled bit */ | ||
473 | #define B43_MAX_PHYHWMODES 2 | ||
474 | struct ieee80211_hw_mode hwmodes[B43_MAX_PHYHWMODES]; | ||
475 | 497 | ||
476 | /* Analog Type */ | 498 | /* Analog Type */ |
477 | u8 analog; | 499 | u8 analog; |
@@ -583,15 +605,27 @@ struct b43_phy { | |||
583 | 605 | ||
584 | /* Data structures for DMA transmission, per 80211 core. */ | 606 | /* Data structures for DMA transmission, per 80211 core. */ |
585 | struct b43_dma { | 607 | struct b43_dma { |
586 | struct b43_dmaring *tx_ring0; | 608 | struct b43_dmaring *tx_ring_AC_BK; /* Background */ |
587 | struct b43_dmaring *tx_ring1; | 609 | struct b43_dmaring *tx_ring_AC_BE; /* Best Effort */ |
588 | struct b43_dmaring *tx_ring2; | 610 | struct b43_dmaring *tx_ring_AC_VI; /* Video */ |
589 | struct b43_dmaring *tx_ring3; | 611 | struct b43_dmaring *tx_ring_AC_VO; /* Voice */ |
590 | struct b43_dmaring *tx_ring4; | 612 | struct b43_dmaring *tx_ring_mcast; /* Multicast */ |
591 | struct b43_dmaring *tx_ring5; | 613 | |
592 | 614 | struct b43_dmaring *rx_ring; | |
593 | struct b43_dmaring *rx_ring0; | 615 | }; |
594 | struct b43_dmaring *rx_ring3; /* only available on core.rev < 5 */ | 616 | |
617 | struct b43_pio_txqueue; | ||
618 | struct b43_pio_rxqueue; | ||
619 | |||
620 | /* Data structures for PIO transmission, per 80211 core. */ | ||
621 | struct 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; | ||
595 | }; | 629 | }; |
596 | 630 | ||
597 | /* Context information for a noise calculation (Link Quality). */ | 631 | /* Context information for a noise calculation (Link Quality). */ |
@@ -617,6 +651,35 @@ struct b43_key { | |||
617 | u8 algorithm; | 651 | u8 algorithm; |
618 | }; | 652 | }; |
619 | 653 | ||
654 | /* SHM offsets to the QOS data structures for the 4 different queues. */ | ||
655 | #define B43_QOS_PARAMS(queue) (B43_SHM_SH_EDCFQ + \ | ||
656 | (B43_NR_QOSPARAMS * sizeof(u16) * (queue))) | ||
657 | #define B43_QOS_BACKGROUND B43_QOS_PARAMS(0) | ||
658 | #define B43_QOS_BESTEFFORT B43_QOS_PARAMS(1) | ||
659 | #define B43_QOS_VIDEO B43_QOS_PARAMS(2) | ||
660 | #define B43_QOS_VOICE B43_QOS_PARAMS(3) | ||
661 | |||
662 | /* QOS parameter hardware data structure offsets. */ | ||
663 | #define B43_NR_QOSPARAMS 22 | ||
664 | enum { | ||
665 | B43_QOSPARAM_TXOP = 0, | ||
666 | B43_QOSPARAM_CWMIN, | ||
667 | B43_QOSPARAM_CWMAX, | ||
668 | B43_QOSPARAM_CWCUR, | ||
669 | B43_QOSPARAM_AIFS, | ||
670 | B43_QOSPARAM_BSLOTS, | ||
671 | B43_QOSPARAM_REGGAP, | ||
672 | B43_QOSPARAM_STATUS, | ||
673 | }; | ||
674 | |||
675 | /* QOS parameters for a queue. */ | ||
676 | struct b43_qos_params { | ||
677 | /* The QOS parameters */ | ||
678 | struct ieee80211_tx_queue_params p; | ||
679 | /* Does this need to get uploaded to hardware? */ | ||
680 | bool need_hw_update; | ||
681 | }; | ||
682 | |||
620 | struct b43_wldev; | 683 | struct b43_wldev; |
621 | 684 | ||
622 | /* Data structure for the WLAN parts (802.11 cores) of the b43 chip. */ | 685 | /* Data structure for the WLAN parts (802.11 cores) of the b43 chip. */ |
@@ -667,8 +730,16 @@ struct b43_wl { | |||
667 | /* The beacon we are currently using (AP or IBSS mode). | 730 | /* The beacon we are currently using (AP or IBSS mode). |
668 | * This beacon stuff is protected by the irq_lock. */ | 731 | * This beacon stuff is protected by the irq_lock. */ |
669 | struct sk_buff *current_beacon; | 732 | struct sk_buff *current_beacon; |
733 | struct ieee80211_tx_control beacon_txctl; | ||
670 | bool beacon0_uploaded; | 734 | bool beacon0_uploaded; |
671 | bool beacon1_uploaded; | 735 | bool beacon1_uploaded; |
736 | struct work_struct beacon_update_trigger; | ||
737 | |||
738 | /* The current QOS parameters for the 4 queues. | ||
739 | * This is protected by the irq_lock. */ | ||
740 | struct b43_qos_params qos_params[4]; | ||
741 | /* Workqueue for updating QOS parameters in hardware. */ | ||
742 | struct work_struct qos_update_work; | ||
672 | }; | 743 | }; |
673 | 744 | ||
674 | /* In-memory representation of a cached microcode file. */ | 745 | /* In-memory representation of a cached microcode file. */ |
@@ -727,7 +798,6 @@ struct b43_wldev { | |||
727 | 798 | ||
728 | bool bad_frames_preempt; /* Use "Bad Frames Preemption" (default off) */ | 799 | bool bad_frames_preempt; /* Use "Bad Frames Preemption" (default off) */ |
729 | bool dfq_valid; /* Directed frame queue valid (IBSS PS mode, ATIM) */ | 800 | bool dfq_valid; /* Directed frame queue valid (IBSS PS mode, ATIM) */ |
730 | bool short_preamble; /* TRUE, if short preamble is enabled. */ | ||
731 | bool short_slot; /* TRUE, if short slot timing is enabled. */ | 801 | bool short_slot; /* TRUE, if short slot timing is enabled. */ |
732 | bool radio_hw_enable; /* saved state of radio hardware enabled state */ | 802 | bool radio_hw_enable; /* saved state of radio hardware enabled state */ |
733 | bool suspend_in_progress; /* TRUE, if we are in a suspend/resume cycle */ | 803 | bool suspend_in_progress; /* TRUE, if we are in a suspend/resume cycle */ |
@@ -735,8 +805,15 @@ struct b43_wldev { | |||
735 | /* PHY/Radio device. */ | 805 | /* PHY/Radio device. */ |
736 | struct b43_phy phy; | 806 | struct b43_phy phy; |
737 | 807 | ||
738 | /* DMA engines. */ | 808 | union { |
739 | struct b43_dma dma; | 809 | /* DMA engines. */ |
810 | struct b43_dma dma; | ||
811 | /* PIO engines. */ | ||
812 | struct b43_pio pio; | ||
813 | }; | ||
814 | /* Use b43_using_pio_transfers() to check whether we are using | ||
815 | * DMA or PIO data transfers. */ | ||
816 | bool __using_pio_transfers; | ||
740 | 817 | ||
741 | /* Various statistics about the physical device. */ | 818 | /* Various statistics about the physical device. */ |
742 | struct b43_stats stats; | 819 | struct b43_stats stats; |
@@ -820,6 +897,22 @@ static inline void b43_write32(struct b43_wldev *dev, u16 offset, u32 value) | |||
820 | ssb_write32(dev->dev, offset, value); | 897 | ssb_write32(dev->dev, offset, value); |
821 | } | 898 | } |
822 | 899 | ||
900 | static inline bool b43_using_pio_transfers(struct b43_wldev *dev) | ||
901 | { | ||
902 | #ifdef CONFIG_B43_PIO | ||
903 | return dev->__using_pio_transfers; | ||
904 | #else | ||
905 | return 0; | ||
906 | #endif | ||
907 | } | ||
908 | |||
909 | #ifdef CONFIG_B43_FORCE_PIO | ||
910 | # define B43_FORCE_PIO 1 | ||
911 | #else | ||
912 | # define B43_FORCE_PIO 0 | ||
913 | #endif | ||
914 | |||
915 | |||
823 | /* Message printing */ | 916 | /* Message printing */ |
824 | void b43info(struct b43_wl *wl, const char *fmt, ...) | 917 | void b43info(struct b43_wl *wl, const char *fmt, ...) |
825 | __attribute__ ((format(printf, 2, 3))); | 918 | __attribute__ ((format(printf, 2, 3))); |