diff options
author | Brad Smith <brad@cvs.openbsd.org> | 2014-11-16 05:46:21 +0000 |
---|---|---|
committer | Brad Smith <brad@cvs.openbsd.org> | 2014-11-16 05:46:21 +0000 |
commit | 0ea741f5137d2fd7be610409df02a37780a7c7e6 (patch) | |
tree | 700089ed0667f267e2d2f3d354938763ec381484 /sys/dev/pci | |
parent | a36243f1a660d50cbcda545cd16837ad2b7f6b47 (diff) |
Allow the driver to be able to retrieve the MAC address from the ROM
for NS Saturn based boards.
From NetBSD
ok deraadt@
Diffstat (limited to 'sys/dev/pci')
-rw-r--r-- | sys/dev/pci/if_cas.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/dev/pci/if_cas.c b/sys/dev/pci/if_cas.c index 37d6985418a..7bc4602bfd6 100644 --- a/sys/dev/pci/if_cas.c +++ b/sys/dev/pci/if_cas.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_cas.c,v 1.33 2013/08/21 05:21:44 dlg Exp $ */ +/* $OpenBSD: if_cas.c,v 1.34 2014/11/16 05:46:20 brad Exp $ */ /* * @@ -167,11 +167,16 @@ cas_match(struct device *parent, void *cf, void *aux) #define PROMDATA_DATA2 0x0a static const u_int8_t cas_promhdr[] = { 0x55, 0xaa }; -static const u_int8_t cas_promdat[] = { +static const u_int8_t cas_promdat_sun[] = { 'P', 'C', 'I', 'R', PCI_VENDOR_SUN & 0xff, PCI_VENDOR_SUN >> 8, PCI_PRODUCT_SUN_CASSINI & 0xff, PCI_PRODUCT_SUN_CASSINI >> 8 }; +static const u_int8_t cas_promdat_ns[] = { + 'P', 'C', 'I', 'R', + PCI_VENDOR_NS & 0xff, PCI_VENDOR_NS >> 8, + PCI_PRODUCT_NS_SATURN & 0xff, PCI_PRODUCT_NS_SATURN >> 8 +}; static const u_int8_t cas_promdat2[] = { 0x18, 0x00, /* structure length */ @@ -211,7 +216,8 @@ cas_pci_enaddr(struct cas_softc *sc, struct pci_attach_args *pa) goto fail; bus_space_read_region_1(romt, romh, dataoff, buf, sizeof(buf)); - if (bcmp(buf, cas_promdat, sizeof(cas_promdat)) || + if ((bcmp(buf, cas_promdat_sun, sizeof(cas_promdat_sun)) && + bcmp(buf, cas_promdat_ns, sizeof(cas_promdat_ns))) || bcmp(buf + PROMDATA_DATA2, cas_promdat2, sizeof(cas_promdat2))) goto fail; |