1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-18 10:35:55 +00:00

Detect cycle lost.

This commit is contained in:
Hidetoshi Shimokawa 2007-03-16 04:25:02 +00:00
parent 2bab61b0b4
commit d0581de84e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=167628
2 changed files with 19 additions and 0 deletions

View File

@ -1877,6 +1877,19 @@ fwohci_intr_body(struct fwohci_softc *sc, uint32_t stat, int count)
#endif
fwohci_arcv(sc, &sc->arrq, count);
}
if (stat & OHCI_INT_CYC_LOST) {
if (sc->cycle_lost >= 0)
sc->cycle_lost ++;
if (sc->cycle_lost > 10) {
sc->cycle_lost = -1;
#if 0
OWRITE(sc, OHCI_LNKCTLCLR, OHCI_CNTL_CYCTIMER);
#endif
OWRITE(sc, FWOHCI_INTMASKCLR, OHCI_INT_CYC_LOST);
device_printf(fc->dev, "too many cycle lost, "
"no cycle master presents?\n");
}
}
if(stat & OHCI_INT_PHY_SID){
uint32_t *buf, node_id;
int plen;
@ -1907,6 +1920,10 @@ fwohci_intr_body(struct fwohci_softc *sc, uint32_t stat, int count)
printf("Bus reset failure\n");
goto sidout;
}
/* cycle timer */
sc->cycle_lost = 0;
OWRITE(sc, FWOHCI_INTMASK, OHCI_INT_CYC_LOST);
if (node_id & OHCI_NODE_ROOT) {
printf("CYCLEMASTER mode\n");
OWRITE(sc, OHCI_LNKCTL,
@ -1916,6 +1933,7 @@ fwohci_intr_body(struct fwohci_softc *sc, uint32_t stat, int count)
OWRITE(sc, OHCI_LNKCTLCLR, OHCI_CNTL_CYCMTR);
OWRITE(sc, OHCI_LNKCTL, OHCI_CNTL_CYCTIMER);
}
fc->nodeid = node_id & 0x3f;
if (plen & OHCI_SID_ERR) {

View File

@ -81,6 +81,7 @@ typedef struct fwohci_softc {
uint32_t intstat;
struct task fwohci_task_complete;
#endif
int cycle_lost;
} fwohci_softc_t;
void fwohci_intr (void *arg);