linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Douglas Gilbert <dougg@torque.net>
To: tonyb@cybernetics.com
Cc: linux-scsi@vger.kernel.org, linux-ide@vger.kernel.org
Subject: Re: ide-scsi data transfer residuals
Date: Fri, 05 Jul 2002 22:10:01 -0400	[thread overview]
Message-ID: <3D265179.BB1444E1@torque.net> (raw)
In-Reply-To: 000301c2242d$596450f0$e0019d89@cybernetics.com

Tony Battersby wrote:
> 
> Hello,
> 
> I am using the scsi-generic and ide-scsi drivers together for low-level
> access to an IDE tape drive (vanilla 2.4.17).  I noticed that the data
> transfer residual in sg_io_hdr_t { int resid; } is always zero.  I assume
> that the residual calculation is just a missing feature from the ide-scsi
> driver.  Does anyone know how hard it is to add it?

Tony,
Support for the residual count is optional. A inaccurate
survey shows these adapter drivers support it:
  advansys
  aha152x
  aic7xxx_old  (but not the newer aic7xxx)
  dc395x_trm
  scsiiom
  sym53c8xx
  sym53c8xx_2

I do not know how the ide-scsi driver would get the information.
However here is the calculation it should do:
  Scsi_Cmnd::resid = Scsi_Cmnd::bufflen - <actual_bytes_transferred>

Of the drivers that support "resid" most given a scatter
gather list will use the sum of the element lengths instead
of bufflen. Unfortunately that sum can be larger the bufflen 
due to padding and alignment requirements of the most backward
DMA engines out there (I was burnt by the aha1542 ISA card).
IOW HBA driver writers, please use bufflen. Perhaps the CAM
name of "dxfer_len" would be clearer for this field.

Doug Gilbert

  reply	other threads:[~2002-07-06  2:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-05 14:07 ide-scsi data transfer residuals Tony Battersby
2002-07-06  2:10 ` Douglas Gilbert [this message]
2002-07-16 18:00   ` Luben Tuikov
  -- strict thread matches above, loose matches on Subject: below --
2002-07-08 16:17 Martin Peschke3

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3D265179.BB1444E1@torque.net \
    --to=dougg@torque.net \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=tonyb@cybernetics.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).