Subject: Re: bge on big endian anyone?
To: None <current-users@NetBSD.org>
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
List: current-users
Date: 11/24/2005 22:25:40
In article <051123071130.M0105882@mirage.ceres.dti.ne.jp>
I wrote:

> Hmm, more bswap ops are needed (for all members in struct bge_ring_data)?

Ok, I receive a report that says TX on bge is working without patch,
so bge has a big endian mode and it handles byteswap against
DMA descriptors properly. The problem is an extra byteswap
which is not needed, and he says the attached patch make
bge work at least on macppc.
---
Izumi Tsutsui

*** ORIG/if_bgereg.h	Sat Nov 19 08:58:47 2005
--- if_bgereg.h	Thu Nov 24 02:56:18 2005
***************
*** 1769,1775 ****
  	u_int32_t		bge_nicaddr;
  };
  
! #if BYTE_ORDER == BIG_ENDIAN
  #define	BGE_RCB_MAXLEN_FLAGS(maxlen, flags)	((flags) << 16 | (maxlen))
  #else
  #define	BGE_RCB_MAXLEN_FLAGS(maxlen, flags)	((maxlen) << 16 | (flags))
--- 1769,1775 ----
  	u_int32_t		bge_nicaddr;
  };
  
! #if 0 /*BYTE_ORDER == BIG_ENDIAN*/
  #define	BGE_RCB_MAXLEN_FLAGS(maxlen, flags)	((flags) << 16 | (maxlen))
  #else
  #define	BGE_RCB_MAXLEN_FLAGS(maxlen, flags)	((maxlen) << 16 | (flags))