Lines Matching defs:atp

722 	atio_private_data_t *atp;
724 atp = LIST_FIRST(&fc->atfree);
725 if (atp) {
726 LIST_REMOVE(atp, next);
727 atp->ccb = ccb;
728 atp->tag = tag;
729 LIST_INSERT_HEAD(&fc->atused[ATPDPHASH(tag)], atp, next);
731 return (atp);
738 atio_private_data_t *atp;
740 LIST_FOREACH(atp, &fc->atused[ATPDPHASH(tag)], next) {
741 if (atp->tag == tag)
742 return (atp);
755 atio_private_data_t *atp;
757 LIST_FOREACH(atp, &fc->atused[ATPDPHASH(tag)], next) {
758 if (atp->tag == tag && atp->ccb == ccb)
759 return (atp);
765 isp_put_atpd(ispsoftc_t *isp, int chan, atio_private_data_t *atp)
769 if (atp->ests)
770 isp_put_ecmd(isp, atp->ests);
771 LIST_REMOVE(atp, next);
772 memset(atp, 0, sizeof (*atp));
773 LIST_INSERT_HEAD(&fc->atfree, atp, next);
780 atio_private_data_t *atp;
783 for (atp = fc->atpool; atp < &fc->atpool[ATPDPSIZE]; atp++) {
784 if (atp->state == ATPD_STATE_FREE)
787 chan, atp->tag, atp->orig_datalen, atp->bytes_xfered, (uintmax_t)atp->lun, atp->nphdl, atp->sid, atp->did, atp->oxid, states[atp->state & 0x7]);
942 atio_private_data_t *atp;
980 atp = isp_find_atpd(isp, XS_CHANNEL(ccb), cso->tag_id);
981 if (atp == NULL) {
992 if (atp->dead) {
1014 if (atp->ctcnt >= ATPD_CCB_OUTSTANDING) {
1023 if ((atp->word3 & PRLI_WD3_RETRY) && fcp->fctape_enabled) {
1033 if (atp->sendst) {
1035 cso->tag_id, atp->orig_datalen, atp->bytes_xfered, atp->bytes_in_transit);
1037 atp->sendst = 0;
1067 tmp = atp->bytes_xfered + atp->bytes_in_transit;
1068 if (xfrlen > 0 && tmp > atp->orig_datalen) {
1071 cso->tag_id, tmp + xfrlen - atp->orig_datalen);
1076 if (xfrlen > atp->orig_datalen - tmp) {
1077 xfrlen = atp->orig_datalen - tmp;
1090 ATPD_SET_SEQNO(cto, atp);
1091 cto->ct_nphdl = atp->nphdl;
1092 cto->ct_rxid = atp->tag;
1093 cto->ct_iid_lo = atp->sid;
1094 cto->ct_iid_hi = atp->sid >> 16;
1095 cto->ct_oxid = atp->oxid;
1098 cto->ct_flags = atp->tattr << CT7_TASK_ATTR_SHIFT;
1110 resid = atp->orig_datalen - atp->bytes_xfered - atp->bytes_in_transit;
1133 if (atp->ests == NULL) {
1134 atp->ests = isp_get_ecmd(isp);
1135 if (atp->ests == NULL) {
1158 isp_put_fcp_rsp_iu(isp, &rp, atp->ests);
1159 memcpy(((fcp_rsp_iu_t *)atp->ests)->fcp_rsp_extra, &cso->sense_data, sense_length);
1161 isp_put_fcp_rsp_iu(isp, &rp, atp->ests);
1164 isp_print_bytes(isp, "FCP Response Frame After Swizzling", MIN_FCP_RESPONSE_SIZE + sense_length, atp->ests);
1168 addr += ((((isp_ecmd_t *)atp->ests) - isp->isp_osinfo.ecmd_base) * XCMD_SIZE);
1169 isp_prt(isp, ISP_LOGTDEBUG0, "%s: ests base %p vaddr %p ecmd_dma %jx addr %jx len %u", __func__, isp->isp_osinfo.ecmd_base, atp->ests,
1178 cto->ct_rxid, ATPD_GET_SEQNO(cto), ATPD_GET_NCAM(cto), atp->cdb0, cto->ct_scsi_status, cto->ct_flags, cto->ct_resid, sense_length,
1182 cto->ct_rxid, ATPD_GET_SEQNO(cto), ATPD_GET_NCAM(cto), atp->cdb0, cto->ct_scsi_status, cto->ct_flags, cto->ct_resid);
1184 atp->state = ATPD_STATE_LAST_CTIO;
1198 cto->rsp.m0.reloff = atp->bytes_xfered + atp->bytes_in_transit;
1209 resid = atp->orig_datalen - atp->bytes_xfered - xfrlen;
1212 atp->state = ATPD_STATE_LAST_CTIO;
1217 atp->sendst = 1; /* send status later */
1219 atp->state = ATPD_STATE_CTIO;
1222 atp->state = ATPD_STATE_CTIO;
1225 cto->ct_rxid, ATPD_GET_SEQNO(cto), ATPD_GET_NCAM(cto), atp->cdb0, cto->ct_scsi_status, cto->ct_flags, xfrlen, atp->bytes_xfered);
1240 atp->bytes_in_transit += xfrlen;
1266 ccb->ccb_h.spriv_field0 = atp->bytes_xfered;
1270 atp->ctcnt++;
1271 atp->seqno++;
1309 atio_private_data_t *atp = NULL;
1400 atp = isp_get_atpd(isp, chan, aep->at_rxid, atiop);
1401 if (atp == NULL) {
1406 atp->word3 = lp->prli_word3;
1407 atp->state = ATPD_STATE_ATIO;
1422 atiop->tag_id = atp->tag;
1447 atp->orig_datalen = aep->at_cmnd.cdb_dl.sf.fcp_cmnd_dl;
1448 atp->bytes_xfered = 0;
1449 atp->lun = lun;
1450 atp->nphdl = nphdl;
1451 atp->sid = sid;
1452 atp->did = did;
1453 atp->oxid = aep->at_hdr.ox_id;
1454 atp->rxid = aep->at_hdr.rx_id;
1455 atp->cdb0 = atiop->cdb_io.cdb_bytes[0];
1456 atp->tattr = aep->at_cmnd.fcp_cmnd_task_attribute & FCP_CMND_TASK_ATTR_MASK;
1457 atp->state = ATPD_STATE_CAM;
1459 aep->at_rxid, atp->cdb0, (uintmax_t)lun, atp->orig_datalen);
1463 KASSERT(atp == NULL, ("%s: atp is not NULL on noresrc!\n", __func__));
1481 isp_handle_srr_start(ispsoftc_t *isp, atio_private_data_t *atp)
1487 inot = (in_fcentry_24xx_t *)atp->srr;
1489 ccb = atp->srr_ccb;
1490 atp->srr_ccb = NULL;
1491 atp->nsrr++;
1493 isp_prt(isp, ISP_LOGWARN, "SRR[0x%x] null ccb", atp->tag);
1506 atp->sendst = 0;
1507 atp->bytes_xfered = srr_off;
1509 isp_prt(isp, ISP_LOGWARN, "SRR[0x%x] SRR offset 0x%x but current CCB doesn't transfer data", atp->tag, srr_off);
1513 isp_prt(isp, ISP_LOGWARN, "SRR[0x%x] SRR offset 0x%x not covered by current CCB data range [0x%x..0x%x]", atp->tag, srr_off, ccb_off, ccb_end);
1516 isp_prt(isp, ISP_LOGWARN, "SRR[0x%x] SRR offset 0x%x covered by current CCB data range [0x%x..0x%x]", atp->tag, srr_off, ccb_off, ccb_end);
1519 isp_prt(isp, ISP_LOGTINFO, "SRR[0x%x] Got an FCP RSP SRR- resending status", atp->tag);
1520 atp->sendst = 1;
1582 atio_private_data_t *atp;
1585 atp = isp_find_atpd(isp, notify->nt_channel, tag);
1586 if (atp == NULL) {
1592 atp->srr_notify_rcvd = 1;
1593 memcpy(atp->srr, inot, sizeof (atp->srr));
1597 if (atp->srr_ccb)
1598 isp_handle_srr_start(isp, atp);
1606 atio_private_data_t *atp = NULL;
1621 atp = isp_find_atpd(isp, bus, ct->ct_rxid);
1622 if (atp == NULL) {
1628 atp = isp_find_atpd(isp, bus, ccb->csio.tag_id);
1630 if (atp == NULL) {
1634 KASSERT((atp->ctcnt > 0), ("ctio count not greater than zero"));
1635 atp->bytes_in_transit -= data_requested;
1636 atp->ctcnt -= 1;
1640 atp->srr_ccb = ccb;
1641 if (atp->srr_notify_rcvd)
1642 isp_handle_srr_start(isp, atp);
1647 (atp->sendst == 0);
1660 atp->bytes_xfered += data_requested - resid;
1674 atp->state = ATPD_STATE_PDON;
1681 (sentstatus)? " FINAL " : "MIDTERM ", atp->tag, ok, notify_cam, atp->sendst, (ccb->ccb_h.flags & CAM_SEND_STATUS) != 0);
1683 if (atp->sendst) {
1694 isp_put_atpd(isp, bus, atp);
1785 atio_private_data_t *atp;
1794 atp = isp_find_atpd(isp, notify->nt_channel,
1796 lun = atp ? atp->lun : CAM_LUN_WILDCARD;
2270 isp_abort_atpd(ispsoftc_t *isp, int chan, atio_private_data_t *atp)
2278 cto->ct_nphdl = atp->nphdl;
2280 cto->ct_iid_lo = atp->sid;
2281 cto->ct_iid_hi = atp->sid >> 16;
2282 cto->ct_rxid = atp->tag;
2284 cto->ct_oxid = atp->oxid;
2291 atio_private_data_t *atp;
2313 atp = isp_find_atpd_ccb(isp, XS_CHANNEL(accb), accb->atio.tag_id, accb);
2314 if (atp != NULL) {
2315 if (isp_abort_atpd(isp, XS_CHANNEL(accb), atp)) {
2319 isp_put_atpd(isp, XS_CHANNEL(accb), atp);
2495 atio_private_data_t *atp;
2523 (atp = isp_find_atpd(isp, XS_CHANNEL(ccb), ccb->cna2.seq_id)) != NULL) {
2524 if (atp->ctcnt == 0 &&
2525 isp_abort_atpd(isp, XS_CHANNEL(ccb), atp) == 0)
2526 isp_put_atpd(isp, XS_CHANNEL(ccb), atp);
2528 atp->dead = 1;