11 #include <linux/module.h>
12 #include <linux/ctype.h>
14 #include <asm/setup.h>
32 static u8 cmdline_mac[6];
34 static int __init get_mac_addr_from_cmdline(
char *
str)
38 for (count = 0; count < 6 && *
str; count++, str += 3) {
41 if (str[2] != ((count < 5) ?
':' :
'\0'))
44 for (i = 0, val = 0; i < 2; i++) {
47 str[
i] -
'0' :
toupper(str[i]) -
'A' + 10;
53 __setup(
"emac_addr=", get_mac_addr_from_cmdline);
65 int i, have_dt_mac = 0, have_cmdline_mac = 0, have_fuse_mac = 0;
67 for (i = 0; i < 6; i++) {
78 memcpy(addr, cmdline_mac, 6);
79 else if (!have_dt_mac) {
83 eth_random_addr(addr);