From e38ad18193011fd138882fefa0958e31dd2e4034 Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Sat, 16 Sep 2006 12:24:34 +0000 Subject: Get subvendor from the PROM instead of the PCI configuration space, since the latter gets reset if you netboot from an interface. ok miod@, brad@, deraadt@ --- sys/dev/pci/if_bge.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'sys/dev/pci') diff --git a/sys/dev/pci/if_bge.c b/sys/dev/pci/if_bge.c index 4679bf9aaab..0146c95881d 100644 --- a/sys/dev/pci/if_bge.c +++ b/sys/dev/pci/if_bge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bge.c,v 1.175 2006/08/30 21:28:06 kettenis Exp $ */ +/* $OpenBSD: if_bge.c,v 1.176 2006/09/16 12:24:33 kettenis Exp $ */ /* * Copyright (c) 2001 Wind River Systems @@ -1671,6 +1671,9 @@ bge_attach(struct device *parent, struct device *self, void *aux) u_int32_t mac_addr = 0; struct ifnet *ifp; caddr_t kva; +#ifdef __sparc64__ + int subvendor; +#endif sc->bge_pa = *pa; @@ -1763,9 +1766,13 @@ bge_attach(struct device *parent, struct device *self, void *aux) * SEEPROM check. */ sc->bge_eeprom = 1; - if ((pci_conf_read(pa->pa_pc, pa->pa_tag, BGE_PCI_SUBSYS) & 0xffff) == - PCI_VENDOR_SUN) - sc->bge_eeprom = 0; +#ifdef __sparc64__ + if (OF_getprop(PCITAG_NODE(pa->pa_tag), "subsystem-vendor-id", + &subvendor, sizeof(subvendor)) == sizeof(subvendor)) { + if (subvendor == PCI_VENDOR_SUN) + sc->bge_eeprom = 0; + } +#endif /* Try to reset the chip. */ DPRINTFN(5, ("bge_reset\n")); -- cgit v1.2.3