static void ecc_e31200_status(struct ecc_e31200_softc *sc) { device_t dev = sc->ecc_device; uint16_t errsts; int bus, slot; bus = pci_get_bus(dev); slot = pci_get_slot(dev); errsts = pcib_read_config(dev, bus, slot, 0, PCI_E31200_ERRSTS, 2); if (errsts & PCI_E31200_ERRSTS_DMERR) ecc_printf(sc, "Uncorrectable multilple-bit ECC error\n"); else if (errsts & PCI_E31200_ERRSTS_DSERR) ecc_printf(sc, "Correctable single-bit ECC error\n"); if (errsts & (PCI_E31200_ERRSTS_DSERR | PCI_E31200_ERRSTS_DMERR)) { if (sc->ecc_addr != NULL) ecc_e31200_errlog(sc); /* Clear pending errors */ pcib_write_config(dev, bus, slot, 0, PCI_E31200_ERRSTS, errsts, 2); } }
static void ecc_e31200_status(struct ecc_e31200_softc *sc) { device_t dev = sc->ecc_device; uint16_t errsts; int bus, slot; bus = pci_get_bus(dev); slot = pci_get_slot(dev); errsts = pcib_read_config(dev, bus, slot, 0, 0xc8, 2); if (errsts & 0x2) ecc_printf(sc, "Uncorrectable ECC error\n"); else if (errsts & 0x1) ecc_printf(sc, "Correctable ECC error\n"); if (errsts & 0x3) { if (sc->ecc_addr != NULL) ecc_e31200_errlog(sc); /* Clear pending errors */ pcib_write_config(dev, bus, slot, 0, 0xc8, errsts, 2); } }