lkml.org 
[lkml]   [2008]   [Aug]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 3/4] Fix remaining big endian issue of hfcmulti
From
Date

> Thanks for this hint, I didn't know that the repetive versions are
> for byte streams and not for eg. transfer of multiple u32.
> So it makes things lot easier the code should look like:
>
> int l = len >> 2;
>
> if (l) {
> ioread32_rep(hc->pci_membase + A_FIFO_DATA0, data, l);
> data += l << 2;
> }
> if (len & 2) {
> ioread16_rep(hc->pci_membase + A_FIFO_DATA0, data, 1);
> data += 2;
> }
> if (len & 1)
> writeb(*data, hc->pci_membase + A_FIFO_DATA0);

Don't mix the io* variants with the PCI variants. Use iowrite8 for the
last one and make sure you do a proper pci_iomap.

One cool thing with the new iomap stuff is that it also works for both
PIO and MMIO, so you no longer need to differenciate writeX from outX
as long as you use the right mapping stuff initially.

Ben.




\
 
 \ /
  Last update: 2008-08-05 15:07    [from the cache]
©2003-2011 Jasper Spaans. Advertise on this site