From owner-svn-src-all@FreeBSD.ORG Sun May 4 15:35:05 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 86EB0FA4; Sun, 4 May 2014 15:35:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 680481FC6; Sun, 4 May 2014 15:35:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s44FZ55u044335; Sun, 4 May 2014 15:35:05 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s44FZ56l044334; Sun, 4 May 2014 15:35:05 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201405041535.s44FZ56l044334@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 4 May 2014 15:35:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265323 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 May 2014 15:35:05 -0000 Author: trasz Date: Sun May 4 15:35:04 2014 New Revision: 265323 URL: http://svnweb.freebsd.org/changeset/base/265323 Log: Provide better descriptions for 'struct ctl_scsiio' fields; based mostly on emails from ken@. Modified: head/sys/cam/ctl/ctl_io.h Modified: head/sys/cam/ctl/ctl_io.h ============================================================================== --- head/sys/cam/ctl/ctl_io.h Sun May 4 15:05:53 2014 (r265322) +++ head/sys/cam/ctl/ctl_io.h Sun May 4 15:35:04 2014 (r265323) @@ -293,21 +293,60 @@ union ctl_io; */ struct ctl_scsiio { struct ctl_io_hdr io_hdr; /* common to all I/O types */ + + /* + * The ext_* fields are generally intended for frontend use; CTL itself + * doesn't modify or use them. + */ uint32_t ext_sg_entries; /* 0 = no S/G list, > 0 = num entries */ uint8_t *ext_data_ptr; /* data buffer or S/G list */ uint32_t ext_data_len; /* Data transfer length */ uint32_t ext_data_filled; /* Amount of data filled so far */ - uint32_t kern_sg_entries; /* 0 = no S/G list, > 0 = num entries */ - uint32_t rem_sg_entries; /* 0 = no S/G list, > 0 = num entries */ - uint8_t *kern_data_ptr; /* data buffer or S/G list */ - uint32_t kern_data_len; /* Length of this S/G list/buffer */ - uint32_t kern_total_len; /* Total length of this transaction */ - uint32_t kern_data_resid; /* Length left to transfer after this*/ - uint32_t kern_rel_offset; /* Byte Offset of this transfer */ + + /* + * The number of scatter/gather entries in the list pointed to + * by kern_data_ptr. 0 means there is no list, just a data pointer. + */ + uint32_t kern_sg_entries; + + uint32_t rem_sg_entries; /* Unused. */ + + /* + * The data pointer or a pointer to the scatter/gather list. + */ + uint8_t *kern_data_ptr; + + /* + * Length of the data buffer or scatter/gather list. It's also + * the length of this particular piece of the data transfer, + * ie. number of bytes expected to be transferred by the current + * invocation of frontend's datamove() callback. It's always + * less than or equal to kern_total_len. + */ + uint32_t kern_data_len; + + /* + * Total length of data to be transferred during this particular + * SCSI command, as decoded from SCSI CDB. + */ + uint32_t kern_total_len; + + /* + * Amount of data left after the current data transfer. + */ + uint32_t kern_data_resid; + + /* + * Byte offset of this transfer, equal to the amount of data + * already transferred for this SCSI command during previous + * datamove() invocations. + */ + uint32_t kern_rel_offset; + struct scsi_sense_data sense_data; /* sense data */ uint8_t sense_len; /* Returned sense length */ uint8_t scsi_status; /* SCSI status byte */ - uint8_t sense_residual; /* sense residual length */ + uint8_t sense_residual; /* Unused. */ uint32_t residual; /* data residual length */ uint32_t tag_num; /* tag number */ ctl_tag_type tag_type; /* simple, ordered, head of queue,etc.*/