root/trunk/patches/2.6.22/64-fsg3-setup-mac.patch
| Revision 917, 1.5 kB (checked in by gordon, 3 years ago) |
|---|
-
a/arch/arm/mach-ixp4xx/fsg-setup.c
old new 16 16 #include <linux/serial_8250.h> 17 17 #include <linux/leds.h> 18 18 #include <linux/i2c-gpio.h> 19 #include <linux/mtd/mtd.h> 19 20 20 21 #include <asm/mach-types.h> 21 22 #include <asm/mach/arch.h> … … 177 178 &fsg_eth[1], 178 179 }; 179 180 181 static 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 201 static void fsg_flash_remove(struct mtd_info *mtd) { 202 } 203 204 static struct mtd_notifier fsg_flash_notifier = { 205 .add = fsg_flash_add, 206 .remove = fsg_flash_remove, 207 }; 208 180 209 static void __init fsg_init(void) 181 210 { 182 211 ixp4xx_sys_init(); … … 198 227 (void)platform_device_register(&fsg_uart); 199 228 200 229 platform_add_devices(fsg_devices, ARRAY_SIZE(fsg_devices)); 230 231 register_mtd_user(&fsg_flash_notifier); 201 232 } 202 233 203 234 MACHINE_START(FSG, "Freecom FSG-3")
Note: See TracBrowser for help on using the browser.
