Forum Topic - SCSI Inquiry with devctl(DCMD_CAM_PASS_THRU):
   
SCSI Inquiry with devctl(DCMD_CAM_PASS_THRU)  
Hello,

I'm trying to send an SCSI Inquiry to an USB Stick over devctl(DCMD_CAM_PASS_THRU), is it possibel in general?

I iterate over the volumes in /fs and get the device with devctl(DCMD_FSYS_MOUNTED_ON) then I try to send the inquiry 
command with

CAM_PASS_THRU cpt;
int ret;
unsigned char sense_buffer[32];
unsigned char data[96];
memset(&cpt, 0, sizeof(cpt));

cpt.cam_flags = CAM_DIR_OUT | CAM_DIS_AUTOSENSE;
cpt.cam_cdb_len = 6;
cpt.cam_cdb[0] = 0x12;
cpt.cam_cdb[4] = 0x24;
cpt.cam_sense_len = sizeof(sense_buffer);
cpt.cam_sense_ptr = sense_buffer;
cpt.cam_data_ptr = data;
cpt.cam_dxfer_len = sizeof(data);
cpt.cam_timeout = CAM_TIME_DEFAULT;

ret = devctl(devfd, DCMD_CAM_PASS_THRU, &cpt, sizeof(cpt), NULL);

But devctl returns immediatly with EINVAL error code.

Thanks in advance.