Lines Matching refs:list

93 	struct tpc_list		*list;  member
164 struct tpc_list *list, *tlist; in tpc_timeout() local
169 TAILQ_FOREACH_SAFE(list, &lun->tpc_lists, links, tlist) { in tpc_timeout()
170 if (!list->completed || time_uptime < list->last_active + in tpc_timeout()
173 TAILQ_REMOVE(&lun->tpc_lists, list, links); in tpc_timeout()
174 free(list, M_CTL); in tpc_timeout()
232 struct tpc_list *list, *tlist; in ctl_tpc_lun_clear() local
234 TAILQ_FOREACH_SAFE(list, &lun->tpc_lists, links, tlist) { in ctl_tpc_lun_clear()
235 if (initidx != -1 && list->init_idx != initidx) in ctl_tpc_lun_clear()
237 if (!list->completed) in ctl_tpc_lun_clear()
239 TAILQ_REMOVE(&lun->tpc_lists, list, links); in ctl_tpc_lun_clear()
240 free(list, M_CTL); in ctl_tpc_lun_clear()
248 struct tpc_list *list; in ctl_tpc_lun_shutdown() local
252 while ((list = TAILQ_FIRST(&lun->tpc_lists)) != NULL) { in ctl_tpc_lun_shutdown()
253 TAILQ_REMOVE(&lun->tpc_lists, list, links); in ctl_tpc_lun_shutdown()
254 KASSERT(list->completed, in ctl_tpc_lun_shutdown()
255 ("Not completed TPC (%p) on shutdown", list)); in ctl_tpc_lun_shutdown()
256 free(list, M_CTL); in ctl_tpc_lun_shutdown()
507 struct tpc_list *list; in tpc_find_list() local
510 TAILQ_FOREACH(list, &lun->tpc_lists, links) { in tpc_find_list()
511 if ((list->flags & EC_LIST_ID_USAGE_MASK) != in tpc_find_list()
512 EC_LIST_ID_USAGE_NONE && list->list_id == list_id && in tpc_find_list()
513 list->init_idx == init_idx) in tpc_find_list()
516 return (list); in tpc_find_list()
525 struct tpc_list *list; in ctl_receive_copy_status_lid1() local
538 list = tpc_find_list(lun, list_id, in ctl_receive_copy_status_lid1()
540 if (list == NULL) { in ctl_receive_copy_status_lid1()
548 list_copy = *list; in ctl_receive_copy_status_lid1()
549 if (list->completed) { in ctl_receive_copy_status_lid1()
550 TAILQ_REMOVE(&lun->tpc_lists, list, links); in ctl_receive_copy_status_lid1()
551 free(list, M_CTL); in ctl_receive_copy_status_lid1()
595 struct tpc_list *list; in ctl_receive_copy_failure_details() local
608 list = tpc_find_list(lun, list_id, in ctl_receive_copy_failure_details()
610 if (list == NULL || !list->completed) { in ctl_receive_copy_failure_details()
618 list_copy = *list; in ctl_receive_copy_failure_details()
619 TAILQ_REMOVE(&lun->tpc_lists, list, links); in ctl_receive_copy_failure_details()
620 free(list, M_CTL); in ctl_receive_copy_failure_details()
655 struct tpc_list *list; in ctl_receive_copy_status_lid4() local
668 list = tpc_find_list(lun, list_id, in ctl_receive_copy_status_lid4()
670 if (list == NULL) { in ctl_receive_copy_status_lid4()
678 list_copy = *list; in ctl_receive_copy_status_lid4()
679 if (list->completed) { in ctl_receive_copy_status_lid4()
680 TAILQ_REMOVE(&lun->tpc_lists, list, links); in ctl_receive_copy_status_lid4()
681 free(list, M_CTL); in ctl_receive_copy_status_lid4()
728 struct tpc_list *list; in ctl_copy_operation_abort() local
739 list = tpc_find_list(lun, list_id, in ctl_copy_operation_abort()
741 if (list == NULL) { in ctl_copy_operation_abort()
749 list->abort = 1; in ctl_copy_operation_abort()
758 tpc_resolve(struct tpc_list *list, uint16_t idx, uint32_t *ss, in tpc_resolve() argument
764 *ss = list->lun->be_lun->blocksize; in tpc_resolve()
766 *pb = list->lun->be_lun->blocksize << in tpc_resolve()
767 list->lun->be_lun->pblockexp; in tpc_resolve()
769 *pbo = list->lun->be_lun->blocksize * in tpc_resolve()
770 list->lun->be_lun->pblockoff; in tpc_resolve()
771 return (list->lun->lun); in tpc_resolve()
773 if (idx >= list->ncscd) in tpc_resolve()
775 return (tpcl_resolve(list->lun->ctl_softc, in tpc_resolve()
776 list->init_port, &list->cscd[idx], ss, pb, pbo)); in tpc_resolve()
780 tpc_set_io_error_sense(struct tpc_list *list) in tpc_set_io_error_sense() argument
787 scsi_ulto4b(list->curseg, csi); in tpc_set_io_error_sense()
788 if (list->fwd_cscd <= 0x07ff) { in tpc_set_io_error_sense()
790 scsi_ulto2b((uint8_t *)&list->cscd[list->fwd_cscd] - in tpc_set_io_error_sense()
791 list->params, &sks[1]); in tpc_set_io_error_sense()
794 if (list->fwd_scsi_status) { in tpc_set_io_error_sense()
796 fbuf[2] = list->fwd_target; in tpc_set_io_error_sense()
797 flen = list->fwd_sense_len; in tpc_set_io_error_sense()
803 fbuf[3] = list->fwd_scsi_status; in tpc_set_io_error_sense()
804 bcopy(&list->fwd_sense_data, &fbuf[4], flen); in tpc_set_io_error_sense()
808 ctl_set_sense(list->ctsio, /*current_error*/ 1, in tpc_set_io_error_sense()
818 tpc_process_b2b(struct tpc_list *list) in tpc_process_b2b() argument
831 scsi_ulto4b(list->curseg, csi); in tpc_process_b2b()
832 if (list->stage == 1) { in tpc_process_b2b()
833 while ((tior = TAILQ_FIRST(&list->allio)) != NULL) { in tpc_process_b2b()
834 TAILQ_REMOVE(&list->allio, tior, links); in tpc_process_b2b()
839 if (list->abort) { in tpc_process_b2b()
840 ctl_set_task_aborted(list->ctsio); in tpc_process_b2b()
842 } else if (list->error) { in tpc_process_b2b()
843 tpc_set_io_error_sense(list); in tpc_process_b2b()
846 list->cursectors += list->segsectors; in tpc_process_b2b()
847 list->curbytes += list->segbytes; in tpc_process_b2b()
851 TAILQ_INIT(&list->allio); in tpc_process_b2b()
852 seg = (struct scsi_ec_segment_b2b *)list->seg[list->curseg]; in tpc_process_b2b()
855 sl = tpc_resolve(list, scscd, &srcblock, NULL, NULL); in tpc_process_b2b()
856 dl = tpc_resolve(list, dcscd, &dstblock, &pb, &pbo); in tpc_process_b2b()
858 ctl_set_sense(list->ctsio, /*current_error*/ 1, in tpc_process_b2b()
867 sdstp = &list->cscd[scscd].dtsp; in tpc_process_b2b()
870 ddstp = &list->cscd[dcscd].dtsp; in tpc_process_b2b()
889 ctl_set_sense(list->ctsio, /*current_error*/ 1, in tpc_process_b2b()
897 list->segbytes = numbytes; in tpc_process_b2b()
898 list->segsectors = numbytes / dstblock; in tpc_process_b2b()
901 list->tbdio = 0; in tpc_process_b2b()
917 tior->list = list; in tpc_process_b2b()
918 TAILQ_INSERT_TAIL(&list->allio, tior, links); in tpc_process_b2b()
938 tiow->list = list; in tpc_process_b2b()
939 TAILQ_INSERT_TAIL(&list->allio, tiow, links); in tpc_process_b2b()
959 list->tbdio++; in tpc_process_b2b()
971 list->stage++; in tpc_process_b2b()
976 tpc_process_verify(struct tpc_list *list) in tpc_process_verify() argument
984 scsi_ulto4b(list->curseg, csi); in tpc_process_verify()
985 if (list->stage == 1) { in tpc_process_verify()
986 while ((tio = TAILQ_FIRST(&list->allio)) != NULL) { in tpc_process_verify()
987 TAILQ_REMOVE(&list->allio, tio, links); in tpc_process_verify()
991 if (list->abort) { in tpc_process_verify()
992 ctl_set_task_aborted(list->ctsio); in tpc_process_verify()
994 } else if (list->error) { in tpc_process_verify()
995 tpc_set_io_error_sense(list); in tpc_process_verify()
1001 TAILQ_INIT(&list->allio); in tpc_process_verify()
1002 seg = (struct scsi_ec_segment_verify *)list->seg[list->curseg]; in tpc_process_verify()
1004 sl = tpc_resolve(list, cscd, NULL, NULL, NULL); in tpc_process_verify()
1006 ctl_set_sense(list->ctsio, /*current_error*/ 1, in tpc_process_verify()
1019 list->tbdio = 1; in tpc_process_verify()
1022 tio->list = list; in tpc_process_verify()
1023 TAILQ_INSERT_TAIL(&list->allio, tio, links); in tpc_process_verify()
1031 list->stage++; in tpc_process_verify()
1038 tpc_process_register_key(struct tpc_list *list) in tpc_process_register_key() argument
1047 scsi_ulto4b(list->curseg, csi); in tpc_process_register_key()
1048 if (list->stage == 1) { in tpc_process_register_key()
1049 while ((tio = TAILQ_FIRST(&list->allio)) != NULL) { in tpc_process_register_key()
1050 TAILQ_REMOVE(&list->allio, tio, links); in tpc_process_register_key()
1055 if (list->abort) { in tpc_process_register_key()
1056 ctl_set_task_aborted(list->ctsio); in tpc_process_register_key()
1058 } else if (list->error) { in tpc_process_register_key()
1059 tpc_set_io_error_sense(list); in tpc_process_register_key()
1065 TAILQ_INIT(&list->allio); in tpc_process_register_key()
1066 seg = (struct scsi_ec_segment_register_key *)list->seg[list->curseg]; in tpc_process_register_key()
1068 dl = tpc_resolve(list, cscd, NULL, NULL, NULL); in tpc_process_register_key()
1070 ctl_set_sense(list->ctsio, /*current_error*/ 1, in tpc_process_register_key()
1080 list->tbdio = 1; in tpc_process_register_key()
1083 tio->list = list; in tpc_process_register_key()
1084 TAILQ_INSERT_TAIL(&list->allio, tio, links); in tpc_process_register_key()
1097 list->stage++; in tpc_process_register_key()
1175 tpc_process_wut(struct tpc_list *list) in tpc_process_wut() argument
1184 if (list->stage > 0) { in tpc_process_wut()
1186 while ((tio = TAILQ_FIRST(&list->allio)) != NULL) { in tpc_process_wut()
1187 TAILQ_REMOVE(&list->allio, tio, links); in tpc_process_wut()
1192 if (list->abort) { in tpc_process_wut()
1193 ctl_set_task_aborted(list->ctsio); in tpc_process_wut()
1195 } else if (list->error) { in tpc_process_wut()
1196 if (list->fwd_scsi_status) { in tpc_process_wut()
1197 list->ctsio->io_hdr.status = in tpc_process_wut()
1199 list->ctsio->scsi_status = list->fwd_scsi_status; in tpc_process_wut()
1200 list->ctsio->sense_data = list->fwd_sense_data; in tpc_process_wut()
1201 list->ctsio->sense_len = list->fwd_sense_len; in tpc_process_wut()
1203 ctl_set_invalid_field(list->ctsio, in tpc_process_wut()
1209 list->cursectors += list->segsectors; in tpc_process_wut()
1210 list->curbytes += list->segbytes; in tpc_process_wut()
1214 if (tpc_skip_ranges(list->range, list->nrange, list->cursectors, in tpc_process_wut()
1217 dstblock = list->lun->be_lun->blocksize; in tpc_process_wut()
1218 pb = dstblock << list->lun->be_lun->pblockexp; in tpc_process_wut()
1219 if (list->lun->be_lun->pblockoff > 0) in tpc_process_wut()
1220 pbo = pb - dstblock * list->lun->be_lun->pblockoff; in tpc_process_wut()
1225 srcblock = list->token->blocksize; in tpc_process_wut()
1226 if (tpc_skip_ranges(list->token->range, list->token->nrange, in tpc_process_wut()
1227 list->offset_into_rod + list->cursectors * dstblock / srcblock, in tpc_process_wut()
1229 ctl_set_invalid_field(list->ctsio, /*sks_valid*/ 0, in tpc_process_wut()
1234 srclba = scsi_8btou64(list->token->range[srange].lba) + soffset; in tpc_process_wut()
1235 dstlba = scsi_8btou64(list->range[drange].lba) + doffset; in tpc_process_wut()
1237 (scsi_4btoul(list->token->range[srange].length) - soffset); in tpc_process_wut()
1239 (scsi_4btoul(list->range[drange].length) - doffset)); in tpc_process_wut()
1251 ctl_set_invalid_field(list->ctsio, /*sks_valid*/ 0, in tpc_process_wut()
1256 list->segbytes = numbytes; in tpc_process_wut()
1257 list->segsectors = numbytes / dstblock; in tpc_process_wut()
1262 list->tbdio = 0; in tpc_process_wut()
1263 TAILQ_INIT(&list->allio); in tpc_process_wut()
1279 tior->list = list; in tpc_process_wut()
1280 TAILQ_INSERT_TAIL(&list->allio, tior, links); in tpc_process_wut()
1293 tior->lun = list->token->lun; in tpc_process_wut()
1298 tiow->list = list; in tpc_process_wut()
1299 TAILQ_INSERT_TAIL(&list->allio, tiow, links); in tpc_process_wut()
1312 tiow->lun = list->lun->lun; in tpc_process_wut()
1317 list->tbdio++; in tpc_process_wut()
1329 list->stage++; in tpc_process_wut()
1334 tpc_process_zero_wut(struct tpc_list *list) in tpc_process_zero_wut() argument
1341 if (list->stage > 0) { in tpc_process_zero_wut()
1344 while ((tio = TAILQ_FIRST(&list->allio)) != NULL) { in tpc_process_zero_wut()
1345 TAILQ_REMOVE(&list->allio, tio, links); in tpc_process_zero_wut()
1349 if (list->abort) { in tpc_process_zero_wut()
1350 ctl_set_task_aborted(list->ctsio); in tpc_process_zero_wut()
1352 } else if (list->error) { in tpc_process_zero_wut()
1353 if (list->fwd_scsi_status) { in tpc_process_zero_wut()
1354 list->ctsio->io_hdr.status = in tpc_process_zero_wut()
1356 list->ctsio->scsi_status = list->fwd_scsi_status; in tpc_process_zero_wut()
1357 list->ctsio->sense_data = list->fwd_sense_data; in tpc_process_zero_wut()
1358 list->ctsio->sense_len = list->fwd_sense_len; in tpc_process_zero_wut()
1360 ctl_set_invalid_field(list->ctsio, in tpc_process_zero_wut()
1366 list->cursectors += list->segsectors; in tpc_process_zero_wut()
1367 list->curbytes += list->segbytes; in tpc_process_zero_wut()
1371 dstblock = list->lun->be_lun->blocksize; in tpc_process_zero_wut()
1374 list->tbdio = 1; in tpc_process_zero_wut()
1375 TAILQ_INIT(&list->allio); in tpc_process_zero_wut()
1376 list->segsectors = 0; in tpc_process_zero_wut()
1377 for (r = 0; r < list->nrange; r++) { in tpc_process_zero_wut()
1378 len = scsi_4btoul(list->range[r].length); in tpc_process_zero_wut()
1384 tiow->list = list; in tpc_process_zero_wut()
1385 TAILQ_INSERT_TAIL(&list->allio, tiow, links); in tpc_process_zero_wut()
1391 /*lba*/ scsi_8btou64(list->range[r].lba), in tpc_process_zero_wut()
1396 tiow->lun = list->lun->lun; in tpc_process_zero_wut()
1401 list->segsectors += len; in tpc_process_zero_wut()
1403 list->segbytes = list->segsectors * dstblock; in tpc_process_zero_wut()
1414 list->stage++; in tpc_process_zero_wut()
1419 tpc_process(struct tpc_list *list) in tpc_process() argument
1421 struct ctl_lun *lun = list->lun; in tpc_process()
1424 struct ctl_scsiio *ctsio = list->ctsio; in tpc_process()
1428 if (list->service_action == EC_WUT) { in tpc_process()
1429 if (list->token != NULL) in tpc_process()
1430 retval = tpc_process_wut(list); in tpc_process()
1432 retval = tpc_process_zero_wut(list); in tpc_process()
1436 list->error = 1; in tpc_process()
1441 while (list->curseg < list->nseg) { in tpc_process()
1442 seg = list->seg[list->curseg]; in tpc_process()
1445 retval = tpc_process_b2b(list); in tpc_process()
1448 retval = tpc_process_verify(list); in tpc_process()
1451 retval = tpc_process_register_key(list); in tpc_process()
1454 scsi_ulto4b(list->curseg, csi); in tpc_process()
1465 list->error = 1; in tpc_process()
1468 list->curseg++; in tpc_process()
1469 list->stage = 0; in tpc_process()
1477 free(list->params, M_CTL); in tpc_process()
1478 list->params = NULL; in tpc_process()
1479 if (list->token) { in tpc_process()
1481 if (--list->token->active == 0) in tpc_process()
1482 list->token->last_active = time_uptime; in tpc_process()
1484 list->token = NULL; in tpc_process()
1487 if ((list->flags & EC_LIST_ID_USAGE_MASK) == EC_LIST_ID_USAGE_NONE) { in tpc_process()
1488 TAILQ_REMOVE(&lun->tpc_lists, list, links); in tpc_process()
1489 free(list, M_CTL); in tpc_process()
1491 list->completed = 1; in tpc_process()
1492 list->last_active = time_uptime; in tpc_process()
1493 list->sense_data = ctsio->sense_data; in tpc_process()
1494 list->sense_len = ctsio->sense_len; in tpc_process()
1495 list->scsi_status = ctsio->scsi_status; in tpc_process()
1641 tio->list->error = 1; in tpc_done()
1644 tio->list->fwd_scsi_status = io->scsiio.scsi_status; in tpc_done()
1645 tio->list->fwd_sense_data = io->scsiio.sense_data; in tpc_done()
1646 tio->list->fwd_sense_len = io->scsiio.sense_len; in tpc_done()
1647 tio->list->fwd_target = tio->target; in tpc_done()
1648 tio->list->fwd_cscd = tio->cscd; in tpc_done()
1651 atomic_add_int(&tio->list->curops, 1); in tpc_done()
1652 if (!tio->list->error && !tio->list->abort) { in tpc_done()
1655 atomic_add_int(&tio->list->tbdio, 1); in tpc_done()
1660 if (atomic_fetchadd_int(&tio->list->tbdio, -1) == 1) in tpc_done()
1661 tpc_process(tio->list); in tpc_done()
1672 struct tpc_list *list, *tlist; in ctl_extended_copy_lid1() local
1735 list = malloc(sizeof(struct tpc_list), M_CTL, M_WAITOK | M_ZERO); in ctl_extended_copy_lid1()
1736 list->service_action = cdb->service_action; in ctl_extended_copy_lid1()
1739 list->init_port = -1; in ctl_extended_copy_lid1()
1741 list->init_port = ctsio->io_hdr.nexus.targ_port; in ctl_extended_copy_lid1()
1742 list->init_idx = ctl_get_initindex(&ctsio->io_hdr.nexus); in ctl_extended_copy_lid1()
1743 list->list_id = data->list_identifier; in ctl_extended_copy_lid1()
1744 list->flags = data->flags; in ctl_extended_copy_lid1()
1745 list->params = ctsio->kern_data_ptr; in ctl_extended_copy_lid1()
1746 list->cscd = (struct scsi_ec_cscd *)&data->data[0]; in ctl_extended_copy_lid1()
1751 free(list, M_CTL); in ctl_extended_copy_lid1()
1761 free(list, M_CTL); in ctl_extended_copy_lid1()
1771 free(list, M_CTL); in ctl_extended_copy_lid1()
1777 list->seg[nseg] = seg; in ctl_extended_copy_lid1()
1781 list->inl = &data->data[lencscd + lenseg]; in ctl_extended_copy_lid1()
1782 list->ncscd = lencscd / sizeof(struct scsi_ec_cscd); in ctl_extended_copy_lid1()
1783 list->nseg = nseg; in ctl_extended_copy_lid1()
1784 list->leninl = leninl; in ctl_extended_copy_lid1()
1785 list->ctsio = ctsio; in ctl_extended_copy_lid1()
1786 list->lun = lun; in ctl_extended_copy_lid1()
1788 if ((list->flags & EC_LIST_ID_USAGE_MASK) != EC_LIST_ID_USAGE_NONE) { in ctl_extended_copy_lid1()
1789 tlist = tpc_find_list(lun, list->list_id, list->init_idx); in ctl_extended_copy_lid1()
1792 free(list, M_CTL); in ctl_extended_copy_lid1()
1803 TAILQ_INSERT_TAIL(&lun->tpc_lists, list, links); in ctl_extended_copy_lid1()
1806 tpc_process(list); in ctl_extended_copy_lid1()
1826 struct tpc_list *list, *tlist; in ctl_extended_copy_lid4() local
1889 list = malloc(sizeof(struct tpc_list), M_CTL, M_WAITOK | M_ZERO); in ctl_extended_copy_lid4()
1890 list->service_action = cdb->service_action; in ctl_extended_copy_lid4()
1893 list->init_port = -1; in ctl_extended_copy_lid4()
1895 list->init_port = ctsio->io_hdr.nexus.targ_port; in ctl_extended_copy_lid4()
1896 list->init_idx = ctl_get_initindex(&ctsio->io_hdr.nexus); in ctl_extended_copy_lid4()
1897 list->list_id = scsi_4btoul(data->list_identifier); in ctl_extended_copy_lid4()
1898 list->flags = data->flags; in ctl_extended_copy_lid4()
1899 list->params = ctsio->kern_data_ptr; in ctl_extended_copy_lid4()
1900 list->cscd = (struct scsi_ec_cscd *)&data->data[0]; in ctl_extended_copy_lid4()
1905 free(list, M_CTL); in ctl_extended_copy_lid4()
1915 free(list, M_CTL); in ctl_extended_copy_lid4()
1925 free(list, M_CTL); in ctl_extended_copy_lid4()
1931 list->seg[nseg] = seg; in ctl_extended_copy_lid4()
1935 list->inl = &data->data[lencscd + lenseg]; in ctl_extended_copy_lid4()
1936 list->ncscd = lencscd / sizeof(struct scsi_ec_cscd); in ctl_extended_copy_lid4()
1937 list->nseg = nseg; in ctl_extended_copy_lid4()
1938 list->leninl = leninl; in ctl_extended_copy_lid4()
1939 list->ctsio = ctsio; in ctl_extended_copy_lid4()
1940 list->lun = lun; in ctl_extended_copy_lid4()
1942 if ((list->flags & EC_LIST_ID_USAGE_MASK) != EC_LIST_ID_USAGE_NONE) { in ctl_extended_copy_lid4()
1943 tlist = tpc_find_list(lun, list->list_id, list->init_idx); in ctl_extended_copy_lid4()
1946 free(list, M_CTL); in ctl_extended_copy_lid4()
1957 TAILQ_INSERT_TAIL(&lun->tpc_lists, list, links); in ctl_extended_copy_lid4()
1960 tpc_process(list); in ctl_extended_copy_lid4()
2027 struct tpc_list *list, *tlist; in ctl_populate_token() local
2119 list = malloc(sizeof(struct tpc_list), M_CTL, M_WAITOK | M_ZERO); in ctl_populate_token()
2120 list->service_action = cdb->service_action; in ctl_populate_token()
2121 list->init_port = ctsio->io_hdr.nexus.targ_port; in ctl_populate_token()
2122 list->init_idx = ctl_get_initindex(&ctsio->io_hdr.nexus); in ctl_populate_token()
2123 list->list_id = scsi_4btoul(cdb->list_identifier); in ctl_populate_token()
2124 list->flags = data->flags; in ctl_populate_token()
2125 list->ctsio = ctsio; in ctl_populate_token()
2126 list->lun = lun; in ctl_populate_token()
2128 tlist = tpc_find_list(lun, list->list_id, list->init_idx); in ctl_populate_token()
2131 free(list, M_CTL); in ctl_populate_token()
2141 TAILQ_INSERT_TAIL(&lun->tpc_lists, list, links); in ctl_populate_token()
2151 list->cursectors = tpc_ranges_length(token->range, token->nrange); in ctl_populate_token()
2152 list->curbytes = (off_t)list->cursectors * lun->be_lun->blocksize; in ctl_populate_token()
2153 tpc_create_token(lun, port, list->curbytes, in ctl_populate_token()
2162 memcpy(list->res_token, token->token, sizeof(list->res_token)); in ctl_populate_token()
2163 list->res_token_valid = 1; in ctl_populate_token()
2164 list->curseg = 0; in ctl_populate_token()
2165 list->completed = 1; in ctl_populate_token()
2166 list->last_active = time_uptime; in ctl_populate_token()
2190 struct tpc_list *list, *tlist; in ctl_write_using_token() local
2265 list = malloc(sizeof(struct tpc_list), M_CTL, M_WAITOK | M_ZERO); in ctl_write_using_token()
2266 list->service_action = cdb->service_action; in ctl_write_using_token()
2267 list->init_port = ctsio->io_hdr.nexus.targ_port; in ctl_write_using_token()
2268 list->init_idx = ctl_get_initindex(&ctsio->io_hdr.nexus); in ctl_write_using_token()
2269 list->list_id = scsi_4btoul(cdb->list_identifier); in ctl_write_using_token()
2270 list->flags = data->flags; in ctl_write_using_token()
2271 list->params = ctsio->kern_data_ptr; in ctl_write_using_token()
2272 list->range = &data->desc[0]; in ctl_write_using_token()
2273 list->nrange = scsi_2btoul(data->range_descriptor_length) / in ctl_write_using_token()
2275 list->offset_into_rod = scsi_8btou64(data->offset_into_rod); in ctl_write_using_token()
2276 list->ctsio = ctsio; in ctl_write_using_token()
2277 list->lun = lun; in ctl_write_using_token()
2279 tlist = tpc_find_list(lun, list->list_id, list->init_idx); in ctl_write_using_token()
2282 free(list, M_CTL); in ctl_write_using_token()
2292 TAILQ_INSERT_TAIL(&lun->tpc_lists, list, links); in ctl_write_using_token()
2297 tpc_process(list); in ctl_write_using_token()
2309 list->token = token; in ctl_write_using_token()
2316 TAILQ_REMOVE(&lun->tpc_lists, list, links); in ctl_write_using_token()
2318 free(list, M_CTL); in ctl_write_using_token()
2325 tpc_process(list); in ctl_write_using_token()
2343 struct tpc_list *list; in ctl_receive_rod_token_information() local
2357 list = tpc_find_list(lun, list_id, in ctl_receive_rod_token_information()
2359 if (list == NULL) { in ctl_receive_rod_token_information()
2367 list_copy = *list; in ctl_receive_rod_token_information()
2368 if (list->completed) { in ctl_receive_rod_token_information()
2369 TAILQ_REMOVE(&lun->tpc_lists, list, links); in ctl_receive_rod_token_information()
2370 free(list, M_CTL); in ctl_receive_rod_token_information()