AIX SCSI standard Inquiry with ioctl and STIOCMD. - Aix

This is a discussion on AIX SCSI standard Inquiry with ioctl and STIOCMD. - Aix ; Hello all I have a problem on AIX 5.2/5.3 with an ioctl call. I'm trying to obtain the result of a standard SCSI INQUIRY on different tape drives. It's OK with IBM LTO drives but not with SUN/STK 9940 or ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: AIX SCSI standard Inquiry with ioctl and STIOCMD.

  1. AIX SCSI standard Inquiry with ioctl and STIOCMD.

    Hello all

    I have a problem on AIX 5.2/5.3 with an ioctl call.

    I'm trying to obtain the result of a standard SCSI INQUIRY on different
    tape drives.

    It's OK with IBM LTO drives but not with SUN/STK 9940 or T10000 drives.

    The error code from ioctl call is EFAULT (14) Bad address.
    ioctl man page says that EFAULT is for :

    EFAULT argp references an inaccessible memory area.

    I don't understand why the same (universal) command works for LTO and
    not for other drives. Perhaps because drivers are not the same : Atape
    for LTO and Other SCSI Tape for 9940 / T10000 ?

    Or is it from the code ?

    #define INQUIRY_SIZE 96

    char *inquiry=(char*) malloc(INQUIRY_SIZE*sizeof(char));
    struct sc_iocmd cmdio;

    .... Openx ...

    memset(&cmdio, 0, sizeof(struct sc_iocmd));
    memset(inquiry, 0, INQUIRY_SIZE*sizeof(char));

    cmdio.scsi_cdb[0]=SCSI_INQUIRY;
    cmdio.timeout_value=200;
    cmdio.command_length=6;
    cmdio.buffer=inquiry;
    cmdio.data_length=INQUIRY_SIZE;
    cmdio.scsi_cdb[4]=INQUIRY_SIZE;
    cmdio.flags=B_READ;

    ioctlreturn = ioctl(rmtfd, STIOCMD, &cmdio);

    .... Error handling ...

    Thanks to all.
    Pierre-yves

  2. Best software for black-SEO and increase Google PR

    This unique software pack can EVERYTHING.

    + mass post threads and messages on forums, blogs, guestbooks, boards, bulletins
    + mass send PM (personal messages) to ALL users on thouthands forums simultaneously (multi-threading)
    + automatically register e-mail accounts on GMAIL.Com and other email services
    + automatically break CAPTCHAs - you see, this forum has captcha on registering, but it's was breaked
    + automatically break text captchas as "2+2=?", "what color is sky?" etc.
    + have a lot of tools for links databases processing and analysing
    + automatically confirm all links from e-mail account
    + built-in "question-answer" system, mass post-editing system
    + a lot of other features


    Name of this program - XRumer 5.0 Palladium
    Not XRunner, not XRoomer, not xrumer - but XRumer.

    (versions XRumer 2.9 and XRumer 3.0 are too old)


    Just ask Google!
    XRumer 5.06 is the BEST software for webmaster: promote your website, increase Google PageRank!

+ Reply to Thread