AIX STIOCMD ioctl for FC SCSI

This is a discussion on AIX STIOCMD ioctl for FC SCSI within the aix forums in Operating Systems category; 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) { 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);...

Go Back   Database Forum > Operating Systems > aix

Database Forums

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 06-23-2008, 06:06 AM
Default 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.
Reply With Quote
  #2  
Old 07-16-2008, 07:05 AM
Default 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
Reply With Quote
  #3  
Old 07-22-2008, 11:50 PM
Default 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..
Reply With Quote
  #4  
Old 07-30-2008, 03:15 AM
Default 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
Reply With Quote
  #5  
Old 07-30-2008, 04:10 AM
Default 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


Reply With Quote
  #6  
Old 07-30-2008, 05:18 AM
Default 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 With Quote
Reply


Thread Tools
Display Modes



All times are GMT -4. The time now is 10:25 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Integrated by bbpixel2009 :: jvbPlugin R1013.368.1

Search Engine Friendly URLs by vBSEO 3.1.0
vB Ad Management by =RedTyger=
In an effort to better serve ads to our visitors, cookies are used on Mydatabasesupport.com. For more information, check out our Privacy Policy.