Add support for AR9280 from FreeBSD HAL
[madwifi/.git] / ath_hal / ah_osdep.h
index abe60faf184c0d5f6e25eb69a41aa97328630ce3..bd5a3c4414dadde024d5760a8fbc1a966e57e82d 100644 (file)
@@ -64,6 +64,7 @@ struct ath_hal_chip *AR5212_chip_ptr __attribute__((__weak__));       \
 struct ath_hal_chip *AR5312_chip_ptr __attribute__((__weak__));        \
 struct ath_hal_chip *AR5416_chip_ptr __attribute__((__weak__));        \
 struct ath_hal_chip *AR9160_chip_ptr __attribute__((__weak__));        \
+struct ath_hal_chip *AR9280_chip_ptr __attribute__((__weak__));        \
 struct ath_hal_chip *const *ah_chips_ptrs[] = {                        \
        &AR5210_chip_ptr,                                       \
        &AR5211_chip_ptr,                                       \
@@ -71,6 +72,7 @@ struct ath_hal_chip *const *ah_chips_ptrs[] = {                       \
        &AR5312_chip_ptr,                                       \
        &AR5416_chip_ptr,                                       \
        &AR9160_chip_ptr,                                       \
+       &AR9280_chip_ptr,                                       \
        NULL                                                    \
 }
 
@@ -152,7 +154,10 @@ struct ath_hal_rf *const *ah_rfs_ptrs[] = {                        \
     !defined(CONFIG_PARISC) && \
     !(defined(CONFIG_PPC64) && \
       (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,14))) && \
-    !defined(CONFIG_PPC_MERGE) && \
+    !(defined(CONFIG_PPC_MERGE) && \
+      (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20))) && \
+    !(defined(CONFIG_PPC32) && \
+      (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27))) && \
     !(defined(CONFIG_MIPS) && \
       (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,21)))
 # ifndef iowrite32be
@@ -181,8 +186,9 @@ struct ath_hal_rf *const *ah_rfs_ptrs[] = {                 \
                           (0x7000 <= (__reg) && (__reg) < 0x8000))
 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,12)
 #  define _OS_REG_WRITE(_ah, _reg, _val) do {                  \
-        is_reg_le(_reg) ?                                      \
-         iowrite32((_val), (_ah)->ah_sh + (_reg)) :            \
+        if (is_reg_le(_reg))                                   \
+         iowrite32((_val), (_ah)->ah_sh + (_reg));             \
+        else                                                   \
          iowrite32be((_val), (_ah)->ah_sh + (_reg));           \
        } while (0)
 #  define _OS_REG_READ(_ah, _reg)                              \