AIX STIOCMD ioctl for FC SCSI - Aix

This is a discussion on AIX STIOCMD ioctl for FC SCSI - Aix ; Hi! all I have a problem on AIX 5L (5.2-08) using ioctl STIOCMD. My problem is below.... ------------------------------------------------------------------------------------------ STIOCMD ioctl is doing well in SCSI interface, but there is no sese in FC interface. Here is sample source code from ...

+ Reply to Thread
Results 1 to 6 of 6

Thread: AIX STIOCMD ioctl for FC SCSI

  1. AIX STIOCMD ioctl for FC SCSI

    Hi! all

    I have a problem on AIX 5L (5.2-08) using ioctl STIOCMD.

    My problem is below....

    ------------------------------------------------------------------------------------------
    STIOCMD ioctl is doing well in SCSI interface,
    but there is no sese in FC interface.

    Here is sample source code from MTX open source

    ==>
    struct sc_iocmd ds;

    if ((filenum=openx(DeviceName, O_RDWR, 0, SC_DIAGNOSTIC))<0) {
    error_handling.....
    }

    bzero (&ds, sizeof (struct sc_iocmd));
    bzero (RequestSense, sizeof (RequestSense_T));

    ds.flags = SC_ASYNC;
    ds.timeout_value = 600;
    bcopy (CDB, ds.scsi_cdb, CDB_Length);
    ds.command_length = CDB_Length;
    if (DataBufferLength > 0) {
    ds.buffer = DataBuffer;
    ds.data_length = DataBufferLength;
    }

    switch (Direction) {
    case Input:
    ds.flags = ds.flags | B_READ;
    break;
    case Output:
    ds.flags = ds.flags | B_WRITE;
    break;
    }

    Result = ioctl (DeviceFD->filenum, STIOCMD, &ds);
    <===
    # lsdev -C -c tape
    rmt0 Available 10-60-00-5,0 SCSI 4mm Tape Drive
    rmt1 Available 10-S8-00 Other FC SCSI Tape Drive

    # mtx -f /dev/rmt0 inquiry
    Product Type: Tape Drive
    Vendor ID: 'IBM '
    Product ID: 'DDS Gen5 '
    Revision: 'V314'
    Attached Changer API: No

    # mtx -f /dev/rmt1 inquiry
    mtx: Request Sense: Long Report=yes
    mtx: Request Sense: Valid Residual=no
    mtx: Request Sense: Error Code=0 (Unknown?!)
    mtx: Request Sense: Sense Key=No Sense
    mtx: Request Sense: FileMark=no
    mtx: Request Sense: EOM=no
    mtx: Request Sense: ILI=no
    mtx: Request Sense: Additional Sense Code = 00
    mtx: Request Sense: Additional Sense Qualifier = 00
    mtx: Request Sense: BPV=no
    mtx: Request Sense: Error in CDB=no
    mtx: Request Sense: SKSV=no
    INQUIRY Command Failed

    Is it OS problem? or Program bugs?

    Can you send me hints or docs for that problem. plz...?

    Thanks to all.

  2. Re: AIX STIOCMD ioctl for FC SCSI


    what is the value of Result returned by the above failure of ioctl.

    Link below has more information
    http://publib.boulder.ibm.com/infoce...rf2/sctape.htm

    Regards
    sudhir

  3. Re: AIX STIOCMD ioctl for FC SCSI

    suhir!

    The return error code is invalid argument..(EINVAL).

    So...I guess.. ioctl command (STIOCMD) not support fc SCSI device.
    But... other platform (Linux, HPUX, Unixware) in same SAN island is
    doing well.

    My problem is.
    1. ioctl command does not same result each SCSI and fc SCSI devices in
    AIX.
    2. Is that any other ioctl command except STIOCMD for fc SCSI device?

    Thanks for reply..

  4. Re: AIX STIOCMD ioctl for FC SCSI

    Hi,
    It looks like an issue with the some field in the CDB which should be
    set for FC devices.
    STIOCMD should be supported on FC devices also.

    I will try to test your code on my system and will get back to you.


    regards
    sudhir

  5. Re: AIX STIOCMD ioctl for FC SCSI

    Ok, Made few changes to your code above and it should work

    ds.version = SCSI_VERSION_1;
    ds.autosense_length = 0xff;
    ds.autosense_buffer_ptr = &RequestSense[0];

    Autosense buffer should be set for FC devices as they return sense
    data without issuing a Request sense command.
    Probably you can add a check for only FC devices.

    Also make sure that file is included in your include
    files.

    Hope this helps.

    regards
    sudhir

    On Jul 30, 11:15*am, sudhir wrote:
    > Hi,
    > It looks like an issue with the some field in the CDB which should be
    > set for FC devices.
    > STIOCMD should be supported on FC devices also.
    >
    > I will try to test your code on my system and will get back to you.
    >
    > regards
    > sudhir



  6. Re: AIX STIOCMD ioctl for FC SCSI

    Thanks for your help.

    I'll try to test your help, when i visit my customer site.

    Thanks again!

+ Reply to Thread