linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jon Bendtsen <jonbendtsen@jbit.dk>
To: linux-scsi@vger.kernel.org
Subject: Re: understanding the sg_ses --raw output? so I can turn on the faulty light
Date: Tue, 08 Feb 2011 15:15:50 +0100	[thread overview]
Message-ID: <4D515016.6050801@jbit.dk> (raw)
In-Reply-To: <4D500EFC.1040801@jbit.dk>

On 07/02/11 16.25, Jon Bendtsen wrote:
> Hi
> 
> There has earlier been 2 threads on sg_ses 21 may 2007 and 10 june 2010,
> but unfortunately neither seemed to include information about how to
> understand the --raw output from sg_ses.
> 
> When I run this command
> 	sg_ses --page=2 /dev/sg30 --raw
> 
> I get output that looks like:
>         00 00 00 00 00 00 00 00  01 00 00 00 01 00 00 00
>         01 00 00 00 01 00 00 00  01 00 00 00 01 00 00 00
>         01 00 00 00 01 00 00 00  01 00 00 00 01 00 00 00
>         01 00 00 00 01 00 00 00  01 00 00 00 01 00 00 00
>         01 00 00 00 01 00 00 00  01 00 00 00 01 00 00 00
>         01 00 00 00 01 00 00 00  01 00 00 00 01 00 00 00
>         01 00 00 00 01 00 00 00  00 00 01 00 01 00 01 00
>         00 00 00 40 06 00 00 47  06 00 00 47 06 00 00 47
>         00 00 00 00 01 00 2c 00  06 00 00 00 06 00 00 00
>         06 00 00 00 06 00 00 00  06 00 00 00 06 00 00 00
>         06 00 00 00 06 00 00 00  06 00 00 00 06 00 00 00
>         06 00 00 00 06 00 00 00  06 00 00 00 06 00 00 00
>         06 00 00 00 06 00 00 00  06 00 00 00 06 00 00 00
>         06 00 00 00 06 00 00 00  06 00 00 00 06 00 00 00
>         06 00 00 00 06 00 00 00

I cracked it using this PDF
http://www.snia.org/events/storage-developer2008/presentations/monday/RajendraDivecha_SCSI_SES.pdf

Page 26 top diagram tells me they use 4 byte segments, aka 01 00 00 00
is one device slot.

Page 26 middle diagram tells me that 01 from the above segment must be
changed to 81 to select this device slot.

Page 27 diagram tells me that the 2. byte is not important.
Page 27 diagram tells me that the 3. byte should be 02 to signal RQST
IDENT. The result on my system is that the device slot starts to blink.

Page 27 diagram also tells me that if I set the 4. byte to 20, then I
select RSQT FAULT. The result on my systems is that the same device slot
turns on but does not blink, it stays static.

If I set both 3. byte to 02 and 4. byte to 20, then it blinks.

Below you can see the raw data blob which selects slot 16 and sets RQST
fault.

        00 00 00 00 00 00 00 00  01 00 00 00 01 00 00 00
        01 00 00 00 01 00 00 00  01 00 00 00 01 00 00 00
        01 00 00 00 01 00 00 00  01 00 00 00 01 00 00 00
        01 00 00 00 01 00 00 00  01 00 00 00 01 00 00 00
        01 00 00 00 81 00 00 20  01 00 00 00 01 00 00 00
        01 00 00 00 01 00 00 00  01 00 00 00 01 00 00 00
        01 00 00 00 01 00 00 00  00 00 01 00 01 00 01 00
        00 00 00 40 06 00 00 47  06 00 00 47 06 00 00 47
        00 00 00 00 01 00 2c 00  06 00 00 00 06 00 00 00
        06 00 00 00 06 00 00 00  06 00 00 00 06 00 00 00
        06 00 00 00 06 00 00 00  06 00 00 00 06 00 00 00
        06 00 00 00 06 00 00 00  06 00 00 00 06 00 00 00
        06 00 00 00 06 00 00 00  06 00 00 00 06 00 00 00
        06 00 00 00 06 00 00 00  06 00 00 00 06 00 00 00
        06 00 00 00 06 00 00 00

And here are the sg_ses output without --raw

    Individual element 16 status:
        Predicted failure=0, Disabled=0, Swap=0, status: OK
        OK=0, Reserved device=0, Hot spare=0, Cons check=0
        In crit array=0, In failed array=0, Rebuild/remap=0, R/R abort=0
        App client bypass A=0, Don't remove=0, Enc bypass A=0, Enc
bypass B=0
        Ready to insert=0, RMV=0, Ident=0, Report=0
        App client bypass B=0, Fault sensed=0, Fault reqstd=1, Device off=0
        Bypassed A=0, Bypassed B=0, Dev bypassed A=0, Dev bypassed B=0



JonB


      parent reply	other threads:[~2011-02-08 14:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-07 15:25 understanding the sg_ses --raw output? so I can turn on the faulty light Jon Bendtsen
2011-02-07 15:40 ` James Bottomley
2011-02-08 12:55   ` Jon Bendtsen
2011-02-08 14:18     ` James Bottomley
2011-02-08 14:22       ` Jon Bendtsen
2011-02-08 14:15 ` Jon Bendtsen [this message]

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=4D515016.6050801@jbit.dk \
    --to=jonbendtsen@jbit.dk \
    --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 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).