root/trunk/patches/2.6.22/64-fsg3-setup-mac.patch

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

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

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

    old new  
    1616#include <linux/serial_8250.h> 
    1717#include <linux/leds.h> 
    1818#include <linux/i2c-gpio.h> 
     19#include <linux/mtd/mtd.h> 
    1920 
    2021#include <asm/mach-types.h> 
    2122#include <asm/mach/arch.h> 
     
    177178        &fsg_eth[1], 
    178179}; 
    179180 
     181static void fsg_flash_add(struct mtd_info *mtd) 
     182{ 
     183        if (strcmp(mtd->name, "RedBoot config") == 0) { 
     184                size_t retlen; 
     185                u_char mac[6]; 
     186 
     187                if (mtd->read(mtd, 0x0422, 6, &retlen, mac) == 0 && retlen == 6) { 
     188                        printk(KERN_INFO "eth0 mac: %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n", 
     189                                mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); 
     190                        memcpy(fsg_plat_eth[0].hwaddr, mac, 6); 
     191                        mac[5]++; 
     192                        printk(KERN_INFO "eth1 mac: %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n", 
     193                                mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); 
     194                        memcpy(fsg_plat_eth[1].hwaddr, mac, 6); 
     195                } else { 
     196                        printk(KERN_ERR "fsg mac: read failed\n"); 
     197                } 
     198        } 
     199} 
     200 
     201static void fsg_flash_remove(struct mtd_info *mtd) { 
     202} 
     203 
     204static struct mtd_notifier fsg_flash_notifier = { 
     205        .add = fsg_flash_add, 
     206        .remove = fsg_flash_remove, 
     207}; 
     208 
    180209static void __init fsg_init(void) 
    181210{ 
    182211        ixp4xx_sys_init(); 
     
    198227        (void)platform_device_register(&fsg_uart); 
    199228 
    200229        platform_add_devices(fsg_devices, ARRAY_SIZE(fsg_devices)); 
     230 
     231        register_mtd_user(&fsg_flash_notifier); 
    201232} 
    202233 
    203234MACHINE_START(FSG, "Freecom FSG-3") 
Note: See TracBrowser for help on using the browser.