Subject: Re: vge not working on bigendian, either (was Re: CVS commit: src/sys/dev/pci)
To: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
From: Jeff Rizzo <riz@NetBSD.org>
List: tech-net
Date: 11/30/2005 17:29:35
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig613C697A3011C82C404DD632
Content-Type: multipart/mixed;
 boundary="------------010308070309080104040305"

This is a multi-part message in MIME format.
--------------010308070309080104040305
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

Izumi Tsutsui wrote:

>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?
>  
>

The MAC address was fixed by the first patch, yes.  Your second patch
(to if_vgereg.h) caused the machine to hang when vge0 was brought up.

However, brad@openbsd sent me a private email saying vge(4) works on
macppc in OpenBSD, so I derived the attached patch from there, and I can
successfully ping over vge0 on macppc with it when combined with your
patch to if_vge.c.

The PHY that I think is supposed to attach (ciphy, if I read this
correctly) isn't, though, so I'm going to look through there and see if
I notice anything preventing that from happening - the ukphy which is
attaching is only negotiating 100baseTX with the switch.

+j




--------------010308070309080104040305
Content-Type: text/plain; x-mac-type="0"; x-mac-creator="0";
 name="vge.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="vge.diff"

Index: if_vge.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_vge.c,v
retrieving revision 1.7
diff -u -r1.7 if_vge.c
--- if_vge.c	21 Nov 2005 20:25:15 -0000	1.7
+++ if_vge.c	1 Dec 2005 01:12:21 -0000
@@ -738,11 +707,11 @@
 	 */
 	i++;
 
-	d->vge_sts = sz << 16;
-	d->vge_ctl = flags|(i << 28)|VGE_TD_LS_NORM;
+	d->vge_sts = htole32(sz << 16);
+	d->vge_ctl = htole32(flags|(i << 28)|VGE_TD_LS_NORM);
 
 	if (sz > ETHERMTU + ETHER_HDR_LEN)
-		d->vge_ctl |= VGE_TDCTL_JUMBO;
+		d->vge_ctl |= htole32(VGE_TDCTL_JUMBO);
 }
 
 static int

--------------010308070309080104040305--

--------------enig613C697A3011C82C404DD632
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Darwin)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iQCVAwUBQ45SA7OuUtxCgar5AQNfdQP+MwBZkiWPYocHxfo0ZKQD3VKrBhcBfLoo
losTDTar8sv63n3Rx5Nu76pNveeahGfxCsnz3kcjtt73TRW1GetenGBAiqc6xtZ8
2CZFQymcd4mD6P/G4vUITGCpvG7RDDXAiWm5G0pdEipZiU1fOyk90ZBfdGUo6GR+
GVP/urMIzqI=
=FTg5
-----END PGP SIGNATURE-----

--------------enig613C697A3011C82C404DD632--