1 Index: madwifi-ng-r2799-20071030/ath_hal/ah_os.h
2 ===================================================================
3 --- madwifi-ng-r2799-20071030.orig/ath_hal/ah_os.h 2007-10-31 14:04:46.433267559 +0100
4 +++ madwifi-ng-r2799-20071030/ath_hal/ah_os.h 2007-10-31 14:04:50.785515582 +0100
6 * never byte-swapped by PCI chipsets or bridges, but always
7 * written directly (i.e. the format defined by the manufacturer).
9 -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,12)
10 -# if (AH_BYTE_ORDER == AH_BIG_ENDIAN)
11 +#if (AH_BYTE_ORDER == AH_BIG_ENDIAN)
12 #define _OS_REG_WRITE(_ah, _reg, _val) do { \
13 (0x4000 <= (_reg) && (_reg) < 0x5000) ? \
14 - iowrite32((_val), (_ah)->ah_sh + (_reg)) : \
15 - iowrite32be((_val), (_ah)->ah_sh + (_reg)); \
17 -#define _OS_REG_READ(_ah, _reg) \
18 - ((0x4000 <= (_reg) && (_reg) < 0x5000) ? \
19 - ioread32((_ah)->ah_sh + (_reg)) : \
20 - ioread32be((_ah)->ah_sh + (_reg)));
21 -# else /* AH_LITTLE_ENDIAN */
22 -#define _OS_REG_WRITE(_ah, _reg, _val) do { \
23 - iowrite32(_val, (_ah)->ah_sh + (_reg)); \
25 -#define _OS_REG_READ(_ah, _reg) \
26 - ioread32((_ah)->ah_sh + (_reg))
28 -# endif /* AH_BYTE_ORDER */
30 -# if (AH_BYTE_ORDER == AH_BIG_ENDIAN)
31 -#define _OS_REG_WRITE(_ah, _reg, _val) do { \
32 - writel((0x4000 <= (_reg) && (_reg) < 0x5000) ? \
33 - (_val) : cpu_to_le32(_val), \
34 - (_ah)->ah_sh + (_reg)); \
36 + writel((_val), (_ah)->ah_sh + (_reg)) : \
37 + ({__raw_writel((_val), (_ah)->ah_sh + (_reg)); \
40 #define _OS_REG_READ(_ah, _reg) \
41 ((0x4000 <= (_reg) && (_reg) < 0x5000) ? \
42 readl((_ah)->ah_sh + (_reg)) : \
43 - cpu_to_le32(readl((_ah)->ah_sh + (_reg))))
44 -# else /* AH_LITTLE_ENDIAN */
45 + ({unsigned long __v = __raw_readl((_ah)->ah_sh + \
46 + (_reg)); mb(); __v; }))
47 +#else /* AH_LITTLE_ENDIAN */
48 #define _OS_REG_WRITE(_ah, _reg, _val) do { \
49 writel(_val, (_ah)->ah_sh + (_reg)); \
52 #define _OS_REG_READ(_ah, _reg) \
53 readl((_ah)->ah_sh + (_reg))
54 -# endif /* AH_BYTE_ORDER */
55 -#endif /* KERNEL_VERSON(2,6,12) */
56 +#endif /* AH_BYTE_ORDER */
59 The functions in this section are not intended to be invoked by MadWifi driver