Re: Linux USB file storage gadget with new UDC

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

 



On Mon, 8 Apr 2013, victor yeo wrote:

> Hi,
> 
> >> Now i insmod g_file_storage gadget with file=/mnt/sd/backing_file, the
> >> SCSI_READ_10 command is still not working properly.
> >
> > What makes you think that?
> 
> Because the SCSI_READ_10 is able to read the MBR from the backing
> file, and after that, SCSI_READ_10 reads all zeroes (fails to read
> boot sector).

Earlier, you complained that your gadget was able to read the boot
sector but not the MBR!  :-)

How do you know the reads were sending all zeros?  The usbmon output
shows only the first 32 bytes of each transfer, and the gadget
debugging output doesn't show the data for READ or WRITE commands at
all.

What makes you think the gadget isn't reading the boot sector?  What is
the boot sector's LBA (logical block address)?

> >> g_file_storage gadget: ep0-setup, length 8:
> >> 00000000: 80 06 00 01 00 00 40 00
> >> g_file_storage gadget: get device descriptor
> >
> > But something is definitely wrong here.  Before sending this
> > Get-Device-Descriptor request, the host should have done a USB port
> > reset.  Either the host isn't performing the reset correctly or else
> > your UDC driver didn't inform g_file_storage when the reset occurred.
> 
> Yes, the UDC driver didn't inform g_file_storage when the reset
> occurred. What is to be done to inform g_file_storage when the reset
> occurs?

Call the gadget driver's ->reset handler.  If the ->reset pointer is
NULL, call the ->disconnect handler instead.  See the code in
net2280.c's handle_stat1_irqs() as an example.

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