Subject: CVS commit: src/sys/dev/pci
To: None <source-changes@NetBSD.org>
From: Pavel Cahyna <pavel@netbsd.org>
List: source-changes
Date: 04/18/2006 13:07:03
Module Name:	src
Committed By:	pavel
Date:		Tue Apr 18 13:07:03 UTC 2006

Modified Files:
	src/sys/dev/pci: if_sip.c

Log Message:
VLAN tags were sent byte-swapped by the gsip driver, because the driver
forgets to convert them from the host to the network byte order. Use
bswap16 to convert them. (Not htons, because on a big-endian machine, they
are in the correct byte order initially, but then, they are byte-swapped
by a htole32 call when written to the transmit descriptor. So
byte-swapping is needed in this case too, to compensate for this htole32
call.)

For a similar reason, tags were seen byte-swapped when received on a
big-endian machine. Replace ntohs by bswap16 in the input path too.
(Again, it is needed to compensate for a le32toh call when the receive
descriptor is read.)

Fixes PR 32644.

Tested on 3.0/i386, 3.0/sgimips and current/alpha.

OK by martin@.


To generate a diff of this commit:
cvs rdiff -r1.106 -r1.107 src/sys/dev/pci/if_sip.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.