All of lore.kernel.org
 help / color / mirror / Atom feed
From: Douglas Gilbert <dougg@torque.net>
To: shankar krishna <kshan01@hotmail.com>
Cc: linux-scsi@vger.kernel.org
Subject: Re: Interpreting SCSI CDB response over FC(FCP-2)
Date: Thu, 14 Nov 2002 22:52:05 +1100	[thread overview]
Message-ID: <3DD38E65.6000008@torque.net> (raw)
In-Reply-To: F123b7PFk6HqzVnWRZg0000c047@hotmail.com

shankar krishna wrote:
> Hi,
> I am looking for specific information in the SCSI response
> for the CDB sent by following method.
> 
> if (ioctl(sd_fd,SCSI_IOCTL_SEND_COMMAND,&cdb_buf))
> {
> /* ERROR */
> }
> 
> The above command sends the CDB and the response comes
> as below in cdb_buf. From DGilbert's doc,(www.torque.net/sg)
> 
>   struct sdata {
>    unsigned int inlen;     [i] Length of data written to device
>    unsigned int outlen;    [i] Length of data read from device
>    unsigned char cmd[x];   [i] SCSI command (6 <= x <= 16)
>                            [o] Data read from device starts here
>                            [o] On error, sense buffer starts here
>    unsigned char wdata[y]; [i] Data written to device starts here
>   };
> 
> Question:
> 1. I want to see the SCSI status byte from 12th byte of FCP_RESP
> payload! how can get that?

if ((res = ioctl(sd_fd,SCSI_IOCTL_SEND_COMMAND,&cdb_buf))) {
     scsi_status = res & 0xff;
     .....
}

> 2. Information FCP_SNS_LEN and FCP_RSP_LEN are also needed but not
> able to get from the above structure as it straight away returns
> the sense key structure! How to get those information?
> 3. If possible, can anybody throw light on how to get the Whole
> FCP response payload as such??
> 
> Any other function call otherthan ioctl can fetch me this info??

I'm not sure what happens in the FC world. However the scsi
subsystem mid level [which is what processes
SCSI_IOCTL_SEND_COMMAND] leaves those sort of details to the
lower level driver. The only way that I can see to get the
whole FCP response payload would be via an ioctl in the
lower level driver.

Doug Gilbert


  reply	other threads:[~2002-11-14 11:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-14  8:14 Interpreting SCSI CDB response over FC(FCP-2) shankar krishna
2002-11-14 11:52 ` Douglas Gilbert [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-11-14 17:49 shankar krishna

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=3DD38E65.6000008@torque.net \
    --to=dougg@torque.net \
    --cc=kshan01@hotmail.com \
    --cc=linux-scsi@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.