2 * RouterBoot helper routines
4 * Copyright (C) 2012 Gabor Juhos <juhosg@openwrt.org>
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 as published
8 * by the Free Software Foundation.
11 #include <linux/kernel.h>
12 #include <linux/errno.h>
13 #include <linux/routerboot.h>
15 #include "routerboot.h"
17 static u32 get_u32(void *buf)
21 return ((u32) p[3] + ((u32) p[2] << 8) + ((u32) p[1] << 16) +
25 static u16 get_u16(void *buf)
29 return (u16) p[1] + ((u16) p[0] << 8);
33 routerboot_find_tag(u8 *buf, unsigned int buflen, u16 tag_id,
34 u8 **tag_data, u16 *tag_len)
45 /* skip magic value */
54 /* skip magic and CRC value */
80 if (id == RB_ID_TERMINATOR)