tech-kern archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: linux_sg.c modification for SCSI Test Unit Ready command
In message <16137.1205684629%menelos.com@localhost>, Tracy Di Marco White
writes:
>
>I've needed to add emulation for the SCSI Test Unit Ready command
>to my backup server, so I could run Sony's tape diagnostics.
>It's fairly simple, but is it the correct flag to use for that?
>The patch below is what I'm using on my 4.0 backup server.
>
>-Tracy
Once more with -u
Index: linux_sg.c
===================================================================
RCS file: /cvsroot/src/sys/compat/linux/common/linux_sg.c,v
retrieving revision 1.8
diff -u -r1.8 linux_sg.c
--- linux_sg.c 13 Sep 2006 00:51:12 -0000 1.8
+++ linux_sg.c 16 Mar 2008 16:26:12 -0000
@@ -107,11 +107,17 @@
(void)memset(&req, 0, sizeof(req));
switch (lreq.dxfer_direction) {
case SG_DXFER_TO_DEV:
+ /* e.g. a SCSI WRITE command */
req.flags = SCCMD_WRITE;
break;
case SG_DXFER_FROM_DEV:
+ /* e.g. a SCSI READ command */
req.flags = SCCMD_READ;
break;
+ case SG_DXFER_NONE:
+ /* e.g. a SCSI Test Unit Ready command */
+ req.flags = SCCMD_ESCAPE;
+ break;
default:
DPRINTF(("unknown direction %d\n",
lreq.dxfer_direction));
Home |
Main Index |
Thread Index |
Old Index