Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/ichsmb/ichsmb.c
| Show First 20 Lines • Show All 504 Lines • ▼ Show 20 Lines | for (count = 0; count < maxloops; count++) { | ||||
| /* Get and reset status bits */ | /* Get and reset status bits */ | ||||
| status = bus_read_1(sc->io_res, ICH_HST_STA); | status = bus_read_1(sc->io_res, ICH_HST_STA); | ||||
| #if ICHSMB_DEBUG | #if ICHSMB_DEBUG | ||||
| if ((status & ~(ICH_HST_STA_INUSE_STS | ICH_HST_STA_HOST_BUSY)) | if ((status & ~(ICH_HST_STA_INUSE_STS | ICH_HST_STA_HOST_BUSY)) | ||||
| || count > 0) { | || count > 0) { | ||||
| DBG("%d stat=0x%02x\n", count, status); | DBG("%d stat=0x%02x\n", count, status); | ||||
| } | } | ||||
| #endif | #endif | ||||
| status &= ~(ICH_HST_STA_INUSE_STS | ICH_HST_STA_HOST_BUSY); | status &= ~(ICH_HST_STA_INUSE_STS | ICH_HST_STA_HOST_BUSY | | ||||
| ICH_HST_STA_SMBALERT_STS); | |||||
| if (status == 0) | if (status == 0) | ||||
| break; | break; | ||||
| /* Check for unexpected interrupt */ | /* Check for unexpected interrupt */ | ||||
| ok_bits = ICH_HST_STA_SMBALERT_STS; | ok_bits = ICH_HST_STA_SMBALERT_STS; | ||||
| cmd_index = sc->ich_cmd >> 2; | cmd_index = sc->ich_cmd >> 2; | ||||
| if (sc->ich_cmd != -1) { | if (sc->ich_cmd != -1) { | ||||
| KASSERT(cmd_index < sizeof(ichsmb_state_irqs), | KASSERT(cmd_index < sizeof(ichsmb_state_irqs), | ||||
| ("%s: ich_cmd=%d", device_get_nameunit(dev), | ("%s: ich_cmd=%d", device_get_nameunit(dev), | ||||
| sc->ich_cmd)); | sc->ich_cmd)); | ||||
| ok_bits |= ichsmb_state_irqs[cmd_index]; | ok_bits |= ichsmb_state_irqs[cmd_index]; | ||||
| } | } | ||||
| if ((status & ~ok_bits) != 0) { | if ((status & ~ok_bits) != 0) { | ||||
| device_printf(dev, "irq 0x%02x during %d\n", status, | device_printf(dev, "irq 0x%02x during %d\n", status, | ||||
| cmd_index); | cmd_index); | ||||
| bus_write_1(sc->io_res, | bus_write_1(sc->io_res, | ||||
| ICH_HST_STA, (status & ~ok_bits)); | ICH_HST_STA, (status & ~ok_bits)); | ||||
| continue; | continue; | ||||
| } | |||||
| /* Handle SMBALERT interrupt */ | |||||
| if (status & ICH_HST_STA_SMBALERT_STS) { | |||||
| static int smbalert_count = 16; | |||||
| if (smbalert_count > 0) { | |||||
| device_printf(dev, "SMBALERT# rec'd\n"); | |||||
| if (--smbalert_count == 0) { | |||||
| device_printf(dev, | |||||
| "not logging anymore\n"); | |||||
| } | |||||
| } | |||||
| } | } | ||||
| /* Check for bus error */ | /* Check for bus error */ | ||||
| if (status & ICH_HST_STA_BUS_ERR) { | if (status & ICH_HST_STA_BUS_ERR) { | ||||
| sc->smb_error = SMB_ECOLLI; /* XXX SMB_EBUSERR? */ | sc->smb_error = SMB_ECOLLI; /* XXX SMB_EBUSERR? */ | ||||
| goto finished; | goto finished; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 142 Lines • Show Last 20 Lines | |||||