libdmx: Add fso-specs to DEPENDS
[openembedded.git] / recipes / linux / linux-gumstix-2.6.15 / smc-ether-addr.patch
blob920aa53ad81c54267f02b01757eb42d46b7fa005
1 Index: linux-2.6.15gum/drivers/net/smc91x.c
2 ===================================================================
3 --- linux-2.6.15gum.orig/drivers/net/smc91x.c
4 +++ linux-2.6.15gum/drivers/net/smc91x.c
5 @@ -1818,6 +1818,30 @@ static int __init smc_findirq(void __iom
6 return probe_irq_off(cookie);
9 +/**
10 + * gen_serial_ether_addr - Generate software assigned Ethernet address
11 + * based on the system_serial number
12 + * @addr: Pointer to a six-byte array containing the Ethernet address
13 + *
14 + * Generate an Ethernet address (MAC) that is not multicast
15 + * and has the local assigned bit set, keyed on the system_serial
16 + */
17 +static inline void gen_serial_ether_addr(u8 *addr)
19 + static u8 ether_serial_digit = 1;
20 + addr [0] = system_serial_high >> 8;
21 + addr [1] = system_serial_high;
22 + addr [2] = system_serial_low >> 24;
23 + addr [3] = system_serial_low >> 16;
24 + addr [4] = system_serial_low >> 8;
25 + addr [5] = (system_serial_low & 0xc0) | /* top bits are from system serial */
26 + (1 << 4) | /* 2 bits identify interface type 1=ether, 2=usb, 3&4 undef */
27 + ((ether_serial_digit++) & 0x0f); /* 15 possible interfaces of each type */
28 + addr [0] &= 0xfe; /* clear multicast bit */
29 + addr [0] |= 0x02; /* set local assignment bit (IEEE802) */
34 * Function: smc_probe(unsigned long ioaddr)
36 @@ -2036,15 +2060,13 @@ static int __init smc_probe(struct net_d
37 THROTTLE_TX_PKTS ? " [throttle_tx]" : "");
39 if (!is_valid_ether_addr(dev->dev_addr)) {
40 - printk("%s: Invalid ethernet MAC address. Please "
41 - "set using ifconfig\n", dev->name);
42 - } else {
43 + gen_serial_ether_addr(dev->dev_addr);
44 + }
45 /* Print the Ethernet address */
46 printk("%s: Ethernet addr: ", dev->name);
47 for (i = 0; i < 5; i++)
48 printk("%2.2x:", dev->dev_addr[i]);
49 printk("%2.2x\n", dev->dev_addr[5]);
50 - }
52 if (lp->phy_type == 0) {
53 PRINTK("%s: No PHY found\n", dev->name);