Exemple #1
0
void
mpt_print_request(void *vreq)
{
	MSG_REQUEST_HEADER *req = vreq;

	switch (req->Function) {
	case MPI_FUNCTION_SCSI_IO_REQUEST:
	case MPI_FUNCTION_RAID_SCSI_IO_PASSTHROUGH:
		mpt_print_scsi_io_request((MSG_SCSI_IO_REQUEST *)req);
		break;
	case MPI_FUNCTION_SCSI_TASK_MGMT:
		mpt_print_scsi_tmf_request((MSG_SCSI_TASK_MGMT *)req);
		break;
	case MPI_FUNCTION_TARGET_ASSIST:
		mpt_print_scsi_target_assist_request(
		    (PTR_MSG_TARGET_ASSIST_REQUEST)req);
		break;
	case MPI_FUNCTION_TARGET_STATUS_SEND:
		mpt_print_scsi_target_status_send_request(
		    (MSG_TARGET_STATUS_SEND_REQUEST *)req);
		break;
	default:
		mpt_print_request_hdr(req);
		break;
	}
}
Exemple #2
0
static void
mpt_print_scsi_tmf_request(MSG_SCSI_TASK_MGMT *msg)
{
	mpt_print_request_hdr((MSG_REQUEST_HEADER *)msg);
	printf("\tLun             0x%02x\n", msg->LUN[1]);
	printf("\tTaskType        %s\n", mpt_scsi_tm_type(msg->TaskType));
	printf("\tTaskMsgContext  0x%08x\n", msg->TaskMsgContext);
}
Exemple #3
0
static void
mpt_print_scsi_io_request(MSG_SCSI_IO_REQUEST *orig_msg)
{
	MSG_SCSI_IO_REQUEST local, *msg = &local;
	int i;

	bcopy(orig_msg, msg, sizeof (MSG_SCSI_IO_REQUEST));
	mpt_print_request_hdr((MSG_REQUEST_HEADER *)msg);
	printf("\tBus:                %d\n", msg->Bus);
	printf("\tTargetID            %d\n", msg->TargetID);
	printf("\tSenseBufferLength   %d\n", msg->SenseBufferLength);
	printf("\tLUN:              0x%jx\n", (uintmax_t)be64dec(msg->LUN));
	printf("\tControl           0x%08x ", msg->Control);
#define MPI_PRINT_FIELD(x)						\
	case MPI_SCSIIO_CONTROL_ ## x :					\
		printf(" " #x " ");					\
		break

	switch (msg->Control & MPI_SCSIIO_CONTROL_DATADIRECTION_MASK) {
	MPI_PRINT_FIELD(NODATATRANSFER);
	MPI_PRINT_FIELD(WRITE);
	MPI_PRINT_FIELD(READ);
	default:
		printf(" Invalid DIR! ");
		break;
	}
	switch (msg->Control & MPI_SCSIIO_CONTROL_TASKATTRIBUTE_MASK) {
	MPI_PRINT_FIELD(SIMPLEQ);
	MPI_PRINT_FIELD(HEADOFQ);
	MPI_PRINT_FIELD(ORDEREDQ);
	MPI_PRINT_FIELD(ACAQ);
	MPI_PRINT_FIELD(UNTAGGED);
	MPI_PRINT_FIELD(NO_DISCONNECT);
	default:
		printf(" Unknown attribute! ");
		break;
	}

	printf("\n");
#undef MPI_PRINT_FIELD

	printf("\tDataLength\t0x%08x\n", msg->DataLength);
	printf("\tSenseBufAddr\t0x%08x\n", msg->SenseBufferLowAddr);
	printf("\tCDB[0:%d]\t", msg->CDBLength);
	for (i = 0; i < msg->CDBLength; i++)
		printf("%02x ", msg->CDB[i]);
	printf("\n");

	if ((msg->Control & MPI_SCSIIO_CONTROL_DATADIRECTION_MASK) !=
	   MPI_SCSIIO_CONTROL_NODATATRANSFER ) {
		mpt_dump_sgl(&orig_msg->SGL,
		    ((char *)&orig_msg->SGL)-(char *)orig_msg);
	}
}
Exemple #4
0
static void
mpt_print_scsi_target_status_send_request(MSG_TARGET_STATUS_SEND_REQUEST *msg)
{
	SGE_IO_UNION x;
	mpt_print_request_hdr((MSG_REQUEST_HEADER *)msg);
	printf("\tStatusCode    0x%02x\n", msg->StatusCode);
	printf("\tStatusFlags   0x%02x\n", msg->StatusFlags);
	printf("\tQueueTag      0x%04x\n", msg->QueueTag);
	printf("\tReplyWord     0x%08x\n", msg->ReplyWord);
	printf("\tLun           0x%02x\n", msg->LUN[1]);
	x.u.Simple = msg->StatusDataSGE;
	mpt_dump_sgl(&x, 0);
}
Exemple #5
0
static void
mpt_print_scsi_target_assist_request(PTR_MSG_TARGET_ASSIST_REQUEST msg)
{
	mpt_print_request_hdr((MSG_REQUEST_HEADER *)msg);
	printf("\tStatusCode    0x%02x\n", msg->StatusCode);
	printf("\tTargetAssist  0x%02x\n", msg->TargetAssistFlags);
	printf("\tQueueTag      0x%04x\n", msg->QueueTag);
	printf("\tReplyWord     0x%08x\n", msg->ReplyWord);
	printf("\tLun           0x%02x\n", msg->LUN[1]);
	printf("\tRelativeOff   0x%08x\n", msg->RelativeOffset);
	printf("\tDataLength    0x%08x\n", msg->DataLength);
	mpt_dump_sgl(msg->SGL, 0);
}
void
mpt_print_request(void *vreq)
{
	MSG_REQUEST_HEADER *req = vreq;

	switch (req->Function) {
	case MPI_FUNCTION_SCSI_IO_REQUEST:
		mpt_print_scsi_io_request((MSG_SCSI_IO_REQUEST *)req);
		break;
	default:
		mpt_print_request_hdr(req);
		break;
	}
}