我是SCSI編程的新手,因此很抱歉提出基本問題。我通過6字節的CDB向SCSI磁帶設備發送了SCSI Inquiry命令,其中ccb =(Exec_IO_CCB *)(buffer + header_size);SCSI查詢數據
ccb-> ccb_length = sizeof(Exec_IO_CCB);
ccb-> cam_opcode = 0x1;
ccb-> connect_id = 0;
ccb-> sense_buf_ptr =(long)(header_size + ccb-> ccb_length);
ccb-> sense_buf_length = MAX_SENSE_LEN;
ccb-> time_out = CAM_TIMEOUT;
ccb-> cdb_length = 6;
/*對於INQUIRY設置cam_flags和CDB [0] */
ccb-> cam_flags = NO_DATA;
ccb-> cdb [0] = INQUIRY;/* 0x12用於查詢命令的SCSI操作碼*/
ccb-> cdb [1] = 0;
ccb-> cdb [2] = 0;
ccb-> cdb [3] = 0;
ccb-> cdb [4] = 3200;
ccb-> cdb [5] = 0;
SCSI命令成功。我如何捕獲INQUIRY命令的輸出,以便我可以得到 供應商ID /產品ID?
我已經宣佈執行I/O緩衝器SCSI如下
typedef結構{
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 */
} Exec_IO_CCB;
此結構將永遠不會捕獲SCSI輸出?
我已經宣佈了調查結構如下。但我不知道如何查詢命令將 填充Inquiry_Data結構數據??
typedef結構{
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;
} Inquiry_Data;
任何一個可以幫助我捕獲上面張貼的查詢命令的輸出?? – arun