On Tue, Aug 18, 2009 at 3:30 PM, Boaz Harrosh<bharrosh@xxxxxxxxxxx> wrote: Dear Boaz, Thanks a lot. >> Do I need to modify the SCSI driver files to handle the >> bi-directional comamnds or Is this already supported? >> > > Yes only very few drivers support bidi commands. > i.e. iscsi is the only one that supports them in general. Currently, I am registering my driver to the SCSI layer. Now I understand, I need to register my driver to iscsi to get bi-directional commands. If this is the case, how can I register my driver to iscsi driver to get bi-directional commands, and will I get the same functionality from iscsi as I am currently getting from scsi. > (Tell me if you need example code for bsg use in user-mode). Could you please send me the link to the user mode bsg initiator code which issues the bi-directional commands? >> I found only one struct scsi_data_buffer pointer in scsi_cmnd >> structure. So, how do SCSI layer sends IN and OUT buffer pointers and >> their lengths to my class driver? >> > > Again: > if (scsi_bidi_cmnd(cmnd)) { > in_sdb = scsi_in(cmnd); > out_sdb = scsi_out(cmnd); > } > It works, look at the code. Before using the above snippet in my class driver, do I need to fill in_req and out_req in SCSI layer or Is it already filled? If I use the iscsi driver, then there is no need to do any modifications to the in_req and out_req. Thanks and Regards, Madhavi M. -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html