1 Index: linux-2.6.19/drivers/usb/gadget/ether.c
2 ===================================================================
3 --- linux-2.6.19.orig/drivers/usb/gadget/ether.c
4 +++ linux-2.6.19/drivers/usb/gadget/ether.c
5 @@ -2184,6 +2184,29 @@ static u8 __devinit nibble (unsigned cha
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
14 + * Generate an Ethernet address (MAC) that is not multicast
15 + * and has the local assigned bit set, keyed on the system_serial
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 + (2 << 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) */
32 static int __devinit get_ether_addr(const char *str, u8 *dev_addr)
35 @@ -2201,8 +2224,16 @@ static int __devinit get_ether_addr(cons
36 if (is_valid_ether_addr (dev_addr))
39 - random_ether_addr(dev_addr);
41 + if(system_serial_high | system_serial_low)
43 + gen_serial_ether_addr(dev_addr);
48 + random_ether_addr(dev_addr);