resync with kamikaze

git-svn-id: svn://svn.openwrt.org/openwrt/branches/buildroot-ng/openwrt@3844 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
Felix Fietkau
2006-05-30 19:38:38 +00:00
parent f45baccdc5
commit 340f1875ed
156 changed files with 15637 additions and 32077 deletions

View File

@@ -7,6 +7,7 @@ config LINUX_2_6_ARUBA
select mips
select LINUX_2_6
select PCI_SUPPORT
select BIG_ENDIAN
help
Build firmware images for Aruba boards
@@ -14,6 +15,7 @@ config LINUX_2_4_AR531X
bool "Atheros AR531x [2.4]"
select mips
select LINUX_2_4
select BIG_ENDIAN
help
Build firmware images for Atheros AR531x based boards
(e.g. Netgear WGT624, Linksys WRT55AG)
@@ -84,6 +86,7 @@ config LINUX_2_6_ARM
config LINUX_2_6_ARMEB
bool "UNSUPPORTED big-endian arm platform"
select LINUX_2_6
select BIG_ENDIAN
select armeb
config LINUX_2_6_CRIS
@@ -99,6 +102,7 @@ config LINUX_2_6_M68K
config LINUX_2_6_PPC
bool "UNSUPPORTED powerpc platform"
select LINUX_2_6
select BIG_ENDIAN
select powerpc
config LINUX_2_6_SH3
@@ -109,6 +113,7 @@ config LINUX_2_6_SH3
config LINUX_2_6_SH3EB
bool "UNSUPPORTED big-endian sh3 platform"
select LINUX_2_6
select BIG_ENDIAN
select sh3eb
config LINUX_2_6_SH4
@@ -119,11 +124,13 @@ config LINUX_2_6_SH4
config LINUX_2_6_SH4EB
bool "UNSUPPORTED big-endian sh4 platform"
select LINUX_2_6
select BIG_ENDIAN
select sh4eb
config LINUX_2_6_SPARC
bool "UNSUPPORTED sparc platform"
select LINUX_2_6
select BIG_ENDIAN
select sparc
endif
@@ -145,6 +152,8 @@ config PCI_SUPPORT
config PCMCIA_SUPPORT
bool
config BIG_ENDIAN
bool
# Architecture selection

View File

@@ -10,6 +10,7 @@ menu "Target Root Filesystem"
bool "squashfs-lzma"
default y
depends !LINUX_2_6_ARUBA
depends !LINUX_2_6_XSCALE
help
Build a squashfs-lzma root filesystem
@@ -53,6 +54,13 @@ config PACKAGE_KMOD_IMQ
help
Kernel support for the Intermediate Queueing device
config PACKAGE_KMOD_IPIP
prompt "kmod-ipip......................... IP in IP encapsulation support"
tristate
default m
help
Kernel module for IP in IP encapsulation
config PACKAGE_KMOD_IPV6
prompt "kmod-ipv6......................... IPv6 support"
tristate
@@ -294,7 +302,7 @@ config PACKAGE_KMOD_IDE
- ide-core
- ide-detect
- ide-disk
- pdc202old
- pdc202xx_old
config PACKAGE_KMOD_LOOP
prompt "kmod-loop......................... Loop mount support"
@@ -316,7 +324,7 @@ config PACKAGE_KMOD_CRYPTO
prompt "CryptoAPI modules"
tristate
default m
select BUSYBOX_FEATURE_CHECK_TAINTED_MODULE
select BUSYBOX_CONFIG_FEATURE_CHECK_TAINTED_MODULE
help
Kernel modules for cryptographic algorithms

View File

@@ -84,3 +84,5 @@ $(eval $(call kernel_template,2.6,x86,2_6_X86))
$(eval $(call kernel_template,2.4,ar531x,2_4_AR531X))
$(eval $(call kernel_template,2.6,aruba,2_6_ARUBA))
$(eval $(call kernel_template,2.6,au1000,2_6_AU1000))
$(eval $(call kernel_template,2.6,xscale,2_6_XSCALE))
$(eval $(call kernel_template,2.6,sibyte,2_6_SIBYTE))

View File

@@ -1,8 +1,8 @@
include $(TOPDIR)/rules.mk
LINUX_VERSION:=2.6.16.4
LINUX_VERSION:=2.6.16.7
LINUX_RELEASE:=1
LINUX_KERNEL_MD5SUM:=cb675279c9711237a06ebb8379a4da27
LINUX_KERNEL_MD5SUM:=9682b2bd6e02f3087982d7c3f5ba824e
include ../rules.mk
include ./config

View File

@@ -45,7 +45,7 @@ diff -Nur linux-2.6.16/arch/mips/aruba/Makefile linux-2.6.16-owrt/arch/mips/arub
+# .S.o:
+# $(CC) $(CFLAGS) -c $< -o $*.o
+
+obj-y := prom.o setup.o idtIRQ.o irq.o time.o flash_lock.o wdt_merlot.o
+obj-y := prom.o setup.o idtIRQ.o irq.o time.o flash_lock.o
+obj-$(CONFIG_SERIAL_8250) += serial.o
+
+subdir-y += nvram
@@ -823,6 +823,7 @@ diff -Nur linux-2.6.16/arch/mips/aruba/setup.c linux-2.6.16-owrt/arch/mips/aruba
+ */
+
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/mm.h>
+#include <linux/sched.h>
+#include <linux/irq.h>
@@ -872,7 +873,6 @@ diff -Nur linux-2.6.16/arch/mips/aruba/setup.c linux-2.6.16-owrt/arch/mips/aruba
+
+extern char * getenv(char *e);
+extern void unlock_ap60_70_flash(void);
+extern void wdt_merlot_disable(void);
+
+void __init plat_setup(void)
+{
@@ -895,8 +895,6 @@ diff -Nur linux-2.6.16/arch/mips/aruba/setup.c linux-2.6.16-owrt/arch/mips/aruba
+
+ printk("BOARD - %s\n",getenv("boardname"));
+
+ wdt_merlot_disable();
+
+ return 0;
+}
+
@@ -909,6 +907,8 @@ diff -Nur linux-2.6.16/arch/mips/aruba/setup.c linux-2.6.16-owrt/arch/mips/aruba
+{
+ return "MIPS IDT32434 - ARUBA";
+}
+
+EXPORT_SYMBOL(get_system_type);
diff -Nur linux-2.6.16/arch/mips/aruba/time.c linux-2.6.16-owrt/arch/mips/aruba/time.c
--- linux-2.6.16/arch/mips/aruba/time.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.16-owrt/arch/mips/aruba/time.c 2006-03-20 14:25:10.000000000 +0100
@@ -1021,40 +1021,6 @@ diff -Nur linux-2.6.16/arch/mips/aruba/time.c linux-2.6.16-owrt/arch/mips/aruba/
+ timer_interrupt(irq, NULL, regs);
+ irq_exit();
+}
diff -Nur linux-2.6.16/arch/mips/aruba/wdt_merlot.c linux-2.6.16-owrt/arch/mips/aruba/wdt_merlot.c
--- linux-2.6.16/arch/mips/aruba/wdt_merlot.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.16-owrt/arch/mips/aruba/wdt_merlot.c 2006-03-20 14:25:10.000000000 +0100
@@ -0,0 +1,30 @@
+#include <linux/config.h>
+#include <linux/kernel.h>
+#include <asm/bootinfo.h>
+
+void wdt_merlot_disable()
+{
+ volatile __u32 *wdt_errcs;
+ volatile __u32 *wdt_wtc;
+ volatile __u32 *wdt_ctl;
+ volatile __u32 val;
+
+ switch (mips_machtype) {
+ case MACH_ARUBA_AP70:
+ wdt_errcs = (__u32 *) 0xb8030030;
+ wdt_wtc = (__u32 *) 0xb803003c;
+ val = *wdt_errcs;
+ val &= ~0x201;
+ *wdt_errcs = val;
+ val = *wdt_wtc;
+ val &= ~0x1;
+ *wdt_wtc = val;
+ break;
+ case MACH_ARUBA_AP65:
+ case MACH_ARUBA_AP60:
+ default:
+ wdt_ctl = (__u32 *) 0xbc003008;
+ *wdt_ctl = 0;
+ break;
+ }
+}
diff -Nur linux-2.6.16/arch/mips/Kconfig linux-2.6.16-owrt/arch/mips/Kconfig
--- linux-2.6.16/arch/mips/Kconfig 2006-03-20 06:53:29.000000000 +0100
+++ linux-2.6.16-owrt/arch/mips/Kconfig 2006-03-20 14:25:10.000000000 +0100

View File

@@ -0,0 +1,126 @@
diff -Nur linux-2.6.15.1/drivers/char/watchdog/wdt_merlot.c linux-2.6.15.1-openwrt/drivers/char/watchdog/wdt_merlot.c
--- linux-2.6.15.1/drivers/char/watchdog/wdt_merlot.c 2006-01-26 21:14:02.204626250 -0800
+++ linux-2.6.15.1-openwrt/drivers/char/watchdog/wdt_merlot.c 2006-02-02 20:31:43.000000000 -0800
@@ -0,0 +1,110 @@
+#include <linux/config.h>
+#include <linux/module.h>
+#include <linux/types.h>
+#include <linux/miscdevice.h>
+#include <linux/watchdog.h>
+#include <linux/fs.h>
+
+#include <asm/io.h>
+#include <asm/uaccess.h>
+#include <asm/system.h>
+#include <asm/bootinfo.h>
+
+extern unsigned long mips_machtype;
+
+static unsigned long wdt_is_open;
+static struct timer_list wdt_timer;
+
+static void wdt_merlot_refresh(void)
+{
+ volatile __u32 *wdt;
+ switch (mips_machtype) {
+ case MACH_ARUBA_AP70:
+ wdt = (__u32 *) 0xb8030034;
+ *wdt = 0x10000000;
+ break;
+ default:
+ wdt = (__u32 *) 0xbc00300c;
+ *wdt = 0x40000000;
+ break;
+ }
+}
+
+static void wdt_merlot_timer_fn(unsigned long data)
+{
+ wdt_merlot_refresh();
+ if (!test_bit(1, &wdt_is_open))
+ mod_timer(&wdt_timer, jiffies + HZ);
+}
+
+static int wdt_merlot_setup_timer(void)
+{
+
+ init_timer(&wdt_timer);
+ wdt_timer.function = wdt_merlot_timer_fn;
+ wdt_timer.data = 0;
+ wdt_timer.expires = jiffies + HZ;
+ add_timer(&wdt_timer);
+ return 0;
+}
+
+static int wdt_open(struct inode *inode, struct file *file)
+{
+ if (test_and_set_bit(0, &wdt_is_open))
+ return -EBUSY;
+ set_bit(1, &wdt_is_open);
+ return nonseekable_open(inode, file);
+}
+
+static ssize_t wdt_write(struct file *file, const char __user * buf, size_t count, loff_t * ppos)
+{
+ if (count) /* something was written */
+ wdt_merlot_refresh();
+ return count;
+}
+
+static int wdt_release(struct inode *inode, struct file *file)
+{
+ clear_bit(0, &wdt_is_open);
+ return 0;
+}
+
+static struct file_operations wdt_fops = {
+ .owner = THIS_MODULE,
+ .llseek = no_llseek,
+ .write = wdt_write,
+ .open = wdt_open,
+ .release = wdt_release,
+};
+
+static struct miscdevice wdt_miscdev = {
+ .minor = WATCHDOG_MINOR,
+ .name = "watchdog",
+ .fops = &wdt_fops,
+};
+
+static void __exit wdt_exit(void)
+{
+ misc_deregister(&wdt_miscdev);
+}
+
+static int __init wdt_init(void)
+{
+ int ret;
+ ret = misc_register(&wdt_miscdev);
+ if (ret) {
+ printk(KERN_ERR
+ "wdt: cannot register miscdev on minor=%d (err=%d)\n",
+ WATCHDOG_MINOR, ret);
+ misc_deregister(&wdt_miscdev);
+ goto out;
+ }
+ printk("wdt: registered with refresh\n");
+ wdt_merlot_refresh();
+ wdt_merlot_setup_timer();
+ out:
+ return ret;
+}
+
+module_init(wdt_init);
+module_exit(wdt_exit);
diff -Nur linux-2.6.15.3/drivers/char/watchdog/Makefile linux-2.6.15.3-openwrt/drivers/char/watchdog/Makefile
--- linux-2.6.15.3/drivers/char/watchdog/Makefile 2006-02-22 10:04:18.596278000 -0800
+++ linux-2.6.15.3-openwrt/drivers/char/watchdog/Makefile 2006-02-22 10:06:21.400960000 -0800
@@ -71,5 +71,8 @@
# SPARC64 Architecture
+# Aruba Architecture
+obj-$(CONFIG_MACH_ARUBA) += wdt_merlot.o
+
# Architecture Independant
obj-$(CONFIG_SOFT_WATCHDOG) += softdog.o

View File

@@ -1,8 +1,8 @@
include $(TOPDIR)/rules.mk
LINUX_VERSION:=2.6.16.4
LINUX_VERSION:=2.6.16.7
LINUX_RELEASE:=1
LINUX_KERNEL_MD5SUM:=cb675279c9711237a06ebb8379a4da27
LINUX_KERNEL_MD5SUM:=9682b2bd6e02f3087982d7c3f5ba824e
include ../rules.mk
include ./config
@@ -17,9 +17,10 @@ $(LINUX_DIR)/.patched: $(LINUX_DIR)/.unpacked
@$(CP) config $(LINUX_DIR)/.config
touch $@
$(LINUX_BUILD_DIR)/bzImage: $(LINUX_DIR)/vmlinux
$(MAKE) -C $(LINUX_DIR) V=1 CROSS_COMPILE=$(TARGET_CROSS) ARCH=$(LINUX_KARCH) PATH=$(TARGET_PATH) bzImage
$(CP) $(LINUX_DIR)/vmlinux $@
$(LINUX_BUILD_DIR)/zImage.flash.srec: $(LINUX_DIR)/arch/mips/boot/compressed/images/zImage.flash.srec $(LINUX_DIR)/arch/mips/boot/compressed/images/zImage.srec
$(MAKE) -C $(LINUX_DIR) V=1 CROSS_COMPILE=$(TARGET_CROSS) ARCH=$(LINUX_KARCH) PATH=$(TARGET_PATH) zImage.flash
$(CP) $(LINUX_DIR)/arch/mips/boot/compressed/images/zImage.flash.srec $(LINUX_DIR)/zImage.flash.srec
$(CP) $(LINUX_DIR)/arch/mips/boot/compressed/images/zImage.srec $(LINUX_DIR)/zImage.srec
touch $@
compile: $(LINUX_DIR)/vmlinux

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,16 @@
diff -urN linux-2.6.16.7/drivers/mtd/maps/alchemy-flash.c linux-2.6.16.7.new/drivers/mtd/maps/alchemy-flash.c
--- linux-2.6.16.7/drivers/mtd/maps/alchemy-flash.c 2006-04-17 23:53:25.000000000 +0200
+++ linux-2.6.16.7.new/drivers/mtd/maps/alchemy-flash.c 2006-04-20 19:16:26.000000000 +0200
@@ -105,6 +105,12 @@
#define USE_LOCAL_ACCESSORS /* why? */
#endif
+#ifdef CONFIG_MIPS_MTX1
+#define BOARD_MAP_NAME "MTX-1 Flash"
+#define BOARD_FLASH_SIZE 0x04000000 /* 64MB */
+#define BOARD_FLASH_WIDTH 4 /* 32-bits */
+#endif
+
static struct map_info alchemy_map = {
.name = BOARD_MAP_NAME,
};

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,279 @@
diff -urN linux-2.6.16.7/drivers/char/watchdog/Kconfig linux-2.6.16.7.new/drivers/char/watchdog/Kconfig
--- linux-2.6.16.7/drivers/char/watchdog/Kconfig 2006-04-17 23:53:25.000000000 +0200
+++ linux-2.6.16.7.new/drivers/char/watchdog/Kconfig 2006-04-22 23:23:53.000000000 +0200
@@ -460,6 +460,14 @@
timer expired and no process has written to /dev/watchdog during
that time.
+config MTX1_WATCHDOG
+ tristate "MTX-1 Hardware Watchdog"
+ depends on WATCHDOG && MIPS_MTX1
+ help
+ Hardware driver for the AccessCube MTX-1 watchdog. This is a
+ watchdog timer that will reboot the machine after a 100 seconds
+ timer expired.
+
# S390 Architecture
config ZVM_WATCHDOG
diff -urN linux-2.6.16.7/drivers/char/watchdog/Makefile linux-2.6.16.7.new/drivers/char/watchdog/Makefile
--- linux-2.6.16.7/drivers/char/watchdog/Makefile 2006-04-17 23:53:25.000000000 +0200
+++ linux-2.6.16.7.new/drivers/char/watchdog/Makefile 2006-04-22 23:21:18.000000000 +0200
@@ -65,6 +65,7 @@
# MIPS Architecture
obj-$(CONFIG_INDYDOG) += indydog.o
+obj-$(CONFIG_MTX1_WATCHDOG) += mtx-1_watchdog.o
# S390 Architecture
diff -urN linux-2.6.16.7/drivers/char/watchdog/mtx-1_watchdog.c linux-2.6.16.7.new/drivers/char/watchdog/mtx-1_watchdog.c
--- linux-2.6.16.7/drivers/char/watchdog/mtx-1_watchdog.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.16.7.new/drivers/char/watchdog/mtx-1_watchdog.c 2006-04-22 23:20:53.000000000 +0200
@@ -0,0 +1,246 @@
+/*
+ * Driver for the MTX-1 Watchdog.
+ *
+ * (c) Copyright 2005 4G Systems <info@4g-systems.biz>, All Rights Reserved.
+ * http://www.4g-systems.biz
+ *
+ * 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.
+ *
+ * Neither Michael Stickel nor 4G Systems admit liability nor provide
+ * warranty for any of this software. This material is provided
+ * "AS-IS" and at no charge.
+ *
+ * (c) Copyright 2005 4G Systems <info@4g-systems.biz>
+ *
+ * Release 0.01.
+ *
+ * Author: Michael Stickel michael.stickel@4g-systems.biz
+ *
+ *
+ * The Watchdog is configured to reset the MTX-1
+ * if it is not triggered for 100 seconds.
+ * It should not be triggered more often than 1.6 seconds.
+ *
+ * A timer triggers the watchdog every 5 seconds, until
+ * it is opened for the first time. After the first open
+ * it MUST be triggered every 2..95 seconds.
+ */
+#include <linux/config.h>
+#include <linux/module.h>
+#include <linux/version.h>
+#include <linux/types.h>
+#include <linux/errno.h>
+#include <linux/kernel.h>
+#include <linux/sched.h>
+#include <linux/miscdevice.h>
+#include <linux/watchdog.h>
+#include <linux/slab.h>
+#include <linux/init.h>
+#include <asm/uaccess.h>
+#include <linux/fs.h>
+
+#include <asm/mach-au1x00/au1000.h>
+
+#ifndef FALSE
+# define FALSE (0)
+#endif
+
+#ifndef TRUE
+# define TRUE (!FALSE)
+#endif
+
+
+//---------[ Hardware Functions ]-----------------
+
+static void mtx1_trigger_wd (void)
+{
+ /*
+ * toggle GPIO2_15
+ */
+
+ u32 tmp = au_readl(GPIO2_DIR);
+ tmp = (tmp & ~(1<<15)) | ((~tmp) & (1<<15));
+ au_writel (tmp, GPIO2_DIR);
+}
+
+static void mtx1_enable_wd (void)
+{
+ au_writel (au_readl(GPIO2_DIR) | (u32)(1<<15), GPIO2_DIR);
+}
+
+static void mtx1_disable_wd (void)
+{
+ au_writel (au_readl(GPIO2_DIR) & ~((u32)(1<<15)), GPIO2_DIR);
+}
+
+
+//---------[ Timer Functions ]-----------------
+
+static struct timer_list wd_trigger_timer;
+static char timer_is_running = FALSE;
+
+static void wd_timer_callback (unsigned long data)
+{
+ if (timer_is_running)
+ mod_timer (&wd_trigger_timer, jiffies + 5 * HZ);
+ mtx1_trigger_wd();
+}
+
+static void start_wd_timer (void)
+{
+ if (!timer_is_running) {
+ struct timer_list *t = &wd_trigger_timer;
+
+ init_timer (t);
+ t->function = wd_timer_callback;
+ t->data = (unsigned long)0L;
+ t->expires = jiffies + 5 * HZ; // 5 seconds.
+ add_timer (t);
+ timer_is_running = TRUE;
+ }
+}
+
+
+
+static void stop_wd_timer (void)
+{
+ if (timer_is_running) {
+ del_timer(&wd_trigger_timer);
+ timer_is_running = FALSE;
+ }
+}
+
+
+//---------[ File Functions ]-----------------
+
+static char restart_after_close;
+
+static int mtx1wd_open (struct inode *inode, struct file *file)
+{
+ if (MINOR(inode->i_rdev) != WATCHDOG_MINOR) return -ENODEV;
+ //MOD_INC_USE_COUNT;
+
+ // stop the timer, if it is running. It will not be
+ // started again, until the module is loaded again.
+ stop_wd_timer();
+
+ // sleep for 2 seconds, to ensure, that the wd is
+ // not triggered more often than every 2 seconds.
+ schedule_timeout (2 * HZ);
+
+ return 0;
+}
+
+
+static int mtx1wd_release (struct inode *inode, struct file *file) {
+ if (MINOR(inode->i_rdev)==WATCHDOG_MINOR) {
+ }
+ if (restart_after_close)
+ start_wd_timer();
+ //MOD_DEC_USE_COUNT;
+ return 0;
+}
+
+
+static ssize_t mtx1wd_write (struct file *file, const char *buf, size_t count, loff_t *ppos) {
+
+ mtx1_trigger_wd ();
+
+ if (count > 0) {
+ char buffer[10];
+ int n = (count>9)?9:count;
+
+ if (copy_from_user (&buffer, buf, n))
+ return -EFAULT;
+ buffer[n]=0;
+
+ if (count >= 4 && strncmp("auto", buffer, 4)==0)
+ restart_after_close = 1;
+
+ else if (count >= 6 && strncmp("manual", buffer, 6)==0)
+ restart_after_close = 0;
+
+ return n;
+ }
+
+ return 0;
+}
+
+static ssize_t mtx1wd_read (struct file *file, char *buf, size_t count, loff_t *ppos)
+{
+ char * state = restart_after_close ? "auto\n" : "manual\n";
+ int n = strlen(state)+1;
+
+ if (file->f_pos >= n)
+ return 0;
+
+ if (count < n)
+ return -EINVAL;
+
+ if(copy_to_user(buf, state, n))
+ return -EFAULT;
+
+ file->f_pos += n;
+
+ return n;
+}
+
+static struct file_operations mtx1wd_fops = {
+ .owner = THIS_MODULE,
+ .read = mtx1wd_read,
+ .write = mtx1wd_write,
+ .open = mtx1wd_open,
+ .release = mtx1wd_release
+};
+
+
+static struct miscdevice mtx1wd_miscdev = {
+ WATCHDOG_MINOR,
+ "watchdog",
+ &mtx1wd_fops
+};
+
+
+
+//---------[ Module Functions ]-----------------
+
+
+static int __init init_mtx1_watchdog(void)
+{
+ printk("MTX-1 watchdog driver\n");
+
+ misc_register(&mtx1wd_miscdev);
+
+ restart_after_close = 0;
+
+ mtx1_enable_wd ();
+
+ //-- trigger it for the first time.
+ //-- We do not exactly know how long it has not been triggered.
+ mtx1_trigger_wd ();
+
+ // start a timer, that calls mtx1_trigger_wd every 5 seconds.
+ start_wd_timer();
+
+ return 0;
+}
+
+static void __exit exit_mtx1_watchdog(void) {
+
+ // stop the timer, if it is running.
+ stop_wd_timer();
+
+ misc_deregister(&mtx1wd_miscdev);
+
+ mtx1_disable_wd();
+}
+
+module_init(init_mtx1_watchdog);
+module_exit(exit_mtx1_watchdog);
+
+MODULE_AUTHOR("Michael Stickel");
+MODULE_DESCRIPTION("Driver for the MTX-1 watchdog");
+MODULE_LICENSE("GPL");

View File

@@ -0,0 +1,24 @@
diff -urN linux-2.6.16.7/drivers/net/au1000_eth.c linux-2.6.16.7.new/drivers/net/au1000_eth.c
--- linux-2.6.16.7/drivers/net/au1000_eth.c 2006-04-17 23:53:25.000000000 +0200
+++ linux-2.6.16.7.new/drivers/net/au1000_eth.c 2006-04-23 01:42:48.000000000 +0200
@@ -12,6 +12,9 @@
* Author: MontaVista Software, Inc.
* ppopov@mvista.com or source@mvista.com
*
+ * Bjoern Riemer 2004
+ * riemer@fokus.fraunhofer.de or riemer@riemer-nt.de
+ * // fixed the link beat detection with ioctls (SIOCGMIIPHY)
* ########################################################################
*
* This program is free software; you can distribute it and/or modify it
@@ -1672,6 +1675,10 @@
aup->phy_ops->phy_status(dev, aup->phy_addr, &link, &speed);
control = MAC_DISABLE_RX_OWN | MAC_RX_ENABLE | MAC_TX_ENABLE;
#ifndef CONFIG_CPU_LITTLE_ENDIAN
+ /*riemer: fix for startup without cable */
+ if (!link)
+ dev->flags &= ~IFF_RUNNING;
+
control |= MAC_BIG_ENDIAN;
#endif
if (link && (dev->if_port == IF_PORT_100BASEFX)) {

View File

@@ -0,0 +1,241 @@
diff -urN linux-2.6.16.7/arch/mips/au1000/mtx-1/irqmap.c linux-2.6.16.7.new/arch/mips/au1000/mtx-1/irqmap.c
--- linux-2.6.16.7/arch/mips/au1000/mtx-1/irqmap.c 2006-04-17 23:53:25.000000000 +0200
+++ linux-2.6.16.7.new/arch/mips/au1000/mtx-1/irqmap.c 2006-04-23 11:54:31.000000000 +0200
@@ -64,6 +64,7 @@
{ AU1500_GPIO_202, INTC_INT_LOW_LEVEL, 0 },
{ AU1500_GPIO_203, INTC_INT_LOW_LEVEL, 0 },
{ AU1500_GPIO_205, INTC_INT_LOW_LEVEL, 0 },
+ { AU1500_GPIO_207, INTC_INT_RISE_AND_FALL_EDGE, 0 },
};
int au1xxx_nr_irqs = sizeof(au1xxx_irq_map)/sizeof(au1xxx_irq_map_t);
diff -urN linux-2.6.16.7/arch/mips/au1000/mtx-1/Makefile linux-2.6.16.7.new/arch/mips/au1000/mtx-1/Makefile
--- linux-2.6.16.7/arch/mips/au1000/mtx-1/Makefile 2006-04-17 23:53:25.000000000 +0200
+++ linux-2.6.16.7.new/arch/mips/au1000/mtx-1/Makefile 2006-04-23 14:01:36.000000000 +0200
@@ -8,3 +8,4 @@
#
lib-y := init.o board_setup.o irqmap.o
+obj-y := mtx-1_sysbtn.o
diff -urN linux-2.6.16.7/arch/mips/au1000/mtx-1/mtx-1_sysbtn.c linux-2.6.16.7.new/arch/mips/au1000/mtx-1/mtx-1_sysbtn.c
--- linux-2.6.16.7/arch/mips/au1000/mtx-1/mtx-1_sysbtn.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.16.7.new/arch/mips/au1000/mtx-1/mtx-1_sysbtn.c 2006-04-23 14:01:17.000000000 +0200
@@ -0,0 +1,218 @@
+/*
+ * Driver for the MTX-1 System Button.
+ *
+ * (c) Copyright 2005 4G Systems <info@4g-systems.biz>, All Rights Reserved.
+ * http://www.4g-systems.biz
+ *
+ * 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.
+ *
+ * Neither Michael Stickel nor 4G Systeme GmbH admit liability nor provide
+ * warranty for any of this software. This material is provided
+ * "AS-IS" and at no charge.
+ *
+ * (c) Copyright 2005 4G Systems <info@4g-systems.biz>
+ *
+ * Release 0.01.
+ *
+ * Author: Michael Stickel michael.stickel@4g-systems.biz
+ *
+ *
+ * After the module is loaded there is a device /dev/misc/btn
+ * that can be read. It returns one char '1' if the button
+ * has been pressed an '0' if it has been released.
+ */
+#include <linux/config.h>
+#include <linux/module.h>
+#include <linux/version.h>
+#include <linux/types.h>
+#include <linux/errno.h>
+#include <linux/kernel.h>
+#include <linux/poll.h>
+#include <linux/sched.h>
+#include <linux/miscdevice.h>
+#include <linux/slab.h>
+#include <linux/init.h>
+#include <linux/irq.h>
+#include <linux/interrupt.h>
+
+#include <asm/uaccess.h>
+
+#include <asm/mach-au1x00/au1000.h>
+
+
+#ifndef FALSE
+# define FALSE (0)
+#endif
+
+#ifndef TRUE
+# define TRUE (!FALSE)
+#endif
+
+
+//---------[ declarations ]-----------------
+
+
+static DECLARE_WAIT_QUEUE_HEAD(mtx1btn_wait_queue);
+static char state_changed;
+static char last_value;
+static char is_inuse;
+
+
+//---------[ Hardware Functions ]-----------------
+
+// The MTX-1 Button is attached to GPIO207.
+#define MTX1_GPIO2_SYSBTN (7)
+#define MTX1_SYSBTN_IRQ (AU1500_GPIO_207)
+
+
+static char mtx1_getbtn (int btnno)
+{
+ if (btnno==0) {
+ return (au_readl(GPIO2_PINSTATE) & (1<<MTX1_GPIO2_SYSBTN)) ? 0 : 1;
+ }
+ return 0;
+}
+
+static void mtx1_initbuttons (void)
+{
+ au_writel (au_readl(GPIO2_DIR) & ~(1<<MTX1_GPIO2_SYSBTN), GPIO2_DIR);
+}
+
+
+//---------[ Interrupt handling ]-----------------
+
+
+static void mtx1_btn_interrupt (int irq, void *private, struct pt_regs *regs)
+{
+ char value = mtx1_getbtn(0);
+ if (last_value != value)
+ {
+ last_value = value;
+ state_changed = 1;
+ wake_up (&mtx1btn_wait_queue);
+ }
+// kill_fasync(&async_queue, SIGIO, POLL_OUT);
+}
+
+
+static int mtx1_btn_startirq (void)
+{
+ if (!request_irq (MTX1_SYSBTN_IRQ, mtx1_btn_interrupt, 0 /* | SA_INTERRUPT */, "mtx1btn", (void *)&state_changed)) {
+ return 0;
+ }
+ return -1;
+}
+
+static int mtx1_btn_stopirq (void)
+{
+ free_irq(MTX1_SYSBTN_IRQ, (void *)&state_changed);
+ return 0;
+}
+
+
+
+//---------[ File Functions ]-----------------
+
+
+static int mtx1sysbtn_minor = -1;
+
+
+static int mtx1sysbtn_open (struct inode *inode, struct file *file)
+{
+ if (MINOR(inode->i_rdev)!=mtx1sysbtn_minor) return -ENODEV;
+ if (is_inuse) return -EBUSY;
+ is_inuse=1;
+ last_value = mtx1_getbtn(0);
+ state_changed = 0;
+ return 0;
+}
+
+
+static int mtx1sysbtn_release (struct inode *inode, struct file *file) {
+ if (MINOR(inode->i_rdev)==mtx1sysbtn_minor) {
+ is_inuse=0;
+ }
+ return 0;
+}
+
+
+static ssize_t mtx1sysbtn_read (struct file *file, char *buf, size_t count, loff_t *ppos)
+{
+ if (count < 1)
+ return -EINVAL;
+ if (!state_changed)
+ interruptible_sleep_on (&mtx1btn_wait_queue);
+ state_changed = 0;
+ char c = last_value ? '1' : '0'; /* mtx1_getbtn(0) */
+ if(copy_to_user(buf, &c, 1))
+ return -EFAULT;
+ return 1;
+}
+
+
+static unsigned int mtx1sysbtn_poll (struct file *file, poll_table * wait)
+{
+ unsigned int mask = 0;
+
+ poll_wait (file, &mtx1btn_wait_queue, wait);
+
+ if (state_changed) // state changed since last time.
+ mask |= POLLIN | POLLRDNORM;
+
+ return mask;
+}
+
+
+static struct file_operations mtx1sysbtn_fops = {
+ .owner = THIS_MODULE,
+ .read = mtx1sysbtn_read,
+ .poll = mtx1sysbtn_poll,
+ .open = mtx1sysbtn_open,
+ .release = mtx1sysbtn_release
+};
+
+
+static struct miscdevice mtx1sysbtn_miscdev = {
+ MISC_DYNAMIC_MINOR /* SYSBTN_MINOR */ ,
+ "btn",
+ &mtx1sysbtn_fops
+};
+
+
+
+//---------[ Module Functions ]-----------------
+
+
+void __exit exit_mtx1_sysbtn (void)
+{
+ is_inuse = 1;
+ mtx1_btn_stopirq ();
+ misc_deregister(&mtx1sysbtn_miscdev);
+}
+
+
+static int __init init_mtx1_sysbtn (void)
+{
+ printk("MTX-1 System Button driver\n");
+ is_inuse = 1;
+ mtx1_initbuttons ();
+ if (misc_register (&mtx1sysbtn_miscdev) >= 0) {
+ mtx1sysbtn_minor = mtx1sysbtn_miscdev.minor;
+ if (mtx1_btn_startirq () == 0) {
+ is_inuse=0;
+ return 0;
+ }
+ misc_deregister(&mtx1sysbtn_miscdev);
+ }
+ return 1;
+}
+
+module_init(init_mtx1_sysbtn);
+module_exit(exit_mtx1_sysbtn);
+
+MODULE_AUTHOR("Michael Stickel");
+MODULE_DESCRIPTION("Driver for the MTX-1 system button");
+MODULE_LICENSE("GPL");

View File

@@ -0,0 +1,13 @@
--- linux-2.6.16.7/arch/mips/au1000/mtx-1/board_setup.c 2006-04-17 23:53:25.000000000 +0200
+++ linux-2.6.16.7.new/arch/mips/au1000/mtx-1/board_setup.c 2006-04-23 14:35:42.000000000 +0200
@@ -71,9 +71,7 @@
#endif
// initialize sys_pinfunc:
- // disable second ethernet port (SYS_PF_NI2)
- // set U3/GPIO23 to GPIO23 (SYS_PF_U3)
- au_writel( SYS_PF_NI2 | SYS_PF_U3, SYS_PINFUNC );
+ au_writel( SYS_PF_NI2, SYS_PINFUNC );
// initialize GPIO
au_writel( 0xFFFFFFFF, SYS_TRIOUTCLR );

View File

@@ -0,0 +1,63 @@
diff -urN linux-2.6.16.7/arch/mips/au1000/mtx-1/board_setup.c linux-2.6.16.7.new/arch/mips/au1000/mtx-1/board_setup.c
--- linux-2.6.16.7/arch/mips/au1000/mtx-1/board_setup.c 2006-04-23 14:39:21.000000000 +0200
+++ linux-2.6.16.7.new/arch/mips/au1000/mtx-1/board_setup.c 2006-04-23 14:39:03.000000000 +0200
@@ -44,6 +44,9 @@
#include <asm/pgtable.h>
#include <asm/mach-au1x00/au1000.h>
+extern int (*board_pci_idsel)(unsigned int devsel, int assert);
+int mtx1_pci_idsel(unsigned int devsel, int assert);
+
void board_reset (void)
{
/* Hit BCSR.SYSTEM_CONTROL[SW_RST] */
@@ -77,11 +80,37 @@
au_writel( 0xFFFFFFFF, SYS_TRIOUTCLR );
au_writel( 0x00000001, SYS_OUTPUTCLR ); // set M66EN (PCI 66MHz) to OFF
au_writel( 0x00000008, SYS_OUTPUTSET ); // set PCI CLKRUN# to OFF
+ au_writel( 0x00000002, SYS_OUTPUTSET ); // set EXT_IO3 ON
au_writel( 0x00000020, SYS_OUTPUTCLR ); // set eth PHY TX_ER to OFF
// enable LED and set it to green
au_writel( au_readl(GPIO2_DIR) | 0x1800, GPIO2_DIR );
au_writel( 0x18000800, GPIO2_OUTPUT );
+ board_pci_idsel = mtx1_pci_idsel;
+
printk("4G Systems MTX-1 Board\n");
}
+
+int
+mtx1_pci_idsel(unsigned int devsel, int assert)
+{
+#define MTX_IDSEL_ONLY_0_AND_3 0
+#if MTX_IDSEL_ONLY_0_AND_3
+ if (devsel != 0 && devsel != 3) {
+ printk("*** not 0 or 3\n");
+ return 0;
+ }
+#endif
+
+ if (assert && devsel != 0) {
+ // supress signal to cardbus
+ au_writel( 0x00000002, SYS_OUTPUTCLR ); // set EXT_IO3 OFF
+ }
+ else {
+ au_writel( 0x00000002, SYS_OUTPUTSET ); // set EXT_IO3 ON
+ }
+ au_sync_udelay(1);
+ return 1;
+}
+
diff -urN linux-2.6.16.7/arch/mips/au1000/mtx-1/irqmap.c linux-2.6.16.7.new/arch/mips/au1000/mtx-1/irqmap.c
--- linux-2.6.16.7/arch/mips/au1000/mtx-1/irqmap.c 2006-04-23 14:40:54.000000000 +0200
+++ linux-2.6.16.7.new/arch/mips/au1000/mtx-1/irqmap.c 2006-04-23 14:40:12.000000000 +0200
@@ -48,7 +48,7 @@
#include <asm/mach-au1x00/au1000.h>
char irq_tab_alchemy[][5] __initdata = {
- [0] = { -1, INTA, INTB, INTX, INTX}, /* IDSEL 00 - AdapterA-Slot0 (top) */
+ [0] = { -1, INTA, INTA, INTX, INTX}, /* IDSEL 00 - AdapterA-Slot0 (top) */
[1] = { -1, INTB, INTA, INTX, INTX}, /* IDSEL 01 - AdapterA-Slot1 (bottom) */
[2] = { -1, INTC, INTD, INTX, INTX}, /* IDSEL 02 - AdapterB-Slot0 (top) */
[3] = { -1, INTD, INTC, INTX, INTX}, /* IDSEL 03 - AdapterB-Slot1 (bottom) */

View File

@@ -0,0 +1,15 @@
diff -Nur linux-cvs/arch/mips/kernel/head.S linux-aruba/arch/mips/kernel/head.S
--- linux-cvs/arch/mips/kernel/head.S 2004-12-23 00:21:39.000000000 -0800
+++ linux-aruba/arch/mips/kernel/head.S 2005-10-20 09:16:08.000000000 -0700
@@ -122,6 +122,10 @@
#endif
.endm
+
+ j kernel_entry
+ nop
+
/*
* Reserved space for exception handlers.
* Necessary for machines which link their kernels at KSEG0.

View File

@@ -6,13 +6,3 @@ config PACKAGE_KMOD_BRCM_WL
help
Proprietary driver for Broadcom Wireless chipsets
config PACKAGE_KMOD_BRCM_WL2
prompt "kmod-brcm-wl2..................... Broadcom Wireless Network Driver (new)"
tristate
depends LINUX_2_4_BRCM
default m
help
Proprietary driver for Broadcom Wireless chipsets
New version with Multi-BSS capability

View File

@@ -12,10 +12,6 @@ $(eval $(call KMOD_template,BRCM_WL,brcm-wl,\
$(MODULES_DIR)/kernel/drivers/net/wl/wl.o \
,CONFIG_WL,,20,wl))
$(eval $(call KMOD_template,BRCM_WL2,brcm-wl2,\
$(MODULES_DIR)/kernel/drivers/net/wl2/wl.o \
,CONFIG_WL,,20,wl))
$(eval $(call KMOD_template,LP,lp,\
$(MODULES_DIR)/kernel/drivers/parport/parport.o \
$(MODULES_DIR)/kernel/drivers/parport/parport_splink.o \
@@ -38,10 +34,10 @@ $(LINUX_DIR)/.patched: $(LINUX_DIR)/.unpacked
# Proprietary driver for BCM43xx
###############################################
LINUX_BINARY_DRIVER_SITE=http://openwrt.org/downloads/sources
LINUX_BINARY_DRIVER_SITE=http://downloads.openwrt.org/sources
# proprietary driver, extracted from Linksys GPL sourcetree WRT54GS 4.70.6
LINUX_BINARY_WL_DRIVER=kernel-binary-wl-0.6.tar.gz
LINUX_BINARY_WL_MD5SUM=4fc1d5b46bcb7a17d6d5dd31da9c8d7f
LINUX_BINARY_WL_DRIVER=kernel-binary-wl-0.7.tar.gz
LINUX_BINARY_WL_MD5SUM=ff50130914790cbae9b73a13513da5ee
$(DL_DIR)/$(LINUX_BINARY_WL_DRIVER):
$(SCRIPT_DIR)/download.pl $(DL_DIR) $(LINUX_BINARY_WL_DRIVER) $(LINUX_BINARY_WL_MD5SUM) $(LINUX_BINARY_DRIVER_SITE)
@@ -56,18 +52,15 @@ $(LINUX_DIR)/.drivers-unpacked: $(LINUX_DIR)/.unpacked
zcat $(DL_DIR)/$(LINUX_BINARY_WL_DRIVER) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
# copy binary wlan driver
mkdir -p $(LINUX_DIR)/drivers/net/wl
$(CP) $(BUILD_DIR)/kernel-binary-wl/old/*.o $(LINUX_DIR)/drivers/net/wl
$(CP) $(BUILD_DIR)/kernel-binary-wl/new/*.o $(LINUX_DIR)/drivers/net/wl2
$(CP) $(BUILD_DIR)/kernel-binary-wl/*.o $(LINUX_DIR)/drivers/net/wl
touch $@
$(LINUX_DIR)/.drivers-installed: $(LINUX_DIR)/.modules_done
mkdir -p $(LINUX_BUILD_DIR)/modules/lib/modules/2.4.32/kernel/drivers/net/wl
mkdir -p $(LINUX_BUILD_DIR)/modules/lib/modules/2.4.32/kernel/drivers/net/wl2
@-[ -f $(LINUX_BUILD_DIR)/modules/lib/modules/2.4.32/kernel/drivers/net/wl/wl.o ] || $(CP) $(LINUX_DIR)/drivers/net/wl/wl.o $(LINUX_BUILD_DIR)/modules/lib/modules/2.4.32/kernel/drivers/net/wl/
@-[ -f $(LINUX_BUILD_DIR)/modules/lib/modules/2.4.32/kernel/drivers/net/wl2/wl.o ] || $(CP) $(LINUX_DIR)/drivers/net/wl2/wl.o $(LINUX_BUILD_DIR)/modules/lib/modules/2.4.32/kernel/drivers/net/wl2/
touch $@
linux-dirclean: drivers-clean
drivers-clean:
rm -rf $(BUILD_DIR)/wl
rm -rf $(BUILD_DIR)/kernel-binary-wl

View File

@@ -833,7 +833,6 @@ CONFIG_NET_RADIO=y
# CONFIG_AIRO is not set
# CONFIG_HERMES is not set
CONFIG_WL=m
CONFIG_WL2=m
# CONFIG_PLX_HERMES is not set
# CONFIG_TMD_HERMES is not set
# CONFIG_PCI_HERMES is not set

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,119 @@
diff -urN linux.old/arch/mips/bcm947xx/pcibios.c linux.dev/arch/mips/bcm947xx/pcibios.c
--- linux.old/arch/mips/bcm947xx/pcibios.c 2006-04-07 21:20:59.000000000 +0200
+++ linux.dev/arch/mips/bcm947xx/pcibios.c 2006-04-08 03:17:59.000000000 +0200
@@ -157,6 +157,7 @@
static u32 pci_iobase = 0x100;
static u32 pci_membase = SB_PCI_DMA;
+static u32 pcmcia_membase = 0x40004000;
void __init
pcibios_fixup_bus(struct pci_bus *b)
@@ -188,7 +189,7 @@
/* Fix up resource bases */
for (pos = 0; pos < 6; pos++) {
res = &d->resource[pos];
- base = (res->flags & IORESOURCE_IO) ? &pci_iobase : &pci_membase;
+ base = (res->flags & IORESOURCE_IO) ? &pci_iobase : ((b->number == 2) ? &pcmcia_membase : &pci_membase);
if (res->end) {
size = res->end - res->start + 1;
if (*base & (size - 1))
@@ -308,7 +309,12 @@
where = PCI_BASE_ADDRESS_0 + (resource * 4);
size = res->end - res->start;
pci_read_config_dword(dev, where, &reg);
- reg = (reg & size) | (((u32)(res->start - root->start)) & ~size);
+
+ if (dev->bus->number == 1)
+ reg = (reg & size) | (((u32)(res->start - root->start)) & ~size);
+ else
+ reg = res->start;
+
pci_write_config_dword(dev, where, reg);
}
diff -urN linux.old/drivers/pcmcia/yenta.c linux.dev/drivers/pcmcia/yenta.c
--- linux.old/drivers/pcmcia/yenta.c 2004-11-17 12:54:21.000000000 +0100
+++ linux.dev/drivers/pcmcia/yenta.c 2006-04-11 17:47:45.000000000 +0200
@@ -543,6 +543,9 @@
* Probe for usable interrupts using the force
* register to generate bogus card status events.
*/
+
+#ifndef CONFIG_BCM947XX
+ /* WRT54G3G does not like this */
cb_writel(socket, CB_SOCKET_EVENT, -1);
cb_writel(socket, CB_SOCKET_MASK, CB_CSTSMASK);
exca_writeb(socket, I365_CSCINT, 0);
@@ -557,7 +560,8 @@
}
cb_writel(socket, CB_SOCKET_MASK, 0);
exca_writeb(socket, I365_CSCINT, 0);
-
+#endif
+
mask = probe_irq_mask(val) & 0xffff;
bridge_ctrl &= ~CB_BRIDGE_INTR;
@@ -578,6 +582,12 @@
socket->cap.cb_dev = socket->dev;
socket->cap.bus = NULL;
+#ifdef CONFIG_BCM947XX
+ /* irq mask probing is broken for the WRT54G3G */
+ if (socket->cap.irq_mask == 0)
+ socket->cap.irq_mask = 0x6f8;
+#endif
+
printk(KERN_INFO "Yenta ISA IRQ mask 0x%04x, PCI irq %d\n",
socket->cap.irq_mask, socket->cb_irq);
}
@@ -609,6 +619,15 @@
printk(KERN_INFO "Socket status: %08x\n",
cb_readl(socket, CB_SOCKET_STATE));
+ /* Generate an interrupt on card insert/remove */
+ config_writew(socket, CB_SOCKET_MASK, CB_CSTSMASK | CB_CDMASK);
+
+ /* Set up Multifunction Routing Status Register */
+ config_writew(socket, 0x8C, 0x1000 /* MFUNC3 to GPIO3 */ | 0x2 /* MFUNC0 to INTA */);
+
+ /* Switch interrupts to parallelized */
+ config_writeb(socket, 0x92, 0x64);
+
/* Register it with the pcmcia layer.. */
cardbus_register(socket);
@@ -731,7 +750,7 @@
{
struct pci_bus *bus;
struct resource *root, *res;
- u32 start, end;
+ u32 start = 0, end = 0;
u32 align, size, min, max;
unsigned offset;
unsigned mask;
@@ -750,6 +769,15 @@
res->end = 0;
root = pci_find_parent_resource(socket->dev, res);
+#ifdef CONFIG_BCM947XX
+ /* default mem resources are completely fscked up on the wrt54g3g */
+ /* bypass the entire resource allocation stuff below and just set it statically */
+ if (type & IORESOURCE_MEM) {
+ res->start = 0x40004000;
+ res->end = res->start + 0x3fff;
+ }
+
+#else
if (!root)
return;
@@ -794,6 +822,7 @@
res->start = res->end = 0;
return;
}
+#endif
config_writel(socket, offset, res->start);
config_writel(socket, offset+4, res->end);

View File

@@ -1,8 +1,8 @@
include $(TOPDIR)/rules.mk
LINUX_VERSION:=2.6.16.4
LINUX_VERSION:=2.6.16.7
LINUX_RELEASE:=1
LINUX_KERNEL_MD5SUM:=cb675279c9711237a06ebb8379a4da27
LINUX_KERNEL_MD5SUM:=9682b2bd6e02f3087982d7c3f5ba824e
include ../rules.mk
include ./config

View File

@@ -1,6 +1,4 @@
Package: kernel
Priority: optional
Section: sys
Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
Source: buildroot internal
Description: Virtual package for the Kernel

View File

@@ -1,6 +1,4 @@
Package: kmod-arptables
Priority: optional
Section: net
Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
Source: buildroot internal
Description: ARP firewalling kernel modules

View File

@@ -1,6 +1,4 @@
Package: kmod-atm
Priority: optional
Section: sys
Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
Source: buildroot internal
Description: ATM/ADSL support

View File

@@ -1,6 +1,4 @@
Package: kmod-ax25
Priority: optional
Section: net
Maintainer: Michael Conrad <openwrt@friggleware.net>
Source: buildroot internal
Description: Kernel AX25 driver

View File

@@ -1,6 +1,4 @@
Package: kmod-bluetooth
Priority: optional
Section: sys
Maintainer: Markus Becker <mab@comnets.uni-bremen.de>
Source: http://bluez.org
Description: Bluetooth support

View File

@@ -1,6 +1,4 @@
Package: kmod-brcm-et
Priority: optional
Section: sys
Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
Source: buildroot internal
Description: Proprietary driver for Broadcom Ethernet chipsets

View File

@@ -1,6 +1,4 @@
Package: kmod-brcm-wl
Priority: optional
Section: sys
Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
Source: buildroot internal
Description: Proprietary driver for Broadcom Wireless chipsets

View File

@@ -1,7 +1,5 @@
Package: kmod-brcm-wl2
Priority: optional
Section: sys
Maintainer: Felix Fietkau <nbd@openwrt.org>
Source: buildroot internal
Description: Proprietary driver for Broadcom Wireless chipsets
New version with multi-BSS support

View File

@@ -1,6 +1,4 @@
Package: kmod-cpmac
Priority: optional
Section: sys
Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
Source: buildroot internal
Description: AR7 CPMAC ethernet driver

View File

@@ -1,6 +1,4 @@
Package: kmod-crypto
Priority: optional
Section: sys
Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
Source: buildroot internal
Description: CryptoAPI kernel modules

View File

@@ -1,6 +1,4 @@
Package: kmod-ebtables
Priority: optional
Section: net
Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
Source: buildroot internal
Description: Ethernet bridge firewalling kernel modules

View File

@@ -1,6 +1,4 @@
Package: kmod-gre
Priority: optional
Section: sys
Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
Source: buildroot internal
Description: Kernel GRE tunneling support

View File

@@ -1,6 +1,4 @@
Package: kmod-ide
Priority: optional
Section: sys
Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
Source: buildroot internal
Description: Kernel modules IDE support

View File

@@ -1,6 +1,4 @@
Package: kmod-ip6tables
Priority: optional
Section: net
Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
Source: buildroot internal
Description: Kernel modules for ip6tables

View File

@@ -0,0 +1,4 @@
Package: kmod-ipip
Section: sys
Priority: optional
Description: IP in IP encapsulation support

View File

@@ -1,6 +1,4 @@
Package: kmod-iptables-extra
Priority: optional
Section: net
Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
Source: buildroot internal
Description: Extra kernel modules for iptables

View File

@@ -1,6 +1,4 @@
Package: kmod-iptables
Priority: optional
Section: net
Maintainer: OpenWrt Development Team <bugs@openwrt.org>
Source: buildroot internal
Description: kernel modules for iptables

View File

@@ -1,6 +1,4 @@
Package: kmod-ipv6
Priority: optional
Section: net
Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
Source: buildroot internal
Description: Kernel modules for the IPv6 protocol

View File

@@ -1,6 +1,4 @@
Package: kmod-loop
Priority: optional
Section: sys
Maintainer: Waldemar Brodkorb <wbx@dass-it.de>
Source: buildroot internal
Description: Kernel module for mount loopback support

View File

@@ -1,6 +1,4 @@
Package: kmod-lp
Priority: optional
Section: sys
Maintainer: Waldemar Brodkorb <wbx@dass-it.de>
Source: buildroot internal
Description: Kernel modules for parallel port support and line printer

View File

@@ -1,6 +1,4 @@
Package: kmod-mppe
Priority: optional
Section: net
Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
Source: buildroot internal
Description: Microsoft PPP Encryption/Compression support

View File

@@ -1,6 +1,4 @@
Package: kmod-nbd
Priority: optional
Section: sys
Maintainer: Waldemar Brodkorb <wbx@dass-it.de>
Source: buildroot internal
Description: Kernel module for network block device

View File

@@ -1,6 +1,4 @@
Package: kmod-nls-base
Priority: optional
Section: sys
Maintainer: Waldemar Brodkorb <wbx@openwrt.org>
Source: buildroot internal
Description: Kernel modules for basic native language support

View File

@@ -1,6 +1,4 @@
Package: kmod-nls-cp437
Priority: optional
Section: sys
Maintainer: Waldemar Brodkorb <wbx@openwrt.org>
Source: buildroot internal
Description: Kernel module for codepage 437

View File

@@ -1,6 +1,4 @@
Package: kmod-nls-cp850
Priority: optional
Section: sys
Maintainer: Waldemar Brodkorb <wbx@openwrt.org>
Source: buildroot internal
Description: Kernel module for codepage 850

View File

@@ -1,6 +1,4 @@
Package: kmod-nls-iso8859-1
Priority: optional
Section: sys
Maintainer: Waldemar Brodkorb <wbx@openwrt.org>
Source: buildroot internal
Description: Kernel module for iso8859-1 charset support

View File

@@ -1,6 +1,4 @@
Package: kmod-nls-iso8859-15
Priority: optional
Section: sys
Maintainer: Waldemar Brodkorb <wbx@openwrt.org>
Source: buildroot internal
Description: Kernel module for iso8859-15 charset support

View File

@@ -1,6 +1,4 @@
Package: kmod-nls-utf8
Priority: optional
Section: sys
Maintainer: Waldemar Brodkorb <wbx@openwrt.org>
Source: buildroot internal
Description: Kernel module for utf8 support

View File

@@ -1,6 +1,4 @@
Package: kmod-ppp
Priority: optional
Section: net
Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
Source: buildroot internal
Description: PPP support

View File

@@ -1,6 +1,4 @@
Package: kmod-pppoatm
Priority: optional
Section: net
Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
Source: buildroot internal
Description: PPP over ATM support

View File

@@ -1,6 +1,4 @@
Package: kmod-pppoe
Priority: optional
Section: net
Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
Source: buildroot internal
Description: PPP over Ethernet support

View File

@@ -1,6 +1,4 @@
Package: kmod-pwc
Priority: optional
Section: sys
Maintainer: Nicolas Thill <nico@openwrt.org>
Source: http://openwrt.org/cgi-bin/viewcvs.cgi/openwrt/target/linux/linux-2.4/
Description: Kernel driver for USB Philips Cameras

View File

@@ -1,6 +1,4 @@
Package: kmod-sangam-atm-annex-a
Priority: optional
Section: sys
Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
Source: buildroot internal
Description: AR7 Sangam ATM/ADSL driver (Annex A version)

View File

@@ -1,6 +1,4 @@
Package: kmod-sangam-atm-annex-b
Priority: optional
Section: sys
Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
Source: buildroot internal
Description: AR7 Sangam ATM/ADSL driver (Annex B version)

View File

@@ -1,6 +1,4 @@
Package: kmod-sched
Priority: optional
Section: sys
Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
Source: buildroot internal
Description: Kernel schedulers for IP traffic

View File

@@ -1,6 +1,4 @@
Package: kmod-softdog
Priority: optional
Section: sys
Maintainer: OpenWrt Developers Team <openwrt-devel@openwrt.org>
Source: buildroot internal
Description: Kernel software watchdog driver

View File

@@ -1,6 +1,4 @@
Package: kmod-soundcore
Priority: optional
Section: sys
Maintainer: OpenWrt Developers Team <openwrt-devel@openwrt.org>, David Collett <daveco@users.sourceforge.net>
Source: buildroot internal
Description: Kernel support for audio soundcards

View File

@@ -1,6 +1,4 @@
Package: kmod-tun
Priority: optional
Section: sys
Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
Source: buildroot internal
Description: Kernel TUN/TAP extension

View File

@@ -1,6 +1,4 @@
Package: kmod-usb-acm
Priority: optional
Section: sys
Maintainer: Waldemar Brodkorb <wbx@openwrt.org>
Source: buildroot internal
Description: Kernel modules for USB modems and ISDN

View File

@@ -1,6 +1,4 @@
Package: kmod-usb-atm-speedtouch
Priority: optional
Section: sys
Maintainer: Jonathan McDowell <noodles@earth.li>
Source: buildroot internal
Description: Kernel driver for USB Speedtouch ADSL modem

View File

@@ -1,7 +1,5 @@
Package: kmod-usb-audio
Priority: optional
Section: sys
Maintainer: David Collett <daveco@users.sourceforge.net>
Source: buildroot internal
Depends: kmod-soundcore
Description: Kernel Support for USB Soundcards

View File

@@ -1,6 +1,4 @@
Package: kmod-usb-core
Priority: optional
Section: sys
Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
Source: buildroot internal
Description: Kernel Support for USB

View File

@@ -1,6 +1,4 @@
Package: kmod-usb-ohci
Priority: optional
Section: sys
Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
Source: buildroot internal
Description: Kernel driver for OHCI USB controllers

View File

@@ -1,6 +1,4 @@
Package: kmod-usb-printer
Priority: optional
Section: sys
Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
Source: buildroot internal
Description: Kernel modules for USB Printer support

View File

@@ -1,6 +1,4 @@
Package: kmod-usb-serial-belkin
Priority: optional
Section: sys
Maintainer: OpenWrt Developers Team <openwrt-devel@openwrt.org>
Source: buildroot internal
Description: Kernel Support for Belkin USB-to-Serial converters

View File

@@ -1,6 +1,4 @@
Package: kmod-usb-serial-ftdi
Priority: optional
Section: sys
Maintainer: OpenWrt Developers Team <openwrt-devel@openwrt.org>
Source: buildroot internal
Description: Kernel Support for FTDI USB-to-Serial converters

View File

@@ -1,6 +1,4 @@
Package: kmod-usb-serial-mct-u232
Priority: optional
Section: sys
Maintainer: OpenWrt Developers Team <openwrt-devel@openwrt.org>
Source: buildroot internal
Description: Kernel Support for Magic Control Technology USB-to-Serial converters

View File

@@ -1,6 +1,4 @@
Package: kmod-usb-serial-pl2303
Priority: optional
Section: sys
Maintainer: OpenWrt Developers Team <openwrt-devel@openwrt.org>
Source: buildroot internal
Description: Kernel Support for Prolific PL2303 USB-to-Serial converters

View File

@@ -1,7 +1,4 @@
Package: kmod-usb-serial-visor
Priority: optional
Section: sys
Maintainer: OpenWrt Developers Team <openwrt-devel@openwrt.org>
Source: buildroot internal
Description: Kernel Support for Handspring Visor / Palm m50x / Sony Clie
Driver
Description: Kernel Support for Handspring Visor / Palm m50x / Sony Clie Driver

View File

@@ -1,6 +1,4 @@
Package: kmod-usb-serial
Priority: optional
Section: sys
Maintainer: OpenWrt Developers Team <openwrt-devel@openwrt.org>
Source: buildroot internal
Description: Kernel Support for USB-to-Serial converters

View File

@@ -1,6 +1,4 @@
Package: kmod-usb-storage
Priority: optional
Section: sys
Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
Source: buildroot internal
Description: Kernel modules for USB storage support

View File

@@ -1,6 +1,4 @@
Package: kmod-usb-uhci
Priority: optional
Section: sys
Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
Source: buildroot internal
Description: Kernel driver for UHCI USB controllers

View File

@@ -1,6 +1,4 @@
Package: kmod-usb2
Priority: optional
Section: sys
Maintainer: Felix Fietkau <nbd@vd-s.ath.cx>
Source: buildroot internal
Description: Kernel driver for USB2 controllers

View File

@@ -1,6 +1,4 @@
Package: kmod-videodev
Priority: optional
Section: sys
Maintainer: Nicolas Thill <nico@openwrt.org>
Source: http://openwrt.org/cgi-bin/viewcvs.cgi/openwrt/target/linux/linux-2.4/
Description: Video For Linux kernel support

View File

@@ -1,6 +1,4 @@
Package: kmod-wd1100
Priority: optional
Section: sys
Maintainer: OpenWrt Developers Team <bugs@openwrt.org>
Source: http://openwrt.org/cgi-bin/viewcvs.cgi/openwrt/target/linux/
Description: NatSemi SC1x00 series Watchdog kernel support

View File

@@ -12,9 +12,12 @@ $(eval $(call KMOD_template,GRE,gre,\
,CONFIG_NET_IPGRE))
$(eval $(call KMOD_template,IMQ,imq,\
$(MODULES_DIR)/kernel/net/*/netfilter/*IMQ*.o \
$(MODULES_DIR)/kernel/net/ipv4/netfilter/*IMQ*.o \
$(MODULES_DIR)/kernel/drivers/net/imq.o \
))
$(eval $(call KMOD_template,IPIP,ipip,\
$(MODULES_DIR)/kernel/net/ipv4/ipip.o \
,CONFIG_NET_IPIP,,60,ipip))
$(eval $(call KMOD_template,IPV6,ipv6,\
$(MODULES_DIR)/kernel/net/ipv6/ipv6.o \
@@ -39,12 +42,9 @@ $(eval $(call KMOD_template,PPPOE,pppoe,\
$(MODULES_DIR)/kernel/drivers/net/pppoe.o \
,CONFIG_PPPOE))
ifneq ($(wildcard $(MODULES_DIR)/kernel/net/sched/*.o),)
CONFIG_SCHED:=m
endif
$(eval $(call KMOD_template,SCHED,sched,\
$(MODULES_DIR)/kernel/net/sched/*.o \
,CONFIG_SCHED))
))
$(eval $(call KMOD_template,TUN,tun,\
$(MODULES_DIR)/kernel/drivers/net/tun.o \

View File

@@ -14,10 +14,14 @@ $(eval $(call KMOD_template,GRE,gre,\
,CONFIG_NET_IPGRE))
$(eval $(call KMOD_template,IMQ,imq,\
$(MODULES_DIR)/kernel/net/*/netfilter/*IMQ*.ko \
$(MODULES_DIR)/kernel/net/ipv4/netfilter/*IMQ*.ko \
$(MODULES_DIR)/kernel/drivers/net/imq.ko \
))
$(eval $(call KMOD_template,IPIP,ipip,\
$(MODULES_DIR)/kernel/net/ipv4/ipip.ko \
,CONFIG_NET_IPIP,,60,ipip))
$(eval $(call KMOD_template,IPV6,ipv6,\
$(MODULES_DIR)/kernel/net/ipv6/ipv6.ko \
,CONFIG_IPV6,,20,ipv6))

View File

@@ -179,7 +179,19 @@ diff -Nur linux-2.6.15.1/lib/Makefile linux-2.6.15.1-openwrt/lib/Makefile
sha1.o
lib-y += kobject.o kref.o kobject_uevent.o klist.o
+lib-y += ashldi3.o ashrdi3.o lshrdi3.o
+obj-y += ashldi3.o ashrdi3.o lshrdi3.o
obj-y += sort.o parser.o halfmd4.o
diff -Nur linux-2.6.15.1/include/asm-arm/libgcc.h linux-2.6.15.1-openwrt/include/asm-arm/libgcc.h
--- linux-2.6.15.1/include/asm-arm/libgcc.h 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.15.1-openwrt/include/asm-arm/libgcc.h 2006-04-12 23:01:18.000000000 +0200
@@ -0,0 +1,8 @@
+#ifndef __ASM_LIBGCC_H
+#define __ASM_LIBGCC_H
+
+#undef ARCH_NEEDS_ashldi3
+#undef ARCH_NEEDS_ashrdi3
+#undef ARCH_NEEDS_lshrdi3
+
+#endif /* __ASM_LIBGCC_H */

View File

@@ -1,18 +1,43 @@
include $(TOPDIR)/rules.mk
LOADADDR = 0x8108c8f4 # RAM start + 16M
KERNEL_ENTRY = 0x80100000 # Default kernel entry in arch/mips/Makefile
RAMSIZE = 0x04000000 # 64MB
LOADER_MAKEOPTS= \
KDIR=$(KDIR) \
LOADADDR=$(LOADADDR) \
KERNEL_ENTRY=$(KERNEL_ENTRY) \
RAMSIZE=$(RAMSIZE)
KDIR:=$(BUILD_DIR)/linux-$(KERNEL)-$(BOARD)
lzma-loader-clean:
$(MAKE) -C ../generic/lzma-loader $(LOADER_MAKEOPTS) clean
lzma-loader-prepare:
$(MAKE) -C ../generic/lzma-loader $(LOADER_MAKEOPTS) prepare
lzma-loader-compile: $(KDIR)/vmlinux.lzma lzma-loader-prepare
$(MAKE) -C ../generic/lzma-loader $(LOADER_MAKEOPTS) compile
ifeq ($(IB),)
$(KDIR)/vmlinux.lzma: $(KDIR)/vmlinux
cat $^ | $(STAGING_DIR)/bin/lzma e -si -so -eos -lc1 -lp2 -pb2 > $@ || (rm -f $@ && false)
install: $(KDIR)/vmlinux.lzma
endif
ifeq ($(FS),jffs2-8MB)
$(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FS).img: $(KDIR)/root.$(FS)
$(CP) $^ $@
install: $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FS).img
$(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FSNAME).bin: $(KDIR)/root.$(FS)
$(TARGET_CROSS)objcopy -O srec -I binary --adjust-vma 0xbe000000 $(KDIR)/root.$(FS) $(KDIR)/root.srec
grep -v S7 $(KDIR)/root.srec > $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FS).img
grep -v S0 $(LINUX_DIR)/arch/mips/boot/compressed/images/zImage.flash.srec >> $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FS).img
install: $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FSNAME).bin
endif
ifeq ($(FS),tgz)
$(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-rootfs.tar.gz: $(KDIR)/root.tar.gz
@@ -22,15 +47,30 @@ install: $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-rootfs.tar.gz
endif
ifeq ($(FS),squashfs)
$(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FSNAME).bin: $(KDIR)/root.$(FS)
$(TARGET_CROSS)objcopy -O srec -I binary --adjust-vma 0xbe000000 $(KDIR)/root.$(FS) $(KDIR)/root.srec
grep -v S7 $(KDIR)/root.srec > $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FS).img
grep -v S0 $(LINUX_DIR)/arch/mips/boot/compressed/images/zImage.flash.srec >> $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FS).img
$(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-vmlinuz: $(KDIR)/vmlinux
endif
$(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-vmlinuz: $(KDIR)/zImage.flash
$(CP) $^ $@
ifeq ($(IB),)
clean: lzma-loader-clean
prepare: lzma-loader-prepare
compile: lzma-loader-compile
else
clean:
prepare:
compile:
install: $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-vmlinuz
endif
install-ib:
mkdir -p $(IB_DIR)/staging_dir_$(ARCH)/bin
mkdir -p $(IB_DIR)/build_$(ARCH)/linux-$(KERNEL)-$(BOARD)
$(CP) $(KDIR)/bzImage $(IB_DIR)/build_$(ARCH)/linux-$(KERNEL)-$(BOARD)/
$(CP) $(KDIR)/loader.elf $(IB_DIR)/build_$(ARCH)/
$(CP) $(KDIR)/vmlinux.lzma $(IB_DIR)/build_$(ARCH)/linux-$(KERNEL)-$(BOARD)/
$(TARGET_CROSS)objcopy -O srec -I binary --adjust-vma 0xbe000000 $(KDIR)/loader.elf $(KDIR)/loader.srec
grep -v S0 $(KDIR)/loader.srec > $(KDIR)/kernel.srec

View File

@@ -1,4 +1,4 @@
ifneq ($(CONFIG_mips),y)
ifneq ($(CONFIG_BIG_ENDIAN),y)
JFFS2OPTS := --pad --little-endian --squash
else
JFFS2OPTS := --pad --big-endian --squash

View File

@@ -1,7 +1,7 @@
ifneq ($(CONFIG_BIG_ENDIAN),y)
endian := le
ifeq ($(ARCH),mips)
endian := be
else
endian := be
endif
squashfs-prepare:

View File

@@ -0,0 +1,36 @@
include $(TOPDIR)/rules.mk
KDIR:=$(BUILD_DIR)/linux-$(KERNEL)-$(BOARD)
ifeq ($(FS),jffs2-8MB)
$(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FS).img: $(KDIR)/root.$(FS)
$(CP) $^ $@
install: $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FS).img
endif
ifeq ($(FS),tgz)
$(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-rootfs.tar.gz: $(KDIR)/root.tar.gz
$(CP) $^ $@
install: $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-rootfs.tar.gz
endif
$(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-vmlinuz: $(KDIR)/vmlinux
$(CP) $^ $@
clean:
prepare:
compile:
install: $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-vmlinuz
install-ib:
mkdir -p $(IB_DIR)/build_$(ARCH)/linux-$(KERNEL)-$(BOARD)
$(CP) $(KDIR)/bzImage $(IB_DIR)/build_$(ARCH)/linux-$(KERNEL)-$(BOARD)/

View File

@@ -103,8 +103,10 @@ mostlyclean:
rebuild:
-$(MAKE) mostlyclean
@[ -f $(LINUX_KERNEL) ] && $(MAKE) clean
$(MAKE) compile
if [ -f $(LINUX_KERNEL) ]; then \
$(MAKE) clean; \
fi
$(MAKE) compile $(MAKE_TRACE)
clean:
rm -f $(STAMP_DIR)/.linux-compile

View File

@@ -6,8 +6,6 @@ package-y += base-files
package-$(CONFIG_PACKAGE_KMOD_ALSA) += alsa
package-$(CONFIG_PACKAGE_KMOD_FUSE) += fuse
package-$(CONFIG_PACKAGE_KMOD_HOSTAP) += hostap
package-$(CONFIG_PACKAGE_KMOD_BCM43XX_STANDALONE) += bcm43xx-standalone
package-$(CONFIG_PACKAGE_KMOD_IEEE80211_DSCAPE) += ieee80211-dscape
package-$(CONFIG_PACKAGE_KMOD_MADWIFI) += madwifi
package-$(CONFIG_PACKAGE_KMOD_MADWIFI_OLD) += madwifi-old
package-$(CONFIG_PACKAGE_KMOD_MINI_FO) += mini_fo
@@ -20,7 +18,6 @@ package-$(CONFIG_PACKAGE_KMOD_DIAG) += diag
package-$(CONFIG_PACKAGE_KMOD_WLCOMPAT) += wlcompat
package-$(CONFIG_PACKAGE_KMOD_ZD1211) += zd1211
bcm43xx-standalone-compile: ieee80211-dscape-compile
wlcompat-compile: base-files-compile
all: compile install

View File

@@ -0,0 +1,23 @@
#!/bin/sh
size=$(awk '/Mem:/ {l=5242880;print((s=$2/2)<l)?$2-l:s}' /proc/meminfo)
mount none /tmp -t tmpfs -o size=$size
if [ "$1" != "failsafe" ]; then
mtd unlock filesystem
mount | grep jffs2 >&-
if [ $? = 0 ] ; then
if [ $(cat /proc/mtd | wc -l) = 6 ]; then
mtd erase filesystem
jffs2root --move
else
mount -o remount,rw /dev/root /
fi
else
. /bin/firstboot
fi
fi
mount none /tmp -t tmpfs -o remount,nosuid,nodev,mode=1777
mkdir -p /dev/pts
mount none /dev/pts -t devpts
mount -t sysfs none /sys 2>&-

View File

@@ -1,5 +1,5 @@
#!/bin/sh
setup_eth()
setup_wl()
{
[ -f /proc/net/wl0 ] && {
lsmod | grep wlcompat >&- || insmod wlcompat
@@ -7,6 +7,9 @@ setup_eth()
iwconfig "$INTERFACE" 2>&- | grep -v 'no wireless' >&- && {
/sbin/wifi
}
}
setup_eth()
{
[ -d /proc/switch ] || {
insmod switch-core
insmod switch-robo || insmod switch-adm
@@ -30,6 +33,7 @@ do_register()
{
case "${INTERFACE%%[0-9]*}" in
eth) setup_eth;;
wl) setup_wl;;
esac
}

View File

@@ -0,0 +1,12 @@
# Network configuration file
## LAN configuration
lan_ifname="br0"
lan_ifnames="eth0 ath0"
lan_proto="static"
lan_ipaddr="192.168.1.1"
lan_netmask="255.255.255.0"
## WAN configuration
wan_ifname=""
wan_proto="none"

View File

@@ -0,0 +1,3 @@
::sysinit:/etc/init.d/rcS
duart/0::askfirst:/bin/ash --login
#tts/1::askfirst:/bin/ash --login

View File

@@ -0,0 +1,6 @@
#!/bin/ash
mount none /dev -t devfs
mount none /proc -t proc
mount_root failsafe
mount -o remount,rw /dev/root /
exec /bin/busybox init

View File

@@ -0,0 +1,5 @@
# Network configuration file
## LAN configuration
lan_ifname="eth0"
lan_proto="dhcp"

View File

@@ -0,0 +1,4 @@
#!/bin/sh
mount none /proc -t proc
mount_root failsafe
mount -o remount,rw /dev/root /

View File

@@ -0,0 +1,3 @@
#!/bin/ash
mount none /dev -t devfs
exec /bin/busybox init

View File

@@ -1,12 +0,0 @@
config PACKAGE_KMOD_BCM43XX_STANDALONE
prompt "kmod-bcm43xx-standalone............... Free Broadcom 43xx wireless driver (devicescape stack)"
tristate
depends LINUX_2_6_BRCM
select PACKAGE_KMOD_IEEE80211_DSCAPE
default n
help
Free driver for the Broadcom 43xx wireless chipset
This driver uses the DeviceScape 802.11 stack
http://bcm43xx.berlios.de

View File

@@ -1,57 +0,0 @@
# $Id$
include $(TOPDIR)/rules.mk
include ../../rules.mk
PKG_NAME := bcm43xx-standalone
PKG_VERSION := 060313
PKG_RELEASE := 1
PKG_MD%SUM := 773b26a164a54f0da544764969ca019b
PKG_SOURCE_URL := ftp://bu3sch.de/bcm43xx-snapshots/standalone/bcm43xx/
PKG_SOURCE := $(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_CAT := bzcat
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
FIRMWARE_BLOB := wl_apsta-3.130.20.0.o
FIRMWARE_BLOB_URL := http://downloads.openwrt.org/sources
FIRMWARE_BLOB_MD5SUM := e08665c5c5b66beb9c3b2dd54aa80cb3
include $(TOPDIR)/package/rules.mk
$(eval $(call PKG_template,KMOD_BCM43XX_DSCAPE,kmod-$(PKG_NAME),$(LINUX_VERSION)-$(BOARD)+0.$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH),kernel ($(LINUX_VERSION)-$(BOARD)-$(LINUX_RELEASE))))
$(PKG_BUILD_DIR)/.configured:
touch $@
$(PKG_BUILD_DIR)/fwcutter/.built:
mkdir -p $(PKG_BUILD_DIR)/fwcutter
$(CP) ./fwcutter/* $(PKG_BUILD_DIR)/fwcutter/
$(SCRIPT_DIR)/download.pl "$(PKG_BUILD_DIR)/fwcutter" "$(FIRMWARE_BLOB)" "$(FIRMWARE_BLOB_MD5SUM)" $(FIRMWARE_BLOB_URL)
$(MAKE) -C $(PKG_BUILD_DIR)/fwcutter
$(PKG_BUILD_DIR)/fwcutter/fwcutter -w $(PKG_BUILD_DIR)/fwcutter $(PKG_BUILD_DIR)/fwcutter/$(FIRMWARE_BLOB)
touch $@
$(PKG_BUILD_DIR)/.built: $(PKG_BUILD_DIR)/fwcutter/.built
$(MAKE) -C "$(LINUX_DIR)" \
CROSS_COMPILE="$(TARGET_CROSS)" \
ARCH="$(LINUX_KARCH)" \
PATH="$(TARGET_PATH)" \
SUBDIRS="$(PKG_BUILD_DIR)" \
LINUXINCLUDE="-I$(STAGING_DIR)/usr/include/ieee80211-dscape -I$(LINUX_DIR)/include -DBCM47XX=1" \
modules
touch $@
$(IPKG_KMOD_BCM43XX_DSCAPE):
install -m0755 -d $(IDIR_KMOD_BCM43XX_DSCAPE)/lib/modules/$(LINUX_VERSION)
install -m0755 -d $(IDIR_KMOD_BCM43XX_DSCAPE)/etc/modules.d
( \
echo 80211; \
echo rate_control; \
echo bcm43xx; \
) >& $(IDIR_KMOD_BCM43XX_DSCAPE)/etc/modules.d/50-bcm43xx
$(CP) $(PKG_BUILD_DIR)/*.ko $(IDIR_KMOD_BCM43XX_DSCAPE)/lib/modules/$(LINUX_VERSION)
install -m0755 -d $(IDIR_KMOD_BCM43XX_DSCAPE)/lib/firmware
$(CP) $(PKG_BUILD_DIR)/fwcutter/*.fw $(IDIR_KMOD_BCM43XX_DSCAPE)/lib/firmware/
$(IPKG_BUILD) $(IDIR_KMOD_BCM43XX_DSCAPE) $(PACKAGE_DIR)

View File

@@ -1,32 +0,0 @@
VERSION = 0.0.1
FIRMWARE_INSTALL_DIR ?= /lib/firmware
CC = cc
PREFIX = /usr/local
CFLAGS = -std=c99 -O2 -fomit-frame-pointer -Wall -pedantic -D_BSD_SOURCE
LDFLAGS =
OBJECTS = fwcutter.o md5.o
CFLAGS += -DFWCUTTER_VERSION_=$(VERSION)
all: fwcutter
fwcutter: $(OBJECTS)
$(CC) $(CFLAGS) -o fwcutter $(OBJECTS) $(LDFLAGS)
install: all
-install -o 0 -g 0 -m 755 fwcutter $(PREFIX)/bin/
clean:
-rm -f *~ *.o *.orig *.rej *.fw fwcutter
installfw:
-if ! [ -d $(FIRMWARE_INSTALL_DIR) ]; then mkdir $(FIRMWARE_INSTALL_DIR); fi
-install -o 0 -g 0 -m 600 bcm43xx_*.fw $(FIRMWARE_INSTALL_DIR)
# dependencies
fwcutter.o: md5.h fwcutter_list.h
md5.o: md5.h

View File

@@ -1,562 +0,0 @@
/*
* firmware cutter for broadcom 43xx wireless driver files
*
* Copyright (c) 2005 Martin Langer <martin-langer@gmx.de>,
* 2005 Michael Buesch <mbuesch@freenet.de>
* 2005 Alex Beregszaszi
*
* 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; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <stdio.h>
typedef unsigned char byte;
#define DRIVER_UNSUPPORTED 0x01 /* no support for this driver file */
#define BYTE_ORDER_BIG_ENDIAN 0x02 /* ppc driver files */
#define BYTE_ORDER_LITTLE_ENDIAN 0x04 /* x86, mips driver files */
#define MISSING_INITVAL_08 0x10 /* initval 8 is missing */
#define MISSING_INITVAL_80211_A 0x20 /* initvals 3,7,9,10 (802.11a cards) are empty */
#define FIRMWARE_UCODE_OFFSET 100
#define FIRMWARE_UNDEFINED 0
#define FIRMWARE_PCM_4 4
#define FIRMWARE_PCM_5 5
#define FIRMWARE_UCODE_2 (FIRMWARE_UCODE_OFFSET + 2)
#define FIRMWARE_UCODE_4 (FIRMWARE_UCODE_OFFSET + 4)
#define FIRMWARE_UCODE_5 (FIRMWARE_UCODE_OFFSET + 5)
#define FIRMWARE_UCODE_11 (FIRMWARE_UCODE_OFFSET + 11)
#define fwcutter_stringify_1(x) #x
#define fwcutter_stringify(x) fwcutter_stringify_1(x)
#define FWCUTTER_VERSION fwcutter_stringify(FWCUTTER_VERSION_)
#include "md5.h"
#include "fwcutter_list.h"
struct cmdline_args {
const char *infile;
const char *postfix;
const char *target_dir;
int identify_only;
};
static struct cmdline_args cmdargs;
int big_endian_cpu;
static void write_little_endian(FILE *f, byte *buffer, int len)
{
byte swapbuf[4];
while (len > 0) {
swapbuf[0] = buffer[3]; swapbuf[1] = buffer[2];
swapbuf[2] = buffer[1]; swapbuf[3] = buffer[0];
fwrite(swapbuf, 4, 1, f);
buffer = buffer + 4;
len = len - 4;
}
}
static void write_big_endian(FILE *f, byte *buffer, int len)
{
while (len > 0) {
fwrite(buffer, 4, 1, f);
buffer = buffer + 4;
len = len - 4;
}
}
static void write_fw(const char *outfilename, uint8_t flags, byte *data, int len)
{
FILE* fw;
char outfile[2048];
snprintf(outfile, sizeof(outfile),
"%s/%s", cmdargs.target_dir, outfilename);
fw = fopen(outfile, "w");
if (!fw) {
perror(outfile);
exit(1);
}
if (flags & BYTE_ORDER_LITTLE_ENDIAN)
write_little_endian(fw, data, len);
else if (flags & BYTE_ORDER_BIG_ENDIAN)
write_big_endian(fw, data, len);
else
printf("unknown byteorder...\n");
fflush(fw);
fclose(fw);
}
static void write_iv(uint8_t flags, byte *data)
{
FILE* fw;
char ivfilename[2048];
int i;
for (i = 1; i <= 10; i++) {
if ((flags & MISSING_INITVAL_08) && (i==8)) {
printf("*****: Sorry, initval08 is not available in driver file \"%s\".\n", cmdargs.infile);
printf("*****: Extracting firmware from an old driver is bad. Choose a more recent one.\n");
printf("*****: Luckily bcm43xx driver doesn't include initval08 uploads at the moment.\n");
printf("*****: But this can be added in the future...\n");
i++;
}
snprintf(ivfilename, sizeof(ivfilename),
"%s/bcm43xx_initval%02d%s.fw",
cmdargs.target_dir, i, cmdargs.postfix);
fw = fopen(ivfilename, "w");
if (!fw) {
perror(ivfilename);
exit(1);
}
printf("extracting bcm43xx_initval%02d%s.fw ...\n", i, cmdargs.postfix);
while (1) {
if ((data[0]==0xff) && (data[1]==0xff) && (data[2]==0x00) && (data[3]==0x00)) {
data = data + 8;
break;
}
if (flags & BYTE_ORDER_LITTLE_ENDIAN)
fprintf(fw, "%c%c%c%c%c%c%c%c",
data[1], data[0], /* offset */
data[3], data[2], /* size */
data[7], data[6], data[5], data[4]); /* value */
else if (flags & BYTE_ORDER_BIG_ENDIAN)
fprintf(fw, "%c%c%c%c%c%c%c%c",
data[0], data[1], /* offset */
data[2], data[3], /* size */
data[4], data[5], data[6], data[7]); /* value */
else {
printf("unknown byteorder...\n");
exit(1);
}
data = data + 8;
}
fflush(fw);
fclose(fw);
}
}
static byte* read_file(const char* filename)
{
FILE* file;
long len;
byte* data;
file = fopen(filename, "rb");
if (!file) {
perror(filename);
exit(1);
}
if (fseek(file, 0, SEEK_END)) {
perror("cannot seek");
exit(1);
}
len = ftell(file);
fseek(file, 0, SEEK_SET);
data = malloc(len);
if (!data) {
fputs("out of memory\n", stderr);
exit(1);
}
if (fread(data, 1, len, file) != len) {
perror("cannot read");
exit(1);
}
fclose(file);
return data;
}
static void extract_fw(uint8_t fwtype, uint8_t flags, uint32_t pos, uint32_t length)
{
byte* filedata;
char outfile[1024];
switch (fwtype) {
case FIRMWARE_UCODE_2:
case FIRMWARE_UCODE_4:
case FIRMWARE_UCODE_5:
case FIRMWARE_UCODE_11:
snprintf(outfile, sizeof(outfile), "bcm43xx_microcode%i%s.fw",
fwtype - FIRMWARE_UCODE_OFFSET, cmdargs.postfix);
break;
case FIRMWARE_PCM_4:
case FIRMWARE_PCM_5:
snprintf(outfile, sizeof(outfile), "bcm43xx_pcm%i%s.fw",
fwtype, cmdargs.postfix);
break;
default:
snprintf(outfile, sizeof(outfile), "bcm43xx_unknown.fw");
}
if (length > 0) {
printf("extracting %s ...\n", outfile);
filedata = read_file(cmdargs.infile);
write_fw(outfile, flags, filedata + pos, length);
free(filedata);
} else {
printf("*****: Sorry, it's not posible to extract \"%s\".\n", outfile);
printf("*****: Extracting firmware from an old driver is bad. Choose a more recent one.\n");
switch (fwtype) {
case FIRMWARE_UCODE_2:
printf("*****: bcm43xx driver will not work with with core revision 2.\n");
break;
case FIRMWARE_UCODE_4:
printf("*****: bcm43xx driver will not work with with core revision 4.\n");
break;
case FIRMWARE_UCODE_5:
printf("*****: bcm43xx driver will not work with with core revision 5 or higher.\n");
break;
case FIRMWARE_UCODE_11:
printf("*****: Luckily bcm43xx driver doesn't include microcode11 uploads at the moment.\n");
printf("*****: But this can be added in the future...\n");
break;
case FIRMWARE_PCM_4:
printf("*****: bcm43xx driver will not work with with core revision 4 or smaller.\n");
break;
case FIRMWARE_PCM_5:
printf("*****: bcm43xx driver will not work with with core revision 5 or higher.\n");
break;
}
}
}
static void extract_iv(uint8_t flags, uint32_t pos)
{
byte* filedata;
if (pos > 0) {
filedata = read_file(cmdargs.infile);
write_iv(flags, filedata + pos);
free(filedata);
}
}
static void print_banner(void)
{
printf("fwcutter " FWCUTTER_VERSION "\n");
}
static void print_file(const struct file *file)
{
printf("%s\t", file->name);
if (strlen(file->name) < 8)
printf("\t");
printf("%s\t", file->version);
if (strlen(file->version) < 8)
printf("\t");
if (strlen(file->version) < 16)
printf("\t");
if (!(file->flags & DRIVER_UNSUPPORTED)) {
if (file->flags & MISSING_INITVAL_80211_A)
printf("b/g ");
else
printf("a/b/g");
}
printf(" %s", file->md5);
printf("\n");
}
static void print_supported_files(void)
{
int i;
print_banner();
printf("\nExtracting firmware is possible from these binary driver files:\n\n");
printf("<filename>\t<version>\t <802.11><MD5 checksum>\n\n");
for (i = 0; i < FILES; i++) {
if (files[i].flags & DRIVER_UNSUPPORTED)
continue;
print_file(&files[i]);
}
printf("\n\nExtracting firmware is IMPOSSIBLE from these binary driver files:\n\n");
printf("<filename>\t<version>\t <MD5 checksum>\n\n");
for (i = 0; i < FILES; i++) {
if (!(files[i].flags & DRIVER_UNSUPPORTED))
continue;
print_file(&files[i]);
}
}
static const struct file * find_file(FILE *fd)
{
unsigned char buffer[16384], signature[16];
struct MD5Context md5c;
char md5sig[33];
int i;
MD5Init(&md5c);
while ((i = (int) fread(buffer, 1, sizeof(buffer), fd)) > 0)
MD5Update(&md5c, buffer, (unsigned) i);
MD5Final(signature, &md5c);
snprintf(md5sig, sizeof(md5sig),
"%.2x%.2x%.2x%.2x%.2x%.2x%.2x%.2x%.2x%.2x%.2x%.2x%.2x%.2x%.2x%.2x",
signature[0], signature[1], signature[2], signature[3],
signature[4], signature[5], signature[6], signature[7],
signature[8], signature[9], signature[10], signature[11],
signature[12], signature[13], signature[14], signature[15]);
for (i = 0; i < FILES; ++i) {
if (strcasecmp(md5sig, files[i].md5) == 0) {
if (files[i].flags & DRIVER_UNSUPPORTED) {
printf("Extracting firmware from this file is IMPOSSIBLE. (too old)\n");
return 0;
}
printf("fwcutter can cut the firmware out of %s\n", cmdargs.infile);
printf(" filename : %s\n", files[i].name);
printf(" version : %s\n", files[i].version);
printf(" MD5 : %s\n\n", files[i].md5);
if (files[i].flags & MISSING_INITVAL_80211_A) {
printf("WARNING! This firmware doesn't include support for 802.11a cards.\n");
printf("WARNING! Use this firmware only for 802.11b/g cards.\n\n");
}
return &(files[i]);
}
}
printf("Sorry, the input file is either wrong or not supported by fwcutter.\n");
printf("I can't find the MD5sum %s :(\n", md5sig);
return 0;
}
static void get_endianess(void)
{
const unsigned char x[] = { 0xde, 0xad, 0xbe, 0xef, };
const uint32_t *p = (uint32_t *)x;
if (*p == 0xdeadbeef) {
big_endian_cpu = 1;
} else if (*p == 0xefbeadde) {
big_endian_cpu = 0;
} else {
printf("Confused: NUXI endian machine??\n");
exit(-1);
}
}
static void print_usage(int argc, char *argv[])
{
print_banner();
printf("\nUsage: %s [OPTION] [driver.sys]\n", argv[0]);
printf(" -l|--list List supported driver versions\n");
printf(" -i|--identify Only identify the driver file (don't extract)\n");
printf(" -w|--target-dir DIR Extract and write firmware to DIR\n");
printf(" -p|--postfix \".FOO\" Postfix for firmware filenames (.FOO.fw)\n");
printf(" -v|--version Print fwcutter version\n");
printf(" -h|--help Print this help\n");
printf("\nExample: %s bcmwl5.sys\n"
" to extract the firmware blobs from bcmwl5.sys\n", argv[0]);
}
#define ARG_MATCH 0
#define ARG_NOMATCH 1
#define ARG_ERROR -1
static int do_cmp_arg(char **argv, int *pos,
const char *template,
int allow_merged,
char **param)
{
char *arg;
char *next_arg;
size_t arg_len, template_len;
arg = argv[*pos];
next_arg = argv[*pos + 1];
arg_len = strlen(arg);
template_len = strlen(template);
if (param) {
/* Maybe we have a merged parameter here.
* A merged parameter is "-pfoobar" for example.
*/
if (allow_merged && arg_len > template_len) {
if (memcmp(arg, template, template_len) == 0) {
*param = arg + template_len;
return ARG_MATCH;
}
return ARG_NOMATCH;
} else if (arg_len != template_len)
return ARG_NOMATCH;
*param = next_arg;
}
if (strcmp(arg, template) == 0) {
if (param) {
/* Skip the parameter on the next iteration. */
(*pos)++;
if (*param == 0) {
printf("%s needs a parameter\n", arg);
return ARG_ERROR;
}
}
return ARG_MATCH;
}
return ARG_NOMATCH;
}
/* Simple and lean command line argument parsing. */
static int cmp_arg(char **argv, int *pos,
const char *long_template,
const char *short_template,
char **param)
{
int err;
if (long_template) {
err = do_cmp_arg(argv, pos, long_template, 0, param);
if (err == ARG_MATCH || err == ARG_ERROR)
return err;
}
err = ARG_NOMATCH;
if (short_template)
err = do_cmp_arg(argv, pos, short_template, 1, param);
return err;
}
static int parse_args(int argc, char *argv[])
{
int i, res;
char *param;
if (argc < 2)
goto out_usage;
for (i = 1; i < argc; i++) {
res = cmp_arg(argv, &i, "--list", "-l", 0);
if (res == ARG_MATCH) {
print_supported_files();
return 1;
} else if (res == ARG_ERROR)
goto out;
res = cmp_arg(argv, &i, "--version", "-v", 0);
if (res == ARG_MATCH) {
print_banner();
return 1;
} else if (res == ARG_ERROR)
goto out;
res = cmp_arg(argv, &i, "--help", "-h", 0);
if (res == ARG_MATCH)
goto out_usage;
else if (res == ARG_ERROR)
goto out;
res = cmp_arg(argv, &i, "--identify", "-i", 0);
if (res == ARG_MATCH) {
cmdargs.identify_only = 1;
continue;
} else if (res == ARG_ERROR)
goto out;
res = cmp_arg(argv, &i, "--target-dir", "-w", &param);
if (res == ARG_MATCH) {
cmdargs.target_dir = param;
continue;
} else if (res == ARG_ERROR)
goto out;
res = cmp_arg(argv, &i, "--postfix", "-p", &param);
if (res == ARG_MATCH) {
cmdargs.postfix = param;
continue;
} else if (res == ARG_ERROR)
goto out;
cmdargs.infile = argv[i];
break;
}
if (!cmdargs.infile)
goto out_usage;
return 0;
out_usage:
print_usage(argc, argv);
out:
return -1;
}
int main(int argc, char *argv[])
{
FILE *fd;
const struct file *file;
int err;
get_endianess();
cmdargs.target_dir = ".";
cmdargs.postfix = "";
err = parse_args(argc, argv);
if (err == 1)
return 0;
else if (err != 0)
return err;
fd = fopen(cmdargs.infile, "rb");
if (!fd) {
fprintf(stderr, "Cannot open input file %s\n", cmdargs.infile);
return 2;
}
err = -1;
file = find_file(fd);
if (!file)
goto out_close;
if (cmdargs.identify_only) {
err = 0;
goto out_close;
}
extract_fw(FIRMWARE_UCODE_2, file->flags, file->uc2_pos, file->uc2_length);
extract_fw(FIRMWARE_UCODE_4, file->flags, file->uc4_pos, file->uc4_length);
extract_fw(FIRMWARE_UCODE_5, file->flags, file->uc5_pos, file->uc5_length);
extract_fw(FIRMWARE_UCODE_11, file->flags, file->uc11_pos, file->uc11_length);
extract_fw(FIRMWARE_PCM_4, file->flags, file->pcm4_pos, file->pcm4_length);
extract_fw(FIRMWARE_PCM_5, file->flags, file->pcm5_pos, file->pcm5_length);
extract_iv(file->flags, file->iv_pos);
err = 0;
out_close:
fclose(fd);
return err;
}

View File

@@ -1,810 +0,0 @@
static const struct file {
const char *name;
const char *version;
const char *md5;
const uint8_t flags;
const uint32_t iv_pos;
const uint32_t uc2_pos;
const uint32_t uc2_length;
const uint32_t uc4_pos;
const uint32_t uc4_length;
const uint32_t uc5_pos;
const uint32_t uc5_length;
const uint32_t uc11_pos;
const uint32_t uc11_length;
const uint32_t pcm4_pos;
const uint32_t pcm4_length;
const uint32_t pcm5_pos;
const uint32_t pcm5_length;
} files[] =
{
{
.name = "AppleAirPort2",
.version = "3.30.15.p3 (3.1.1b2)",
.md5 = "a8275cc50107a13b5be15d067b2245a0",
.flags = BYTE_ORDER_BIG_ENDIAN |
MISSING_INITVAL_08,
.iv_pos = 0x42550,
.uc2_pos = 0x45630, .uc2_length = 0x3d88,
.uc4_pos = 0x493bc, .uc4_length = 0x44a0,
.uc5_pos = 0x4d860, .uc5_length = 0x4ec0,
.pcm4_pos = 0x52724, .pcm4_length = 0x478,
.pcm5_pos = 0x52ba0, .pcm5_length = 0x478,
},
{
.name = "AppleAirPort2",
.version = "3.30.15.p3 (3.1.2b3)",
.md5 = "55134c1298abaa85f190331f016d4d36",
.flags = BYTE_ORDER_BIG_ENDIAN |
MISSING_INITVAL_08,
.iv_pos = 0x42c24,
.uc2_pos = 0x45d04, .uc2_length = 0x3d88,
.uc4_pos = 0x49a90, .uc4_length = 0x44a0,
.uc5_pos = 0x4df34, .uc5_length = 0x4ec0,
.pcm4_pos = 0x52df8, .pcm4_length = 0x478,
.pcm5_pos = 0x53274, .pcm5_length = 0x478,
},
{
.name = "AppleAirPort2",
.version = "3.30.15.p7 (3.2)",
.md5 = "e74e8d2df2e4eb97e28602f3b2dd4647",
.flags = BYTE_ORDER_BIG_ENDIAN |
MISSING_INITVAL_08,
.iv_pos = 0x40efc,
.uc2_pos = 0x43fdc, .uc2_length = 0x3d88,
.uc4_pos = 0x47d68, .uc4_length = 0x44a0,
.uc5_pos = 0x4c20c, .uc5_length = 0x4ec0,
.pcm4_pos = 0x510d0, .pcm4_length = 0x478,
.pcm5_pos = 0x5154c, .pcm5_length = 0x478,
},
{
.name = "AppleAirPort2",
.version = "3.30.15.p8 (3.3b1)", /* 01/19/2004 */
.md5 = "87c74c55d2501d2e968f8c132e160b6e",
.flags = BYTE_ORDER_BIG_ENDIAN,
.iv_pos = 0x41c8c,
.uc2_pos = 0x43fe4, .uc2_length = 0x3d88,
.uc4_pos = 0x47d70, .uc4_length = 0x44b2,
.uc5_pos = 0x4c214, .uc5_length = 0x4ec0,
.pcm4_pos = 0x510d8, .pcm4_length = 0x478,
.pcm5_pos = 0x51554, .pcm5_length = 0x478,
},
{
.name = "AppleAirPort2",
.version = "3.50.37.p4 (3.4.2b1)",
.md5 = "1739c357ade1d04c9be47e8604afb1c2",
.flags = BYTE_ORDER_BIG_ENDIAN,
.iv_pos = 0x4f2b8,
.uc2_pos = 0x52da0, .uc2_length = 0x3d30,
.uc4_pos = 0x56ad4, .uc4_length = 0x45c8,
.uc5_pos = 0x5b0a0, .uc5_length = 0x5500,
.pcm4_pos = 0x605a4, .pcm4_length = 0x478,
.pcm5_pos = 0x60a20, .pcm5_length = 0x478,
},
{
.name = "AppleAirPort2",
.version = "3.50.37.p4 (3.4.3f1)", /* 09/29/2004 */
.md5 = "c672b8c218c5dc4a55060bdfa9f58a69",
.flags = BYTE_ORDER_BIG_ENDIAN |
MISSING_INITVAL_08,
.iv_pos = 0x4f378,
.uc2_pos = 0x52e60, .uc2_length = 0x3d30,
.uc4_pos = 0x56b94, .uc4_length = 0x45c8,
.uc5_pos = 0x5b160, .uc5_length = 0x5500,
.pcm4_pos = 0x60664, .pcm4_length = 0x478,
.pcm5_pos = 0x60ae0, .pcm5_length = 0x478,
},
{
.name = "AppleAirPort2",
.version = "3.50.37.p4 (3.4.4f5)",
.md5 = "2c388e3e8ea9310a58cf76a3757e8ccc",
.flags = BYTE_ORDER_BIG_ENDIAN,
.iv_pos = 0x4f5f0,
.uc2_pos = 0x530d8, .uc2_length = 0x3d30,
.uc4_pos = 0x56e0c, .uc4_length = 0x45c8,
.uc5_pos = 0x5b3d8, .uc5_length = 0x5500,
.pcm4_pos = 0x608dc, .pcm4_length = 0x478,
.pcm5_pos = 0x60d58, .pcm5_length = 0x478,
},
{
.name = "AppleAirPort2",
.version = "3.50.37.p4 (3.4.4f5)",
.md5 = "3860545266b554d2955664db55452f5a",
.flags = BYTE_ORDER_BIG_ENDIAN,
.iv_pos = 0x4f5f0,
.uc2_pos = 0x530d8, .uc2_length = 0x3d30,
.uc4_pos = 0x56e0c, .uc4_length = 0x45c8,
.uc5_pos = 0x5b3d8, .uc5_length = 0x5500,
.pcm4_pos = 0x608dc, .pcm4_length = 0x478,
.pcm5_pos = 0x60d58, .pcm5_length = 0x478,
},
{
.name = "AppleAirPort2",
.version = "3.50.37.p6 (3.5f1)",
.md5 = "a62e35ee9956b286c46b145d35bd6e0c",
.flags = BYTE_ORDER_BIG_ENDIAN,
.iv_pos = 0x4f9b8,
.uc2_pos = 0x534a0, .uc2_length = 0x3d30,
.uc4_pos = 0x571d4, .uc4_length = 0x45c8,
.uc5_pos = 0x5b7a0, .uc5_length = 0x5500,
.pcm4_pos = 0x60ca4, .pcm4_length = 0x478,
.pcm5_pos = 0x61120, .pcm5_length = 0x478,
},
{
.name = "AppleAirPort2",
.version = "3.50.37.p6 (3.5f1)",
.md5 = "b6f3d2437c40277c197f0afcf12208e9",
.flags = BYTE_ORDER_BIG_ENDIAN,
.iv_pos = 0x4f9b8,
.uc2_pos = 0x534a0, .uc2_length = 0x3d30,
.uc4_pos = 0x571d4, .uc4_length = 0x45c8,
.uc5_pos = 0x5b7a0, .uc5_length = 0x5500,
.pcm4_pos = 0x60ca4, .pcm4_length = 0x478,
.pcm5_pos = 0x61120, .pcm5_length = 0x478,
},
{
.name = "AppleAirPort2",
.version = "3.90.34.0.p11 (400.17)", /* 09/13/2005 (??) */
.md5 = "ca0f34df2f0bfb8b5cfd83b5848d2bf5",
.flags = BYTE_ORDER_BIG_ENDIAN |
MISSING_INITVAL_80211_A,
.iv_pos = 0x4ff2c, /* A-PHY init vals empty */
.uc2_pos = 0x5181c, .uc2_length = 0x3f48,
.uc4_pos = 0x55764, .uc4_length = 0x4df0,
.uc5_pos = 0x5a554, .uc5_length = 0x57e0,
.pcm4_pos = 0x5fd34, .pcm4_length = 0x520,
.pcm5_pos = 0x60254, .pcm5_length = 0x520,
},
{
.name = "AppleAirPort2",
.version = "3.90.34.0.p11 (400.17)",
.md5 = "dc3a69aac95c68fe8edc760e39bbb2c9",
.flags = BYTE_ORDER_BIG_ENDIAN |
MISSING_INITVAL_80211_A,
.iv_pos = 0x50efc, /* A-PHY init vals empty */
.uc2_pos = 0x527ec, .uc2_length = 0x3f48,
.uc4_pos = 0x56734, .uc4_length = 0x4df0,
.uc5_pos = 0x5b524, .uc5_length = 0x57e0,
.pcm4_pos = 0x60d04, .pcm4_length = 0x520,
.pcm5_pos = 0x61224, .pcm5_length = 0x520,
},
{
.name = "AppleAirPort2",
.version = "3.90.34.0.p13 (401.2)", /* 07/10/2005 */
.md5 = "6ecf38e5ab6997c7ec483c0d637f5c68",
.flags = BYTE_ORDER_BIG_ENDIAN |
MISSING_INITVAL_80211_A,
.iv_pos = 0x50fcc, /* A-PHY init vals empty */
.uc2_pos = 0x528bc, .uc2_length = 0x3f48,
.uc4_pos = 0x56804, .uc4_length = 0x4df0,
.uc5_pos = 0x5b5f4, .uc5_length = 0x57e0,
.pcm4_pos = 0x60dd4, .pcm4_length = 0x520,
.pcm5_pos = 0x612f4, .pcm5_length = 0x520,
},
{
.name = "AppleAirPort2",
.version = "3.90.34.0.p16 (404.2)",
.md5 = "7200d1aef5f413ebc811046d068b40dc",
.flags = BYTE_ORDER_BIG_ENDIAN |
MISSING_INITVAL_80211_A,
.iv_pos = 0x511ec, /* A-PHY init vals empty */
.uc2_pos = 0x52adc, .uc2_length = 0x3f48,
.uc4_pos = 0x56a24, .uc4_length = 0x4df0,
.uc5_pos = 0x5b814, .uc5_length = 0x57f0,
.pcm4_pos = 0x61004, .pcm4_length = 0x520,
.pcm5_pos = 0x61524, .pcm5_length = 0x520,
},
{
.name = "AppleAirPort2",
.version = "3.90.34.0.p16 (404.2)",
.md5 = "86cc708e8df3b035a1dbea41ac4eb7d2",
.flags = BYTE_ORDER_BIG_ENDIAN |
MISSING_INITVAL_80211_A,
.iv_pos = 0x5021c, /* A-PHY init vals empty */
.uc2_pos = 0x51b0c, .uc2_length = 0x3f48,
.uc4_pos = 0x55a54, .uc4_length = 0x4df0,
.uc5_pos = 0x5a844, .uc5_length = 0x57f0,
.pcm4_pos = 0x60034, .pcm4_length = 0x520,
.pcm5_pos = 0x60554, .pcm5_length = 0x520,
},
{
.name = "bcmwl5.sys",
.version = "3.10.8.0", /* 10/04/2002 */
.md5 = "288923b401e87ef76b7ae2652601ee47",
.flags = DRIVER_UNSUPPORTED, /* file differs from later ones */
},
{
.name = "bcmwl5.sys",
.version = "3.10.53.6", /* 04/28/2003 */
.md5 = "b43c593fd7c2a47cdc40580fe341f674",
.flags = DRIVER_UNSUPPORTED, /* file differs from later ones */
},
{
.name = "bcmwl5.sys",
.version = "3.20.23.0", /* 06/13/2003 */
.md5 = "1b1cf5e962c15abca83d1ef2b3906e2f", /* pcm5 not available, driver is too old */
.flags = BYTE_ORDER_LITTLE_ENDIAN |
MISSING_INITVAL_08,
.iv_pos = 0x2a1d0,
.uc2_pos = 0x2d228, .uc2_length = 0x3da8,
.uc4_pos = 0x30fd8, .uc4_length = 0x4470,
.uc5_pos = 0x35450, .uc5_length = 0x4ba0,
.pcm4_pos = 0x39ff8, .pcm4_length = 0x478,
},
{
.name = "bcmwl5.sys",
.version = "3.30.15.0", /* 07/17/2003 */
.md5 = "ebf36d658d0da5b1ea667fa403919c26",
.flags = BYTE_ORDER_LITTLE_ENDIAN |
MISSING_INITVAL_08,
.iv_pos = 0x2c658,
.uc2_pos = 0x2f738, .uc2_length = 0x3d88,
.uc4_pos = 0x334c8, .uc4_length = 0x44a0,
.uc5_pos = 0x37970, .uc5_length = 0x4ec0,
.pcm4_pos = 0x3c838, .pcm4_length = 0x478,
.pcm5_pos = 0x3ccb8, .pcm5_length = 0x478,
},
{
.name = "bcmwl5.sys",
.version = "3.40.20.0", /* 09/24/2003 */
.md5 = "0c3fc803184f6f85e665dd012611225b",
.flags = BYTE_ORDER_LITTLE_ENDIAN,
.iv_pos = 0x302f0,
.uc2_pos = 0x33d88, .uc2_length = 0x3db8,
.uc4_pos = 0x37b48, .uc4_length = 0x45d8,
.uc5_pos = 0x3c128, .uc5_length = 0x5050,
.pcm4_pos = 0x41180, .pcm4_length = 0x478,
.pcm5_pos = 0x41600, .pcm5_length = 0x478,
},
{
.name = "bcmwl5.sys",
.version = "3.40.25.3", /* 10/28/2003 */
.md5 = "5e58a3148b98c9f356cde6049435cb21",
.flags = BYTE_ORDER_LITTLE_ENDIAN,
.iv_pos = 0x30970,
.uc2_pos = 0x34408, .uc2_length = 0x3db0,
.uc4_pos = 0x381c0, .uc4_length = 0x45d0,
.uc5_pos = 0x3c798, .uc5_length = 0x5050,
.pcm4_pos = 0x417f0, .pcm4_length = 0x478,
.pcm5_pos = 0x41c70, .pcm5_length = 0x478,
},
{
.name = "bcmwl5.sys",
.version = "3.40.73.0", /* 06/25/2004 */
.md5 = "52d67c5465c01913b03b7daca0cc4077",
.flags = BYTE_ORDER_LITTLE_ENDIAN,
.iv_pos = 0x37398,
.uc2_pos = 0x3ae30, .uc2_length = 0x3ff0,
.uc4_pos = 0x3ee28, .uc4_length = 0x47f0,
.uc5_pos = 0x43620, .uc5_length = 0x5260,
.pcm4_pos = 0x48888, .pcm4_length = 0x478,
.pcm5_pos = 0x48d08, .pcm5_length = 0x478,
},
{
.name = "bcmwl5.sys",
.version = "3.40.100.0", /* 02/07/2004 */
.md5 = "431195b941dff794f23c2077fcbf8377",
.flags = BYTE_ORDER_LITTLE_ENDIAN,
.iv_pos = 0x34d18,
.uc2_pos = 0x387b0, .uc2_length = 0x3ff0,
.uc4_pos = 0x3c7a8, .uc4_length = 0x47f0,
.uc5_pos = 0x40fa0, .uc5_length = 0x5260,
.pcm4_pos = 0x46208, .pcm4_length = 0x478,
.pcm5_pos = 0x46688, .pcm5_length = 0x478,
},
{
.name = "bcmwl5.sys",
.version = "3.50.21.11", /* 02/19/2004 */
.md5 = "ae96075a3aed5c40f1ead477ea94acd7",
.flags = BYTE_ORDER_LITTLE_ENDIAN,
.iv_pos = 0x33370,
.uc2_pos = 0x36e58, .uc2_length = 0x3e00,
.uc4_pos = 0x3ac60, .uc4_length = 0x4628,
.uc5_pos = 0x3f290, .uc5_length = 0x5548,
.pcm4_pos = 0x447e0, .pcm4_length = 0x478,
.pcm5_pos = 0x44c60, .pcm5_length = 0x478,
},
{
.name = "bcmwl5.sys",
.version = "3.60.7.0", /* 03/22/2004 */
.md5 = "c5616736df4e83930780dca5795387ca",
.flags = BYTE_ORDER_LITTLE_ENDIAN,
.iv_pos = 0x3b988,
.uc2_pos = 0x3f580, .uc2_length = 0x3e08,
.uc4_pos = 0x43390, .uc4_length = 0x4e58,
.uc5_pos = 0x481f0, .uc5_length = 0x5608,
.pcm4_pos = 0x4d800, .pcm4_length = 0x478,
.pcm5_pos = 0x4dc80, .pcm5_length = 0x478,
},
{
.name = "bcmwl5.sys",
.version = "3.60.7.5", /* 06/07/2004 */
.md5 = "d2ae116c741c215ef3ef68603db9917f",
.flags = BYTE_ORDER_LITTLE_ENDIAN,
.iv_pos = 0x3b988,
.uc2_pos = 0x3f580, .uc2_length = 0x3e08,
.uc4_pos = 0x43390, .uc4_length = 0x4e58,
.uc5_pos = 0x481f0, .uc5_length = 0x5608,
.pcm4_pos = 0x4d800, .pcm4_length = 0x478,
.pcm5_pos = 0x4dc80, .pcm5_length = 0x478,
},
{
.name = "bcmwl5.sys",
.version = "3.70.12.0", /* 06/02/2004 */
.md5 = "d409b089370486521d5408baed9bffde",
.flags = BYTE_ORDER_LITTLE_ENDIAN,
.iv_pos = 0x39480,
.uc2_pos = 0x3d0c8, .uc2_length = 0x3e80,
.uc4_pos = 0x40f50, .uc4_length = 0x4ed0,
.uc5_pos = 0x45e28, .uc5_length = 0x5680,
.pcm4_pos = 0x4b4b0, .pcm4_length = 0x478,
.pcm5_pos = 0x4b930, .pcm5_length = 0x478,
},
{
.name = "bcmwl5.sys",
.version = "3.70.17.0", /* 06/25/2004 */
.md5 = "d87b4e14e890091d8e64fb5c570cf192",
.flags = BYTE_ORDER_LITTLE_ENDIAN,
.iv_pos = 0x39600,
.uc2_pos = 0x3d248, .uc2_length = 0x3e80,
.uc4_pos = 0x410d0, .uc4_length = 0x4ed0,
.uc5_pos = 0x45fa8, .uc5_length = 0x5680,
.pcm4_pos = 0x4b630, .pcm4_length = 0x478,
.pcm5_pos = 0x4bab0, .pcm5_length = 0x478,
},
{
.name = "bcmwl5.sys",
.version = "3.70.22.0", /* 10/20/2004 */
.md5 = "185a6dc6d655dc31c0b228cc94fb99ac",
.flags = BYTE_ORDER_LITTLE_ENDIAN,
.iv_pos = 0x39a88,
.uc2_pos = 0x3d6d0, .uc2_length = 0x3e80,
.uc4_pos = 0x41558, .uc4_length = 0x4ed0,
.uc5_pos = 0x46430, .uc5_length = 0x5680,
.pcm4_pos = 0x4bab8, .pcm4_length = 0x478,
.pcm5_pos = 0x4bf38, .pcm5_length = 0x478,
},
{
.name = "bcmwl5.sys",
.version = "3.90.41.1", /* 07/04/2005 */
.md5 = "0a87541dd24c6f046a4bf8f671f74de2",
.flags = BYTE_ORDER_LITTLE_ENDIAN,
.iv_pos = 0x3bec8,
.uc2_pos = 0x3fb38, .uc2_length = 0x3f48,
.uc4_pos = 0x43a88, .uc4_length = 0x4df0,
.uc5_pos = 0x48880, .uc5_length = 0x57e0,
.pcm4_pos = 0x4e068, .pcm4_length = 0x520,
.pcm5_pos = 0x4e590, .pcm5_length = 0x520,
},
{
.name = "bcmwl5.sys",
.version = "3.100.35.0", /* 11/27/2004 */
.md5 = "c3ab2d6954c7b5103770832a3a6a591b",
.flags = BYTE_ORDER_LITTLE_ENDIAN,
.iv_pos = 0x3de80,
.uc2_pos = 0x41af0, .uc2_length = 0x3f58,
.uc4_pos = 0x45a50, .uc4_length = 0x4df8,
.uc5_pos = 0x4a850, .uc5_length = 0x57f8,
.pcm4_pos = 0x50050, .pcm4_length = 0x520,
.pcm5_pos = 0x50578, .pcm5_length = 0x520,
},
{
.name = "bcmwl5.sys",
.version = "3.100.35.1", /* 02/10/2005 */
.md5 = "da7ca369a1a3593ceac85dec2d267a08",
.flags = BYTE_ORDER_LITTLE_ENDIAN,
.iv_pos = 0x3df00,
.uc2_pos = 0x41b70, .uc2_length = 0x3f58,
.uc4_pos = 0x45ad0, .uc4_length = 0x4df8,
.uc5_pos = 0x4a8d0, .uc5_length = 0x57f8,
.pcm4_pos = 0x500d0, .pcm4_length = 0x520,
.pcm5_pos = 0x505f8, .pcm5_length = 0x520,
},
{
.name = "bcmwl5.sys",
.version = "3.100.46.0", /* 12/22/2004 */
.md5 = "38ca1443660d0f5f06887c6a2e692aeb",
.flags = BYTE_ORDER_LITTLE_ENDIAN,
.iv_pos = 0x3de80,
.uc2_pos = 0x41af0, .uc2_length = 0x3f58,
.uc4_pos = 0x45a50, .uc4_length = 0x4df8,
.uc5_pos = 0x4a850, .uc5_length = 0x57f8,
.pcm4_pos = 0x50050, .pcm4_length = 0x520,
.pcm5_pos = 0x50578, .pcm5_length = 0x520,
},
{
.name = "bcmwl5.sys",
.version = "3.100.64.0", /* 02/11/2005 */
.md5 = "e7debb46b9ef1f28932e533be4a3d1a9",
.flags = BYTE_ORDER_LITTLE_ENDIAN,
.iv_pos = 0x3e980,
.uc2_pos = 0x425f0, .uc2_length = 0x3f58,
.uc4_pos = 0x46550, .uc4_length = 0x4e00,
.uc5_pos = 0x4b358, .uc5_length = 0x5800,
.pcm4_pos = 0x50b60, .pcm4_length = 0x520,
.pcm5_pos = 0x51088, .pcm5_length = 0x520,
},
{
.name = "bcmwl5.sys",
.version = "3.100.64.50", /* 04/05/2005 */
.md5 = "4b3e367b829b9b2c0c088909a617e04e",
.flags = BYTE_ORDER_LITTLE_ENDIAN,
.iv_pos = 0x3e900,
.uc2_pos = 0x42570, .uc2_length = 0x3f58,
.uc4_pos = 0x464d0, .uc4_length = 0x4e00,
.uc5_pos = 0x4b2d8, .uc5_length = 0x5800,
.pcm4_pos = 0x50ae0, .pcm4_length = 0x520,
.pcm5_pos = 0x51008, .pcm5_length = 0x520,
},
{
.name = "bcmwl5.sys",
.version = "3.100.65.1", /* 04/21/2005 */
.md5 = "d5f1ab1aab8b81bca6f19da9554a267a",
.flags = BYTE_ORDER_LITTLE_ENDIAN,
.iv_pos = 0x3e980,
.uc2_pos = 0x425f0, .uc2_length = 0x3f58,
.uc4_pos = 0x46550, .uc4_length = 0x4e00,
.uc5_pos = 0x4b358, .uc5_length = 0x5800,
.pcm4_pos = 0x50b60, .pcm4_length = 0x520,
.pcm5_pos = 0x51088, .pcm5_length = 0x520,
},
{
.name = "bcmwl5.sys",
.version = "3.120.27.0", /* 05/19/2005 */
.md5 = "8d49f11238815a320880fee9f98b2c92",
.flags = BYTE_ORDER_LITTLE_ENDIAN,
.iv_pos = 0x3f700,
.uc2_pos = 0x43370, .uc2_length = 0x3f68,
.uc4_pos = 0x472e0, .uc4_length = 0x4e10,
.uc5_pos = 0x4c0f8, .uc5_length = 0x5800,
.pcm4_pos = 0x51900, .pcm4_length = 0x520,
.pcm5_pos = 0x51e28, .pcm5_length = 0x520,
},
{
.name = "bcmwl5.sys",
.version = "3.140.16.0", /* 07/21/2005 */
.md5 = "fa4a4a50b4b2647afedc676cc68c69cc",
.flags = BYTE_ORDER_LITTLE_ENDIAN,
.iv_pos = 0x3f700,
.uc2_pos = 0x43370, .uc2_length = 0x3f68,
.uc4_pos = 0x472e0, .uc4_length = 0x4e10,
.uc5_pos = 0x4c0f8, .uc5_length = 0x5800,
.pcm4_pos = 0x51900, .pcm4_length = 0x520,
.pcm5_pos = 0x51e28, .pcm5_length = 0x520,
},
{
.name = "bcmwl564.sys",
.version = "3.70.17.5", /* 09/21/2004 */
.md5 = "f5590c8784b91dfd9ee092d3040b6e40", /* for 64bit machines */
.flags = BYTE_ORDER_LITTLE_ENDIAN,
.iv_pos = 0x566f0,
.uc2_pos = 0x5a360, .uc2_length = 0x3e80,
.uc4_pos = 0x5e1f0, .uc4_length = 0x4ed0,
.uc5_pos = 0x630d0, .uc5_length = 0x5680,
.pcm4_pos = 0x68760, .pcm4_length = 0x478,
.pcm5_pos = 0x68be0, .pcm5_length = 0x478,
},
{
.name = "bcmwl564.sys",
.version = "3.100.64.10", /* 05/12/2005 */
.md5 = "b8d76da338ecf2c650f5f7ca226ccf89", /* for 64bit machines */
.flags = BYTE_ORDER_LITTLE_ENDIAN,
.iv_pos = 0x50bf0,
.uc2_pos = 0x54860, .uc2_length = 0x3f58,
.uc4_pos = 0x587c0, .uc4_length = 0x4e00,
.uc5_pos = 0x5d5d0, .uc5_length = 0x5800,
.pcm4_pos = 0x62de0, .pcm4_length = 0x520,
.pcm5_pos = 0x63310, .pcm5_length = 0x520,
},
{
.name = "bcmwl5a.sys",
.version = "3.90.16.0", /* 12/06/2004 */
.md5 = "e6d927deea6c75bddf84080e6c3837b7",
.flags = BYTE_ORDER_LITTLE_ENDIAN,
.iv_pos = 0x3b4c8,
.uc2_pos = 0x3f138, .uc2_length = 0x3f48,
.uc4_pos = 0x43088, .uc4_length = 0x4de8,
.uc5_pos = 0x47e78, .uc5_length = 0x57d8,
.pcm4_pos = 0x4d658, .pcm4_length = 0x520,
.pcm5_pos = 0x4db80, .pcm5_length = 0x520,
},
{
.name = "d11ucode.o",
.version = "3.31.16.0 ?", /*FIXME: version correct? */
.md5 = "31e6cac8a8129bf8f91291293e017329",
.flags = BYTE_ORDER_LITTLE_ENDIAN |
MISSING_INITVAL_08,
.iv_pos = 0x40,
.uc2_pos = 0x3120, .uc2_length = 0x3d88,
.uc4_pos = 0x6eac, .uc4_length = 0x44a0,
.uc5_pos = 0xb350, .uc5_length = 0x4ec0,
.pcm4_pos = 0x10214, .pcm4_length = 0x478,
.pcm5_pos = 0x10690, .pcm5_length = 0x478,
},
{
.name = "d11ucode.o",
.version = "3.60.7.0 ? (1.3.2)", /* no version number found */
.md5 = "7774e5dda1daa2b3f83d279552ca1cc4", /* but same fw files are also */
.flags = BYTE_ORDER_LITTLE_ENDIAN, /* in bcmwl5.sys 3.60.7.0 */
.iv_pos = 0x40,
.uc2_pos = 0x3c38, .uc2_length = 0x3e08,
.uc4_pos = 0x7a44, .uc4_length = 0x4e58,
.uc5_pos = 0xc8a0, .uc5_length = 0x5608,
.pcm4_pos = 0x11eac, .pcm4_length = 0x478,
.pcm5_pos = 0x12328, .pcm5_length = 0x478,
},
{
.name = "d11ucode.o",
.version = "3.90.7.0 ? (3.90.RC7)", /* 10/14/2004 */
.md5 = "b2580361620881b06fa810422ec8b7ce",
.flags = BYTE_ORDER_LITTLE_ENDIAN,
.iv_pos = 0x60,
.uc2_pos = 0x3cd0, .uc2_length = 0x3ec0,
.uc4_pos = 0x7b94, .uc4_length = 0x4d60,
.uc5_pos = 0xc8f8, .uc5_length = 0x5750,
.pcm4_pos = 0x1204c, .pcm4_length = 0x520,
.pcm5_pos = 0x12570, .pcm5_length = 0x520,
},
{
.name = "d11ucode.o",
.version = "3.90.37.0",
.md5 = "2543935259739a8a879ccb8386647ac7",
.flags = BYTE_ORDER_LITTLE_ENDIAN,
.iv_pos = 0x60,
.uc2_pos = 0x3cd0, .uc2_length = 0x3f48,
.uc4_pos = 0x7c1c, .uc4_length = 0x4df0,
.uc5_pos = 0xca10, .uc5_length = 0x57e0,
.pcm4_pos = 0x121f4, .pcm4_length = 0x520,
.pcm5_pos = 0x12718, .pcm5_length = 0x520,
},
{
.name = "wl.o",
.version = "3.31.15.0", /* 07/28/2003 */
.md5 = "a85af65b5ae1d64ee11eab714faab843",
.flags = BYTE_ORDER_LITTLE_ENDIAN |
MISSING_INITVAL_08,
.iv_pos = 0x32270,
.uc2_pos = 0x35350, .uc2_length = 0x3d88,
.uc4_pos = 0x390dc, .uc4_length = 0x44a0,
.uc5_pos = 0x3d580, .uc5_length = 0x4ec0,
.pcm4_pos = 0x42444, .pcm4_length = 0x478,
.pcm5_pos = 0x428c0, .pcm5_length = 0x478,
},
{
.name = "wl.o",
.version = "3.31.15.0", /* 07/28/2003 */
.md5 = "98dd50a95b02c8bcb3725c770df81dfc",
.flags = BYTE_ORDER_LITTLE_ENDIAN |
MISSING_INITVAL_08,
.iv_pos = 0x32270,
.uc2_pos = 0x35350, .uc2_length = 0x3d88,
.uc4_pos = 0x390dc, .uc4_length = 0x44a0,
.uc5_pos = 0x3d580, .uc5_length = 0x4ec0,
.pcm4_pos = 0x42444, .pcm4_length = 0x478,
.pcm5_pos = 0x428c0, .pcm5_length = 0x478,
},
{
.name = "wl.o",
.version = "3.50.21.0", /* 05/11/2003 */
.md5 = "f71be0e1d14f68c98d916465a300d835",
.flags = BYTE_ORDER_LITTLE_ENDIAN,
.iv_pos = 0x38990,
.uc2_pos = 0x3c428, .uc2_length = 0x3db8,
.uc4_pos = 0x401e4, .uc4_length = 0x45d8,
.uc5_pos = 0x447c0, .uc5_length = 0x5050,
.pcm4_pos = 0x49814, .pcm4_length = 0x478,
.pcm5_pos = 0x49c90, .pcm5_length = 0x478,
},
{
.name = "wl.o",
.version = "3.50.21.10", /* 01/21/2004 */
.md5 = "191029d5e7097ed7db92cbd6e6131f85",
.flags = BYTE_ORDER_LITTLE_ENDIAN,
.iv_pos = 0x3a5d0,
.uc2_pos = 0x3e0b8, .uc2_length = 0x3e00,
.uc4_pos = 0x41ebc, .uc4_length = 0x4628,
.uc5_pos = 0x464e8, .uc5_length = 0x5548,
.pcm4_pos = 0x4ba34, .pcm4_length = 0x478,
.pcm5_pos = 0x4beb0, .pcm5_length = 0x478,
},
{
.name = "wl.o",
.version = "3.60.7.0 ? (1.3.2.0)", /* 02/04/2004 */
.md5 = "7009220d84c445797443aa0221b7d8a4", /* no bcm version found */
.flags = BYTE_ORDER_LITTLE_ENDIAN, /* but same fw files are also */
.iv_pos = 0x545e0, /* in bcmwl5.sys 3.60.7.0, */
.uc2_pos = 0x581d8, .uc2_length = 0x3e08,
.uc4_pos = 0x5bfe4, .uc4_length = 0x4e58,
.uc5_pos = 0x60e40, .uc5_length = 0x5608,
.pcm4_pos = 0x6644c, .pcm4_length = 0x478,
.pcm5_pos = 0x668c8, .pcm5_length = 0x478,
},
{
.name = "wl.o",
.version = "3.60.13.0", /* 05/05/2004 */
.md5 = "275dd4958eb94058d4650f58d534c635",
.flags = BYTE_ORDER_LITTLE_ENDIAN,
.iv_pos = 0x3b740,
.uc2_pos = 0x3f388, .uc2_length = 0x3e30,
.uc4_pos = 0x431bc, .uc4_length = 0x4e80,
.uc5_pos = 0x48040, .uc5_length = 0x5630,
.pcm4_pos = 0x4d674, .pcm4_length = 0x478,
.pcm5_pos = 0x4daf0, .pcm5_length = 0x478,
},
{
.name = "wl.o",
.version = "3.60.13.0", /* 08/02/2004 */
.md5 = "4f20653a0b7c0bb3bd1ee0dd79f77785",
.flags = BYTE_ORDER_LITTLE_ENDIAN,
.iv_pos = 0x3b730,
.uc2_pos = 0x3f378, .uc2_length = 0x3e30,
.uc4_pos = 0x431ac, .uc4_length = 0x4e80,
.uc5_pos = 0x48030, .uc5_length = 0x5630,
.pcm4_pos = 0x4d664, .pcm4_length = 0x478,
.pcm5_pos = 0x4dae0, .pcm5_length = 0x478,
},
{
.name = "wl.o",
.version = "3.90.7.0", /* 14/10/2004 */
.md5 = "f15b59ad4d6f6ad2c7f45193d033aff8",
.flags = BYTE_ORDER_LITTLE_ENDIAN,
.iv_pos = 0x4d890,
.uc2_pos = 0x51500, .uc2_length = 0x3ec0,
.uc4_pos = 0x553c4, .uc4_length = 0x4d60,
.uc5_pos = 0x5a128, .uc5_length = 0x5750,
.pcm4_pos = 0x5f87c, .pcm4_length = 0x520,
.pcm5_pos = 0x5fda0, .pcm5_length = 0x520,
},
{
.name = "wl.o",
.version = "3.90.37.0", /* 15/02/2005 */
.md5 = "984c42947552652d5ab61b78e7d12227",
.flags = BYTE_ORDER_LITTLE_ENDIAN,
.iv_pos = 0x4cf50,
.uc2_pos = 0x50bc0, .uc2_length = 0x3f48,
.uc4_pos = 0x54b0c, .uc4_length = 0x4df0,
.uc5_pos = 0x59900, .uc5_length = 0x57e0,
.pcm4_pos = 0x5f0e4, .pcm4_length = 0x520,
.pcm5_pos = 0x5f608, .pcm5_length = 0x520,
},
{
.name = "wl_ap.o",
.version = "3.31.16.0", /* 08/06/2003 */
.md5 = "463633e7bf0efc6c0f8eac2514a71024",
.flags = BYTE_ORDER_LITTLE_ENDIAN |
MISSING_INITVAL_08,
.iv_pos = 0x32270,
.uc2_pos = 0x35350, .uc2_length = 0x3d88,
.uc4_pos = 0x390dc, .uc4_length = 0x44a0,
.uc5_pos = 0x3d580, .uc5_length = 0x4ec0,
.pcm4_pos = 0x42444, .pcm4_length = 0x478,
.pcm5_pos = 0x428c0, .pcm5_length = 0x478,
},
{
.name = "wl_ap.o",
.version = "3.90.37.0", /* 15/02/2005 */
.md5 = "0538296d46a854d2facc9a0db2088180",
.flags = BYTE_ORDER_LITTLE_ENDIAN,
.iv_pos = 0x3eac0,
.uc2_pos = 0x42730, .uc2_length = 0x3f48,
.uc4_pos = 0x4667c, .uc4_length = 0x4df0,
.uc5_pos = 0x4b470, .uc5_length = 0x57e0,
.pcm4_pos = 0x50c54, .pcm4_length = 0x520,
.pcm5_pos = 0x51178, .pcm5_length = 0x520,
},
{
.name = "wl_ap.o",
.version = "3.90.37.0", /* 15/02/2005 */
.md5 = "6c9073531a528dd455b716b5e821e696",
.flags = BYTE_ORDER_LITTLE_ENDIAN,
.iv_pos = 0x3eac0,
.uc2_pos = 0x42730, .uc2_length = 0x3f48,
.uc4_pos = 0x4667c, .uc4_length = 0x4df0,
.uc5_pos = 0x4b470, .uc5_length = 0x57e0,
.pcm4_pos = 0x50c54, .pcm4_length = 0x520,
.pcm5_pos = 0x51178, .pcm5_length = 0x520,
},
{
.name = "wl_apsta.o",
.version = "3.31.16.0", /* 06/08/2003 */
.md5 = "22b90e4cbeee45ad7f78ff536c65712a",
.flags = BYTE_ORDER_LITTLE_ENDIAN |
MISSING_INITVAL_08,
.iv_pos = 0x38020,
.uc2_pos = 0x3b100, .uc2_length = 0x3d88,
.uc4_pos = 0x3ee8c, .uc4_length = 0x44a0,
.uc5_pos = 0x43330, .uc5_length = 0x4ec0,
.pcm4_pos = 0x481f4, .pcm4_length = 0x478,
.pcm5_pos = 0x48670, .pcm5_length = 0x478,
},
{
.name = "wl_apsta.o",
.version = "3.31.16.0", /* 06/08/2003 */
.md5 = "dfce35a8b5cb6e53e1ab75342c7e7194",
.flags = BYTE_ORDER_LITTLE_ENDIAN |
MISSING_INITVAL_08,
.iv_pos = 0x38020,
.uc2_pos = 0x3b100, .uc2_length = 0x3d88,
.uc4_pos = 0x3ee8c, .uc4_length = 0x44a0,
.uc5_pos = 0x43330, .uc5_length = 0x4ec0,
.pcm4_pos = 0x481f4, .pcm4_length = 0x478,
.pcm5_pos = 0x48670, .pcm5_length = 0x478,
},
{
.name = "wl_apsta.o",
.version = "3.90.37.0", /* 15/02/2005 */
.md5 = "2922e6c48917eacd6c8c094347d2ec4b",
.flags = BYTE_ORDER_LITTLE_ENDIAN,
.iv_pos = 0x4ebc0,
.uc2_pos = 0x52830, .uc2_length = 0x3f48,
.uc4_pos = 0x5677c, .uc4_length = 0x4df0,
.uc5_pos = 0x5b570, .uc5_length = 0x57e0,
.pcm4_pos = 0x60d54, .pcm4_length = 0x520,
.pcm5_pos = 0x61278, .pcm5_length = 0x520,
},
{
.name = "wl_apsta.o",
.version = "3.90.37.0", /* 15/02/2005 */
.md5 = "f9fa565a766e8befeb495a8a8c0c134b",
.flags = BYTE_ORDER_LITTLE_ENDIAN,
.iv_pos = 0x4ebc0,
.uc2_pos = 0x52830, .uc2_length = 0x3f48,
.uc4_pos = 0x5677c, .uc4_length = 0x4df0,
.uc5_pos = 0x5b570, .uc5_length = 0x57e0,
.pcm4_pos = 0x60d54, .pcm4_length = 0x520,
.pcm5_pos = 0x61278, .pcm5_length = 0x520,
},
{
.name = "wl_apsta.o",
.version = "3.130.20.0", /* 19/05/2005 */
.md5 = "e08665c5c5b66beb9c3b2dd54aa80cb3",
.flags = BYTE_ORDER_LITTLE_ENDIAN,
.iv_pos = 0x56020,
.uc2_pos = 0x59ca0, .uc2_length = 0x3fe0,
.uc4_pos = 0x5dc84, .uc4_length = 0x4e78,
.uc5_pos = 0x62b00, .uc5_length = 0x5700,
.uc11_pos = 0x68204, .uc11_length = 0x54a8,
.pcm4_pos = 0x6d6b0, .pcm4_length = 0x520,
.pcm5_pos = 0x6dbd4, .pcm5_length = 0x520,
},
{
.name = "wl_sta.o",
.version = "3.31.16.0", /* 08/06/2003 */
.md5 = "c3e663cb78b2fc299088de69fc11a9a9",
.flags = BYTE_ORDER_LITTLE_ENDIAN |
MISSING_INITVAL_08,
.iv_pos = 0x317b0,
.uc2_pos = 0x34890, .uc2_length = 0x3d88,
.uc4_pos = 0x3861c, .uc4_length = 0x44a0,
.uc5_pos = 0x3cac0, .uc5_length = 0x4ec0,
.pcm4_pos = 0x41984, .pcm4_length = 0x478,
.pcm5_pos = 0x41e00, .pcm5_length = 0x478,
},
{
.name = "wl_sta.o",
.version = "3.90.37.0", /* 15/02/2005 */
.md5 = "4631d4d4c3ab943462e1ea24f4dba7bd",
.flags = BYTE_ORDER_LITTLE_ENDIAN,
.iv_pos = 0x47040,
.uc2_pos = 0x4acb0, .uc2_length = 0x3f48,
.uc4_pos = 0x4ebfc, .uc4_length = 0x4df0,
.uc5_pos = 0x539f0, .uc5_length = 0x57e0,
.pcm4_pos = 0x591d4, .pcm4_length = 0x520,
.pcm5_pos = 0x596f8, .pcm5_length = 0x520,
},
{
.name = "wl_sta.o",
.version = "3.90.37.0", /* 15/02/2005 */
.md5 = "bf824b38b3993e0a8b5a9bf717c428ed",
.flags = BYTE_ORDER_LITTLE_ENDIAN,
.iv_pos = 0x47040,
.uc2_pos = 0x4acb0, .uc2_length = 0x3f48,
.uc4_pos = 0x4ebfc, .uc4_length = 0x4df0,
.uc5_pos = 0x539f0, .uc5_length = 0x57e0,
.pcm4_pos = 0x591d4, .pcm4_length = 0x520,
.pcm5_pos = 0x596f8, .pcm5_length = 0x520,
},
};
#define FILES (sizeof(files) / sizeof(files[0]))

View File

@@ -1,253 +0,0 @@
/*
* This code implements the MD5 message-digest algorithm.
* The algorithm is due to Ron Rivest. This code was
* written by Colin Plumb in 1993, no copyright is claimed.
* This code is in the public domain; do with it what you wish.
*
* Equivalent code is available from RSA Data Security, Inc.
* This code has been tested against that, and is equivalent,
* except that you don't need to include two pages of legalese
* with every copy.
*
* To compute the message digest of a chunk of bytes, declare an
* MD5Context structure, pass it to MD5Init, call MD5Update as
* needed on buffers full of bytes, and then call MD5Final, which
* will fill a supplied 16-byte array with the digest.
*/
/* Brutally hacked by John Walker back from ANSI C to K&R (no
prototypes) to maintain the tradition that Netfone will compile
with Sun's original "cc". */
/* Ripped out ugly K&R again ;) --mbuesch */
#include <memory.h> /* for memcpy() */
#include "md5.h"
extern int big_endian_cpu;
/*
* Note: this code is harmless on little-endian machines,
* but we return early nevertheless.
*/
static void byteReverse(unsigned char *buf, unsigned longs)
{
uint32_t t;
if (!big_endian_cpu)
return;
do {
t = (uint32_t) ((unsigned) buf[3] << 8 | buf[2]) << 16 |
((unsigned) buf[1] << 8 | buf[0]);
*(uint32_t *) buf = t;
buf += 4;
} while (--longs);
}
/* The four core functions - F1 is optimized somewhat */
/* #define F1(x, y, z) (x & y | ~x & z) */
#define F1(x, y, z) (z ^ (x & (y ^ z)))
#define F2(x, y, z) F1(z, x, y)
#define F3(x, y, z) (x ^ y ^ z)
#define F4(x, y, z) (y ^ (x | ~z))
/* This is the central step in the MD5 algorithm. */
#define MD5STEP(f, w, x, y, z, data, s) \
( w += f(x, y, z) + data, w = w<<s | w>>(32-s), w += x )
/*
* The core of the MD5 algorithm, this alters an existing MD5 hash to
* reflect the addition of 16 longwords of new data. MD5Update blocks
* the data and converts bytes into longwords for this routine.
*/
static void MD5Transform(uint32_t *buf, uint32_t *in)
{
register uint32_t a, b, c, d;
a = buf[0];
b = buf[1];
c = buf[2];
d = buf[3];
MD5STEP(F1, a, b, c, d, in[0] + 0xd76aa478, 7);
MD5STEP(F1, d, a, b, c, in[1] + 0xe8c7b756, 12);
MD5STEP(F1, c, d, a, b, in[2] + 0x242070db, 17);
MD5STEP(F1, b, c, d, a, in[3] + 0xc1bdceee, 22);
MD5STEP(F1, a, b, c, d, in[4] + 0xf57c0faf, 7);
MD5STEP(F1, d, a, b, c, in[5] + 0x4787c62a, 12);
MD5STEP(F1, c, d, a, b, in[6] + 0xa8304613, 17);
MD5STEP(F1, b, c, d, a, in[7] + 0xfd469501, 22);
MD5STEP(F1, a, b, c, d, in[8] + 0x698098d8, 7);
MD5STEP(F1, d, a, b, c, in[9] + 0x8b44f7af, 12);
MD5STEP(F1, c, d, a, b, in[10] + 0xffff5bb1, 17);
MD5STEP(F1, b, c, d, a, in[11] + 0x895cd7be, 22);
MD5STEP(F1, a, b, c, d, in[12] + 0x6b901122, 7);
MD5STEP(F1, d, a, b, c, in[13] + 0xfd987193, 12);
MD5STEP(F1, c, d, a, b, in[14] + 0xa679438e, 17);
MD5STEP(F1, b, c, d, a, in[15] + 0x49b40821, 22);
MD5STEP(F2, a, b, c, d, in[1] + 0xf61e2562, 5);
MD5STEP(F2, d, a, b, c, in[6] + 0xc040b340, 9);
MD5STEP(F2, c, d, a, b, in[11] + 0x265e5a51, 14);
MD5STEP(F2, b, c, d, a, in[0] + 0xe9b6c7aa, 20);
MD5STEP(F2, a, b, c, d, in[5] + 0xd62f105d, 5);
MD5STEP(F2, d, a, b, c, in[10] + 0x02441453, 9);
MD5STEP(F2, c, d, a, b, in[15] + 0xd8a1e681, 14);
MD5STEP(F2, b, c, d, a, in[4] + 0xe7d3fbc8, 20);
MD5STEP(F2, a, b, c, d, in[9] + 0x21e1cde6, 5);
MD5STEP(F2, d, a, b, c, in[14] + 0xc33707d6, 9);
MD5STEP(F2, c, d, a, b, in[3] + 0xf4d50d87, 14);
MD5STEP(F2, b, c, d, a, in[8] + 0x455a14ed, 20);
MD5STEP(F2, a, b, c, d, in[13] + 0xa9e3e905, 5);
MD5STEP(F2, d, a, b, c, in[2] + 0xfcefa3f8, 9);
MD5STEP(F2, c, d, a, b, in[7] + 0x676f02d9, 14);
MD5STEP(F2, b, c, d, a, in[12] + 0x8d2a4c8a, 20);
MD5STEP(F3, a, b, c, d, in[5] + 0xfffa3942, 4);
MD5STEP(F3, d, a, b, c, in[8] + 0x8771f681, 11);
MD5STEP(F3, c, d, a, b, in[11] + 0x6d9d6122, 16);
MD5STEP(F3, b, c, d, a, in[14] + 0xfde5380c, 23);
MD5STEP(F3, a, b, c, d, in[1] + 0xa4beea44, 4);
MD5STEP(F3, d, a, b, c, in[4] + 0x4bdecfa9, 11);
MD5STEP(F3, c, d, a, b, in[7] + 0xf6bb4b60, 16);
MD5STEP(F3, b, c, d, a, in[10] + 0xbebfbc70, 23);
MD5STEP(F3, a, b, c, d, in[13] + 0x289b7ec6, 4);
MD5STEP(F3, d, a, b, c, in[0] + 0xeaa127fa, 11);
MD5STEP(F3, c, d, a, b, in[3] + 0xd4ef3085, 16);
MD5STEP(F3, b, c, d, a, in[6] + 0x04881d05, 23);
MD5STEP(F3, a, b, c, d, in[9] + 0xd9d4d039, 4);
MD5STEP(F3, d, a, b, c, in[12] + 0xe6db99e5, 11);
MD5STEP(F3, c, d, a, b, in[15] + 0x1fa27cf8, 16);
MD5STEP(F3, b, c, d, a, in[2] + 0xc4ac5665, 23);
MD5STEP(F4, a, b, c, d, in[0] + 0xf4292244, 6);
MD5STEP(F4, d, a, b, c, in[7] + 0x432aff97, 10);
MD5STEP(F4, c, d, a, b, in[14] + 0xab9423a7, 15);
MD5STEP(F4, b, c, d, a, in[5] + 0xfc93a039, 21);
MD5STEP(F4, a, b, c, d, in[12] + 0x655b59c3, 6);
MD5STEP(F4, d, a, b, c, in[3] + 0x8f0ccc92, 10);
MD5STEP(F4, c, d, a, b, in[10] + 0xffeff47d, 15);
MD5STEP(F4, b, c, d, a, in[1] + 0x85845dd1, 21);
MD5STEP(F4, a, b, c, d, in[8] + 0x6fa87e4f, 6);
MD5STEP(F4, d, a, b, c, in[15] + 0xfe2ce6e0, 10);
MD5STEP(F4, c, d, a, b, in[6] + 0xa3014314, 15);
MD5STEP(F4, b, c, d, a, in[13] + 0x4e0811a1, 21);
MD5STEP(F4, a, b, c, d, in[4] + 0xf7537e82, 6);
MD5STEP(F4, d, a, b, c, in[11] + 0xbd3af235, 10);
MD5STEP(F4, c, d, a, b, in[2] + 0x2ad7d2bb, 15);
MD5STEP(F4, b, c, d, a, in[9] + 0xeb86d391, 21);
buf[0] += a;
buf[1] += b;
buf[2] += c;
buf[3] += d;
}
/*
* Start MD5 accumulation. Set bit count to 0 and buffer to mysterious
* initialization constants.
*/
void MD5Init(struct MD5Context *ctx)
{
ctx->buf[0] = 0x67452301;
ctx->buf[1] = 0xefcdab89;
ctx->buf[2] = 0x98badcfe;
ctx->buf[3] = 0x10325476;
ctx->bits[0] = 0;
ctx->bits[1] = 0;
}
/*
* Update context to reflect the concatenation of another buffer full
* of bytes.
*/
void MD5Update(struct MD5Context *ctx, unsigned char *buf, unsigned len)
{
uint32_t t;
/* Update bitcount */
t = ctx->bits[0];
if ((ctx->bits[0] = t + ((uint32_t) len << 3)) < t)
ctx->bits[1]++; /* Carry from low to high */
ctx->bits[1] += len >> 29;
t = (t >> 3) & 0x3f; /* Bytes already in shsInfo->data */
/* Handle any leading odd-sized chunks */
if (t) {
unsigned char *p = (unsigned char *) ctx->in + t;
t = 64 - t;
if (len < t) {
memcpy(p, buf, len);
return;
}
memcpy(p, buf, t);
byteReverse(ctx->in, 16);
MD5Transform(ctx->buf, (uint32_t *) ctx->in);
buf += t;
len -= t;
}
/* Process data in 64-byte chunks */
while (len >= 64) {
memcpy(ctx->in, buf, 64);
byteReverse(ctx->in, 16);
MD5Transform(ctx->buf, (uint32_t *) ctx->in);
buf += 64;
len -= 64;
}
/* Handle any remaining bytes of data. */
memcpy(ctx->in, buf, len);
}
/*
* Final wrapup - pad to 64-byte boundary with the bit pattern
* 1 0* (64-bit count of bits processed, MSB-first)
*/
void MD5Final(unsigned char *digest, struct MD5Context *ctx)
{
unsigned count;
unsigned char *p;
/* Compute number of bytes mod 64 */
count = (ctx->bits[0] >> 3) & 0x3F;
/* Set the first char of padding to 0x80. This is safe since there is
always at least one byte free */
p = ctx->in + count;
*p++ = 0x80;
/* Bytes of padding needed to make 64 bytes */
count = 64 - 1 - count;
/* Pad out to 56 mod 64 */
if (count < 8) {
/* Two lots of padding: Pad the first block to 64 bytes */
memset(p, 0, count);
byteReverse(ctx->in, 16);
MD5Transform(ctx->buf, (uint32_t *) ctx->in);
/* Now fill the next block with 56 bytes */
memset(ctx->in, 0, 56);
} else {
/* Pad block to 56 bytes */
memset(p, 0, count - 8);
}
byteReverse(ctx->in, 14);
/* Append length in bits and transform */
((uint32_t *) ctx->in)[14] = ctx->bits[0];
((uint32_t *) ctx->in)[15] = ctx->bits[1];
MD5Transform(ctx->buf, (uint32_t *) ctx->in);
byteReverse((unsigned char *) ctx->buf, 4);
memcpy(digest, ctx->buf, 16);
memset(ctx, 0, sizeof(ctx)); /* In case it's sensitive */
}

Some files were not shown because too many files have changed in this diff Show More