Hi All,<br><br>I have written a func to send a CDB on a scsi device from the kernel. For that I am getting a request and queueing for execution.<br>But blk_execute_rq() func is setting errors field of request to 65536 and sense length is set but all the fields in sense header is <br>
0.<br><br>I dont know what I am missing, any suggestion would be great help.<br><br><br>snippet of the code<br>===========================<br> rq = blk_get_request(q, rw, __GFP_WAIT);<br> if(!rq){<br> goto out;<br>
}<br> if (buflen && blk_rq_map_kern(q, rq, buf, buflen, __GFP_WAIT)){<br> goto out;<br> }<br> rq->cmd_len = cmdlen;<br> memcpy(rq->cmd, cmd, cmdlen);<br> memset(sense, 0, sizeof(sense));<br>
rq->sense_len = 0;<br> rq->sense = sense;<br> rq->cmd_type |= REQ_TYPE_BLOCK_PC;<br> rq->cmd_type |= REQ_NOMERGE;<br> rq->timeout = WRITE_SCSI_TIMEOUT; //WRITE_SCSI_TIMEOUT is set to 60 sec<br>
blk_execute_rq(q, bd_disk, rq, 0);<br> error = rq->errors;<br> if( error ){<br> dbg("error in blk_execute_rq error %d",error);<br> }<br> if(rq->sense_len){<br> process_sense_info(rq->sense);<br>
} else {<br> info("no sense available");<br> }<br>==========================================<br><br><br>thanks,<br>ajit<br><br>PS:We can not use sg_ioctl interface because code expects user space application only to invoke sg_ioctl that the reason it does a copyin.<br>
<input id="gwProxy" type="hidden"><input onclick="jsCall();" id="jsProxy" type="hidden"><div id="refHTML"></div>