Lines Matching refs:list

91 	struct tpc_list		*list;  member
162 struct tpc_list *list, *tlist; in tpc_timeout() local
167 TAILQ_FOREACH_SAFE(list, &lun->tpc_lists, links, tlist) { in tpc_timeout()
168 if (!list->completed || time_uptime < list->last_active + in tpc_timeout()
171 TAILQ_REMOVE(&lun->tpc_lists, list, links); in tpc_timeout()
172 free(list, M_CTL); in tpc_timeout()
230 struct tpc_list *list, *tlist; in ctl_tpc_lun_clear() local
232 TAILQ_FOREACH_SAFE(list, &lun->tpc_lists, links, tlist) { in ctl_tpc_lun_clear()
233 if (initidx != -1 && list->init_idx != initidx) in ctl_tpc_lun_clear()
235 if (!list->completed) in ctl_tpc_lun_clear()
237 TAILQ_REMOVE(&lun->tpc_lists, list, links); in ctl_tpc_lun_clear()
238 free(list, M_CTL); in ctl_tpc_lun_clear()
246 struct tpc_list *list; in ctl_tpc_lun_shutdown() local
250 while ((list = TAILQ_FIRST(&lun->tpc_lists)) != NULL) { in ctl_tpc_lun_shutdown()
251 TAILQ_REMOVE(&lun->tpc_lists, list, links); in ctl_tpc_lun_shutdown()
252 KASSERT(list->completed, in ctl_tpc_lun_shutdown()
253 ("Not completed TPC (%p) on shutdown", list)); in ctl_tpc_lun_shutdown()
254 free(list, M_CTL); in ctl_tpc_lun_shutdown()
505 struct tpc_list *list; in tpc_find_list() local
508 TAILQ_FOREACH(list, &lun->tpc_lists, links) { in tpc_find_list()
509 if ((list->flags & EC_LIST_ID_USAGE_MASK) != in tpc_find_list()
510 EC_LIST_ID_USAGE_NONE && list->list_id == list_id && in tpc_find_list()
511 list->init_idx == init_idx) in tpc_find_list()
514 return (list); in tpc_find_list()
523 struct tpc_list *list; in ctl_receive_copy_status_lid1() local
536 list = tpc_find_list(lun, list_id, in ctl_receive_copy_status_lid1()
538 if (list == NULL) { in ctl_receive_copy_status_lid1()
546 list_copy = *list; in ctl_receive_copy_status_lid1()
547 if (list->completed) { in ctl_receive_copy_status_lid1()
548 TAILQ_REMOVE(&lun->tpc_lists, list, links); in ctl_receive_copy_status_lid1()
549 free(list, M_CTL); in ctl_receive_copy_status_lid1()
593 struct tpc_list *list; in ctl_receive_copy_failure_details() local
606 list = tpc_find_list(lun, list_id, in ctl_receive_copy_failure_details()
608 if (list == NULL || !list->completed) { in ctl_receive_copy_failure_details()
616 list_copy = *list; in ctl_receive_copy_failure_details()
617 TAILQ_REMOVE(&lun->tpc_lists, list, links); in ctl_receive_copy_failure_details()
618 free(list, M_CTL); in ctl_receive_copy_failure_details()
653 struct tpc_list *list; in ctl_receive_copy_status_lid4() local
666 list = tpc_find_list(lun, list_id, in ctl_receive_copy_status_lid4()
668 if (list == NULL) { in ctl_receive_copy_status_lid4()
676 list_copy = *list; in ctl_receive_copy_status_lid4()
677 if (list->completed) { in ctl_receive_copy_status_lid4()
678 TAILQ_REMOVE(&lun->tpc_lists, list, links); in ctl_receive_copy_status_lid4()
679 free(list, M_CTL); in ctl_receive_copy_status_lid4()
726 struct tpc_list *list; in ctl_copy_operation_abort() local
737 list = tpc_find_list(lun, list_id, in ctl_copy_operation_abort()
739 if (list == NULL) { in ctl_copy_operation_abort()
747 list->abort = 1; in ctl_copy_operation_abort()
756 tpc_resolve(struct tpc_list *list, uint16_t idx, uint32_t *ss, in tpc_resolve() argument
762 *ss = list->lun->be_lun->blocksize; in tpc_resolve()
764 *pb = list->lun->be_lun->blocksize << in tpc_resolve()
765 list->lun->be_lun->pblockexp; in tpc_resolve()
767 *pbo = list->lun->be_lun->blocksize * in tpc_resolve()
768 list->lun->be_lun->pblockoff; in tpc_resolve()
769 return (list->lun->lun); in tpc_resolve()
771 if (idx >= list->ncscd) in tpc_resolve()
773 return (tpcl_resolve(list->lun->ctl_softc, in tpc_resolve()
774 list->init_port, &list->cscd[idx], ss, pb, pbo)); in tpc_resolve()
778 tpc_set_io_error_sense(struct tpc_list *list) in tpc_set_io_error_sense() argument
785 scsi_ulto4b(list->curseg, csi); in tpc_set_io_error_sense()
786 if (list->fwd_cscd <= 0x07ff) { in tpc_set_io_error_sense()
788 scsi_ulto2b((uint8_t *)&list->cscd[list->fwd_cscd] - in tpc_set_io_error_sense()
789 list->params, &sks[1]); in tpc_set_io_error_sense()
792 if (list->fwd_scsi_status) { in tpc_set_io_error_sense()
794 fbuf[2] = list->fwd_target; in tpc_set_io_error_sense()
795 flen = list->fwd_sense_len; in tpc_set_io_error_sense()
801 fbuf[3] = list->fwd_scsi_status; in tpc_set_io_error_sense()
802 bcopy(&list->fwd_sense_data, &fbuf[4], flen); in tpc_set_io_error_sense()
806 ctl_set_sense(list->ctsio, /*current_error*/ 1, in tpc_set_io_error_sense()
816 tpc_process_b2b(struct tpc_list *list) in tpc_process_b2b() argument
829 scsi_ulto4b(list->curseg, csi); in tpc_process_b2b()
830 if (list->stage == 1) { in tpc_process_b2b()
831 while ((tior = TAILQ_FIRST(&list->allio)) != NULL) { in tpc_process_b2b()
832 TAILQ_REMOVE(&list->allio, tior, links); in tpc_process_b2b()
837 if (list->abort) { in tpc_process_b2b()
838 ctl_set_task_aborted(list->ctsio); in tpc_process_b2b()
840 } else if (list->error) { in tpc_process_b2b()
841 tpc_set_io_error_sense(list); in tpc_process_b2b()
844 list->cursectors += list->segsectors; in tpc_process_b2b()
845 list->curbytes += list->segbytes; in tpc_process_b2b()
849 TAILQ_INIT(&list->allio); in tpc_process_b2b()
850 seg = (struct scsi_ec_segment_b2b *)list->seg[list->curseg]; in tpc_process_b2b()
853 sl = tpc_resolve(list, scscd, &srcblock, NULL, NULL); in tpc_process_b2b()
854 dl = tpc_resolve(list, dcscd, &dstblock, &pb, &pbo); in tpc_process_b2b()
856 ctl_set_sense(list->ctsio, /*current_error*/ 1, in tpc_process_b2b()
865 sdstp = &list->cscd[scscd].dtsp; in tpc_process_b2b()
868 ddstp = &list->cscd[dcscd].dtsp; in tpc_process_b2b()
887 ctl_set_sense(list->ctsio, /*current_error*/ 1, in tpc_process_b2b()
895 list->segbytes = numbytes; in tpc_process_b2b()
896 list->segsectors = numbytes / dstblock; in tpc_process_b2b()
899 list->tbdio = 0; in tpc_process_b2b()
915 tior->list = list; in tpc_process_b2b()
916 TAILQ_INSERT_TAIL(&list->allio, tior, links); in tpc_process_b2b()
936 tiow->list = list; in tpc_process_b2b()
937 TAILQ_INSERT_TAIL(&list->allio, tiow, links); in tpc_process_b2b()
957 list->tbdio++; in tpc_process_b2b()
969 list->stage++; in tpc_process_b2b()
974 tpc_process_verify(struct tpc_list *list) in tpc_process_verify() argument
982 scsi_ulto4b(list->curseg, csi); in tpc_process_verify()
983 if (list->stage == 1) { in tpc_process_verify()
984 while ((tio = TAILQ_FIRST(&list->allio)) != NULL) { in tpc_process_verify()
985 TAILQ_REMOVE(&list->allio, tio, links); in tpc_process_verify()
989 if (list->abort) { in tpc_process_verify()
990 ctl_set_task_aborted(list->ctsio); in tpc_process_verify()
992 } else if (list->error) { in tpc_process_verify()
993 tpc_set_io_error_sense(list); in tpc_process_verify()
999 TAILQ_INIT(&list->allio); in tpc_process_verify()
1000 seg = (struct scsi_ec_segment_verify *)list->seg[list->curseg]; in tpc_process_verify()
1002 sl = tpc_resolve(list, cscd, NULL, NULL, NULL); in tpc_process_verify()
1004 ctl_set_sense(list->ctsio, /*current_error*/ 1, in tpc_process_verify()
1017 list->tbdio = 1; in tpc_process_verify()
1020 tio->list = list; in tpc_process_verify()
1021 TAILQ_INSERT_TAIL(&list->allio, tio, links); in tpc_process_verify()
1029 list->stage++; in tpc_process_verify()
1036 tpc_process_register_key(struct tpc_list *list) in tpc_process_register_key() argument
1045 scsi_ulto4b(list->curseg, csi); in tpc_process_register_key()
1046 if (list->stage == 1) { in tpc_process_register_key()
1047 while ((tio = TAILQ_FIRST(&list->allio)) != NULL) { in tpc_process_register_key()
1048 TAILQ_REMOVE(&list->allio, tio, links); in tpc_process_register_key()
1053 if (list->abort) { in tpc_process_register_key()
1054 ctl_set_task_aborted(list->ctsio); in tpc_process_register_key()
1056 } else if (list->error) { in tpc_process_register_key()
1057 tpc_set_io_error_sense(list); in tpc_process_register_key()
1063 TAILQ_INIT(&list->allio); in tpc_process_register_key()
1064 seg = (struct scsi_ec_segment_register_key *)list->seg[list->curseg]; in tpc_process_register_key()
1066 dl = tpc_resolve(list, cscd, NULL, NULL, NULL); in tpc_process_register_key()
1068 ctl_set_sense(list->ctsio, /*current_error*/ 1, in tpc_process_register_key()
1078 list->tbdio = 1; in tpc_process_register_key()
1081 tio->list = list; in tpc_process_register_key()
1082 TAILQ_INSERT_TAIL(&list->allio, tio, links); in tpc_process_register_key()
1095 list->stage++; in tpc_process_register_key()
1173 tpc_process_wut(struct tpc_list *list) in tpc_process_wut() argument
1182 if (list->stage > 0) { in tpc_process_wut()
1184 while ((tio = TAILQ_FIRST(&list->allio)) != NULL) { in tpc_process_wut()
1185 TAILQ_REMOVE(&list->allio, tio, links); in tpc_process_wut()
1190 if (list->abort) { in tpc_process_wut()
1191 ctl_set_task_aborted(list->ctsio); in tpc_process_wut()
1193 } else if (list->error) { in tpc_process_wut()
1194 if (list->fwd_scsi_status) { in tpc_process_wut()
1195 list->ctsio->io_hdr.status = in tpc_process_wut()
1197 list->ctsio->scsi_status = list->fwd_scsi_status; in tpc_process_wut()
1198 list->ctsio->sense_data = list->fwd_sense_data; in tpc_process_wut()
1199 list->ctsio->sense_len = list->fwd_sense_len; in tpc_process_wut()
1201 ctl_set_invalid_field(list->ctsio, in tpc_process_wut()
1207 list->cursectors += list->segsectors; in tpc_process_wut()
1208 list->curbytes += list->segbytes; in tpc_process_wut()
1212 if (tpc_skip_ranges(list->range, list->nrange, list->cursectors, in tpc_process_wut()
1215 dstblock = list->lun->be_lun->blocksize; in tpc_process_wut()
1216 pb = dstblock << list->lun->be_lun->pblockexp; in tpc_process_wut()
1217 if (list->lun->be_lun->pblockoff > 0) in tpc_process_wut()
1218 pbo = pb - dstblock * list->lun->be_lun->pblockoff; in tpc_process_wut()
1223 srcblock = list->token->blocksize; in tpc_process_wut()
1224 if (tpc_skip_ranges(list->token->range, list->token->nrange, in tpc_process_wut()
1225 list->offset_into_rod + list->cursectors * dstblock / srcblock, in tpc_process_wut()
1227 ctl_set_invalid_field(list->ctsio, /*sks_valid*/ 0, in tpc_process_wut()
1232 srclba = scsi_8btou64(list->token->range[srange].lba) + soffset; in tpc_process_wut()
1233 dstlba = scsi_8btou64(list->range[drange].lba) + doffset; in tpc_process_wut()
1235 (scsi_4btoul(list->token->range[srange].length) - soffset); in tpc_process_wut()
1237 (scsi_4btoul(list->range[drange].length) - doffset)); in tpc_process_wut()
1249 ctl_set_invalid_field(list->ctsio, /*sks_valid*/ 0, in tpc_process_wut()
1254 list->segbytes = numbytes; in tpc_process_wut()
1255 list->segsectors = numbytes / dstblock; in tpc_process_wut()
1260 list->tbdio = 0; in tpc_process_wut()
1261 TAILQ_INIT(&list->allio); in tpc_process_wut()
1277 tior->list = list; in tpc_process_wut()
1278 TAILQ_INSERT_TAIL(&list->allio, tior, links); in tpc_process_wut()
1291 tior->lun = list->token->lun; in tpc_process_wut()
1296 tiow->list = list; in tpc_process_wut()
1297 TAILQ_INSERT_TAIL(&list->allio, tiow, links); in tpc_process_wut()
1310 tiow->lun = list->lun->lun; in tpc_process_wut()
1315 list->tbdio++; in tpc_process_wut()
1327 list->stage++; in tpc_process_wut()
1332 tpc_process_zero_wut(struct tpc_list *list) in tpc_process_zero_wut() argument
1339 if (list->stage > 0) { in tpc_process_zero_wut()
1342 while ((tio = TAILQ_FIRST(&list->allio)) != NULL) { in tpc_process_zero_wut()
1343 TAILQ_REMOVE(&list->allio, tio, links); in tpc_process_zero_wut()
1347 if (list->abort) { in tpc_process_zero_wut()
1348 ctl_set_task_aborted(list->ctsio); in tpc_process_zero_wut()
1350 } else if (list->error) { in tpc_process_zero_wut()
1351 if (list->fwd_scsi_status) { in tpc_process_zero_wut()
1352 list->ctsio->io_hdr.status = in tpc_process_zero_wut()
1354 list->ctsio->scsi_status = list->fwd_scsi_status; in tpc_process_zero_wut()
1355 list->ctsio->sense_data = list->fwd_sense_data; in tpc_process_zero_wut()
1356 list->ctsio->sense_len = list->fwd_sense_len; in tpc_process_zero_wut()
1358 ctl_set_invalid_field(list->ctsio, in tpc_process_zero_wut()
1364 list->cursectors += list->segsectors; in tpc_process_zero_wut()
1365 list->curbytes += list->segbytes; in tpc_process_zero_wut()
1369 dstblock = list->lun->be_lun->blocksize; in tpc_process_zero_wut()
1372 list->tbdio = 1; in tpc_process_zero_wut()
1373 TAILQ_INIT(&list->allio); in tpc_process_zero_wut()
1374 list->segsectors = 0; in tpc_process_zero_wut()
1375 for (r = 0; r < list->nrange; r++) { in tpc_process_zero_wut()
1376 len = scsi_4btoul(list->range[r].length); in tpc_process_zero_wut()
1382 tiow->list = list; in tpc_process_zero_wut()
1383 TAILQ_INSERT_TAIL(&list->allio, tiow, links); in tpc_process_zero_wut()
1389 /*lba*/ scsi_8btou64(list->range[r].lba), in tpc_process_zero_wut()
1394 tiow->lun = list->lun->lun; in tpc_process_zero_wut()
1399 list->segsectors += len; in tpc_process_zero_wut()
1401 list->segbytes = list->segsectors * dstblock; in tpc_process_zero_wut()
1412 list->stage++; in tpc_process_zero_wut()
1417 tpc_process(struct tpc_list *list) in tpc_process() argument
1419 struct ctl_lun *lun = list->lun; in tpc_process()
1422 struct ctl_scsiio *ctsio = list->ctsio; in tpc_process()
1426 if (list->service_action == EC_WUT) { in tpc_process()
1427 if (list->token != NULL) in tpc_process()
1428 retval = tpc_process_wut(list); in tpc_process()
1430 retval = tpc_process_zero_wut(list); in tpc_process()
1434 list->error = 1; in tpc_process()
1439 while (list->curseg < list->nseg) { in tpc_process()
1440 seg = list->seg[list->curseg]; in tpc_process()
1443 retval = tpc_process_b2b(list); in tpc_process()
1446 retval = tpc_process_verify(list); in tpc_process()
1449 retval = tpc_process_register_key(list); in tpc_process()
1452 scsi_ulto4b(list->curseg, csi); in tpc_process()
1463 list->error = 1; in tpc_process()
1466 list->curseg++; in tpc_process()
1467 list->stage = 0; in tpc_process()
1475 free(list->params, M_CTL); in tpc_process()
1476 list->params = NULL; in tpc_process()
1477 if (list->token) { in tpc_process()
1479 if (--list->token->active == 0) in tpc_process()
1480 list->token->last_active = time_uptime; in tpc_process()
1482 list->token = NULL; in tpc_process()
1485 if ((list->flags & EC_LIST_ID_USAGE_MASK) == EC_LIST_ID_USAGE_NONE) { in tpc_process()
1486 TAILQ_REMOVE(&lun->tpc_lists, list, links); in tpc_process()
1487 free(list, M_CTL); in tpc_process()
1489 list->completed = 1; in tpc_process()
1490 list->last_active = time_uptime; in tpc_process()
1491 list->sense_data = ctsio->sense_data; in tpc_process()
1492 list->sense_len = ctsio->sense_len; in tpc_process()
1493 list->scsi_status = ctsio->scsi_status; in tpc_process()
1639 tio->list->error = 1; in tpc_done()
1642 tio->list->fwd_scsi_status = io->scsiio.scsi_status; in tpc_done()
1643 tio->list->fwd_sense_data = io->scsiio.sense_data; in tpc_done()
1644 tio->list->fwd_sense_len = io->scsiio.sense_len; in tpc_done()
1645 tio->list->fwd_target = tio->target; in tpc_done()
1646 tio->list->fwd_cscd = tio->cscd; in tpc_done()
1649 atomic_add_int(&tio->list->curops, 1); in tpc_done()
1650 if (!tio->list->error && !tio->list->abort) { in tpc_done()
1653 atomic_add_int(&tio->list->tbdio, 1); in tpc_done()
1658 if (atomic_fetchadd_int(&tio->list->tbdio, -1) == 1) in tpc_done()
1659 tpc_process(tio->list); in tpc_done()
1670 struct tpc_list *list, *tlist; in ctl_extended_copy_lid1() local
1733 list = malloc(sizeof(struct tpc_list), M_CTL, M_WAITOK | M_ZERO); in ctl_extended_copy_lid1()
1734 list->service_action = cdb->service_action; in ctl_extended_copy_lid1()
1737 list->init_port = -1; in ctl_extended_copy_lid1()
1739 list->init_port = ctsio->io_hdr.nexus.targ_port; in ctl_extended_copy_lid1()
1740 list->init_idx = ctl_get_initindex(&ctsio->io_hdr.nexus); in ctl_extended_copy_lid1()
1741 list->list_id = data->list_identifier; in ctl_extended_copy_lid1()
1742 list->flags = data->flags; in ctl_extended_copy_lid1()
1743 list->params = ctsio->kern_data_ptr; in ctl_extended_copy_lid1()
1744 list->cscd = (struct scsi_ec_cscd *)&data->data[0]; in ctl_extended_copy_lid1()
1749 free(list, M_CTL); in ctl_extended_copy_lid1()
1759 free(list, M_CTL); in ctl_extended_copy_lid1()
1769 free(list, M_CTL); in ctl_extended_copy_lid1()
1775 list->seg[nseg] = seg; in ctl_extended_copy_lid1()
1779 list->inl = &data->data[lencscd + lenseg]; in ctl_extended_copy_lid1()
1780 list->ncscd = lencscd / sizeof(struct scsi_ec_cscd); in ctl_extended_copy_lid1()
1781 list->nseg = nseg; in ctl_extended_copy_lid1()
1782 list->leninl = leninl; in ctl_extended_copy_lid1()
1783 list->ctsio = ctsio; in ctl_extended_copy_lid1()
1784 list->lun = lun; in ctl_extended_copy_lid1()
1786 if ((list->flags & EC_LIST_ID_USAGE_MASK) != EC_LIST_ID_USAGE_NONE) { in ctl_extended_copy_lid1()
1787 tlist = tpc_find_list(lun, list->list_id, list->init_idx); in ctl_extended_copy_lid1()
1790 free(list, M_CTL); in ctl_extended_copy_lid1()
1801 TAILQ_INSERT_TAIL(&lun->tpc_lists, list, links); in ctl_extended_copy_lid1()
1804 tpc_process(list); in ctl_extended_copy_lid1()
1824 struct tpc_list *list, *tlist; in ctl_extended_copy_lid4() local
1887 list = malloc(sizeof(struct tpc_list), M_CTL, M_WAITOK | M_ZERO); in ctl_extended_copy_lid4()
1888 list->service_action = cdb->service_action; in ctl_extended_copy_lid4()
1891 list->init_port = -1; in ctl_extended_copy_lid4()
1893 list->init_port = ctsio->io_hdr.nexus.targ_port; in ctl_extended_copy_lid4()
1894 list->init_idx = ctl_get_initindex(&ctsio->io_hdr.nexus); in ctl_extended_copy_lid4()
1895 list->list_id = scsi_4btoul(data->list_identifier); in ctl_extended_copy_lid4()
1896 list->flags = data->flags; in ctl_extended_copy_lid4()
1897 list->params = ctsio->kern_data_ptr; in ctl_extended_copy_lid4()
1898 list->cscd = (struct scsi_ec_cscd *)&data->data[0]; in ctl_extended_copy_lid4()
1903 free(list, M_CTL); in ctl_extended_copy_lid4()
1913 free(list, M_CTL); in ctl_extended_copy_lid4()
1923 free(list, M_CTL); in ctl_extended_copy_lid4()
1929 list->seg[nseg] = seg; in ctl_extended_copy_lid4()
1933 list->inl = &data->data[lencscd + lenseg]; in ctl_extended_copy_lid4()
1934 list->ncscd = lencscd / sizeof(struct scsi_ec_cscd); in ctl_extended_copy_lid4()
1935 list->nseg = nseg; in ctl_extended_copy_lid4()
1936 list->leninl = leninl; in ctl_extended_copy_lid4()
1937 list->ctsio = ctsio; in ctl_extended_copy_lid4()
1938 list->lun = lun; in ctl_extended_copy_lid4()
1940 if ((list->flags & EC_LIST_ID_USAGE_MASK) != EC_LIST_ID_USAGE_NONE) { in ctl_extended_copy_lid4()
1941 tlist = tpc_find_list(lun, list->list_id, list->init_idx); in ctl_extended_copy_lid4()
1944 free(list, M_CTL); in ctl_extended_copy_lid4()
1955 TAILQ_INSERT_TAIL(&lun->tpc_lists, list, links); in ctl_extended_copy_lid4()
1958 tpc_process(list); in ctl_extended_copy_lid4()
2025 struct tpc_list *list, *tlist; in ctl_populate_token() local
2117 list = malloc(sizeof(struct tpc_list), M_CTL, M_WAITOK | M_ZERO); in ctl_populate_token()
2118 list->service_action = cdb->service_action; in ctl_populate_token()
2119 list->init_port = ctsio->io_hdr.nexus.targ_port; in ctl_populate_token()
2120 list->init_idx = ctl_get_initindex(&ctsio->io_hdr.nexus); in ctl_populate_token()
2121 list->list_id = scsi_4btoul(cdb->list_identifier); in ctl_populate_token()
2122 list->flags = data->flags; in ctl_populate_token()
2123 list->ctsio = ctsio; in ctl_populate_token()
2124 list->lun = lun; in ctl_populate_token()
2126 tlist = tpc_find_list(lun, list->list_id, list->init_idx); in ctl_populate_token()
2129 free(list, M_CTL); in ctl_populate_token()
2139 TAILQ_INSERT_TAIL(&lun->tpc_lists, list, links); in ctl_populate_token()
2149 list->cursectors = tpc_ranges_length(token->range, token->nrange); in ctl_populate_token()
2150 list->curbytes = (off_t)list->cursectors * lun->be_lun->blocksize; in ctl_populate_token()
2151 tpc_create_token(lun, port, list->curbytes, in ctl_populate_token()
2160 memcpy(list->res_token, token->token, sizeof(list->res_token)); in ctl_populate_token()
2161 list->res_token_valid = 1; in ctl_populate_token()
2162 list->curseg = 0; in ctl_populate_token()
2163 list->completed = 1; in ctl_populate_token()
2164 list->last_active = time_uptime; in ctl_populate_token()
2188 struct tpc_list *list, *tlist; in ctl_write_using_token() local
2263 list = malloc(sizeof(struct tpc_list), M_CTL, M_WAITOK | M_ZERO); in ctl_write_using_token()
2264 list->service_action = cdb->service_action; in ctl_write_using_token()
2265 list->init_port = ctsio->io_hdr.nexus.targ_port; in ctl_write_using_token()
2266 list->init_idx = ctl_get_initindex(&ctsio->io_hdr.nexus); in ctl_write_using_token()
2267 list->list_id = scsi_4btoul(cdb->list_identifier); in ctl_write_using_token()
2268 list->flags = data->flags; in ctl_write_using_token()
2269 list->params = ctsio->kern_data_ptr; in ctl_write_using_token()
2270 list->range = &data->desc[0]; in ctl_write_using_token()
2271 list->nrange = scsi_2btoul(data->range_descriptor_length) / in ctl_write_using_token()
2273 list->offset_into_rod = scsi_8btou64(data->offset_into_rod); in ctl_write_using_token()
2274 list->ctsio = ctsio; in ctl_write_using_token()
2275 list->lun = lun; in ctl_write_using_token()
2277 tlist = tpc_find_list(lun, list->list_id, list->init_idx); in ctl_write_using_token()
2280 free(list, M_CTL); in ctl_write_using_token()
2290 TAILQ_INSERT_TAIL(&lun->tpc_lists, list, links); in ctl_write_using_token()
2295 tpc_process(list); in ctl_write_using_token()
2307 list->token = token; in ctl_write_using_token()
2314 TAILQ_REMOVE(&lun->tpc_lists, list, links); in ctl_write_using_token()
2316 free(list, M_CTL); in ctl_write_using_token()
2323 tpc_process(list); in ctl_write_using_token()
2341 struct tpc_list *list; in ctl_receive_rod_token_information() local
2355 list = tpc_find_list(lun, list_id, in ctl_receive_rod_token_information()
2357 if (list == NULL) { in ctl_receive_rod_token_information()
2365 list_copy = *list; in ctl_receive_rod_token_information()
2366 if (list->completed) { in ctl_receive_rod_token_information()
2367 TAILQ_REMOVE(&lun->tpc_lists, list, links); in ctl_receive_rod_token_information()
2368 free(list, M_CTL); in ctl_receive_rod_token_information()