Re: eata.c module and PCI setup problem (RAID SCSI card)
On Sun, 9 Jun 2002, Michel Lanners wrote:
> On 9 Jun, this message from Ballabio_Dario@emc.com echoed through cyberspace:
> > With this value both the auto detection and the io_port option
> > would give the same (good) behavior.
> > The real problem is that the driver expects the "EATA" signature
> > (big endian) while you get "AEAT". It looks like you have a 16 bit
> > system.
>
> No, no, this is not about a 16- or 32-bit-system. This is about the way
> the data is read from the device.
>
> Looking at the struct eata_info that you are reading from the device,
> this looks to me like a stream of bytes of varying size. But you are
> reading it in 16-bit quantities over a byte-swapping barrier: PCI is
> little-endian, powerpc is big-endian. Therefore all data transfers going
> to/coming from the PCI bus are byte-swapped.
>
> The solution here is to not byteswap the data that you are reading from
> the device, so that the byte stream that you are reading keeps the right
> byte alignment.
If it's a struct, you should read the individual fields using in[bwl](),
depending on their size. Then they will be correctly swapped, and you'll have
portable code.
> To the debian-powerpc list: what is the correct replacement for inw()
> that doesn't do byteswap?
But that wouldn't be portable across architectures.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
--
To UNSUBSCRIBE, email to debian-powerpc-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Reply to: