summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hurley <peter@hurleysoftware.com>2013-01-29 14:10:30 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-01-30 04:31:34 (GMT)
commit612588a886965706e9593626c277e561c1932249 (patch)
tree4d9377ffb2618d27c37e394df0dc8a444d331465
parentef34dd184d58824f1cde7402afa8ba2a957029d9 (diff)
downloadlinux-fsl-qoriq-612588a886965706e9593626c277e561c1932249.tar.xz
staging/fwserial: Fix endian issue in unit directory
Reported-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Acked-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Acked-by: Stefan Richter <stefanr@s5r6.in-berlin.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/fwserial/fwserial.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/staging/fwserial/fwserial.c b/drivers/staging/fwserial/fwserial.c
index fe9a688..cad9e98 100644
--- a/drivers/staging/fwserial/fwserial.c
+++ b/drivers/staging/fwserial/fwserial.c
@@ -2559,26 +2559,25 @@ static struct fw_driver fwserial_driver = {
/* XXX: config ROM definitons could be improved with semi-automated offset
* and length calculation
*/
+#define FW_ROM_LEN(quads) ((quads) << 16)
#define FW_ROM_DESCRIPTOR(ofs) (((CSR_LEAF | CSR_DESCRIPTOR) << 24) | (ofs))
struct fwserial_unit_directory_data {
- u16 crc;
- u16 len;
+ u32 len_crc;
u32 unit_specifier;
u32 unit_sw_version;
u32 unit_addr_offset;
u32 desc1_ofs;
- u16 desc1_crc;
- u16 desc1_len;
+ u32 desc1_len_crc;
u32 desc1_data[5];
} __packed;
static struct fwserial_unit_directory_data fwserial_unit_directory_data = {
- .len = 4,
+ .len_crc = FW_ROM_LEN(4),
.unit_specifier = FW_UNIT_SPECIFIER(LINUX_VENDOR_ID),
.unit_sw_version = FW_UNIT_VERSION(FWSERIAL_VERSION),
.desc1_ofs = FW_ROM_DESCRIPTOR(1),
- .desc1_len = 5,
+ .desc1_len_crc = FW_ROM_LEN(5),
.desc1_data = {
0x00000000, /* type = text */
0x00000000, /* enc = ASCII, lang EN */