summaryrefslogtreecommitdiffstats
path: root/share/examples/scsi_target/scsi_target.c
diff options
context:
space:
mode:
Diffstat (limited to 'share/examples/scsi_target/scsi_target.c')
-rw-r--r--share/examples/scsi_target/scsi_target.c29
1 files changed, 8 insertions, 21 deletions
diff --git a/share/examples/scsi_target/scsi_target.c b/share/examples/scsi_target/scsi_target.c
index 6f665af..1a7a061 100644
--- a/share/examples/scsi_target/scsi_target.c
+++ b/share/examples/scsi_target/scsi_target.c
@@ -88,7 +88,7 @@ static void handle_read(void);
/* static int work_atio(struct ccb_accept_tio *); */
static void queue_io(struct ccb_scsiio *);
static int run_queue(struct ccb_accept_tio *);
-static int work_inot(struct ccb_immed_notify *);
+static int work_inot(struct ccb_immediate_notify *);
static struct ccb_scsiio *
get_ctio(void);
/* static void free_ccb(union ccb *); */
@@ -387,7 +387,7 @@ init_ccbs()
warn("malloc INOT");
return (-1);
}
- inot->ccb_h.func_code = XPT_IMMED_NOTIFY;
+ inot->ccb_h.func_code = XPT_IMMEDIATE_NOTIFY;
send_ccb((union ccb *)inot, /*priority*/1);
}
@@ -495,8 +495,8 @@ request_loop()
/* Start one more transfer. */
retval = work_atio(&ccb->atio);
break;
- case XPT_IMMED_NOTIFY:
- retval = work_inot(&ccb->cin);
+ case XPT_IMMEDIATE_NOTIFY:
+ retval = work_inot(&ccb->cin1);
break;
default:
warnx("Unhandled ccb type %#x on workq",
@@ -651,7 +651,7 @@ work_atio(struct ccb_accept_tio *atio)
warnx("ATIO with %u bytes sense received",
atio->sense_len);
}
- sense = &atio->sense_data;
+ sense = (struct scsi_sense_data_fixed *)&atio->sense_data;
tcmd_sense(ctio->init_id, ctio, sense->flags,
sense->add_sense_code, sense->add_sense_code_qual);
send_ccb((union ccb *)ctio, /*priority*/1);
@@ -772,16 +772,14 @@ run_queue(struct ccb_accept_tio *atio)
}
static int
-work_inot(struct ccb_immed_notify *inot)
+work_inot(struct ccb_immediate_notify *inot)
{
cam_status status;
- int sense;
if (debug)
warnx("Working on INOT %p", inot);
status = inot->ccb_h.status;
- sense = (status & CAM_AUTOSNS_VALID) != 0;
status &= CAM_STATUS_MASK;
switch (status) {
@@ -794,7 +792,7 @@ work_inot(struct ccb_immed_notify *inot)
abort_all_pending();
break;
case CAM_MESSAGE_RECV:
- switch (inot->message_args[0]) {
+ switch (inot->arg) {
case MSG_TASK_COMPLETE:
case MSG_INITIATOR_DET_ERR:
case MSG_ABORT_TASK_SET:
@@ -805,7 +803,7 @@ work_inot(struct ccb_immed_notify *inot)
case MSG_ABORT_TASK:
case MSG_CLEAR_TASK_SET:
default:
- warnx("INOT message %#x", inot->message_args[0]);
+ warnx("INOT message %#x", inot->arg);
break;
}
break;
@@ -817,17 +815,6 @@ work_inot(struct ccb_immed_notify *inot)
break;
}
- /* If there is sense data, use it */
- if (sense != 0) {
- struct scsi_sense_data_fixed *sense;
-
- sense = (struct scsi_sense_data_fixed *)&inot->sense_data;
- tcmd_sense(inot->initiator_id, NULL, sense->flags,
- sense->add_sense_code, sense->add_sense_code_qual);
- if (debug)
- warnx("INOT has sense: %#x", sense->flags);
- }
-
/* Requeue on SIM */
TAILQ_REMOVE(&work_queue, &inot->ccb_h, periph_links.tqe);
send_ccb((union ccb *)inot, /*priority*/1);
OpenPOWER on IntegriCloud