
3 Oct
2015
3 Oct
'15
12:14 p.m.
Takashi Sakamoto wrote:
23 data = be32_to_cpu(fw_dev->config_rom[28]);
About using 'be32_to_cpu()', the 'config_rom' member actually has 'const u32 *', while in the member caracters in the textual leaf are aligned in big-endian.
Strictly speaking, strings do not have an endianness.
Most data in the actual configuration ROM is organized as big-endian 32- bit values, so the FireWire core converts _all_ words from big endian to CPU endian. The words that are not actually 32-bit values but strings have to be converted back; the correct function for this is cpu_to_be32().
Regards, Clemens