Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 Aug 2001 17:31:57 +0800
From:      Rex Luo <rexluo@synology.com>
To:        freebsd-scsi@FreeBSD.ORG
Subject:   Question about SCSI target mode codes
Message-ID:  <200108140931.RAA00609@synology.com>

next in thread | raw e-mail | index | archive | help

   I have a quick question about CAM/XPT target mode codes, and I use FreeBSD 4.1
release kernel. Although I know target mode codes is not yet complete, I still
hope to know the virtue of design.

in target mode peripheral driver:
   targenlun() will launch MAX_ACCEPT ccb to sim device to wait for request from
							------------------------
initiator side.
---------------

   targdone() deals with 2 main function codes, XPT_ACCEPT_TARGET_IO, 
and XPT_CONT_TARGET_IO.
   If a ccb callback from sim device and its fun_code is XPT_ACCEPT_TARGET_IO,
simple command like INQUIRY, TEST_UNIT_READY etc would be filled with 

		atio->ccb_h.flags &= ~CAM_DIR_MASK;
		atio->ccb_h.flags | CAM_DIR_NONE;
		descr->data_resid = 0;
		descr->data_increment = 0;
		descr->timeout = 5*1000;
		descr->status = SCSI_STATUS_OK;

 then return to sim device for reply to initiator side.
			--------------------------------
However, complicated command like RECEIVE, SEND would notify userland polling 
program to process command. The process would call targstrategy() -> targstart()
to launch XPT_CONT_TARGET_IO command to sim device for data transfer.

  My question is does sim device distinguish 2 different XPT_ACCEPT_TARGET_IO 
behaviours? or my interpretation is wrong?


Thanks
--
Rex Luo

Tel : 886-2-25521814 Ext. 824
Fax : 886-2-25521824
e-mail : rexluo@synology.com



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-scsi" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200108140931.RAA00609>