public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* Best approach for using sg_ses to control locate/fault leds?
@ 2010-06-09 22:35 Jeff Johnson
  2010-06-10 15:52 ` Benjamin ESTRABAUD
  0 siblings, 1 reply; 3+ messages in thread
From: Jeff Johnson @ 2010-06-09 22:35 UTC (permalink / raw)
  To: linux-scsi

Greetings,

     I am using sg_ses to poll a SAS JBOD for locate and fault led 
status and light leds if needed. So far the only method I can figure out 
how to accomplish this is by reading page 2 of the SES management device 
in the jbod chassis, dumping the raw hex output to a file, setting the 
select and RQST IDENT or RQST FAULT bits and sending back the entire 480 
bytes with modified bits.

Turn locate led on:
sg_ses --page=0x2 /dev/sg18 -f --raw > /tmp/out
...twittle bits in /tmp/out with editor of choice...
sg_ses --control --page=2 -d - /dev/sg18 < /tmp/out

     Is there a utility, a '--element=' arg or another method by which 
only the four bytes of the element control diag page can be sent instead 
of all 480 bytes?

--Jeff

-- 
------------------------------
Jeff Johnson
Manager
Aeon Computing

jeff.johnson@aeoncomputing.com
www.aeoncomputing.com
t: 858-412-3810   f: 858-412-3845
m: 619-204-9061

4905 Morena Boulevard, Suite 1313 - San Diego, CA 92117


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Best approach for using sg_ses to control locate/fault leds?
  2010-06-09 22:35 Best approach for using sg_ses to control locate/fault leds? Jeff Johnson
@ 2010-06-10 15:52 ` Benjamin ESTRABAUD
  2010-06-10 16:42   ` Douglas Gilbert
  0 siblings, 1 reply; 3+ messages in thread
From: Benjamin ESTRABAUD @ 2010-06-10 15:52 UTC (permalink / raw)
  To: Jeff Johnson; +Cc: linux-scsi

Hi,

As far as I know, you unfortunately have to send back the entire page 
when it comes to SES.

Ben.

Jeff Johnson wrote:
> Greetings,
>
>     I am using sg_ses to poll a SAS JBOD for locate and fault led 
> status and light leds if needed. So far the only method I can figure 
> out how to accomplish this is by reading page 2 of the SES management 
> device in the jbod chassis, dumping the raw hex output to a file, 
> setting the select and RQST IDENT or RQST FAULT bits and sending back 
> the entire 480 bytes with modified bits.
>
> Turn locate led on:
> sg_ses --page=0x2 /dev/sg18 -f --raw > /tmp/out
> ...twittle bits in /tmp/out with editor of choice...
> sg_ses --control --page=2 -d - /dev/sg18 < /tmp/out
>
>     Is there a utility, a '--element=' arg or another method by which 
> only the four bytes of the element control diag page can be sent 
> instead of all 480 bytes?
>
> --Jeff
>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Best approach for using sg_ses to control locate/fault leds?
  2010-06-10 15:52 ` Benjamin ESTRABAUD
@ 2010-06-10 16:42   ` Douglas Gilbert
  0 siblings, 0 replies; 3+ messages in thread
From: Douglas Gilbert @ 2010-06-10 16:42 UTC (permalink / raw)
  To: Benjamin ESTRABAUD; +Cc: Jeff Johnson, linux-scsi

On 10-06-10 11:52 AM, Benjamin ESTRABAUD wrote:
> Hi,
>
> As far as I know, you unfortunately have to send back the entire page
> when it comes to SES.
>
> Ben.
>
> Jeff Johnson wrote:
>> Greetings,
>>
>> I am using sg_ses to poll a SAS JBOD for locate and fault led status
>> and light leds if needed. So far the only method I can figure out how
>> to accomplish this is by reading page 2 of the SES management device
>> in the jbod chassis, dumping the raw hex output to a file, setting the
>> select and RQST IDENT or RQST FAULT bits and sending back the entire
>> 480 bytes with modified bits.
>>
>> Turn locate led on:
>> sg_ses --page=0x2 /dev/sg18 -f --raw > /tmp/out
>> ...twittle bits in /tmp/out with editor of choice...
>> sg_ses --control --page=2 -d - /dev/sg18 < /tmp/out
>>
>> Is there a utility, a '--element=' arg or another method by which only
>> the four bytes of the element control diag page can be sent instead of
>> all 480 bytes?

Jeff,
No, that is the only way. Ugly but relatively simple
to code. I'm open to suggestions and especially code.
Short of writing something as complicated as sdparm
(for example) I don't see an easy way.

I did notice that the '--data <H,H...>' option was
limited to 512 bytes and you were at 480. So I
increased that to 2048.

Doug Gilbert

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-06-10 16:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-09 22:35 Best approach for using sg_ses to control locate/fault leds? Jeff Johnson
2010-06-10 15:52 ` Benjamin ESTRABAUD
2010-06-10 16:42   ` Douglas Gilbert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox