SCSI programming

This is a discussion on SCSI programming within the Linux Programming forums, part of the Platform Specific Boards category; 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 ...

  1. #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

  2. #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....

Popular pages Recent additions subscribe to a feed

Similar Threads

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

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