Ke Wei wrote:
Yes, the mvi->sas_addr array is in wire big endian format. And it
will be written to two
little-endian 32-bit registers after converting to little endian. So I
think this is independent
of system architecture.
BTW, just a reminder... the values written by writel() [aka mw32, in
mvsas] are converted by the API.
Thus, when writing to MMIO registers, you always pass in CPU-endian
values, and mw32() will do the right thing regardless of platform.
Ditto for reading MMIO registers -- regardless of being on a big-endian
or little-endian platform, the values returned are always in CPU-endian
format.
So the typical cases where you must perform a conversion in the driver are
1) DMA memory. You must use le32_to_cpu(), etc. This is the most
common case for endian conversions.
2) In rare cases, depending on your hardware, sometimes you must add a
conversion even though you are reading data via readl() and writing via
writel(). Often, this rare case occurs when reading data from EEPROM
data-in registers, for example, where the EEPROM data is in big-endian
format.
Jeff
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html