Lines Matching refs:pkt

78 static int emul64_scsi_start(struct scsi_address *ap, struct scsi_pkt *pkt);
80 static int emul64_scsi_abort(struct scsi_address *ap, struct scsi_pkt *pkt);
86 struct scsi_pkt *pkt, struct buf *bp, int cmdlen, int statuslen,
89 struct scsi_pkt *pkt);
90 static void emul64_scsi_dmafree(struct scsi_address *ap, struct scsi_pkt *pkt);
91 static void emul64_scsi_sync_pkt(struct scsi_address *ap, struct scsi_pkt *pkt);
117 struct scsi_pkt *pkt);
802 emul64_scsi_init_pkt(struct scsi_address *ap, struct scsi_pkt *pkt, in emul64_scsi_init_pkt() argument
814 if (pkt == NULL) { in emul64_scsi_init_pkt()
815 pkt = scsi_hba_pkt_alloc(emul64->emul64_dip, ap, cmdlen, in emul64_scsi_init_pkt()
818 if (pkt == NULL) { in emul64_scsi_init_pkt()
824 sp = PKT2CMD(pkt); in emul64_scsi_init_pkt()
830 sp->cmd_pkt = pkt; in emul64_scsi_init_pkt()
835 pkt->pkt_address = *ap; in emul64_scsi_init_pkt()
836 pkt->pkt_comp = (void (*)())NULL; in emul64_scsi_init_pkt()
837 pkt->pkt_flags = 0; in emul64_scsi_init_pkt()
838 pkt->pkt_time = 0; in emul64_scsi_init_pkt()
839 pkt->pkt_resid = 0; in emul64_scsi_init_pkt()
840 pkt->pkt_statistics = 0; in emul64_scsi_init_pkt()
841 pkt->pkt_reason = 0; in emul64_scsi_init_pkt()
844 sp = PKT2CMD(pkt); in emul64_scsi_init_pkt()
859 pkt->pkt_resid = 0; in emul64_scsi_init_pkt()
862 return (pkt); in emul64_scsi_init_pkt()
878 emul64_scsi_destroy_pkt(struct scsi_address *ap, struct scsi_pkt *pkt) in emul64_scsi_destroy_pkt() argument
880 struct emul64_cmd *sp = PKT2CMD(pkt); in emul64_scsi_destroy_pkt()
895 scsi_hba_pkt_free(ap, pkt); in emul64_scsi_destroy_pkt()
910 emul64_scsi_dmafree(struct scsi_address *ap, struct scsi_pkt *pkt) in emul64_scsi_dmafree() argument
925 emul64_scsi_sync_pkt(struct scsi_address *ap, struct scsi_pkt *pkt) in emul64_scsi_sync_pkt() argument
991 emul64_scsi_start(struct scsi_address *ap, struct scsi_pkt *pkt) in emul64_scsi_start() argument
993 struct emul64_cmd *sp = PKT2CMD(pkt); in emul64_scsi_start()
1004 pkt->pkt_reason = CMD_CMPLT; in emul64_scsi_start()
1008 emul64_debug_dump_cdb(ap, pkt); in emul64_scsi_start()
1020 sp->cmd_deadline = cur_lbolt + (pkt->pkt_time * 128); in emul64_scsi_start()
1022 if ((emul64_usetaskq == 0) || (pkt->pkt_flags & FLAG_NOINTR) != 0) { in emul64_scsi_start()
1023 emul64_pkt_comp((caddr_t)pkt); in emul64_scsi_start()
1037 emul64_pkt_comp, (void *)pkt, TQ_NOSLEEP); in emul64_scsi_start()
1047 emul64_pkt_comp, (void *)pkt, TQ_SLEEP); in emul64_scsi_start()
1059 emul64_check_cond(struct scsi_pkt *pkt, uchar_t key, uchar_t asc, uchar_t ascq) in emul64_check_cond() argument
1062 (struct scsi_arq_status *)pkt->pkt_scbp; in emul64_check_cond()
1066 pkt->pkt_state |= STATE_ARQ_DONE; in emul64_check_cond()
1067 pkt->pkt_state &= ~STATE_XFERRED_DATA; in emul64_check_cond()
1082 emul64_error_inject(struct scsi_pkt *pkt) in emul64_error_inject() argument
1084 struct emul64_cmd *sp = PKT2CMD(pkt); in emul64_error_inject()
1087 (struct scsi_arq_status *)pkt->pkt_scbp; in emul64_error_inject()
1092 pkt->pkt_address.a_target, pkt->pkt_address.a_lun); in emul64_error_inject()
1107 pkt->pkt_state = tgt->emul64_einj_pkt_state; in emul64_error_inject()
1108 pkt->pkt_reason = tgt->emul64_einj_pkt_reason; in emul64_error_inject()
1229 emul64_handle_cmd(struct scsi_pkt *pkt) in emul64_handle_cmd() argument
1231 if (emul64_error_inject(pkt) == ERR_INJ_ENABLE_NODATA) { in emul64_handle_cmd()
1245 switch (pkt->pkt_cdbp[0]) { in emul64_handle_cmd()
1247 (void) bsd_scsi_start_stop_unit(pkt); in emul64_handle_cmd()
1250 (void) bsd_scsi_test_unit_ready(pkt); in emul64_handle_cmd()
1253 (void) bsd_scsi_request_sense(pkt); in emul64_handle_cmd()
1256 (void) bsd_scsi_inquiry(pkt); in emul64_handle_cmd()
1259 (void) bsd_scsi_format(pkt); in emul64_handle_cmd()
1267 (void) bsd_scsi_io(pkt); in emul64_handle_cmd()
1270 (void) bsd_scsi_log_sense(pkt); in emul64_handle_cmd()
1274 (void) bsd_scsi_mode_sense(pkt); in emul64_handle_cmd()
1278 (void) bsd_scsi_mode_select(pkt); in emul64_handle_cmd()
1281 (void) bsd_scsi_read_capacity(pkt); in emul64_handle_cmd()
1284 if (pkt->pkt_cdbp[1] == SSVC_ACTION_READ_CAPACITY_G4) { in emul64_handle_cmd()
1285 (void) bsd_scsi_read_capacity_16(pkt); in emul64_handle_cmd()
1288 "action 0x%x", pkt->pkt_cdbp[1]); in emul64_handle_cmd()
1293 (void) bsd_scsi_reserve(pkt); in emul64_handle_cmd()
1297 (void) bsd_scsi_release(pkt); in emul64_handle_cmd()
1300 (void) bsd_scsi_reassign_block(pkt); in emul64_handle_cmd()
1303 (void) bsd_scsi_read_defect_list(pkt); in emul64_handle_cmd()
1309 emul64_check_cond(pkt, KEY_ILLEGAL_REQUEST, 0x24, 0x0); in emul64_handle_cmd()
1313 "SCSI cmd 0x%x", pkt->pkt_cdbp[0]); in emul64_handle_cmd()
1314 emul64_check_cond(pkt, KEY_ILLEGAL_REQUEST, 0x24, 0x0); in emul64_handle_cmd()
1326 struct scsi_pkt *pkt = (struct scsi_pkt *)arg; in emul64_pkt_comp() local
1327 struct emul64_cmd *sp = PKT2CMD(pkt); in emul64_pkt_comp()
1332 pkt->pkt_address.a_target, pkt->pkt_address.a_lun); in emul64_pkt_comp()
1335 pkt->pkt_reason = CMD_TIMEOUT; in emul64_pkt_comp()
1336 pkt->pkt_state = STATE_GOT_BUS | STATE_SENT_CMD; in emul64_pkt_comp()
1337 pkt->pkt_statistics = STAT_TIMEOUT; in emul64_pkt_comp()
1339 pkt->pkt_reason = CMD_CMPLT; in emul64_pkt_comp()
1340 *pkt->pkt_scbp = STATUS_GOOD; in emul64_pkt_comp()
1341 pkt->pkt_state = STATE_GOT_BUS | STATE_GOT_TARGET | in emul64_pkt_comp()
1343 pkt->pkt_statistics = 0; in emul64_pkt_comp()
1344 emul64_handle_cmd(pkt); in emul64_pkt_comp()
1346 scsi_hba_pkt_comp(pkt); in emul64_pkt_comp()
1351 emul64_scsi_abort(struct scsi_address *ap, struct scsi_pkt *pkt) in emul64_scsi_abort() argument
1604 emul64_debug_dump_cdb(struct scsi_address *ap, struct scsi_pkt *pkt) in emul64_debug_dump_cdb() argument
1608 struct emul64_cmd *sp = PKT2CMD(pkt); in emul64_debug_dump_cdb()
1609 uint8_t *cdb = pkt->pkt_cdbp; in emul64_debug_dump_cdb()