/*
* Copyright (C) 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
static struct mtd_partition ar7_parts[5];
-static int create_mtd_partitions(struct mtd_info *master,
- struct mtd_partition **pparts,
+static int create_mtd_partitions(struct mtd_info *master,
+ struct mtd_partition **pparts,
unsigned long origin)
{
struct ar7_bin_rec header;
ar7_parts[1].size = master->erasesize;
ar7_parts[1].mask_flags = 0;
- do {
+ do { /* Try 10 blocks starting from master->erasesize */
offset = pre_size;
- master->read(master, offset, sizeof(header), &len, (u_char *)&header);
+ master->read(master, offset,
+ sizeof(header), &len, (u_char *)&header);
if (!strncmp((char *)&header, "TIENV0.8", 8))
ar7_parts[1].offset = pre_size;
if (header.checksum == 0xfeedfa42)
while (header.length) {
offset += sizeof(header) + header.length;
master->read(master, offset, sizeof(header),
- &len, (u_char *)&header);
+ &len, (u_char *)&header);
}
root_offset = offset + sizeof(header) + 4;
break;
while (header.length) {
offset += sizeof(header) + header.length;
master->read(master, offset, sizeof(header),
- &len, (u_char *)&header);
+ &len, (u_char *)&header);
}
root_offset = offset + sizeof(header) + 4 + 0xff;
root_offset &= ~(u32)0xff;
break;
}
- master->read(master, root_offset, sizeof(header), &len, (u_char *)&header);
+ master->read(master, root_offset,
+ sizeof(header), &len, (u_char *)&header);
if (header.checksum != SQUASHFS_MAGIC) {
root_offset += master->erasesize - 1;
root_offset &= ~(master->erasesize - 1);
module_init(ar7_parser_init);
MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Felix Fietkau <nbd@openwrt.org>, Eugene Konev <ejka@openwrt.org>");
+MODULE_AUTHOR( "Felix Fietkau <nbd@openwrt.org>, "
+ "Eugene Konev <ejka@openwrt.org>");
MODULE_DESCRIPTION("MTD partitioning for TI AR7");