Subject: Re: port-i386/2109: ultra14f.c byte-read of board ID fails on 34f (mine at least)
To: None <mhw@NETRIS.org>
From: Mike Long <mike.long@analog.com>
List: netbsd-bugs
Date: 02/23/1996 11:23:44
>From: "Mark H. Weaver" <mhw@netris.org>
>Date: Fri, 23 Feb 1996 04:39:53 -0500

>I wrote:
>> Sorry, should've thought to check for that.  0x4156 is read, and
>> 0x5641 is what we want, meaning that the word-read seems to be
>> returning the big-endian representation for some reason.
>> 
>> Was the change to byte-reads ever tested?
>
>Oops, I didn't notice the htons's used in the word-read code; I just
>copied it blind from version 1.60 of ultra14f.c.
>
>I guess it was never tested, and is a simple mistake.  How about the
>following patch instead?

I biffed this.  In port-i386/2150 I translated the inw() to the
equivalent pair of inb()s, but forgot about the byte-swap performed by
htons() on the i386.  I think your latest patch will work, and should
be applied ASAP.
-- 
Mike Long <mike.long@analog.com>     <URL:http://www.shore.net/~mikel>
VLSI Design Engineer         finger mikel@shore.net for PGP public key
Analog Devices, CPD Division          CCBF225E7D3F7ECB2C8F7ABB15D9BE7B
Norwood, MA 02062 USA       (eq (opinion 'ADI) (opinion 'mike)) -> nil