title: SCSI Inquiry Data
body: <p>I am new to SCSI Programming  and hence sorry for asking basic question.  I sent SCSI Inquiry command to a Tape Device   through 6 byte CDB </p>
  
  <p>ccb = (Exec_IO_CCB *)( buffer + header_size  ); </p>
  
  <p>ccb->ccb_length = sizeof(Exec_IO_CCB);  </p>
  
  <p>ccb->cam_opcode = 0x1;</p>
  
  <p>ccb->connect_id = 0;</p>
  
  <p>ccb->sense_buf_ptr = (long)(header_size + ccb->ccb_length);</p>
  
  <p>ccb->sense_buf_length = MAX_SENSE_LEN;</p>
  
  <p>ccb->time_out = CAM_TIMEOUT;</p>
  
  <p>ccb->cdb_length = 6;</p>
  
  <p>/*  For INQUIRY  sets cam_flags and cdb[0]  */</p>
  
  <p>ccb->cam_flags = NO_DATA;</p>
  
  <p>ccb->cdb[0] = INQUIRY;     /*  0x12 SCSI Opcode for Inquiry Command */</p>
  
  <p>ccb->cdb[1] = 0;</p>
  
  <p>ccb->cdb[2] = 0;</p>
  
  <p>ccb->cdb[3] = 0;</p>
  
  <p>ccb->cdb[4] = 3200;</p>
  
  <p>ccb->cdb[5] = 0;</p>
  
  <p>The SCSI Command is successful . How do i capture the output of INQUIRY command so that i can get 
  Vendor ID / Product ID ??</p>
  
  <p>I have declared the Execute I/O SCSI buffer as follows</p>
  
  <p>typedef struct {</p>
  
  <pre><code>long        ccb_address;            /* Address of this CCB               */
  short       ccb_length;             /* CAM Control Block Length          */
  char        cam_opcode;             /* CAM Operation Code                */
  char        status;                 /* CAM Status                        */
  long        connect_id;             /* Connect ID - no fields supported  */
  long        cam_flags;              /* CAM Flags                         */
  long        pd_pointer;             /* Peripheral driver pointer         */
  long        next_ccb_ptr;           /* Next CCB Pointer                  */
  long        req_map_info;           /* Request mapping information       */
  long        call_on_comp;           /* Callback on completion            */
  long        data_buf_ptr;           /* Data Buffer Pointer               */
  long        data_xfer_length;       /* Data transfer length              */
  long        sense_buf_ptr;          /* Sense information buffer pointer  */
  char        sense_buf_length;       /* Sense information buffer length   */
  char        cdb_length;             /* Command Descriptor Block (CDB)    **
                                      **  length                           */
  short       num_sg_entries;         /* Number of scatter/gather entries  */
  long        vendor_unique;          /* Vendor Unique field               */
  char        scsi_status;            /* SCSI status                       */
  char        auto_resid;             /* Auto sense residual length        */
  short       reserved;               /* Reserved                          */
  long        resid_length;           /* Residual length                   */
  char        cdb[12];                /* Command Descriptor Block (CDB)    */
  long        time_out;               /* Time-out value                    */
  long        msg_buf_ptr;            /* Message buffer pointer            */
  short       msg_buf_length;         /* Message buffer length             */
  short       vu_flags;               /* Vendor-unique flags               */
  char        tag_queue_act;          /* Tagged Queue action               */
  char        tag_id;                 /* Tag ID (target only)              */
  char        init_id;                /* Initiator ID (target only)        */
  char        reserved2;              /* Reserved                          */
  </code></pre>
  
  <p>} Exec_IO_CCB;</p>
  
  <p>This structure will never capture SCSI Output ?</p>
  
  <p>I have declared the Inquiry Structure as follows . But I am not sure how Inquire command will
  populate Inquiry_Data structure data ??</p>
  
  <p>typedef struct {</p>
  
  <pre><code>short data_valid;           /* Flag that indicates whether or not the */
                              /*   structure has been filled in with    */
                              /*   inquiry data from the device.        */
  byte  periph_qual;
  byte  periph_dev_type;
  byte  rmb;
  byte  iso_version;
  byte  ecma_version;
  byte  ansi_version;
  byte  resp_data_format;
  byte  rel_adr;
  byte  sync;
  byte  linked;
  byte  cmd_que;
  byte  sft_rst;
  char  vendor_id[9];
  char  prod_id[17];
  char  prod_rev[5];
  char  reserved;
  </code></pre>
  
  <p>} Inquiry_Data;</p>