changeset 465:023c99ac60f4

i82559 driver tweak
author msalter
date Tue, 17 Dec 2002 22:10:53 +0000
parents bac0bf105669
children 995048bffcec
files packages/devs/eth/intel/i82559/current/ChangeLog packages/devs/eth/intel/i82559/current/src/if_i82559.c
diffstat 2 files changed, 22 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/packages/devs/eth/intel/i82559/current/ChangeLog
+++ b/packages/devs/eth/intel/i82559/current/ChangeLog
@@ -1,3 +1,9 @@
+2002-12-17  Mark Salter  <msalter@redhat.com>
+
+	* src/if_i82559.c (CYGHWR_DEVS_ETH_INTEL_I82559_ENDIAN_NEUTRAL_IO): New
+	flag to support systems where PCI IO operations are not affected by
+	CPU endianess.
+
 2002-10-06  Andrew Lunn  <andrew.lunn@ascom.ch>
 
 	* src/if_i82559.c (pci_init_find_82559s): Changed scope of 
--- a/packages/devs/eth/intel/i82559/current/src/if_i82559.c
+++ b/packages/devs/eth/intel/i82559/current/src/if_i82559.c
@@ -131,6 +131,9 @@
 //               int32 argument is used to hold a eg. the value of a
 //               fast-running hardware timer.
 //
+//               CYGHWR_DEVS_ETH_INTEL_I82559_ENDIAN_NEUTRAL_IO if PCI IO
+//               access is not affected by CPU endianess.
+//
 //        FIXME: replace -1/-2 return values with proper E-defines
 //        FIXME: For 82557/8 compatibility i82559_configure() function
 //               probably needs some tweaking - config bits differ
@@ -330,6 +333,19 @@ static struct {
 #define HAL_CTOLE16(x)  ((((x) & 0xff) << 8) | (((x) & 0xff00) >> 8))
 #define HAL_LE16TOC(x)  ((((x) & 0xff) << 8) | (((x) & 0xff00) >> 8))
 
+#else
+// Maintaining the same styleee as above...
+#define HAL_CTOLE32(x)  ((((x))))
+#define HAL_LE32TOC(x)  ((((x))))
+
+#define HAL_CTOLE16(x)  ((((x))))
+#define HAL_LE16TOC(x)  ((((x))))
+
+#endif
+
+
+#if (CYG_BYTEORDER == CYG_MSBFIRST) && !defined(CYGHWR_DEVS_ETH_INTEL_I82559_ENDIAN_NEUTRAL_IO)
+
 static inline void OUTB(cyg_uint8 value, cyg_uint32 io_address)
 {
     HAL_WRITE_UINT8( io_address, value);
@@ -368,13 +384,6 @@ static inline cyg_uint32 INL(cyg_uint32 
 }
 #else
 
-// Maintaining the same styleee as above...
-#define HAL_CTOLE32(x)  ((((x))))
-#define HAL_LE32TOC(x)  ((((x))))
-
-#define HAL_CTOLE16(x)  ((((x))))
-#define HAL_LE16TOC(x)  ((((x))))
-
 static inline void OUTB(cyg_uint8  value, cyg_uint32 io_address)
 {   HAL_WRITE_UINT8( io_address, value );   }