C Board  

Go Back   C Board > Platform Specific Boards > Linux Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 03-05-2009, 03:12 AM   #1
Registered User
 
Join Date: Aug 2008
Posts: 22
SCSI programming

Hello,
I am trying to communicate with a tape drive using ioctl and SCSI_IOCTL_SEND_COMMAND as ioctl(fd, SCSI_IOCTL_SEND_COMMAND, buffer);

I read that the buffer should be of the form :
Code:
struct sdata {
    unsigned int inlen;     [i] Length of data written to device
    unsigned int outlen;    [i] Length of data read from device
    unsigned char cmd[x];   [i] SCSI command (6 <= x <= 16)
                            [o] Data read from device starts here
                            [o] On error, sense buffer starts here
    unsigned char wdata[y]; [i] Data written to device starts here
   };
There may be commands only read data from the device and dont write or vice versa. Also some commands may read and write data. To what value can I set outlen so that it will cover all the 3 conditons?


Thanks
rak1986 is offline   Reply With Quote
Old 03-18-2009, 06:10 AM   #2
Registered User
 
Join Date: Aug 2008
Posts: 22
HI guys,
I need some help here.
Is it possible to write a generic function to support all SCSI commands?

Thanks....
rak1986 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux SCSI read/write galapogos Linux Programming 1 12-09-2008 10:36 AM
Detect SCSI Hard Drive Serial Number mercury529 Windows Programming 3 10-17-2006 06:23 PM
Hp C5110a Scsi GanglyLamb Tech Board 5 09-25-2004 07:17 AM
SCSI drivers... device conflict... no CD drives CodeMonkey Tech Board 2 09-10-2003 06:48 AM
SCSI Programming ? C of Green Networking/Device Communication 0 08-14-2003 12:09 PM


All times are GMT -6. The time now is 02:04 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22