Use new common code in ether_device.h for random_ether_addr.
Same exact code just in one common place.

diff -Nru a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
--- a/drivers/usb/gadget/ether.c        Fri Apr  9 11:39:51 2004
+++ b/drivers/usb/gadget/ether.c        Fri Apr  9 11:39:51 2004
@@ -1804,17 +1804,13 @@
        /* one random address for the gadget device ... both of these could
         * reasonably come from an id prom or a module parameter.
         */
-       get_random_bytes (net->dev_addr, ETH_ALEN);
-       net->dev_addr [0] &= 0xfe;      // clear multicast bit
-       net->dev_addr [0] |= 0x02;      // set local assignment bit (IEEE802)
+       random_ether_addr(net->dev_addr);
 
 #ifdef DEV_CONFIG_CDC
        /* ... another address for the host, on the other end of the
         * link, gets exported through CDC (see CDC spec table 41)
         */
-       get_random_bytes (node_id, sizeof node_id);
-       node_id [0] &= 0xfe;    // clear multicast bit
-       node_id [0] |= 0x02;    // set local assignment bit (IEEE802)
+       random_ether_addr(node_id);
        snprintf (ethaddr, sizeof ethaddr, "%02X%02X%02X%02X%02X%02X",
                node_id [0], node_id [1], node_id [2],
                node_id [3], node_id [4], node_id [5]);


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to