diff options
Diffstat (limited to 'packages/linux/ixp4xx-kernel/2.6.15/92-nas100d-maclist.patch')
-rw-r--r-- | packages/linux/ixp4xx-kernel/2.6.15/92-nas100d-maclist.patch | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/packages/linux/ixp4xx-kernel/2.6.15/92-nas100d-maclist.patch b/packages/linux/ixp4xx-kernel/2.6.15/92-nas100d-maclist.patch new file mode 100644 index 0000000000..3143850b22 --- /dev/null +++ b/packages/linux/ixp4xx-kernel/2.6.15/92-nas100d-maclist.patch @@ -0,0 +1,72 @@ +--- linux-2.6.15/arch/arm/mach-ixp4xx/Kconfig 1970-01-01 00:00:00.000000000 +0000 ++++ linux-2.6.15/arch/arm/mach-ixp4xx/Kconfig 1970-01-01 00:00:00.000000000 +0000 +@@ -74,6 +74,7 @@ comment "IXP4xx Platforms" + config MACH_NAS100D + bool + prompt "NAS100D" ++ select MACLIST + help + Say 'Y' here if you want your kernel to support Iomega's + NAS 100d device. For more information on this platform, +--- linux-2.6.15/arch/arm/mach-ixp4xx/nas100d-setup.c 1970-01-01 00:00:00.000000000 +0000 ++++ linux-2.6.15/arch/arm/mach-ixp4xx/nas100d-setup.c 1970-01-01 00:00:00.000000000 +0000 +@@ -14,11 +14,14 @@ + #include <linux/kernel.h> + #include <linux/serial.h> + #include <linux/serial_8250.h> ++#include <linux/mtd/mtd.h> + + #include <asm/mach-types.h> + #include <asm/mach/arch.h> + #include <asm/mach/flash.h> + ++#include <net/maclist.h> ++ + static struct flash_platform_data nas100d_flash_data = { + .map_name = "cfi_probe", + .width = 2, +@@ -110,8 +113,44 @@ + gpio_line_set(NAS100D_PO_GPIO, IXP4XX_GPIO_HIGH); + } + ++/* ++ * When the RedBoot config partition is added the MAC address is read from ++ * it. ++ */ ++void flash_add(struct mtd_info *mtd) { ++ if (strcmp(mtd->name, "RedBoot config") == 0) { ++ size_t retlen; ++ u_char mac[6]; ++ ++ /* The MAC is at a known offset... */ ++ if (mtd->read(mtd, 0x0FD8, 6, &retlen, mac) == 0 && retlen == 6) { ++ printk(KERN_INFO "NAS100D MAC: %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n", ++ mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); ++ maclist_add(mac); ++ } else { ++ printk(KERN_ERR "NAS100D MAC: read failed\n"); ++ } ++ } ++} ++ ++/* ++ * Nothing to do on remove at present. ++ */ ++void flash_remove(struct mtd_info *mtd) { ++} ++ ++struct mtd_notifier flash_notifier = { ++ .add = flash_add, ++ .remove = flash_remove, ++}; ++ + static void __init nas100d_init(void) + { ++ /* The flash has an ethernet MAC embedded in it which we need, ++ * that is all this notifier does. ++ */ ++ register_mtd_user(&flash_notifier); ++ + ixp4xx_sys_init(); + + pm_power_off = nas100d_power_off; |