From owner-freebsd-scsi Tue Aug 14 2:31:10 2001 Delivered-To: freebsd-scsi@freebsd.org Received: from synology.com (dns1.synology.com [202.173.37.131]) by hub.freebsd.org (Postfix) with ESMTP id 385F137B411 for ; Tue, 14 Aug 2001 02:31:04 -0700 (PDT) (envelope-from rexluo@synology.com) Received: from synology.com (IDENT:nobody@localhost [127.0.0.1]) by synology.com (8.9.3/8.9.3) with SMTP id RAA00609 for freebsd-scsi@FreeBSD.ORG; Tue, 14 Aug 2001 17:31:57 +0800 Date: Tue, 14 Aug 2001 17:31:57 +0800 Message-Id: <200108140931.RAA00609@synology.com> To: freebsd-scsi@FreeBSD.ORG Subject: Question about SCSI target mode codes From: Rex Luo X-Mailer: TWIG Sender: owner-freebsd-scsi@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org 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