tools: edimax_fw_header: fix suspicious memset usage
[openwrt/openwrt.git] / target / linux / adm5120 / files / arch / mips / adm5120 / prom / bootbase.c
index cbdc598928f8e072f70c42686905dadf347e841a..063281e3f7a8b24192925ad8aa832d90802d1353 100644 (file)
@@ -1,10 +1,7 @@
 /*
- *  $Id$
- *
  *  ZyXEL's Bootbase specific prom routines
  *
- *  Copyright (C) 2007 OpenWrt.org
- *  Copyright (C) 2007 Gabor Juhos <juhosg at openwrt.org>
+ *  Copyright (C) 2007-2008 Gabor Juhos <juhosg@openwrt.org>
  *
  *  This program is free software; you can redistribute it and/or modify it
  *  under the terms of the GNU General Public License version 2 as published
@@ -13,7 +10,6 @@
  */
 
 #include <linux/types.h>
-#include <linux/autoconf.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/string.h>
@@ -22,7 +18,7 @@
 #include <asm/addrspace.h>
 #include <asm/byteorder.h>
 
-#include <adm5120_defs.h>
+#include <asm/mach-adm5120/adm5120_defs.h>
 #include <prom/zynos.h>
 #include "prom_read.h"
 
@@ -56,6 +52,14 @@ static inline u32 bootbase_get_bootext_addr(void)
        return prom_read_be32(&board_info->bootext_addr);
 }
 
+static inline void bootbase_get_mac(u8 *mac)
+{
+       int     i;
+
+       for (i = 0; i < 6; i++)
+               mac[i] = board_info->mac[i];
+}
+
 static inline u16 bootbase_get_vendor_id(void)
 {
 #define CHECK_VENDOR(n) (strnicmp(board_info->vendor, (n), strlen(n)) == 0)
@@ -105,6 +109,7 @@ int __init bootbase_present(void)
 
        bootbase_info.vendor_id = bootbase_get_vendor_id();
        bootbase_info.board_id = bootbase_get_board_id();
+       bootbase_get_mac(bootbase_info.mac);
 
        bootbase_found = 1;