diff options
author | Marcus Glocker <mglocker@cvs.openbsd.org> | 2006-08-31 17:05:51 +0000 |
---|---|---|
committer | Marcus Glocker <mglocker@cvs.openbsd.org> | 2006-08-31 17:05:51 +0000 |
commit | 560833d54c4c7697b2fc00d22f764c0a15e88ed6 (patch) | |
tree | 2696023b40f5c45a6384a9f11e147981427fc68f | |
parent | 959f1496acad2d98ae5994ba97f05a74f717fadd (diff) |
Do proper chipset identification.
ok deraadt@
-rw-r--r-- | sys/dev/ic/pgt.c | 14 | ||||
-rw-r--r-- | sys/dev/ic/pgtvar.h | 6 | ||||
-rw-r--r-- | sys/dev/pci/if_pgt_pci.c | 6 |
3 files changed, 11 insertions, 15 deletions
diff --git a/sys/dev/ic/pgt.c b/sys/dev/ic/pgt.c index f7fc85d6fa7..369a40cda93 100644 --- a/sys/dev/ic/pgt.c +++ b/sys/dev/ic/pgt.c @@ -233,8 +233,6 @@ pgt_attachhook(void *xsc) printf("%s: attach error\n", sc->sc_dev.dv_xname); return; } - - DPRINTF(("%s: attach ok\n", sc->sc_dev.dv_xname)); } void @@ -410,12 +408,10 @@ pgt_load_firmware(struct pgt_softc *sc) size_t size; char *name; - if (sc->sc_dev_type == PFF_DEV_ISL3877) - name = "isl3877"; + if (sc->sc_flags & SC_ISL3877) + name = "pgt-isl3877"; else - name = "isl3890"; /* includes isl3880 */ - - name = "pgt-isl3890"; + name = "pgt-isl3890"; /* includes isl3880 */ error = loadfirmware(name, &ucode, &size); @@ -462,8 +458,8 @@ pgt_load_firmware(struct pgt_softc *sc) fwlen -= 4; ucodeoff++; } - DPRINTF(("%s: %d bytes of firmware microcode loaded\n", - sc->sc_dev.dv_xname, fwoff)); + DPRINTF(("%s: %d bytes microcode loaded from %s\n", + sc->sc_dev.dv_xname, fwoff, name)); reg = pgt_read_4(sc, PFF_REG_CTRL_STAT); reg &= ~(PFF_CTRL_STAT_RESET | PFF_CTRL_STAT_CLOCKRUN); diff --git a/sys/dev/ic/pgtvar.h b/sys/dev/ic/pgtvar.h index 6239ee715e3..f27ddc09d69 100644 --- a/sys/dev/ic/pgtvar.h +++ b/sys/dev/ic/pgtvar.h @@ -109,6 +109,7 @@ struct pgt_softc { #define SC_NOFREE_ALLNODES 0x00000100 /* do not free assoc w/reinit */ #define SC_START_DESIRED 0x00000200 /* tried to start during mgmt-crit */ #define SC_KTHREAD 0x00000400 /* has a kthread around */ +#define SC_ISL3877 0x00000800 /* chipset */ /* configuration sysctls */ int sc_dot1x; int sc_wds; @@ -134,11 +135,6 @@ struct pgt_softc { #define SC_DEBUG_RXANNEX 0x00000100 #define SC_DEBUG_RXFRAG 0x00000200 #define SC_DEBUG_RXETHER 0x00000400 - enum pgt_dev_type { - PFF_DEV_ISL3877, - PFF_DEV_ISL3890, - PFF_DEV_3COM6001 - } sc_dev_type; struct resource *sc_intres; /* interrupt resource */ void *sc_intcookie; struct resource *sc_iores; /* IO memory resource */ diff --git a/sys/dev/pci/if_pgt_pci.c b/sys/dev/pci/if_pgt_pci.c index cb95a7b7bb1..4ae79d727e2 100644 --- a/sys/dev/pci/if_pgt_pci.c +++ b/sys/dev/pci/if_pgt_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_pgt_pci.c,v 1.4 2006/08/31 09:26:14 mglocker Exp $ */ +/* $OpenBSD: if_pgt_pci.c,v 1.5 2006/08/31 17:05:50 mglocker Exp $ */ /* * Copyright (c) 2006 Marcus Glocker <mglocker@openbsd.org> @@ -101,6 +101,10 @@ pgt_pci_attach(struct device *parent, struct device *self, void *aux) sc->sc_dmat = pa->pa_dmat; psc->sc_pc = pa->pa_pc; + /* remember chipset */ + if (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_INTERSIL_ISL3877) + sc->sc_flags |= SC_ISL3877; + /* map control / status registers */ error = pci_mapreg_map(pa, PGT_PCI_BAR0, PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_32BIT, 0, |