Re: SCSI_START_STOP_UNIT implementation question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 14 Jan 2011, Tanya Brokhman wrote:

> Hi All,
> 
> I was looking at do_start_stop() function in f_mass_storage.c and have a
> small question regarding its implementation.
> According to the SCSI spec if the LOEJ bit of the START_STOP_UNIT CBW is 1
> and so is the START bit - the medium should be loaded. I don?t see this
> implemented in do_start_stop(). According to the code if START = 1 but the
> lun is closed we return error.  According to my understanding if START =1
> and the lun is closed and LOEJ = 1 then the lun should be reopened.
> 
> Please advice.

Think of a CDROM drive.  If you send a START-STOP UNIT command with
START and LOEJ both set to 1, but there is no disc in the drive, you 
will get an error.  The drive doesn't magically put a disc into itself.

That's sort of how do_start_stop() works.  fsg_lun_close() is like
opening the door and removing the disc from the drive.  fsg_lun_open()  
is like putting a disc in the drive and shutting the door.  START=1 
won't work if there isn't a disc in the drive.

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


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux