3 @@ -606,6 +606,14 @@ ath_attach(u_int16_t devid, struct net_d
7 + /* WAR for AR7100 PCI bug */
8 +#ifdef CONFIG_ATHEROS_AR71XX
9 + if ((ar_device(sc->devid) >= 5210) && (ar_device(sc->devid) < 5416)) {
10 + ath_hal_setcapability(ah, HAL_CAP_DMABURST_RX, 0, HAL_DMABURST_4B, NULL);
11 + ath_hal_setcapability(ah, HAL_CAP_DMABURST_TX, 0, HAL_DMABURST_4B, NULL);
16 * Check if the MAC has multi-rate retry support.
17 * We do this by trying to setup a fake extended
18 @@ -7568,7 +7576,7 @@ ath_txq_setup(struct ath_softc *sc, int
19 if (qtype == HAL_TX_QUEUE_UAPSD)
20 qi.tqi_qflags = HAL_TXQ_TXDESCINT_ENABLE;
22 - qi.tqi_qflags = HAL_TXQ_TXEOLINT_ENABLE |
23 + qi.tqi_qflags = HAL_TXQ_TXEOLINT_ENABLE | HAL_TXQ_TXOKINT_ENABLE |
24 HAL_TXQ_TXDESCINT_ENABLE;
25 qnum = ath_hal_setuptxqueue(ah, qtype, &qi);
29 @@ -126,6 +126,13 @@ ath_hal_printf(struct ath_hal *ah, const
31 EXPORT_SYMBOL(ath_hal_printf);
34 +ath_hal_printstr(struct ath_hal *ah, const char *str)
38 +EXPORT_SYMBOL(ath_hal_printstr);
41 * Format an Ethernet MAC for printing.
45 @@ -156,69 +156,23 @@ extern u_int32_t __ahdecl ath_hal_getupt
47 #endif /* AH_BYTE_ORDER */
50 - * Some big-endian architectures don't set CONFIG_GENERIC_IOMAP, but fail to
51 - * implement iowrite32be and ioread32be. Provide compatibility macros when
54 - * As of Linux 2.6.24, only MIPS, PARISC and PowerPC implement iowrite32be and
55 - * ioread32be as functions.
57 - * The downside or the replacement macros it that we may be byte-swapping data
58 - * for the second time, so the native implementations should be preferred.
60 -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,12)) && \
61 - !defined(CONFIG_GENERIC_IOMAP) && (AH_BYTE_ORDER == AH_BIG_ENDIAN) && \
62 - !defined(__mips__) && !defined(__hppa__) && !defined(__powerpc__)
64 -# define iowrite32be(_val, _addr) iowrite32(swab32((_val)), (_addr))
67 -# define ioread32be(_addr) swab32(ioread32((_addr)))
70 +#define IS_SWAPPED(_ah, _reg) \
71 + ((_ah)->ah_swapped && \
72 + (((0x4000 <= (_reg)) && ((_reg) < 0x5000)) || \
73 + ((0x7000 <= (_reg)) && ((_reg) < 0x8000))))
75 +#define SWAPREG(_ah, _reg, _val) \
76 + (IS_SWAPPED(_ah, _reg) ? cpu_to_le32(_val) : (_val))
79 * The register accesses are done using target-specific functions when
80 * debugging is enabled (AH_DEBUG) or it's explicitly requested for the target.
82 - * The hardware registers use little-endian byte order natively. Big-endian
83 - * systems are configured by HAL to enable hardware byte-swap of register reads
84 - * and writes at reset. This avoid the need to byte-swap the data in software.
85 - * However, the registers in a certain area from 0x4000 to 0x4fff (PCI clock
86 - * domain registers) are not byte swapped!
88 - * Since Linux I/O primitives default to little-endian operations, we only
89 - * need to suppress byte-swapping on big-endian systems outside the area used
90 - * by the PCI clock domain registers.
92 -#if (AH_BYTE_ORDER == AH_BIG_ENDIAN)
93 -#define is_reg_le(__reg) ((0x4000 <= (__reg) && (__reg) < 0x5000))
95 -#define is_reg_le(__reg) 1
98 -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,12)
99 -#define _OS_REG_WRITE(_ah, _reg, _val) do { \
100 - is_reg_le(_reg) ? \
101 - iowrite32((_val), (_ah)->ah_sh + (_reg)) : \
102 - iowrite32be((_val), (_ah)->ah_sh + (_reg)); \
104 -#define _OS_REG_READ(_ah, _reg) \
105 - (is_reg_le(_reg) ? \
106 - ioread32((_ah)->ah_sh + (_reg)) : \
107 - ioread32be((_ah)->ah_sh + (_reg)))
109 #define _OS_REG_WRITE(_ah, _reg, _val) do { \
110 - writel(is_reg_le(_reg) ? \
111 - (_val) : cpu_to_le32(_val), \
112 - (_ah)->ah_sh + (_reg)); \
114 + __raw_writel(SWAPREG(_ah, _reg, _val), (_ah)->ah_sh + (_reg)); \
116 #define _OS_REG_READ(_ah, _reg) \
117 - (is_reg_le(_reg) ? \
118 - readl((_ah)->ah_sh + (_reg)) : \
119 - cpu_to_le32(readl((_ah)->ah_sh + (_reg))))
120 -#endif /* KERNEL_VERSION(2,6,12) */
121 + SWAPREG(_ah, _reg, __raw_readl((_ah)->ah_sh + (_reg)))
124 * The functions in this section are not intended to be invoked by MadWifi
125 --- a/ath/if_ath_hal.h
126 +++ b/ath/if_ath_hal.h
127 @@ -778,17 +778,6 @@ static inline HAL_STATUS ath_hal_getcapa
131 -static inline HAL_BOOL ath_hal_radar_wait(struct ath_hal *ah, HAL_CHANNEL *a1)
134 - ATH_HAL_LOCK_IRQ(ah->ah_sc);
135 - ath_hal_set_function(__func__);
136 - ret = ah->ah_radarWait(ah, a1);
137 - ath_hal_set_function(NULL);
138 - ATH_HAL_UNLOCK_IRQ(ah->ah_sc);
142 static inline HAL_BOOL ath_hal_setmcastfilterindex(struct ath_hal *ah,
145 @@ -1268,8 +1257,6 @@ static inline void ath_hal_dump_map(stru
146 /* HAL_STATUS ah_getCapability(struct ath_hal *ah, HAL_CAPABILITY_TYPE a1, u_int32_t capability, u_int32_t *result) */
147 __print_symbol("%s=ah_getCapability\n",
148 (unsigned long)ah->ah_getCapability);
149 - /* HAL_BOOL ah_radarWait(struct ath_hal *ah, HAL_CHANNEL *a1) */
150 - __print_symbol("%s=ah_radarWait\n", (unsigned long)ah->ah_radarWait);
151 /* HAL_BOOL ah_setMulticastFilterIndex(struct ath_hal *ah, u_int32_t index) */
152 __print_symbol("%s=ah_setMulticastFilterIndex\n",
153 (unsigned long)ah->ah_setMulticastFilterIndex);