Subject: Re: vge not working on bigendian, either (was Re: CVS commit: src/sys/dev/pci)
To: None <riz@NetBSD.org>
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
List: tech-net
Date: 12/01/2005 08:41:50
In article <438E3551.7030309@NetBSD.org>
riz@NetBSD.org wrote:

> >If it only works on the promisc mode (i.e. if tcpdump(8) works),
> >please try the following patch:

> tcpdump(8) does appear to show arp traffic on the interface, but the
> patch does not seem to help...

Hmm, does the previous patch at least fix MAC address?
All RX works, or only short packets can be received?
How about the attached one?

---
Index: if_vgereg.h
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_vgereg.h,v
retrieving revision 1.1
diff -u -r1.1 if_vgereg.h
--- if_vgereg.h	20 Feb 2005 18:34:33 -0000	1.1
+++ if_vgereg.h	30 Nov 2005 23:40:16 -0000
@@ -588,8 +588,13 @@
 
 struct vge_tx_frag {
 	uint32_t		vge_addrlo;
+#if BYTE_ORDER == BIG_ENDIAN
+	uint16_t		vge_buflen;
+	uint16_t		vge_addrhi;
+#else
 	uint16_t		vge_addrhi;
 	uint16_t		vge_buflen;
+#endif
 };
 
 /*
@@ -649,8 +654,13 @@
 	volatile uint32_t	vge_sts;
 	volatile uint32_t	vge_ctl;
 	volatile uint32_t	vge_addrlo;
+#if BYTE_ORDER == BIG_ENDIAN
+	volatile uint16_t	vge_buflen;
+	volatile uint16_t	vge_addrhi;
+#else
 	volatile uint16_t	vge_addrhi;
 	volatile uint16_t	vge_buflen;
+#endif
 };
 
 /*

---
Izumi Tsutsui