Lines Matching refs:pkt

79 static int emul64_scsi_start(struct scsi_address *ap, struct scsi_pkt *pkt);
81 static int emul64_scsi_abort(struct scsi_address *ap, struct scsi_pkt *pkt);
87 struct scsi_pkt *pkt, struct buf *bp, int cmdlen, int statuslen,
90 struct scsi_pkt *pkt);
91 static void emul64_scsi_dmafree(struct scsi_address *ap, struct scsi_pkt *pkt);
92 static void emul64_scsi_sync_pkt(struct scsi_address *ap, struct scsi_pkt *pkt);
124 struct scsi_pkt *pkt);
809 emul64_scsi_init_pkt(struct scsi_address *ap, struct scsi_pkt *pkt, in emul64_scsi_init_pkt() argument
821 if (pkt == NULL) { in emul64_scsi_init_pkt()
822 pkt = scsi_hba_pkt_alloc(emul64->emul64_dip, ap, cmdlen, in emul64_scsi_init_pkt()
825 if (pkt == NULL) { in emul64_scsi_init_pkt()
831 sp = PKT2CMD(pkt); in emul64_scsi_init_pkt()
837 sp->cmd_pkt = pkt; in emul64_scsi_init_pkt()
842 pkt->pkt_address = *ap; in emul64_scsi_init_pkt()
843 pkt->pkt_comp = (void (*)())NULL; in emul64_scsi_init_pkt()
844 pkt->pkt_flags = 0; in emul64_scsi_init_pkt()
845 pkt->pkt_time = 0; in emul64_scsi_init_pkt()
846 pkt->pkt_resid = 0; in emul64_scsi_init_pkt()
847 pkt->pkt_statistics = 0; in emul64_scsi_init_pkt()
848 pkt->pkt_reason = 0; in emul64_scsi_init_pkt()
851 sp = PKT2CMD(pkt); in emul64_scsi_init_pkt()
866 pkt->pkt_resid = 0; in emul64_scsi_init_pkt()
869 return (pkt); in emul64_scsi_init_pkt()
885 emul64_scsi_destroy_pkt(struct scsi_address *ap, struct scsi_pkt *pkt) in emul64_scsi_destroy_pkt() argument
887 struct emul64_cmd *sp = PKT2CMD(pkt); in emul64_scsi_destroy_pkt()
902 scsi_hba_pkt_free(ap, pkt); in emul64_scsi_destroy_pkt()
917 emul64_scsi_dmafree(struct scsi_address *ap, struct scsi_pkt *pkt) in emul64_scsi_dmafree() argument
932 emul64_scsi_sync_pkt(struct scsi_address *ap, struct scsi_pkt *pkt) in emul64_scsi_sync_pkt() argument
998 emul64_scsi_start(struct scsi_address *ap, struct scsi_pkt *pkt) in emul64_scsi_start() argument
1000 struct emul64_cmd *sp = PKT2CMD(pkt); in emul64_scsi_start()
1011 pkt->pkt_reason = CMD_CMPLT; in emul64_scsi_start()
1015 emul64_debug_dump_cdb(ap, pkt); in emul64_scsi_start()
1027 sp->cmd_deadline = cur_lbolt + (pkt->pkt_time * 128); in emul64_scsi_start()
1029 if ((emul64_usetaskq == 0) || (pkt->pkt_flags & FLAG_NOINTR) != 0) { in emul64_scsi_start()
1030 emul64_pkt_comp((caddr_t)pkt); in emul64_scsi_start()
1044 emul64_pkt_comp, (void *)pkt, TQ_NOSLEEP); in emul64_scsi_start()
1054 emul64_pkt_comp, (void *)pkt, TQ_SLEEP); in emul64_scsi_start()
1066 emul64_check_cond(struct scsi_pkt *pkt, uchar_t key, uchar_t asc, uchar_t ascq) in emul64_check_cond() argument
1069 (struct scsi_arq_status *)pkt->pkt_scbp; in emul64_check_cond()
1073 pkt->pkt_state |= STATE_ARQ_DONE; in emul64_check_cond()
1074 pkt->pkt_state &= ~STATE_XFERRED_DATA; in emul64_check_cond()
1089 emul64_error_inject(struct scsi_pkt *pkt) in emul64_error_inject() argument
1091 struct emul64_cmd *sp = PKT2CMD(pkt); in emul64_error_inject()
1094 (struct scsi_arq_status *)pkt->pkt_scbp; in emul64_error_inject()
1099 pkt->pkt_address.a_target, pkt->pkt_address.a_lun); in emul64_error_inject()
1114 pkt->pkt_state = tgt->emul64_einj_pkt_state; in emul64_error_inject()
1115 pkt->pkt_reason = tgt->emul64_einj_pkt_reason; in emul64_error_inject()
1236 emul64_handle_cmd(struct scsi_pkt *pkt) in emul64_handle_cmd() argument
1238 if (emul64_error_inject(pkt) == ERR_INJ_ENABLE_NODATA) { in emul64_handle_cmd()
1252 switch (pkt->pkt_cdbp[0]) { in emul64_handle_cmd()
1254 (void) bsd_scsi_start_stop_unit(pkt); in emul64_handle_cmd()
1257 (void) bsd_scsi_test_unit_ready(pkt); in emul64_handle_cmd()
1260 (void) bsd_scsi_request_sense(pkt); in emul64_handle_cmd()
1263 (void) bsd_scsi_inquiry(pkt); in emul64_handle_cmd()
1266 (void) bsd_scsi_format(pkt); in emul64_handle_cmd()
1274 (void) bsd_scsi_io(pkt); in emul64_handle_cmd()
1277 (void) bsd_scsi_log_sense(pkt); in emul64_handle_cmd()
1281 (void) bsd_scsi_mode_sense(pkt); in emul64_handle_cmd()
1285 (void) bsd_scsi_mode_select(pkt); in emul64_handle_cmd()
1288 (void) bsd_scsi_read_capacity(pkt); in emul64_handle_cmd()
1291 if (pkt->pkt_cdbp[1] == SSVC_ACTION_READ_CAPACITY_G4) { in emul64_handle_cmd()
1292 (void) bsd_scsi_read_capacity_16(pkt); in emul64_handle_cmd()
1295 "action 0x%x", pkt->pkt_cdbp[1]); in emul64_handle_cmd()
1300 (void) bsd_scsi_reserve(pkt); in emul64_handle_cmd()
1304 (void) bsd_scsi_release(pkt); in emul64_handle_cmd()
1307 (void) bsd_scsi_reassign_block(pkt); in emul64_handle_cmd()
1310 (void) bsd_scsi_read_defect_list(pkt); in emul64_handle_cmd()
1316 emul64_check_cond(pkt, KEY_ILLEGAL_REQUEST, 0x24, 0x0); in emul64_handle_cmd()
1320 "SCSI cmd 0x%x", pkt->pkt_cdbp[0]); in emul64_handle_cmd()
1321 emul64_check_cond(pkt, KEY_ILLEGAL_REQUEST, 0x24, 0x0); in emul64_handle_cmd()
1333 struct scsi_pkt *pkt = (struct scsi_pkt *)arg; in emul64_pkt_comp() local
1334 struct emul64_cmd *sp = PKT2CMD(pkt); in emul64_pkt_comp()
1339 pkt->pkt_address.a_target, pkt->pkt_address.a_lun); in emul64_pkt_comp()
1342 pkt->pkt_reason = CMD_TIMEOUT; in emul64_pkt_comp()
1343 pkt->pkt_state = STATE_GOT_BUS | STATE_SENT_CMD; in emul64_pkt_comp()
1344 pkt->pkt_statistics = STAT_TIMEOUT; in emul64_pkt_comp()
1346 pkt->pkt_reason = CMD_CMPLT; in emul64_pkt_comp()
1347 *pkt->pkt_scbp = STATUS_GOOD; in emul64_pkt_comp()
1348 pkt->pkt_state = STATE_GOT_BUS | STATE_GOT_TARGET | in emul64_pkt_comp()
1350 pkt->pkt_statistics = 0; in emul64_pkt_comp()
1351 emul64_handle_cmd(pkt); in emul64_pkt_comp()
1353 scsi_hba_pkt_comp(pkt); in emul64_pkt_comp()
1358 emul64_scsi_abort(struct scsi_address *ap, struct scsi_pkt *pkt) in emul64_scsi_abort() argument
1622 emul64_debug_dump_cdb(struct scsi_address *ap, struct scsi_pkt *pkt) in emul64_debug_dump_cdb() argument
1626 struct emul64_cmd *sp = PKT2CMD(pkt); in emul64_debug_dump_cdb()
1627 uint8_t *cdb = pkt->pkt_cdbp; in emul64_debug_dump_cdb()