root/trunk/patches/2.6.22/61-nslu2-setup-mac.patch

Revision 917, 1.4 kB (checked in by gordon, 3 years ago)

Update IXP4XX network drivers to Krzysztof's latest version from git

  • a/arch/arm/mach-ixp4xx/nslu2-setup.c

    old new  
    1919#include <linux/serial_8250.h> 
    2020#include <linux/leds.h> 
    2121#include <linux/i2c-gpio.h> 
     22#include <linux/mtd/mtd.h> 
    2223 
    2324#include <asm/mach-types.h> 
    2425#include <asm/mach/arch.h> 
     
    167168        &nslu2_eth[0], 
    168169}; 
    169170 
     171static void nslu2_flash_add(struct mtd_info *mtd) 
     172{ 
     173        if (strcmp(mtd->name, "RedBoot") == 0) { 
     174                size_t retlen; 
     175                u_char mac[6]; 
     176 
     177                if (mtd->read(mtd, 0x3FFB0, 6, &retlen, mac) == 0 && retlen == 6) { 
     178                        printk(KERN_INFO "nslu2 mac: %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n", 
     179                        mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); 
     180                        memcpy(nslu2_plat_eth[0].hwaddr, mac, 6); 
     181                } else { 
     182                        printk(KERN_ERR "nslu2 mac: read failed\n"); 
     183                } 
     184        } 
     185} 
     186 
     187static void nslu2_flash_remove(struct mtd_info *mtd) { 
     188} 
     189 
     190static struct mtd_notifier nslu2_flash_notifier = { 
     191        .add = nslu2_flash_add, 
     192        .remove = nslu2_flash_remove, 
     193}; 
     194 
    170195static void nslu2_power_off(void) 
    171196{ 
    172197        /* This causes the box to drop the power and go dead. */ 
     
    209234        (void)platform_device_register(&nslu2_uart); 
    210235 
    211236        platform_add_devices(nslu2_devices, ARRAY_SIZE(nslu2_devices)); 
     237 
     238        register_mtd_user(&nslu2_flash_notifier); 
    212239} 
    213240 
    214241MACHINE_START(NSLU2, "Linksys NSLU2") 
Note: See TracBrowser for help on using the browser.