Subject: Re: PCI nics on big-endian CPUs [was Re: vge not working on bigendian,
To: None <jonathan@Pescadero.dsg.stanford.edu>
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
List: tech-kern
Date: 12/01/2005 08:22:00
In article <E1EhYYw-0003Jq-00@smeg.dsg.stanford.edu>
jonathan@Pescadero.dsg.stanford.edu wrote:
> Uh... if (dim) memory serves, the main difference between my port of
> the FreeBSD-4 bge(4) and the one (Christos?) committed is that the
> committed version worked on Sparcs. Sparcs are big-endian.
>
> Does the cited change to if_bgereg break bge on sparc, or make it
> work, or something completely different?
I was told that the problem was introduced in if_bgereg.h rev 1.7.
It has an unnecessary macro for BE machines, which the FreeBSD
driver didn't have. The device always accesses DMA descriptors
in uint32_t and swaps byteorder by itself, so no need to swap values
if they are stored in uint32_t by the driver.
(i.e. we should use uint32_t and shift ops for all 16bit DMA descs
so that all #ifdef BYTE_ORDER statements can be removed.)
---
Izumi Tsutsui