Lines Matching refs:sr
252 struct sunscpal_req *sr = sc->sc_current;
262 ((sr->sr_flags & SR_IMMED) ? 0 : SUNSCPAL_ICR_INTERRUPT_ENABLE);
286 struct sunscpal_req *sr = sc->sc_current;
301 sr->sr_flags |= SR_OVERDUE;
321 struct sunscpal_req *sr = sc->sc_current;
322 struct scsipi_xfer *xs = sr->sr_xs;
346 sunscpal_dma_handle_t dh = sr->sr_dma_hand;
360 sr->sr_xs->error = XS_DRIVER_STUFFUP;
652 struct sunscpal_req *sr = arg;
661 xs = sr->sr_xs;
671 sr->sr_target, sr->sr_lun);
679 sr->sr_flags |= SR_OVERDUE;
680 if (sc->sc_current == sr) {
681 SUNSCPAL_TRACE("cmd_tmo: call abort, sr=0x%x\n", (long)sr);
689 (sr->sr_target << 4) | sr->sr_lun);
690 sc->sc_matrix[sr->sr_target][sr->sr_lun] = NULL;
729 struct sunscpal_req *sr;
746 sr = sc->sc_current;
747 if (sr != NULL) {
749 device_xname(sc->sc_dev), sr->sr_target,
750 sr->sr_lun);
773 sr = &sc->sc_ring[i];
774 sr->sr_xs = xs;
775 sr->sr_target = xs->xs_periph->periph_target;
776 sr->sr_lun = xs->xs_periph->periph_lun;
777 sr->sr_dma_hand = NULL;
778 sr->sr_dataptr = xs->data;
779 sr->sr_datalen = xs->datalen;
780 sr->sr_flags = (flags & XS_CTL_POLL) ? SR_IMMED : 0;
781 sr->sr_status = -1; /* no value */
784 SUNSCPAL_TRACE("scsipi_cmd: new sr=0x%x\n", (long)sr);
841 struct sunscpal_req *sr;
851 sr = sc->sc_current;
852 xs = sr->sr_xs;
859 if (sr->sr_dma_hand) {
861 (long)sr->sr_dma_hand);
865 if (sr->sr_dma_hand)
881 SUNSCPAL_TRACE("done: check status=%d\n", sr->sr_status);
883 xs->status = sr->sr_status;
884 switch (sr->sr_status) {
898 device_xname(sc->sc_dev), sr->sr_target, sr->sr_status);
921 sc->sc_matrix[sr->sr_target][sr->sr_lun] = NULL;
922 callout_stop(&sr->sr_xs->xs_callout);
925 sr->sr_xs = NULL;
945 struct sunscpal_req *sr;
971 sr = NULL;
985 sr = &sc->sc_ring[i];
994 if (sr == NULL) {
1008 (sr->sr_target << 4) | sr->sr_lun);
1011 error = sunscpal_select(sc, sr);
1015 if (sr->sr_flags & SR_IMMED) {
1022 sr = sc->sc_current;
1023 xs = sr->sr_xs;
1024 SUNSCPAL_TRACE("sched: reselect, new sr=0x%x\n", (long)sr);
1029 sc->sc_matrix[target][lun] = sr;
1030 sc->sc_current = sr; /* connected */
1031 xs = sr->sr_xs;
1036 sc->sc_dataptr = sr->sr_dataptr;
1037 sc->sc_datalen = sr->sr_datalen;
1058 SUNSCPAL_TRACE("sched: call done, sr=0x%x\n", (long)sr);
1077 if (sr->sr_flags & SR_OVERDUE) {
1078 SUNSCPAL_TRACE("sched: overdue, sr=0x%x\n", (long)sr);
1099 SUNSCPAL_TRACE("sched: cmd=reset, sr=0x%x\n", (long)sr);
1132 if (sr->sr_dma_hand) {
1134 (long) sr->sr_dma_hand);
1141 if ((sr->sr_flags & SR_IMMED) == 0) {
1144 callout_reset(&sr->sr_xs->xs_callout, i,
1145 sunscpal_cmd_timeout, sr);
1198 sunscpal_select(struct sunscpal_softc *sc, struct sunscpal_req *sr)
1214 target_mask = (1 << sr->sr_target);
1294 struct sunscpal_req *sr = sc->sc_current;
1295 struct scsipi_xfer *xs = sr->sr_xs;
1433 sr->sr_dataptr = sc->sc_dataptr;
1434 sr->sr_datalen = sc->sc_datalen;
1439 sc->sc_dataptr = sr->sr_dataptr;
1440 sc->sc_datalen = sr->sr_datalen;
1523 struct sunscpal_req *sr = sc->sc_current;
1524 struct scsipi_xfer *xs = sr->sr_xs;
1557 struct sunscpal_req *sr = sc->sc_current;
1558 struct scsipi_xfer *xs = sr->sr_xs;
1601 if (sr->sr_dma_hand && (sc->sc_datalen >= sc->sc_min_dma_len)) {
1608 (long)sr->sr_dma_hand);
1643 struct sunscpal_req *sr = sc->sc_current;
1647 sr->sr_status = status;
1668 struct sunscpal_req *sr;
1679 sr = sc->sc_current;
1680 xs = sr->sr_xs;
1774 if ((sr->sr_flags & SR_IMMED) == 0) {
1780 (long)sr->sr_dma_hand);
1784 if (sr->sr_flags & SR_OVERDUE)
1787 (long)sr->sr_dma_hand);
1824 device_xname(sc->sc_dev), sr->sr_target, sr->sr_lun);
1835 sr->sr_target, sr->sr_lun);
1840 SUNSCPAL_TRACE("machine: call done, cur=0x%x\n", (long)sr);
1860 device_xname(sc->sc_dev), sr->sr_target, sr->sr_lun);
1869 SUNSCPAL_TRACE("machine: discon, cur=0x%x\n", (long)sr);
1971 sunscpal_show_req(struct sunscpal_req *sr)
1973 struct scsipi_xfer *xs = sr->sr_xs;
1975 db_printf("TID=%d ", sr->sr_target);
1976 db_printf("LUN=%d ", sr->sr_lun);
1977 db_printf("dh=%p ", sr->sr_dma_hand);
1978 db_printf("dptr=%p ", sr->sr_dataptr);
1979 db_printf("dlen=0x%x ", sr->sr_datalen);
1980 db_printf("flags=%d ", sr->sr_flags);
1981 db_printf("stat=%d ", sr->sr_status);
1999 struct sunscpal_req *sr;
2012 sr = &sc->sc_ring[i];
2013 if (sr->sr_xs) {
2014 if (sr == sc->sc_current)
2016 db_printf("req %d: (sr=%p)", i, sr);
2017 sunscpal_show_req(sr);
2025 sr = sc->sc_matrix[i][j];
2026 if (sr) {
2027 db_printf("TID=%d LUN=%d sr=%p\n", i, j, sr);
2120 * Allocate a DMA handle and put it in sr->sr_dma_hand. Prepare
2126 struct sunscpal_req *sr = sc->sc_current;
2132 if (sr->sr_dma_hand != NULL)
2187 sr->sr_dma_hand = dh;
2193 struct sunscpal_req *sr = sc->sc_current;
2194 sunscpal_dma_handle_t dh = sr->sr_dma_hand;
2210 sr->sr_dma_hand = NULL;
2223 struct sunscpal_req *sr = sc->sc_current;
2224 struct scsipi_xfer *xs = sr->sr_xs;
2225 sunscpal_dma_handle_t dh = sr->sr_dma_hand;