1 #ifndef _USB_DFU_TRAILER_H
2 #define _USB_DFU_TRAILER_H
4 /* trailer handling for DFU files */
6 #define UBOOT_DFU_TRAILER_V1 1
7 #define UBOOT_DFU_TRAILER_MAGIC 0x19731978
8 struct uboot_dfu_trailer
{
15 } __attribute__((packed
));
17 /* we mirror the trailer because we want it to be longer in later versions
18 * while keeping backwards compatibility */
19 static inline void dfu_trailer_mirror(struct uboot_dfu_trailer
*trailer
,
23 int len
= sizeof(struct uboot_dfu_trailer
);
24 unsigned char *src
= eof
- len
;
25 unsigned char *dst
= (unsigned char *) trailer
;
27 for (i
= 0; i
< len
; i
++)
28 dst
[len
-1-i
] = src
[i
];
31 #endif /* _USB_DFU_TRAILER_H */