/*
 * idprom.h
 *
 * Copyright (c) 2010 Allied Telesis Labs
 *
 * This file is licensed under the terms of the GNU General Public License
 * version 2. This program is licensed "as is" without any warranty of any
 * kind, whether express or implied.
 */

#define IDPROM_SIZE 256
struct idprom {
        char raw[IDPROM_SIZE+1];
        int crc_ok;
        char *sn;	// Serial Number
        char *mn;	// Model Number (customer visible) e.g. AT-SBx81CFC
        char *smn;	// Software Model Number (for internal use) e.g. CFC200
        char *pn;	// Part Number (usually the 844 number from Agile)
        char *hv;	// Hardware version e.g X1, A
        char *hm;	// Hardware Matrix
        char *svc;	// Software Version Compatibility
        char *bd;	// Birth Date (in MMDDYYYY format)
        char *mac0;	// First MAC address
        char *nmac;	// Number of MAC addresses
        char *oem;	// OEM region
};

struct idprom *idprom_get(void);
void idprom_parse_enetaddr(struct idprom *, uchar *);
void idprom_setmacaddr(int index);
#ifdef CONFIG_ARM
int idprom_setmachid(void);
#endif
