Lines Matching refs:list
90 struct tpc_list *list; member
161 struct tpc_list *list, *tlist; in tpc_timeout() local
166 TAILQ_FOREACH_SAFE(list, &lun->tpc_lists, links, tlist) { in tpc_timeout()
167 if (!list->completed || time_uptime < list->last_active + in tpc_timeout()
170 TAILQ_REMOVE(&lun->tpc_lists, list, links); in tpc_timeout()
171 free(list, M_CTL); in tpc_timeout()
229 struct tpc_list *list, *tlist; in ctl_tpc_lun_clear() local
231 TAILQ_FOREACH_SAFE(list, &lun->tpc_lists, links, tlist) { in ctl_tpc_lun_clear()
232 if (initidx != -1 && list->init_idx != initidx) in ctl_tpc_lun_clear()
234 if (!list->completed) in ctl_tpc_lun_clear()
236 TAILQ_REMOVE(&lun->tpc_lists, list, links); in ctl_tpc_lun_clear()
237 free(list, M_CTL); in ctl_tpc_lun_clear()
245 struct tpc_list *list; in ctl_tpc_lun_shutdown() local
249 while ((list = TAILQ_FIRST(&lun->tpc_lists)) != NULL) { in ctl_tpc_lun_shutdown()
250 TAILQ_REMOVE(&lun->tpc_lists, list, links); in ctl_tpc_lun_shutdown()
251 KASSERT(list->completed, in ctl_tpc_lun_shutdown()
252 ("Not completed TPC (%p) on shutdown", list)); in ctl_tpc_lun_shutdown()
253 free(list, M_CTL); in ctl_tpc_lun_shutdown()
504 struct tpc_list *list; in tpc_find_list() local
507 TAILQ_FOREACH(list, &lun->tpc_lists, links) { in tpc_find_list()
508 if ((list->flags & EC_LIST_ID_USAGE_MASK) != in tpc_find_list()
509 EC_LIST_ID_USAGE_NONE && list->list_id == list_id && in tpc_find_list()
510 list->init_idx == init_idx) in tpc_find_list()
513 return (list); in tpc_find_list()
522 struct tpc_list *list; in ctl_receive_copy_status_lid1() local
535 list = tpc_find_list(lun, list_id, in ctl_receive_copy_status_lid1()
537 if (list == NULL) { in ctl_receive_copy_status_lid1()
545 list_copy = *list; in ctl_receive_copy_status_lid1()
546 if (list->completed) { in ctl_receive_copy_status_lid1()
547 TAILQ_REMOVE(&lun->tpc_lists, list, links); in ctl_receive_copy_status_lid1()
548 free(list, M_CTL); in ctl_receive_copy_status_lid1()
592 struct tpc_list *list; in ctl_receive_copy_failure_details() local
605 list = tpc_find_list(lun, list_id, in ctl_receive_copy_failure_details()
607 if (list == NULL || !list->completed) { in ctl_receive_copy_failure_details()
615 list_copy = *list; in ctl_receive_copy_failure_details()
616 TAILQ_REMOVE(&lun->tpc_lists, list, links); in ctl_receive_copy_failure_details()
617 free(list, M_CTL); in ctl_receive_copy_failure_details()
652 struct tpc_list *list; in ctl_receive_copy_status_lid4() local
665 list = tpc_find_list(lun, list_id, in ctl_receive_copy_status_lid4()
667 if (list == NULL) { in ctl_receive_copy_status_lid4()
675 list_copy = *list; in ctl_receive_copy_status_lid4()
676 if (list->completed) { in ctl_receive_copy_status_lid4()
677 TAILQ_REMOVE(&lun->tpc_lists, list, links); in ctl_receive_copy_status_lid4()
678 free(list, M_CTL); in ctl_receive_copy_status_lid4()
725 struct tpc_list *list; in ctl_copy_operation_abort() local
736 list = tpc_find_list(lun, list_id, in ctl_copy_operation_abort()
738 if (list == NULL) { in ctl_copy_operation_abort()
746 list->abort = 1; in ctl_copy_operation_abort()
755 tpc_resolve(struct tpc_list *list, uint16_t idx, uint32_t *ss, in tpc_resolve() argument
761 *ss = list->lun->be_lun->blocksize; in tpc_resolve()
763 *pb = list->lun->be_lun->blocksize << in tpc_resolve()
764 list->lun->be_lun->pblockexp; in tpc_resolve()
766 *pbo = list->lun->be_lun->blocksize * in tpc_resolve()
767 list->lun->be_lun->pblockoff; in tpc_resolve()
768 return (list->lun->lun); in tpc_resolve()
770 if (idx >= list->ncscd) in tpc_resolve()
772 return (tpcl_resolve(list->lun->ctl_softc, in tpc_resolve()
773 list->init_port, &list->cscd[idx], ss, pb, pbo)); in tpc_resolve()
777 tpc_set_io_error_sense(struct tpc_list *list) in tpc_set_io_error_sense() argument
784 scsi_ulto4b(list->curseg, csi); in tpc_set_io_error_sense()
785 if (list->fwd_cscd <= 0x07ff) { in tpc_set_io_error_sense()
787 scsi_ulto2b((uint8_t *)&list->cscd[list->fwd_cscd] - in tpc_set_io_error_sense()
788 list->params, &sks[1]); in tpc_set_io_error_sense()
791 if (list->fwd_scsi_status) { in tpc_set_io_error_sense()
793 fbuf[2] = list->fwd_target; in tpc_set_io_error_sense()
794 flen = list->fwd_sense_len; in tpc_set_io_error_sense()
800 fbuf[3] = list->fwd_scsi_status; in tpc_set_io_error_sense()
801 bcopy(&list->fwd_sense_data, &fbuf[4], flen); in tpc_set_io_error_sense()
805 ctl_set_sense(list->ctsio, /*current_error*/ 1, in tpc_set_io_error_sense()
815 tpc_process_b2b(struct tpc_list *list) in tpc_process_b2b() argument
828 scsi_ulto4b(list->curseg, csi); in tpc_process_b2b()
829 if (list->stage == 1) { in tpc_process_b2b()
830 while ((tior = TAILQ_FIRST(&list->allio)) != NULL) { in tpc_process_b2b()
831 TAILQ_REMOVE(&list->allio, tior, links); in tpc_process_b2b()
836 if (list->abort) { in tpc_process_b2b()
837 ctl_set_task_aborted(list->ctsio); in tpc_process_b2b()
839 } else if (list->error) { in tpc_process_b2b()
840 tpc_set_io_error_sense(list); in tpc_process_b2b()
843 list->cursectors += list->segsectors; in tpc_process_b2b()
844 list->curbytes += list->segbytes; in tpc_process_b2b()
848 TAILQ_INIT(&list->allio); in tpc_process_b2b()
849 seg = (struct scsi_ec_segment_b2b *)list->seg[list->curseg]; in tpc_process_b2b()
852 sl = tpc_resolve(list, scscd, &srcblock, NULL, NULL); in tpc_process_b2b()
853 dl = tpc_resolve(list, dcscd, &dstblock, &pb, &pbo); in tpc_process_b2b()
855 ctl_set_sense(list->ctsio, /*current_error*/ 1, in tpc_process_b2b()
864 sdstp = &list->cscd[scscd].dtsp; in tpc_process_b2b()
867 ddstp = &list->cscd[dcscd].dtsp; in tpc_process_b2b()
886 ctl_set_sense(list->ctsio, /*current_error*/ 1, in tpc_process_b2b()
894 list->segbytes = numbytes; in tpc_process_b2b()
895 list->segsectors = numbytes / dstblock; in tpc_process_b2b()
898 list->tbdio = 0; in tpc_process_b2b()
914 tior->list = list; in tpc_process_b2b()
915 TAILQ_INSERT_TAIL(&list->allio, tior, links); in tpc_process_b2b()
935 tiow->list = list; in tpc_process_b2b()
936 TAILQ_INSERT_TAIL(&list->allio, tiow, links); in tpc_process_b2b()
956 list->tbdio++; in tpc_process_b2b()
968 list->stage++; in tpc_process_b2b()
973 tpc_process_verify(struct tpc_list *list) in tpc_process_verify() argument
981 scsi_ulto4b(list->curseg, csi); in tpc_process_verify()
982 if (list->stage == 1) { in tpc_process_verify()
983 while ((tio = TAILQ_FIRST(&list->allio)) != NULL) { in tpc_process_verify()
984 TAILQ_REMOVE(&list->allio, tio, links); in tpc_process_verify()
988 if (list->abort) { in tpc_process_verify()
989 ctl_set_task_aborted(list->ctsio); in tpc_process_verify()
991 } else if (list->error) { in tpc_process_verify()
992 tpc_set_io_error_sense(list); in tpc_process_verify()
998 TAILQ_INIT(&list->allio); in tpc_process_verify()
999 seg = (struct scsi_ec_segment_verify *)list->seg[list->curseg]; in tpc_process_verify()
1001 sl = tpc_resolve(list, cscd, NULL, NULL, NULL); in tpc_process_verify()
1003 ctl_set_sense(list->ctsio, /*current_error*/ 1, in tpc_process_verify()
1016 list->tbdio = 1; in tpc_process_verify()
1019 tio->list = list; in tpc_process_verify()
1020 TAILQ_INSERT_TAIL(&list->allio, tio, links); in tpc_process_verify()
1028 list->stage++; in tpc_process_verify()
1035 tpc_process_register_key(struct tpc_list *list) in tpc_process_register_key() argument
1044 scsi_ulto4b(list->curseg, csi); in tpc_process_register_key()
1045 if (list->stage == 1) { in tpc_process_register_key()
1046 while ((tio = TAILQ_FIRST(&list->allio)) != NULL) { in tpc_process_register_key()
1047 TAILQ_REMOVE(&list->allio, tio, links); in tpc_process_register_key()
1052 if (list->abort) { in tpc_process_register_key()
1053 ctl_set_task_aborted(list->ctsio); in tpc_process_register_key()
1055 } else if (list->error) { in tpc_process_register_key()
1056 tpc_set_io_error_sense(list); in tpc_process_register_key()
1062 TAILQ_INIT(&list->allio); in tpc_process_register_key()
1063 seg = (struct scsi_ec_segment_register_key *)list->seg[list->curseg]; in tpc_process_register_key()
1065 dl = tpc_resolve(list, cscd, NULL, NULL, NULL); in tpc_process_register_key()
1067 ctl_set_sense(list->ctsio, /*current_error*/ 1, in tpc_process_register_key()
1077 list->tbdio = 1; in tpc_process_register_key()
1080 tio->list = list; in tpc_process_register_key()
1081 TAILQ_INSERT_TAIL(&list->allio, tio, links); in tpc_process_register_key()
1094 list->stage++; in tpc_process_register_key()
1172 tpc_process_wut(struct tpc_list *list) in tpc_process_wut() argument
1181 if (list->stage > 0) { in tpc_process_wut()
1183 while ((tio = TAILQ_FIRST(&list->allio)) != NULL) { in tpc_process_wut()
1184 TAILQ_REMOVE(&list->allio, tio, links); in tpc_process_wut()
1189 if (list->abort) { in tpc_process_wut()
1190 ctl_set_task_aborted(list->ctsio); in tpc_process_wut()
1192 } else if (list->error) { in tpc_process_wut()
1193 if (list->fwd_scsi_status) { in tpc_process_wut()
1194 list->ctsio->io_hdr.status = in tpc_process_wut()
1196 list->ctsio->scsi_status = list->fwd_scsi_status; in tpc_process_wut()
1197 list->ctsio->sense_data = list->fwd_sense_data; in tpc_process_wut()
1198 list->ctsio->sense_len = list->fwd_sense_len; in tpc_process_wut()
1200 ctl_set_invalid_field(list->ctsio, in tpc_process_wut()
1206 list->cursectors += list->segsectors; in tpc_process_wut()
1207 list->curbytes += list->segbytes; in tpc_process_wut()
1211 if (tpc_skip_ranges(list->range, list->nrange, list->cursectors, in tpc_process_wut()
1214 dstblock = list->lun->be_lun->blocksize; in tpc_process_wut()
1215 pb = dstblock << list->lun->be_lun->pblockexp; in tpc_process_wut()
1216 if (list->lun->be_lun->pblockoff > 0) in tpc_process_wut()
1217 pbo = pb - dstblock * list->lun->be_lun->pblockoff; in tpc_process_wut()
1222 srcblock = list->token->blocksize; in tpc_process_wut()
1223 if (tpc_skip_ranges(list->token->range, list->token->nrange, in tpc_process_wut()
1224 list->offset_into_rod + list->cursectors * dstblock / srcblock, in tpc_process_wut()
1226 ctl_set_invalid_field(list->ctsio, /*sks_valid*/ 0, in tpc_process_wut()
1231 srclba = scsi_8btou64(list->token->range[srange].lba) + soffset; in tpc_process_wut()
1232 dstlba = scsi_8btou64(list->range[drange].lba) + doffset; in tpc_process_wut()
1234 (scsi_4btoul(list->token->range[srange].length) - soffset); in tpc_process_wut()
1236 (scsi_4btoul(list->range[drange].length) - doffset)); in tpc_process_wut()
1248 ctl_set_invalid_field(list->ctsio, /*sks_valid*/ 0, in tpc_process_wut()
1253 list->segbytes = numbytes; in tpc_process_wut()
1254 list->segsectors = numbytes / dstblock; in tpc_process_wut()
1259 list->tbdio = 0; in tpc_process_wut()
1260 TAILQ_INIT(&list->allio); in tpc_process_wut()
1276 tior->list = list; in tpc_process_wut()
1277 TAILQ_INSERT_TAIL(&list->allio, tior, links); in tpc_process_wut()
1290 tior->lun = list->token->lun; in tpc_process_wut()
1295 tiow->list = list; in tpc_process_wut()
1296 TAILQ_INSERT_TAIL(&list->allio, tiow, links); in tpc_process_wut()
1309 tiow->lun = list->lun->lun; in tpc_process_wut()
1314 list->tbdio++; in tpc_process_wut()
1326 list->stage++; in tpc_process_wut()
1331 tpc_process_zero_wut(struct tpc_list *list) in tpc_process_zero_wut() argument
1338 if (list->stage > 0) { in tpc_process_zero_wut()
1341 while ((tio = TAILQ_FIRST(&list->allio)) != NULL) { in tpc_process_zero_wut()
1342 TAILQ_REMOVE(&list->allio, tio, links); in tpc_process_zero_wut()
1346 if (list->abort) { in tpc_process_zero_wut()
1347 ctl_set_task_aborted(list->ctsio); in tpc_process_zero_wut()
1349 } else if (list->error) { in tpc_process_zero_wut()
1350 if (list->fwd_scsi_status) { in tpc_process_zero_wut()
1351 list->ctsio->io_hdr.status = in tpc_process_zero_wut()
1353 list->ctsio->scsi_status = list->fwd_scsi_status; in tpc_process_zero_wut()
1354 list->ctsio->sense_data = list->fwd_sense_data; in tpc_process_zero_wut()
1355 list->ctsio->sense_len = list->fwd_sense_len; in tpc_process_zero_wut()
1357 ctl_set_invalid_field(list->ctsio, in tpc_process_zero_wut()
1363 list->cursectors += list->segsectors; in tpc_process_zero_wut()
1364 list->curbytes += list->segbytes; in tpc_process_zero_wut()
1368 dstblock = list->lun->be_lun->blocksize; in tpc_process_zero_wut()
1371 list->tbdio = 1; in tpc_process_zero_wut()
1372 TAILQ_INIT(&list->allio); in tpc_process_zero_wut()
1373 list->segsectors = 0; in tpc_process_zero_wut()
1374 for (r = 0; r < list->nrange; r++) { in tpc_process_zero_wut()
1375 len = scsi_4btoul(list->range[r].length); in tpc_process_zero_wut()
1381 tiow->list = list; in tpc_process_zero_wut()
1382 TAILQ_INSERT_TAIL(&list->allio, tiow, links); in tpc_process_zero_wut()
1388 /*lba*/ scsi_8btou64(list->range[r].lba), in tpc_process_zero_wut()
1393 tiow->lun = list->lun->lun; in tpc_process_zero_wut()
1398 list->segsectors += len; in tpc_process_zero_wut()
1400 list->segbytes = list->segsectors * dstblock; in tpc_process_zero_wut()
1411 list->stage++; in tpc_process_zero_wut()
1416 tpc_process(struct tpc_list *list) in tpc_process() argument
1418 struct ctl_lun *lun = list->lun; in tpc_process()
1421 struct ctl_scsiio *ctsio = list->ctsio; in tpc_process()
1425 if (list->service_action == EC_WUT) { in tpc_process()
1426 if (list->token != NULL) in tpc_process()
1427 retval = tpc_process_wut(list); in tpc_process()
1429 retval = tpc_process_zero_wut(list); in tpc_process()
1433 list->error = 1; in tpc_process()
1438 while (list->curseg < list->nseg) { in tpc_process()
1439 seg = list->seg[list->curseg]; in tpc_process()
1442 retval = tpc_process_b2b(list); in tpc_process()
1445 retval = tpc_process_verify(list); in tpc_process()
1448 retval = tpc_process_register_key(list); in tpc_process()
1451 scsi_ulto4b(list->curseg, csi); in tpc_process()
1462 list->error = 1; in tpc_process()
1465 list->curseg++; in tpc_process()
1466 list->stage = 0; in tpc_process()
1474 free(list->params, M_CTL); in tpc_process()
1475 list->params = NULL; in tpc_process()
1476 if (list->token) { in tpc_process()
1478 if (--list->token->active == 0) in tpc_process()
1479 list->token->last_active = time_uptime; in tpc_process()
1481 list->token = NULL; in tpc_process()
1484 if ((list->flags & EC_LIST_ID_USAGE_MASK) == EC_LIST_ID_USAGE_NONE) { in tpc_process()
1485 TAILQ_REMOVE(&lun->tpc_lists, list, links); in tpc_process()
1486 free(list, M_CTL); in tpc_process()
1488 list->completed = 1; in tpc_process()
1489 list->last_active = time_uptime; in tpc_process()
1490 list->sense_data = ctsio->sense_data; in tpc_process()
1491 list->sense_len = ctsio->sense_len; in tpc_process()
1492 list->scsi_status = ctsio->scsi_status; in tpc_process()
1638 tio->list->error = 1; in tpc_done()
1641 tio->list->fwd_scsi_status = io->scsiio.scsi_status; in tpc_done()
1642 tio->list->fwd_sense_data = io->scsiio.sense_data; in tpc_done()
1643 tio->list->fwd_sense_len = io->scsiio.sense_len; in tpc_done()
1644 tio->list->fwd_target = tio->target; in tpc_done()
1645 tio->list->fwd_cscd = tio->cscd; in tpc_done()
1648 atomic_add_int(&tio->list->curops, 1); in tpc_done()
1649 if (!tio->list->error && !tio->list->abort) { in tpc_done()
1652 atomic_add_int(&tio->list->tbdio, 1); in tpc_done()
1657 if (atomic_fetchadd_int(&tio->list->tbdio, -1) == 1) in tpc_done()
1658 tpc_process(tio->list); in tpc_done()
1669 struct tpc_list *list, *tlist; in ctl_extended_copy_lid1() local
1732 list = malloc(sizeof(struct tpc_list), M_CTL, M_WAITOK | M_ZERO); in ctl_extended_copy_lid1()
1733 list->service_action = cdb->service_action; in ctl_extended_copy_lid1()
1736 list->init_port = -1; in ctl_extended_copy_lid1()
1738 list->init_port = ctsio->io_hdr.nexus.targ_port; in ctl_extended_copy_lid1()
1739 list->init_idx = ctl_get_initindex(&ctsio->io_hdr.nexus); in ctl_extended_copy_lid1()
1740 list->list_id = data->list_identifier; in ctl_extended_copy_lid1()
1741 list->flags = data->flags; in ctl_extended_copy_lid1()
1742 list->params = ctsio->kern_data_ptr; in ctl_extended_copy_lid1()
1743 list->cscd = (struct scsi_ec_cscd *)&data->data[0]; in ctl_extended_copy_lid1()
1748 free(list, M_CTL); in ctl_extended_copy_lid1()
1758 free(list, M_CTL); in ctl_extended_copy_lid1()
1768 free(list, M_CTL); in ctl_extended_copy_lid1()
1774 list->seg[nseg] = seg; in ctl_extended_copy_lid1()
1778 list->inl = &data->data[lencscd + lenseg]; in ctl_extended_copy_lid1()
1779 list->ncscd = lencscd / sizeof(struct scsi_ec_cscd); in ctl_extended_copy_lid1()
1780 list->nseg = nseg; in ctl_extended_copy_lid1()
1781 list->leninl = leninl; in ctl_extended_copy_lid1()
1782 list->ctsio = ctsio; in ctl_extended_copy_lid1()
1783 list->lun = lun; in ctl_extended_copy_lid1()
1785 if ((list->flags & EC_LIST_ID_USAGE_MASK) != EC_LIST_ID_USAGE_NONE) { in ctl_extended_copy_lid1()
1786 tlist = tpc_find_list(lun, list->list_id, list->init_idx); in ctl_extended_copy_lid1()
1789 free(list, M_CTL); in ctl_extended_copy_lid1()
1800 TAILQ_INSERT_TAIL(&lun->tpc_lists, list, links); in ctl_extended_copy_lid1()
1803 tpc_process(list); in ctl_extended_copy_lid1()
1823 struct tpc_list *list, *tlist; in ctl_extended_copy_lid4() local
1886 list = malloc(sizeof(struct tpc_list), M_CTL, M_WAITOK | M_ZERO); in ctl_extended_copy_lid4()
1887 list->service_action = cdb->service_action; in ctl_extended_copy_lid4()
1890 list->init_port = -1; in ctl_extended_copy_lid4()
1892 list->init_port = ctsio->io_hdr.nexus.targ_port; in ctl_extended_copy_lid4()
1893 list->init_idx = ctl_get_initindex(&ctsio->io_hdr.nexus); in ctl_extended_copy_lid4()
1894 list->list_id = scsi_4btoul(data->list_identifier); in ctl_extended_copy_lid4()
1895 list->flags = data->flags; in ctl_extended_copy_lid4()
1896 list->params = ctsio->kern_data_ptr; in ctl_extended_copy_lid4()
1897 list->cscd = (struct scsi_ec_cscd *)&data->data[0]; in ctl_extended_copy_lid4()
1902 free(list, M_CTL); in ctl_extended_copy_lid4()
1912 free(list, M_CTL); in ctl_extended_copy_lid4()
1922 free(list, M_CTL); in ctl_extended_copy_lid4()
1928 list->seg[nseg] = seg; in ctl_extended_copy_lid4()
1932 list->inl = &data->data[lencscd + lenseg]; in ctl_extended_copy_lid4()
1933 list->ncscd = lencscd / sizeof(struct scsi_ec_cscd); in ctl_extended_copy_lid4()
1934 list->nseg = nseg; in ctl_extended_copy_lid4()
1935 list->leninl = leninl; in ctl_extended_copy_lid4()
1936 list->ctsio = ctsio; in ctl_extended_copy_lid4()
1937 list->lun = lun; in ctl_extended_copy_lid4()
1939 if ((list->flags & EC_LIST_ID_USAGE_MASK) != EC_LIST_ID_USAGE_NONE) { in ctl_extended_copy_lid4()
1940 tlist = tpc_find_list(lun, list->list_id, list->init_idx); in ctl_extended_copy_lid4()
1943 free(list, M_CTL); in ctl_extended_copy_lid4()
1954 TAILQ_INSERT_TAIL(&lun->tpc_lists, list, links); in ctl_extended_copy_lid4()
1957 tpc_process(list); in ctl_extended_copy_lid4()
2024 struct tpc_list *list, *tlist; in ctl_populate_token() local
2116 list = malloc(sizeof(struct tpc_list), M_CTL, M_WAITOK | M_ZERO); in ctl_populate_token()
2117 list->service_action = cdb->service_action; in ctl_populate_token()
2118 list->init_port = ctsio->io_hdr.nexus.targ_port; in ctl_populate_token()
2119 list->init_idx = ctl_get_initindex(&ctsio->io_hdr.nexus); in ctl_populate_token()
2120 list->list_id = scsi_4btoul(cdb->list_identifier); in ctl_populate_token()
2121 list->flags = data->flags; in ctl_populate_token()
2122 list->ctsio = ctsio; in ctl_populate_token()
2123 list->lun = lun; in ctl_populate_token()
2125 tlist = tpc_find_list(lun, list->list_id, list->init_idx); in ctl_populate_token()
2128 free(list, M_CTL); in ctl_populate_token()
2138 TAILQ_INSERT_TAIL(&lun->tpc_lists, list, links); in ctl_populate_token()
2148 list->cursectors = tpc_ranges_length(token->range, token->nrange); in ctl_populate_token()
2149 list->curbytes = (off_t)list->cursectors * lun->be_lun->blocksize; in ctl_populate_token()
2150 tpc_create_token(lun, port, list->curbytes, in ctl_populate_token()
2159 memcpy(list->res_token, token->token, sizeof(list->res_token)); in ctl_populate_token()
2160 list->res_token_valid = 1; in ctl_populate_token()
2161 list->curseg = 0; in ctl_populate_token()
2162 list->completed = 1; in ctl_populate_token()
2163 list->last_active = time_uptime; in ctl_populate_token()
2187 struct tpc_list *list, *tlist; in ctl_write_using_token() local
2262 list = malloc(sizeof(struct tpc_list), M_CTL, M_WAITOK | M_ZERO); in ctl_write_using_token()
2263 list->service_action = cdb->service_action; in ctl_write_using_token()
2264 list->init_port = ctsio->io_hdr.nexus.targ_port; in ctl_write_using_token()
2265 list->init_idx = ctl_get_initindex(&ctsio->io_hdr.nexus); in ctl_write_using_token()
2266 list->list_id = scsi_4btoul(cdb->list_identifier); in ctl_write_using_token()
2267 list->flags = data->flags; in ctl_write_using_token()
2268 list->params = ctsio->kern_data_ptr; in ctl_write_using_token()
2269 list->range = &data->desc[0]; in ctl_write_using_token()
2270 list->nrange = scsi_2btoul(data->range_descriptor_length) / in ctl_write_using_token()
2272 list->offset_into_rod = scsi_8btou64(data->offset_into_rod); in ctl_write_using_token()
2273 list->ctsio = ctsio; in ctl_write_using_token()
2274 list->lun = lun; in ctl_write_using_token()
2276 tlist = tpc_find_list(lun, list->list_id, list->init_idx); in ctl_write_using_token()
2279 free(list, M_CTL); in ctl_write_using_token()
2289 TAILQ_INSERT_TAIL(&lun->tpc_lists, list, links); in ctl_write_using_token()
2294 tpc_process(list); in ctl_write_using_token()
2306 list->token = token; in ctl_write_using_token()
2313 TAILQ_REMOVE(&lun->tpc_lists, list, links); in ctl_write_using_token()
2315 free(list, M_CTL); in ctl_write_using_token()
2322 tpc_process(list); in ctl_write_using_token()
2340 struct tpc_list *list; in ctl_receive_rod_token_information() local
2354 list = tpc_find_list(lun, list_id, in ctl_receive_rod_token_information()
2356 if (list == NULL) { in ctl_receive_rod_token_information()
2364 list_copy = *list; in ctl_receive_rod_token_information()
2365 if (list->completed) { in ctl_receive_rod_token_information()
2366 TAILQ_REMOVE(&lun->tpc_lists, list, links); in ctl_receive_rod_token_information()
2367 free(list, M_CTL); in ctl_receive_rod_token_information()