Registers between 0x7000 and 0x8000 are always little-endian
authorproski <proski@0192ed92-7a03-0410-a25b-9323aeb14dbd>
Thu, 5 Jun 2008 07:22:51 +0000 (07:22 +0000)
committerproski <proski@0192ed92-7a03-0410-a25b-9323aeb14dbd>
Thu, 5 Jun 2008 07:22:51 +0000 (07:22 +0000)
According to FreeBSD changelog, this area is present in 5416 and newer
and must be byteswapped on big-endian systems.  Testing confirms it.

git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3701 0192ed92-7a03-0410-a25b-9323aeb14dbd

ath_hal/ah_os.h

index dc4171d08c3c73d017f7b056d685b7d40417d795..58fef2e1fb5e599c0134d3624e56d42a489f1a8d 100644 (file)
@@ -187,7 +187,8 @@ extern void *__ahdecl ath_hal_memcpy(void *, const void *, size_t);
  * by the PCI clock domain registers.
  */
 #if (AH_BYTE_ORDER == AH_BIG_ENDIAN)
-#define is_reg_le(__reg) ((0x4000 <= (__reg) && (__reg) < 0x5000))
+#define is_reg_le(__reg) ((0x4000 <= (__reg) && (__reg) < 0x5000) || \
+                         (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) ?                                      \