diff options
author | Matteo Croce <rootkit85@yahoo.it> | 2008-05-04 17:05:26 +0000 |
---|---|---|
committer | Matteo Croce <rootkit85@yahoo.it> | 2008-05-04 17:05:26 +0000 |
commit | 4bc59b8552c3cafd5bc532af265d364b659e1097 (patch) | |
tree | f6618e5b0b06b450e4903ed9d664d195f0330b6c /target/linux/ar7 | |
parent | 326c6c3d1d1f3396f708f695e19070fb7247965c (diff) | |
download | upstream-4bc59b8552c3cafd5bc532af265d364b659e1097.tar.gz upstream-4bc59b8552c3cafd5bc532af265d364b659e1097.tar.bz2 upstream-4bc59b8552c3cafd5bc532af265d364b659e1097.zip |
ar7: backport small fixes from linux-mips
SVN-Revision: 11045
Diffstat (limited to 'target/linux/ar7')
-rw-r--r-- | target/linux/ar7/patches-2.6.25/200-mtd_fixes.patch | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/target/linux/ar7/patches-2.6.25/200-mtd_fixes.patch b/target/linux/ar7/patches-2.6.25/200-mtd_fixes.patch new file mode 100644 index 0000000000..1b90fc7ea4 --- /dev/null +++ b/target/linux/ar7/patches-2.6.25/200-mtd_fixes.patch @@ -0,0 +1,61 @@ +--- linux/drivers/mtd/ar7part.c 2007-09-20 21:47:22.000000000 +0200 ++++ linux-mips/drivers/mtd/ar7part.c 2008-05-04 18:49:04.000000000 +0200 +@@ -1,5 +1,5 @@ + /* +- * Copyright (C) 2007 Eugene Konev <ejka@openwrt.org> ++ * Copyright © 2007 Eugene Konev <ejka@openwrt.org> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by +@@ -34,6 +34,10 @@ + #define LOADER_MAGIC1 le32_to_cpu(0xfeedfa42) + #define LOADER_MAGIC2 le32_to_cpu(0xfeed1281) + ++#ifndef SQUASHFS_MAGIC ++#define SQUASHFS_MAGIC 0x73717368 ++#endif ++ + struct ar7_bin_rec { + unsigned int checksum; + unsigned int length; +@@ -47,7 +51,8 @@ + unsigned long origin) + { + struct ar7_bin_rec header; +- unsigned int offset, len; ++ unsigned int offset; ++ size_t len; + unsigned int pre_size = master->erasesize, post_size = 0; + unsigned int root_offset = ROOT_OFFSET; + +@@ -66,7 +71,7 @@ + do { /* Try 10 blocks starting from master->erasesize */ + offset = pre_size; + master->read(master, offset, +- sizeof(header), &len, (u8 *)&header); ++ sizeof(header), &len, (uint8_t *)&header); + if (!strncmp((char *)&header, "TIENV0.8", 8)) + ar7_parts[1].offset = pre_size; + if (header.checksum == LOADER_MAGIC1) +@@ -88,7 +93,7 @@ + while (header.length) { + offset += sizeof(header) + header.length; + master->read(master, offset, sizeof(header), +- &len, (u8 *)&header); ++ &len, (uint8_t *)&header); + } + root_offset = offset + sizeof(header) + 4; + break; +@@ -96,10 +101,10 @@ + while (header.length) { + offset += sizeof(header) + header.length; + master->read(master, offset, sizeof(header), +- &len, (u8 *)&header); ++ &len, (uint8_t *)&header); + } + root_offset = offset + sizeof(header) + 4 + 0xff; +- root_offset &= ~(u32)0xff; ++ root_offset &= ~(uint32_t)0xff; + break; + default: + printk(KERN_WARNING "Unknown magic: %08x\n", header.checksum); |