Hi Alan Some time ago you explained to me how the SCSI_START_STOP_UNIT command should be handled. After the host sends an Eject command the LUN is closed and will remain so until we write another filename to the LUN's "file" attribute. I was able to do so when working with Linux host. Now I'm using f_mass_storage with Win7 (BOT protocol, not UAS) and after I "Eject" the disc drive I'm not sure how to reopen the LUN. Disconnect/Connect doesn't help since it only resets the interface. The example you gave me once was of a CD. But what if I'm using a disc-on-key, shouldn't disconnect/connect reopen the LUN? How do I initiate the call to storage_common.c:fsg_store_file() for a disc-on-key that I Ejected prior to disconnecting it physically from the host? BTW, I'm working with v2.6.38 if it makes any difference. Best regards, Tanya Brokhman Consultant for Qualcomm Innovation Center, Inc. Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum > > Hi Alan > > > > Thank you for the explanation. But according to the code if a host > sends a > > start_stop(START=0, LOEJ=1) the lun will be closed and there is no > way to > > "reopen" it, even if the disk is still in the drive physically. > > No -- LOEJ=1 means that the disc has been "taken out" of the drive (it > means "eject"). If the host sends START=0, LOEJ=0 then the lun file > will remain open; it's equivalent to spinning down the drive while > leaving the disc in place. > > > I thought > > that it should be done by start_stop(START=1, LOEJ=1), shouldn't it? > > Why should START=1 cause the lun file to be closed? > > > Otherwise if the host sends start_stop(START=0, LOEJ=1) the lun is > not > > functional until you reset the f_mass_storage module. > > Not at all. You simply have to write another filename to the LUN's > "file" attribute. That's equivalent to putting a new disc in a CDROM > drive. > > > Or am I missing something? Suppose this is a CD. What notification/cb > will > > we receive (in the code) when the disk is inserted to the drive? > > storage_common.c:fsg_store_file() is called when that attribute file is > written. It then calls fsg_lun_open(). > > Alan Stern -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html