aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorYoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>2007-10-15 06:06:20 -0400
committerJeff Garzik <jeff@garzik.org>2007-10-15 14:38:24 -0400
commit2de889235d0e820a6b256b834ee6a64e12fede08 (patch)
treecb7b58e6ed74f2c6fe8479acb28ff9c50781a2d6 /drivers/net
parentc2af68e5f550a671ac9f67f566f04e1580a103a0 (diff)
update AU1000 get_ethernet_addr()
Update AU1000 get_ethernet_addr(). Three functions were brought together in one. Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> Acked-by: Ralf Baechle <ralf@linux-mips.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/au1000_eth.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/drivers/net/au1000_eth.c b/drivers/net/au1000_eth.c
index b46c5d8a77bd..297e2d08d267 100644
--- a/drivers/net/au1000_eth.c
+++ b/drivers/net/au1000_eth.c
@@ -97,9 +97,7 @@ static void au1000_adjust_link(struct net_device *);
97static void enable_mac(struct net_device *, int); 97static void enable_mac(struct net_device *, int);
98 98
99// externs 99// externs
100extern int get_ethernet_addr(char *ethernet_addr); 100extern int prom_get_ethernet_addr(char *ethernet_addr);
101extern void str2eaddr(unsigned char *ea, unsigned char *str);
102extern char * prom_getcmdline(void);
103 101
104/* 102/*
105 * Theory of operation 103 * Theory of operation
@@ -619,7 +617,6 @@ static struct net_device * au1000_probe(int port_num)
619 struct au1000_private *aup = NULL; 617 struct au1000_private *aup = NULL;
620 struct net_device *dev = NULL; 618 struct net_device *dev = NULL;
621 db_dest_t *pDB, *pDBfree; 619 db_dest_t *pDB, *pDBfree;
622 char *pmac, *argptr;
623 char ethaddr[6]; 620 char ethaddr[6];
624 int irq, i, err; 621 int irq, i, err;
625 u32 base, macen; 622 u32 base, macen;
@@ -677,21 +674,12 @@ static struct net_device * au1000_probe(int port_num)
677 au_macs[port_num] = aup; 674 au_macs[port_num] = aup;
678 675
679 if (port_num == 0) { 676 if (port_num == 0) {
680 /* Check the environment variables first */ 677 if (prom_get_ethernet_addr(ethaddr) == 0)
681 if (get_ethernet_addr(ethaddr) == 0)
682 memcpy(au1000_mac_addr, ethaddr, sizeof(au1000_mac_addr)); 678 memcpy(au1000_mac_addr, ethaddr, sizeof(au1000_mac_addr));
683 else { 679 else {
684 /* Check command line */ 680 printk(KERN_INFO "%s: No MAC address found\n",
685 argptr = prom_getcmdline(); 681 dev->name);
686 if ((pmac = strstr(argptr, "ethaddr=")) == NULL)
687 printk(KERN_INFO "%s: No MAC address found\n",
688 dev->name);
689 /* Use the hard coded MAC addresses */ 682 /* Use the hard coded MAC addresses */
690 else {
691 str2eaddr(ethaddr, pmac + strlen("ethaddr="));
692 memcpy(au1000_mac_addr, ethaddr,
693 sizeof(au1000_mac_addr));
694 }
695 } 683 }
696 684
697 setup_hw_rings(aup, MAC0_RX_DMA_ADDR, MAC0_TX_DMA_ADDR); 685 setup_hw_rings(aup, MAC0_RX_DMA_ADDR, MAC0_TX_DMA_ADDR);