1/* 2 * 3 * Copyright (C) 2007,2009 Gabor Juhos <juhosg@openwrt.org> 4 * 5 * This program was based on the code found in various Linux 6 * source tarballs released by Edimax for it's devices. 7 * Original author: David Hsu <davidhsu@realtek.com.tw> 8 * 9 * This program is free software; you can redistribute it and/or 10 * modify it under the terms of the GNU General Public License 11 * as published by the Free Software Foundation; either version 2 12 * of the License, or (at your option) any later version. 13 * 14 * This program is distributed in the hope that it will be useful, 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 * GNU General Public License for more details. 18 * 19 * You should have received a copy of the GNU General Public License 20 * along with this program; if not, write to the 21 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 22 * Boston, MA 02110-1301, USA. 23 */ 24 25#define SIG_LEN 4 26 27#define ADM_CODE_ADDR 0x80500000 28#define ADM_WEBP_ADDR 0x10000 29#define ADM_WEBP_SIZE 0x10000 30#define ADM_BOOT_SIZE 0x8000 31#define ADM_CONF_SIZE 0x8000 32#define ADM_BOOT_SIG "\x00\x60\x1A\x40" 33 34 35/* 36 * Generic signatures 37 */ 38#define SIG_CSYS "CSYS" 39#define SIG_CONF "HS\x00\x00" 40#define SIG_BOOT_RTL "\x00\x00\x40\x21" 41 42/* 43 * Web page signatures 44 */ 45#define SIG_BR6104K "WB4K" 46#define SIG_BR6104KP "WBKP" 47#define SIG_BR6104Wg "WBGW" 48#define SIG_BR6104IPC "WBIP" 49#define SIG_BR6114WG SIG_BR6104IPC 50#define SIG_BR6524K "2-K-" 51#define SIG_BR6524KP "2-KP" /* FIXME: valid? */ 52#define SIG_BR6524WG "2-WG" /* FIXME: valid? */ 53#define SIG_BR6524WP "2-WP" /* FIXME: valid? */ 54#define SIG_BR6541K "4--K" 55#define SIG_BR6541KP "4-KP" /* FIXME: valid? */ 56#define SIG_BR6541WP "4-WP" /* FIXME: valid? */ 57#define SIG_C54BSR4 SIG_BR6104IPC 58#define SIG_EW7207APg "EWAS" 59#define SIG_PS1205UWg "4000" 60#define SIG_PS3205U "5010" 61#define SIG_PS3205UWg "5011" 62#define SIG_RALINK "RNRA" 63#define SIG_5GXI "5GXI" /* fake signature */ 64 65#define SIG_H2BR4 SIG_BR6524K 66#define SIG_H2WR54G SIG_BR6524WG 67 68#define SIG_XRT401D SIG_BR6104K 69#define SIG_XRT402D SIG_BR6524K 70 71/* 72 * CSYS image file header 73 */ 74struct csys_header { 75 unsigned char sig[SIG_LEN]; 76 uint32_t addr; 77 uint32_t size; 78}; 79