Lines Matching defs:xycsc

1098 	struct xyc_softc *xycsc = v;
1101 xycsc->sc_intrcnt.ev_count++;
1104 xyc_remove_iorq(xycsc);
1107 xyc_start(xycsc, NULL);
1207 xyc_cmd(struct xyc_softc *xycsc, int cmd, int subfn, int unit, int block,
1210 struct xy_iorq *iorq = xycsc->ciorq;
1211 struct xy_iopb *iopb = xycsc->ciopb;
1227 printf("%s: stole control iopb\n", device_xname(xycsc->sc_dev));
1232 xyc_rqinit(iorq, xycsc,
1233 (unit == XYC_NOUNIT) ? NULL : xycsc->sc_drives[unit],
1242 xyc_submit_iorq(xycsc, iorq, fullmode); /* error code will be in iorq */
1253 xyc_startbuf(struct xyc_softc *xycsc, struct xy_softc *xysc, struct buf *bp)
1303 device_xname(xycsc->sc_dev));
1310 xyc_rqinit(iorq, xycsc, xysc, XY_SUB_NORM | XY_MODE_VERBO, block,
1356 xyc_submit_iorq(struct xyc_softc *xycsc, struct xy_iorq *iorq, int type)
1363 device_xname(xycsc->sc_dev), iorq, type);
1367 if ((xycsc->xyc->xyc_csr & XYC_GBSY) != 0) {
1382 iopbaddr = xycsc->xyc->xyc_rsetup; /* RESET */
1383 if (xyc_unbusy(xycsc->xyc, XYC_RESETUSEC) ==
1387 device_xname(xycsc->sc_dev));
1394 iopb = xyc_chain(xycsc, iorq); /* build chain */
1400 iopbaddr = dvma_kvtopa(iopb, xycsc->bustype);
1402 XYC_GO(xycsc->xyc, iopbaddr);
1415 return xyc_piodriver(xycsc, iorq);
1430 xyc_chain(struct xyc_softc *xycsc, struct xy_iorq *iorq)
1435 memset(xycsc->xy_chain, 0, sizeof(xycsc->xy_chain));
1441 if ((XY_STATE(xycsc->reqs[XYC_CTLIOPB].mode) == XY_SUB_POLL ||
1442 XY_STATE(xycsc->reqs[XYC_CTLIOPB].mode) == XY_SUB_WAIT) &&
1443 xycsc->iopbase[XYC_CTLIOPB].done == 0)
1444 iorq = &xycsc->reqs[XYC_CTLIOPB];
1452 xycsc->xy_chain[0] = iorq;
1462 hand = xycsc->xy_hand;
1463 xycsc->xy_hand = (xycsc->xy_hand + 1) % XYC_MAXIOPB;
1468 if (XY_STATE(xycsc->reqs[hand].mode) != XY_SUB_NORM ||
1469 xycsc->iopbase[hand].done)
1472 xycsc->xy_chain[chain] = &xycsc->reqs[hand];
1473 iopb = xycsc->xy_chain[chain]->iopb;
1476 prev_iopb = xycsc->xy_chain[chain-1]->iopb;
1479 dvma_kvtopa(iopb, xycsc->bustype);
1481 iorq = xycsc->xy_chain[chain];
1484 if (xycsc->no_ols)
1498 xyc_piodriver(struct xyc_softc *xycsc, struct xy_iorq *iorq)
1505 printf("%s(%s, 0x%x)\n", __func__, device_xname(xycsc->sc_dev), iorq);
1510 res = xyc_unbusy(xycsc->xyc, XYC_MAXTIME);
1514 xyc_reset(xycsc, 0, XY_RSET_ALL, XY_ERR_FAIL, 0);
1521 if (xyc_reset(xycsc, 0,
1529 xyc_remove_iorq(xycsc); /* may resubmit request */
1532 xyc_start(xycsc, iorq);
1546 xyc_start(xycsc, NULL);
1556 xyc_xyreset(struct xyc_softc *xycsc, struct xy_softc *xysc)
1561 memcpy(&tmpiopb, xycsc->ciopb, sizeof(tmpiopb));
1562 xycsc->ciopb->chen = xycsc->ciopb->done = xycsc->ciopb->errs = 0;
1563 xycsc->ciopb->ien = 0;
1564 xycsc->ciopb->com = XYCMD_RST;
1565 xycsc->ciopb->unit = xysc->xy_drive;
1566 addr = dvma_kvtopa(xycsc->ciopb, xycsc->bustype);
1568 XYC_GO(xycsc->xyc, addr);
1572 if ((xycsc->xyc->xyc_csr & XYC_GBSY) == 0)
1578 if (del <= 0 || xycsc->ciopb->errs) {
1579 printf("%s: off-line: %s\n", device_xname(xycsc->sc_dev),
1580 xyc_e2str(xycsc->ciopb->errno));
1581 del = xycsc->xyc->xyc_rsetup;
1582 if (xyc_unbusy(xycsc->xyc, XYC_RESETUSEC) == XY_ERR_FAIL)
1585 xycsc->xyc->xyc_csr = XYC_IPND; /* clear IPND */
1587 memcpy(xycsc->ciopb, &tmpiopb, sizeof(tmpiopb));
1596 xyc_reset(struct xyc_softc *xycsc, int quiet, struct xy_iorq *blastmode,
1605 printf("%s: soft reset\n", device_xname(xycsc->sc_dev));
1606 del = xycsc->xyc->xyc_rsetup;
1607 del = xyc_unbusy(xycsc->xyc, XYC_RESETUSEC);
1613 xyc_xyreset(xycsc, xysc);
1618 iorq = &xycsc->reqs[lcv];
1630 xycsc->iopbase[lcv].done = xycsc->iopbase[lcv].errs = 1;
1663 xyc_start(xycsc, NULL);
1673 xyc_start(struct xyc_softc *xycsc, struct xy_iorq *iorq)
1680 if ((xy = xycsc->sc_drives[lcv]) == NULL)
1686 xyc_startbuf(xycsc, xy, bufq_peek(xy->xyq));
1689 xyc_submit_iorq(xycsc, iorq, XY_SUB_NOQ);
1697 xyc_remove_iorq(struct xyc_softc *xycsc)
1700 struct xyc *xyc = xycsc->xyc;
1713 printf("%s: DOUBLE ERROR!\n", device_xname(xycsc->sc_dev));
1714 if (xyc_reset(xycsc, 0, XY_RSET_ALL, errno, 0) != XY_ERR_AOK) {
1716 device_xname(xycsc->sc_dev));
1734 iorq = xycsc->xy_chain[rq];
1753 xyc_error(xycsc, iorq, iopb, comm) == XY_ERR_AOK)
1792 addr = dvma_kvtopa(iorq->dbuf, xycsc->bustype);
1870 xyc_error(struct xyc_softc *xycsc, struct xy_iorq *iorq, struct xy_iopb *iopb,
1881 xyc_reset(xycsc, 1, XY_RSET_NONE, errno, iorq->xy);
1937 struct xyc_softc *xycsc = arg;
1943 if (xycsc->reqs[lcv].mode == 0 ||
1944 XY_STATE(xycsc->reqs[lcv].mode) == XY_SUB_DONE)
1946 xycsc->reqs[lcv].ttl--;
1947 if (xycsc->reqs[lcv].ttl == 0)
1951 printf("%s: watchdog timeout\n", device_xname(xycsc->sc_dev));
1952 xyc_reset(xycsc, 0, XY_RSET_NONE, XY_ERR_FAIL, NULL);
1958 callout_reset(&xycsc->sc_tick_ch, XYC_TICKCNT, xyc_tick, xycsc);
1974 struct xyc_softc *xycsc;
2016 xycsc = xy->parent;
2018 rqno = xyc_cmd(xycsc, xio->cmd, xio->subfn, xy->xy_drive, xio->block,
2024 xio->errno = xycsc->ciorq->errno;
2025 xio->tries = xycsc->ciorq->tries;
2026 XYC_DONE(xycsc, err);