summaryrefslogtreecommitdiff
path: root/recipes/linux/linux-gumstix-2.6.15/smc-ether-addr.patch
diff options
context:
space:
mode:
authorDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
committerDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
commit709c4d66e0b107ca606941b988bad717c0b45d9b (patch)
tree37ee08b1eb308f3b2b6426d5793545c38396b838 /recipes/linux/linux-gumstix-2.6.15/smc-ether-addr.patch
parentfa6cd5a3b993f16c27de4ff82b42684516d433ba (diff)
rename packages/ to recipes/ per earlier agreement
See links below for more details: http://thread.gmane.org/gmane.comp.handhelds.openembedded/21326 http://thread.gmane.org/gmane.comp.handhelds.openembedded/21816 Signed-off-by: Denys Dmytriyenko <denis@denix.org> Acked-by: Mike Westerhof <mwester@dls.net> Acked-by: Philip Balister <philip@balister.org> Acked-by: Khem Raj <raj.khem@gmail.com> Acked-by: Marcin Juszkiewicz <hrw@openembedded.org> Acked-by: Koen Kooi <koen@openembedded.org> Acked-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Diffstat (limited to 'recipes/linux/linux-gumstix-2.6.15/smc-ether-addr.patch')
-rw-r--r--recipes/linux/linux-gumstix-2.6.15/smc-ether-addr.patch53
1 files changed, 53 insertions, 0 deletions
diff --git a/recipes/linux/linux-gumstix-2.6.15/smc-ether-addr.patch b/recipes/linux/linux-gumstix-2.6.15/smc-ether-addr.patch
new file mode 100644
index 0000000000..920aa53ad8
--- /dev/null
+++ b/recipes/linux/linux-gumstix-2.6.15/smc-ether-addr.patch
@@ -0,0 +1,53 @@
+Index: linux-2.6.15gum/drivers/net/smc91x.c
+===================================================================
+--- linux-2.6.15gum.orig/drivers/net/smc91x.c
++++ linux-2.6.15gum/drivers/net/smc91x.c
+@@ -1818,6 +1818,30 @@ static int __init smc_findirq(void __iom
+ return probe_irq_off(cookie);
+ }
+
++/**
++ * gen_serial_ether_addr - Generate software assigned Ethernet address
++ * based on the system_serial number
++ * @addr: Pointer to a six-byte array containing the Ethernet address
++ *
++ * Generate an Ethernet address (MAC) that is not multicast
++ * and has the local assigned bit set, keyed on the system_serial
++ */
++static inline void gen_serial_ether_addr(u8 *addr)
++{
++ static u8 ether_serial_digit = 1;
++ addr [0] = system_serial_high >> 8;
++ addr [1] = system_serial_high;
++ addr [2] = system_serial_low >> 24;
++ addr [3] = system_serial_low >> 16;
++ addr [4] = system_serial_low >> 8;
++ addr [5] = (system_serial_low & 0xc0) | /* top bits are from system serial */
++ (1 << 4) | /* 2 bits identify interface type 1=ether, 2=usb, 3&4 undef */
++ ((ether_serial_digit++) & 0x0f); /* 15 possible interfaces of each type */
++ addr [0] &= 0xfe; /* clear multicast bit */
++ addr [0] |= 0x02; /* set local assignment bit (IEEE802) */
++}
++
++
+ /*
+ * Function: smc_probe(unsigned long ioaddr)
+ *
+@@ -2036,15 +2060,13 @@ static int __init smc_probe(struct net_d
+ THROTTLE_TX_PKTS ? " [throttle_tx]" : "");
+
+ if (!is_valid_ether_addr(dev->dev_addr)) {
+- printk("%s: Invalid ethernet MAC address. Please "
+- "set using ifconfig\n", dev->name);
+- } else {
++ gen_serial_ether_addr(dev->dev_addr);
++ }
+ /* Print the Ethernet address */
+ printk("%s: Ethernet addr: ", dev->name);
+ for (i = 0; i < 5; i++)
+ printk("%2.2x:", dev->dev_addr[i]);
+ printk("%2.2x\n", dev->dev_addr[5]);
+- }
+
+ if (lp->phy_type == 0) {
+ PRINTK("%s: No PHY found\n", dev->name);