Commit 15536221 authored by Kristian Høgsberg's avatar Kristian Høgsberg Committed by Stefan Richter

firewire: Byteswap iso header so all headers are presented as be32.

Signed-off-by: default avatarKristian Høgsberg <krh@redhat.com>
Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
parent 8a2f7d93
...@@ -1257,7 +1257,13 @@ static int handle_ir_dualbuffer_packet(struct context *context, ...@@ -1257,7 +1257,13 @@ static int handle_ir_dualbuffer_packet(struct context *context,
p = db + 1; p = db + 1;
end = p + header_length; end = p + header_length;
while (p < end && i + ctx->base.header_size <= PAGE_SIZE) { while (p < end && i + ctx->base.header_size <= PAGE_SIZE) {
memcpy(ctx->header + i, p + 4, ctx->base.header_size); /* The iso header is byteswapped to little endian by
* the controller, but the remaining header quadlets
* are big endian. We want to present all the headers
* as big endian, so we have to swap the first
* quadlet. */
*(u32 *) (ctx->header + i) = __swab32(*(u32 *) (p + 4));
memcpy(ctx->header + i + 4, p + 8, ctx->base.header_size - 4);
i += ctx->base.header_size; i += ctx->base.header_size;
p += ctx->base.header_size + 4; p += ctx->base.header_size + 4;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment