[1728] in linux-scsi channel archive

home help back first fref pref prev next nref lref last post

Re: How to use scsiinfo ?

daemon@ATHENA.MIT.EDU (Eric Youngdale)
Sun Apr 20 08:41:04 1997

Date: 	Sat, 19 Apr 1997 19:34:56 -0400
From: Eric Youngdale <eric@andante.jic.com>
To: steffen@gfz-potsdam.de
CC: steffen@gfz-potsdam.de, linux-scsi@vger.rutgers.edu
In-reply-to: <199704191945.VAA29436@zrt2.gfz-potsdam.de> (message from Steffen
	Grunewald on Sat, 19 Apr 1997 21:45:08 +0200 (MET DST))


>Eric, if there wasn't the number of disks to be processed (about 100,
>6 of them are already done :-) _and_ the number of MBs in that particular
>machine (8) I'd gladly use the Tcl/Tk tool (nice work, really) - but I
>_need_ a quick way, even if it's dirty.

	OK, I believe (it has been so long, I am not certain) that the
when you replace the parameters, you merely end up specifying them in
the same order in which they come out when you are using the Tcl/Tk
interface.  Thus you could grab the numbers, modify one or two of them, and
then ship the whole lot back to the drive.

	For your purposes, it might make more sense to modify scsiinfo to
do the heavy lifting for you - have it first snarf the page, then modify the
appropriate bits, and then send it back again.  Completely untested, but the
below might do the trick.

-Eric

int frob_error_recovery_page(int page_code)
{
  int status;
  int bdlen;
  unsigned char * pagestart;

  SETUP_MODE_PAGE(1, 14);

#if 0
  bitfield(pagestart+2, "AWRE", 1, 7);
  bitfield(pagestart+2, "ARRE", 1, 6);
#endif

  pagestart[2] |= 0xc0; /* Set bits 6 and 7 for AWRE and ARRE */

  put_mode_page(1, buffer+8, 0);
  return 0;
}


home help back first fref pref prev next nref lref last post