Jukebox SCSI passthrough? - SCO

This is a discussion on Jukebox SCSI passthrough? - SCO ; I'm trying to send SCSI commands to tape devices and tape libraries using the SCSIUSERCMD2 ioctl() call. This works fine on the tape devices I have (/dev/xStp0, /dev/xStp1), but fails on the jukebox device (/dev/Sjk0). The SCO generix 'juke' command ...

+ Reply to Thread
Results 1 to 6 of 6

Thread: Jukebox SCSI passthrough?

  1. Jukebox SCSI passthrough?

    I'm trying to send SCSI commands to tape devices and tape libraries using
    the SCSIUSERCMD2 ioctl() call. This works fine on the tape devices I have
    (/dev/xStp0, /dev/xStp1), but fails on the jukebox device (/dev/Sjk0). The
    SCO generix 'juke' command works OK, but the SCSI passthrough ioctl()
    returns "Invalid argument". Is the Sjk jukebox driver supposed to support
    SCSI passthrough??

    This is on OpenServer 5.0.7 by the way. Any suggestions are welcome?!?

    Rob



  2. Re: Jukebox SCSI passthrough?

    In article <_eCkf.1745$zc1.133@amstwist00>,
    Rob Turk <_wipe_me_r.turk@chello.nl> wrote:
    >I'm trying to send SCSI commands to tape devices and tape libraries using
    >the SCSIUSERCMD2 ioctl() call. This works fine on the tape devices I have
    >(/dev/xStp0, /dev/xStp1), but fails on the jukebox device (/dev/Sjk0). The
    >SCO generix 'juke' command works OK, but the SCSI passthrough ioctl()
    >returns "Invalid argument". Is the Sjk jukebox driver supposed to support
    >SCSI passthrough??


    Sjk supports only SCSIUSERCMD, not SCSIUSERCMD2.

    John
    --
    John DuBois spcecdt@armory.com KC6QKZ/AE http://www.armory.com/~spcecdt/

  3. Re: Jukebox SCSI passthrough?

    "John DuBois" wrote in message
    news:11p66o8c61043ba@corp.supernews.com...
    > In article <_eCkf.1745$zc1.133@amstwist00>,
    > Rob Turk <_wipe_me_r.turk@chello.nl> wrote:
    >>I'm trying to send SCSI commands to tape devices and tape libraries using
    >>the SCSIUSERCMD2 ioctl() call. This works fine on the tape devices I have
    >>(/dev/xStp0, /dev/xStp1), but fails on the jukebox device (/dev/Sjk0). The
    >>SCO generix 'juke' command works OK, but the SCSI passthrough ioctl()
    >>returns "Invalid argument". Is the Sjk jukebox driver supposed to support
    >>SCSI passthrough??

    >
    > Sjk supports only SCSIUSERCMD, not SCSIUSERCMD2.
    >
    > John


    Thanks for the quick response, John. I figured as much while experimenting.
    I've written a 'fall-back' routine to use SCSIUSERCMD, and this works OK,
    sort of. The only problem I have now is how to grab the Request Sense data
    for commands that fail. I sometimes need to send commands that are supposed
    to fail and return Sense data...

    It appears that the kernel does auto-sense even when using SCSIUSERCMD (the
    right sense key and ASC/ASCQ show up on the console), so an attempt to issue
    a Request Sense myself returns nothing useful. Is there anyway you know of
    to retrieve that information from a user program?

    Thanks again,
    Rob



  4. Re: Jukebox SCSI passthrough?

    Rob Turk wrote:

    > "John DuBois" wrote in message
    > news:11p66o8c61043ba@corp.supernews.com...
    > > In article <_eCkf.1745$zc1.133@amstwist00>,
    > > Rob Turk <_wipe_me_r.turk@chello.nl> wrote:
    > >>I'm trying to send SCSI commands to tape devices and tape libraries using
    > >>the SCSIUSERCMD2 ioctl() call. This works fine on the tape devices I have
    > >>(/dev/xStp0, /dev/xStp1), but fails on the jukebox device (/dev/Sjk0). The
    > >>SCO generix 'juke' command works OK, but the SCSI passthrough ioctl()
    > >>returns "Invalid argument". Is the Sjk jukebox driver supposed to support
    > >>SCSI passthrough??

    > >
    > > Sjk supports only SCSIUSERCMD, not SCSIUSERCMD2.
    > >
    > > John

    >
    > Thanks for the quick response, John. I figured as much while experimenting.
    > I've written a 'fall-back' routine to use SCSIUSERCMD, and this works OK,
    > sort of. The only problem I have now is how to grab the Request Sense data
    > for commands that fail. I sometimes need to send commands that are supposed
    > to fail and return Sense data...
    >
    > It appears that the kernel does auto-sense even when using SCSIUSERCMD (the
    > right sense key and ASC/ASCQ show up on the console), so an attempt to issue
    > a Request Sense myself returns nothing useful. Is there anyway you know of
    > to retrieve that information from a user program?


    It's sort of insane, but you could try to parse it out of
    /usr/adm/messages...

    I had done a bunch of work trying to integrate the SCSIUSERCMD and
    SCSIUSERCMD2 code in all the OSR5 peripheral drivers, making them all
    sane and all support both ioctls, but it was incomplete when I left the
    company (and the source is probably lost by now). Oh well.

    >Bela<


  5. Re: Jukebox SCSI passthrough?

    "Bela Lubkin" wrote in message
    news:200512042132.aa08268@deepthought.armory.com.. .
    > Rob Turk wrote:
    >
    >> Thanks for the quick response, John. I figured as much while
    >> experimenting.
    >> I've written a 'fall-back' routine to use SCSIUSERCMD, and this works OK,
    >> sort of. The only problem I have now is how to grab the Request Sense
    >> data
    >> for commands that fail. I sometimes need to send commands that are
    >> supposed
    >> to fail and return Sense data...
    >>
    >> It appears that the kernel does auto-sense even when using SCSIUSERCMD
    >> (the
    >> right sense key and ASC/ASCQ show up on the console), so an attempt to
    >> issue
    >> a Request Sense myself returns nothing useful. Is there anyway you know
    >> of
    >> to retrieve that information from a user program?

    >
    > It's sort of insane, but you could try to parse it out of
    > /usr/adm/messages...
    >
    > I had done a bunch of work trying to integrate the SCSIUSERCMD and
    > SCSIUSERCMD2 code in all the OSR5 peripheral drivers, making them all
    > sane and all support both ioctls, but it was incomplete when I left the
    > company (and the source is probably lost by now). Oh well.
    >


    Hi Bela,

    Yes, that is indeed insane 8-(
    Maybe a popen() with 'tail -n 3 /usr/adm/messages' would sorta-work.. Here's
    what it shows for me:
    NOTICE: Sjk: Source Element Empty on SCSI Juke 0 dev 30/0 (ha=1 bus=0 id=2
    lun=0)
    Illegal request
    Status: host=00 target=02, Key: 05 3B 0E

    There's no way to ensure that other messages will not clog up the bottom of
    the file, or I'll have to parse it all out, check the time stamp and
    hopefully find something there.. I guess I'll have to live with the fact
    that I can't tell a user what went wrong when something does.

    Thanks anyway,
    Rob



  6. Re: Jukebox SCSI passthrough?

    Rob Turk wrote:

    > "Bela Lubkin" wrote in message
    > news:200512042132.aa08268@deepthought.armory.com.. .


    > > It's sort of insane, but you could try to parse it out of
    > > /usr/adm/messages...


    > Yes, that is indeed insane 8-(
    > Maybe a popen() with 'tail -n 3 /usr/adm/messages' would sorta-work.. Here's
    > what it shows for me:
    > NOTICE: Sjk: Source Element Empty on SCSI Juke 0 dev 30/0 (ha=1 bus=0 id=2
    > lun=0)
    > Illegal request
    > Status: host=00 target=02, Key: 05 3B 0E
    >
    > There's no way to ensure that other messages will not clog up the bottom of
    > the file, or I'll have to parse it all out, check the time stamp and
    > hopefully find something there.. I guess I'll have to live with the fact
    > that I can't tell a user what went wrong when something does.


    The same data would typically be in /usr/adm/syslog with much more
    reliable timestamps. The problem there is that syslog is much more
    configurable than /usr/adm/messages: a system could and in many cases
    will be configured to put those messages somewhere else.

    If you're programming with SCSIUSERCMD{,2}, you must be writing in C.
    You can open /usr/adm/messages. Immediately before doing a SCSIUSERCMD,
    seek to the end of that fd: lseek(fd, 0, SEEK_END). After SCSIUSERCMD
    returns, parse from that point to the new end of file, look for "Sjk"
    messages.

    It's still insane, but I'm pretty sure you could get somewhere with
    it...

    >Bela<


+ Reply to Thread