This is one of the old Unix-OSD Group Messages that John Gallant sent to me for posting on the SCSI BBS. The date reflects when he sent it to me, not the original message date. John Lohmeyer ---------------------------------------------------------------------------- Date: Thu, 4 Jan 90 17:14:27 -0500 From: "John A. Gallant UEG" Message-Id: <9001042214.AA25604@abyss.zk3.dec.com> To: jlohmeye@entec.wichita.ncr.com Subject: Target Mode I sent around a summary of the text of my target mode proposal to a limited set of reviewers earlier. Having heard nothing, I assume it is perfect in every way, so I will send out the same draft to everybody now. Bob Snively ----- Begin Included Message ----- The present definition of CAM provides a very clear and general interface for SCSI device drivers to pass requests for SCSI activity to host adapter hardware, firmware, and software. The CAM Control Block is the primary information passing structure in the system. The division of functionality clearly defines the layers below the CAM as having the responsibility for all SCSI Host Bus Adapter (HBA) protocol steps and for executing all required functions to the SCSI HBA. The advantages of such a structure are very clear, isolating the various low-level SCSI implementation decisions from the programming controlling the actual logical functions to be executed by the selected SCSI devices. Similarly, it is clear that those special programs that support user access to the phase level control cannot have such independence. While such programs are often useful, including SCSI Development Systems, SCSI regression test tools, and devices operating beyond the SCSI standard, the phase level control must be executed across a special driver interface other than the CAM. The CAM interface is specifically designed to transfer standard format SCSI requests across the interface. The same architectural distinction should be made for functions provided by host computer systems when they elect to operate in target mode on their SCSI interfaces. If phase level control for non-standard SCSI commands is required, a special driver interface must be created for those functions. NCR has previously created such a special interface for their multi-bus to SCSI HBA. Such a low-level interface is not appropriate for the generic CAM interface. However, a host computer system does have a standard SCSI command set designed specifically for its use, the Processor Device command set. The CAM should be allowed to support this command set in target mode using the same CAM Control Block structure to provide the generic command functions of the Processor Device type. The following set of functions and CAM control block modifications is suggested to implement Processor Device Target Mode for the CAM interface. The following functions, once Processor Device Target Mode has been enabled, should be handled directly by the SIM layer below the CAM Interface. Test Unit Ready: Inquiry: Request Sense: Set Diagnostic (Self Test bit): The following functions should be supported by a CCB. Send: (Processor Device Target receives data from initiator) Receive: (Processor Device Target sends data to initiator) The CCB may be prepared prior to the requirement for it. In that case, the CCB defines a transmit or receive buffer. CCB's may be prepared for both a SEND command (which requires allocation of a receive buffer) and/or a RECEIVE command (which requires preparation of a transmit buffer with appropriate data). The CCB is not actually used until the appropriate command comes across to the Processor Device Target, at which time, the appropriate SCSI sequence is followed, the information is transferred to or from the allocated buffer, and the CCB is posted back as completed to the target driver that prepared it above the CAM. The CCB may not have been prepared prior to the requirement for it. In that case, the SEND or RECEIVE command is accepted by the SIM layer and the target disconnects from the SCSI. The fact that a CCB is required, as well as the type of CCB required and the length of the required buffer, is posted back to the enabling program by an interrupt. The host target driver then prepares the proper CCB, sends it to the SIM, and the CCB is used as previously described to perform the proper SCSI reconnection and data transfer. If errors occur, the SIM prepares the proper Processor Device error code and posts Check Condition to the command. A subsequent REQUEST SENSE will allow the initiator to recover the error information from the Processor Device Target. Internally, the Target Driver managing the Processor Device Target receives the identical request sense information in the CCB, just as it would resulting from any error detected in initiator mode. If Processor Device Target Mode has not been enabled, any attempts to execute target type functions to the host computer system will be ignored with a selection timeout indication. When Processor Device Target Mode is enabled, a Unit Attention condition will be posted on the next attempt to access the device from another initiator. Asynchronous Event Notification may optionally be used to explicitly indicate that a Processor Device Target has become available on the bus. Commands other than the six mandatory commands for a Processor Device would be rejected as invalid. SCSI Resets are generated in the normal manner. The following additional CCB function is required to manage the Processor Device Target. Enable/Disable Processor Device Target Mode: This CCB Function Code should be added to the present set of CCB function codes. The following information is included in the parameters provided by this function code: a) Enable or Disable b) Logical Unit Mask (indicates which logical units should be indicated as installed when an INQUIRY command is received. Other commands are either accepted if the LUN is enabled or rejected if not.) c) Request for CCB callback address (indicates the address which must be called if a request is received by the the Processor Device Target, but no CCB has been already prepared for the device.) d) Private Data Area Allocation (indicates the location and length of a private data area the CCB Callback uses to present the CDB command and length parameters to the Request for CCB callback address. If this area is not provided or is filled with requests that have not been serviced, the SCSI interface will present a BUSY status instead of disconnecting for later data transfer.) This simple structure should provide the full capability of target mode operation, allowing hosts to pass messages and data across the SCSI at the full SCSI data rate (5, 10, 20, or 40 Megabytes). At the same time, it is a simple and architecturally consistent modification of the CAM Interface. ----- End Included Message -----