Hi, >> 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)? > > Earlier, i used file=/dev/mmcblk0p1. Now i use > file=/mnt/sd/backing_file. This backing_file is a dummy file system > that i created. I attached two jpeg files. One show the MBR and Boot > Sector of the backing_file. Another shows the usbmon of the Linux Host > PC. I also attached the udc log which shows the MBR and Boot Sector > content which are read from the backing_file. From the usbmon jpeg, > that first SCSI_READ_10 command got a overflow error, the second > SCSI_READ_10 command got a connection reset error. Is the overflow > error occurred because the host PC cannot handle the data returned > from the gadget device? Another usbmon trace showing 3 SCSI_READ_10 command. >>> >> 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 >> > > i read the net2280.c code. Is it the usb_reset() function, called by > stop_activity()? I am sorry if i understand incorrectly. > > Thanks, > victor
Attachment:
backing_file_usbmon2.png
Description: PNG image