	vi: set autoindent tabstop=4 shiftwidth=4 :

Entry points into initiator code:

iscsi_initiator_queuecommand()-	Called by SCSI Mid-level to issue a SCSI command
								(which is given as parameter).
								Call is in linux/drivers/scsi/scsi.c.
								io_request_lock is held by the caller.
								Returns 0 on success, != 0 on error.

iscsi_initiator_abort() -		Called by SCSI Mid-level to abort a previously
								issued SCSI command (which is given as
								parameter).
								Call is in linux/drivers/scsi/scsi_error.c.
								io_request_lock is held by the caller.

iscs_initiator_proc_info() -	Called by

Call-backs from initiator code to SCSI Mid-level:

Cmnd->scsi_done() -				Called by initiator when finished with a
								previously issued SCSI command (pointed to by
								Cmnd and passed as only parameter).
								Before calling, Cmnd->result must be set.
								At least a DID_XXXX code should be set in the
								host_byte of the result, as in
									Cmnd->result = (DID_XXXX << 16);
								However, the normal DID_OK is 0, so we don't
								have to set that.
								io_request_lock MUST be held before calling.
								No Return value.


Fields in the 32-bit Cmnd->result unsigned int:
(info from file linux/drivers/scsi/scsi.h)
Bits
 0			-unused-
 1 to 5		status_byte - set from target device.
 8 to 15	msg_byte	- set by host adapter itself.
16 to 23	host_byte	- set by low-level driver to indicate status.
24 to 31	driver_byte	- set by mid-level.

Values for the status_byte field:
(info fromfile linux/include/scsi/scsi.h)

SAM2		LINUX
			0x3e	STATUS_MASK (bit 0 masked off) - use after shifting the code

					The following Linux codes must be shifted left by 1
					before they go into the Cmnd->result field.
					The macro status_byte() extracts them from the Cmnd->result
					field.
0x00		0x00	GOOD
0x02		0x01	CHECK_CONDITION
			0x02	CONDITION_GOOD
0x04		0x04	BUSY
			0x08	INTERMEDIATE_GOOD
			0x0a	INTERMEDIATE_C_GOOD
0x18		0x0c	RESERVATION_CONFLICT
			0x11	COMMAND_TERMINATED
0x28		0x14	QUEUE_FULL (SAM2: TASK SET FULL)
0x30				ACA ACTIVE
0x40				TASK ABORTED

Values for the host_byte field:
(info from file linux/drivers/scsi/scsi.h)

					The following codes must be shifted left by 16
					before they go into the Cmnd->result field.
					The macro host_byte() extracts them from the Cmnd->result
					field.
			0x00	DID_OK
			0x01	DID_NO_CONNECT
			0x02	DID_BUS_BUSY
			0x03	DID_TIME_OUT
			0x04	DID_BAD_TARGET
			0x05	DID_ABORT
			0x06	DID_PARITY
			0x07	DID_ERROR
			0x08	DID_RESET
			0x09	DID_BAD_INTR
