forked from Ivasoft/openwrt
ar71xx: add hard_cfg offset detection for rb2011 support - fixes wlan on some newer devices
Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 36631
This commit is contained in:
@@ -29,6 +29,26 @@ static u16 get_u16(void *buf)
|
||||
return (u16) p[1] + ((u16) p[0] << 8);
|
||||
}
|
||||
|
||||
__init int
|
||||
routerboot_find_magic(u8 *buf, unsigned int buflen, u32 *offset, bool hard)
|
||||
{
|
||||
u32 magic_ref = hard ? RB_MAGIC_HARD : RB_MAGIC_SOFT;
|
||||
u32 magic;
|
||||
u32 cur = *offset;
|
||||
|
||||
while (cur < buflen) {
|
||||
magic = get_u32(buf + cur);
|
||||
if (magic == magic_ref) {
|
||||
*offset = cur;
|
||||
return 0;
|
||||
}
|
||||
|
||||
cur += 0x1000;
|
||||
}
|
||||
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
__init int
|
||||
routerboot_find_tag(u8 *buf, unsigned int buflen, u16 tag_id,
|
||||
u8 **tag_data, u16 *tag_len)
|
||||
|
||||
Reference in New Issue
Block a user