Hi, > Another possibility is to set up a virtual Windows system inside your > Linux host. Then try running the USB CV program on the virtual > machine, and use usbmon on the host system to capture the USB traffic. > > I don't know if that will work, but it might. Thanks. i will find a way to setup the virtual Windows inside Linux host. >> Ok. Today i tested the same mass storage gadget driver on Lenovo x100e >> Ubuntu. There is a strange problem. After SCSI_READ_10 command data is >> returned to the Ubuntu host. The gadget driver says: >> >> g_file_storage gadget: reset config >> g_file_storage gadget: reset interface >> >> Then the same process to get descriptors and receive SCSI commands are >> repeated. Is the SCSI_READ_10 command or something else causing the >> problem? Please see the attached gadget driver log. > > Perhaps you will recognize this answer (I have sent it several times > before): I can't tell what is happening without seeing _both_ the log > file on the gadget _and_ the usbmon trace on the host. > > Alan Stern > Yes, the matching gadget log and usbmon trace are attached in this email. From the usbmon trace, the error (-108) is ESHUTDOWN from SCSI_READ_10 command. From the gadget log, the last SCSI_READ_10 command is received twice. First time it is ok, second time it causes some problem. Which side could cause the ESHUTDOWN error? Thanks, victor
[start_transfer] 43425355 35 ept1 out queue len 0x200, buffer 0xc0c44000 before kagen2_ep_queue after kagen2_ep_queue kagen2_ep_queue 31 512 31 [kagen2_ep_queue] 43425355 36 g_file_storage gadget: bulk-out, length 31: 00000000: 55 53 42 43 36 00 00 00 12 00 00 00 80 00 06 03 00000010: 00 00 00 12 00 00 00 00 00 00 00 00 00 00 00 g_file_storage gadget: SCSI command: REQUEST SENSE; Dc=6, Di=18; Hc=6, Hi=18 g_file_storage gadget: bulk-in, length 18: 00000000: 70 00 06 00 00 00 00 0a 00 00 00 00 29 00 00 00 00000010: 00 00 [start_transfer] 60070 a000000 ept1 in queue len 0x12, buffer 0xc0c44000 0: 0x60070 4: 0xa000000 8: 0x0 c: 0x29 bulk_in_complete --> 0, 18/18 g_file_storage gadget: before calling send_status g_file_storage gadget: bulk-in, length 13: 00000000: 55 53 42 53 36 00 00 00 00 00 00 00 00 [start_transfer] 53425355 36 ept1 in queue len 0xd, buffer 0xc1338000 0: 0x53425355 4: 0x36 8: 0x0 bulk_in_complete --> 0, 13/13 [start_transfer] 60070 a000000 ept1 out queue len 0x200, buffer 0xc0c44000 before kagen2_ep_queue after kagen2_ep_queue kagen2_ep_queue 31 512 31 [kagen2_ep_queue] 43425355 37 g_file_storage gadget: bulk-out, length 31: 00000000: 55 53 42 43 37 00 00 00 00 10 00 00 80 00 0a 28 00000010: 00 00 00 00 18 00 00 08 00 00 00 00 00 00 00 g_file_storage gadget: SCSI command: READ(10); Dc=10, Di=4096; Hc=10, Hi=4096 g_file_storage gadget-lun0: file read 4096 @ 12288 -> 4096 [start_transfer] 0 0 ept1 in queue len 0x1000, buffer 0xc0c44000 len_num 4096, iter_num 0 0: 0x0 4: 0x0 8: 0x0 c: 0x0 len_num 3584, iter_num 1 0: 0x0 4: 0x0 8: 0x0 c: 0x0 len_num 3072, iter_num 2 0: 0x0 4: 0x0 8: 0x0 c: 0x0 len_num 2560, iter_num 3 0: 0x0 4: 0x0 8: 0x0 c: 0x0 len_num 2048, iter_num 4 0: 0x0 4: 0x0 8: 0x0 c: 0x0 len_num 1536, iter_num 5 0: 0x0 4: 0x0 8: 0x0 c: 0x0 len_num 1024, iter_num 6 0: 0x0 4: 0x0 8: 0x0 c: 0x0 len_num 512, iter_num 7 0: 0x0 4: 0x0 8: 0x0 c: 0x0 bulk_in_complete --> 0, 4096/4096 g_file_storage gadget: before calling send_status g_file_storage gadget: bulk-in, length 13: 00000000: 55 53 42 53 37 00 00 00 00 00 00 00 00 [start_transfer] 53425355 37 ept1 in queue len 0xd, buffer 0xc1338000 0: 0x53425355 4: 0x37 8: 0x0 bulk_in_complete --> 0, 13/13 [start_transfer] 0 0 ept1 out queue len 0x200, buffer 0xc0c44000 before kagen2_ep_queue after kagen2_ep_queue kagen2_ep_queue 31 512 31 [kagen2_ep_queue] 43425355 38 g_file_storage gadget: bulk-out, length 31: 00000000: 55 53 42 43 38 00 00 00 00 10 00 00 80 00 0a 28 00000010: 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 g_file_storage gadget: SCSI command: READ(10); Dc=10, Di=4096; Hc=10, Hi=4096 g_file_storage gadget-lun0: file read 4096 @ 0 -> 4096 [start_transfer] 0 0 ept1 in queue len 0x1000, buffer 0xc0c44000 len_num 4096, iter_num 0 0: 0x0 4: 0x0 8: 0x0 c: 0x0 len_num 3584, iter_num 1 0: 0x6d903ceb 4: 0x736f646b 8: 0x7366 c: 0x10402 len_num 3072, iter_num 2 0: 0xfffff8 4: 0xfff0 8: 0x0 c: 0x0 len_num 2560, iter_num 3 0: 0x0 4: 0x0 8: 0x0 c: 0x0 len_num 2048, iter_num 4 0: 0xfffff8 4: 0xfff0 8: 0x0 c: 0x0 len_num 1536, iter_num 5 0: 0x0 4: 0x0 8: 0x0 c: 0x0 len_num 1024, iter_num 6 0: 0x6f007442 4: 0x7000 8: 0xfffff00 c: 0xffffc100 len_num 512, iter_num 7 0: 0x0 4: 0x0 8: 0x0 c: 0x0 bulk_in_complete --> 0, 4096/4096 g_file_storage gadget: before calling send_status g_file_storage gadget: bulk-in, length 13: 00000000: 55 53 42 53 38 00 00 00 00 00 00 00 00 [start_transfer] 53425355 38 ept1 in queue len 0xd, buffer 0xc1338000 0: 0x53425355 4: 0x38 8: 0x0 bulk_in_complete --> 0, 13/13 [start_transfer] 0 0 ept1 out queue len 0x200, buffer 0xc0c44000 before kagen2_ep_queue after kagen2_ep_queue kagen2_ep_queue 31 512 31 [kagen2_ep_queue] 43425355 39 g_file_storage gadget: bulk-out, length 31: 00000000: 55 53 42 43 39 00 00 00 00 10 00 00 80 00 0a 28 00000010: 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 g_file_storage gadget: SCSI command: READ(10); Dc=10, Di=4096; Hc=10, Hi=4096 g_file_storage gadget-lun0: file read 4096 @ 0 -> 4096 [start_transfer] 0 0 ept1 in queue len 0x1000, buffer 0xc0c44000 len_num 4096, iter_num 0 0: 0x0 4: 0x0 8: 0x0 c: 0x0 len_num 3584, iter_num 1 0: 0x6d903ceb 4: 0x736f646b 8: 0x7366 c: 0x10402 len_num 3072, iter_num 2 0: 0xfffff8 4: 0xfff0 8: 0x0 c: 0x0 len_num 2560, iter_num 3 0: 0x0 4: 0x0 8: 0x0 c: 0x0 len_num 2048, iter_num 4 0: 0xfffff8 4: 0xfff0 8: 0x0 c: 0x0 len_num 1536, iter_num 5 0: 0x0 4: 0x0 8: 0x0 c: 0x0 len_num 1024, iter_num 6 0: 0x6f007442 4: 0x7000 8: 0xfffff00 c: 0xffffc100 len_num 512, iter_num 7 0: 0x0 4: 0x0 8: 0x0 c: 0x0 bulk_in_complete --> 0, 4096/4096 g_file_storage gadget: before calling send_status g_file_storage gadget: bulk-in, length 13: 00000000: 55 53 42 53 39 00 00 00 00 00 00 00 00 [start_transfer] 53425355 39 ept1 in queue len 0xd, buffer 0xc1338000 0: 0x53425355 4: 0x39 8: 0x0 bulk_in_complete --> 0, 13/13 [start_transfer] 0 0 ept1 out queue len 0x200, buffer 0xc0c44000 before kagen2_ep_queue EP1 OUT IRQ 0x28 after kagen2_ep_queue kagen2_ep_queue 31 512 31 [kagen2_ep_queue] 43425355 3a g_file_storage gadget: bulk-out, length 31: 00000000: 55 53 42 43 3a 00 00 00 00 00 00 00 00 00 06 00 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 g_file_storage gadget: SCSI command: TEST UNIT READY; Dc=6, Dn=0; Hc=6, Hn=0 g_file_storage gadget: before calling send_status g_file_storage gadget: bulk-in, length 13: 00000000: 55 53 42 53 3a 00 00 00 00 00 00 00 00 [start_transfer] 53425355 3a ept1 in queue len 0xd, buffer 0xc0c44000 0: 0x53425355 4: 0x3a 8: 0x0 bulk_in_complete --> 0, 13/13 [start_transfer] 53425355 39 ept1 out queue len 0x200, buffer 0xc1338000 before kagen2_ep_queue after kagen2_ep_queue kagen2_ep_queue 31 512 31 [kagen2_ep_queue] 43425355 3b g_file_storage gadget: bulk-out, length 31: 00000000: 55 53 42 43 3b 00 00 00 08 00 00 00 80 00 0a 25 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 g_file_storage gadget: SCSI command: READ CAPACITY; Dc=10, Di=8; Hc=10, Hi=8 g_file_storage gadget: bulk-in, length 8: 00000000: 00 00 07 ff 00 00 02 00 [start_transfer] ff070000 20000 ept1 in queue len 0x8, buffer 0xc1338000 0: 0xff070000 4: 0x20000 bulk_in_complete --> 0, 8/8 g_file_storage gadget: before calling send_status g_file_storage gadget: bulk-in, length 13: 00000000: 55 53 42 53 3b 00 00 00 00 00 00 00 00 [start_transfer] 53425355 3b ept1 in queue len 0xd, buffer 0xc0c44000 0: 0x53425355 4: 0x3b 8: 0x0 bulk_in_complete --> 0, 13/13 [start_transfer] ff070000 20000 ept1 out queue len 0x200, buffer 0xc1338000 before kagen2_ep_queue after kagen2_ep_queue kagen2_ep_queue 31 512 31 [kagen2_ep_queue] 43425355 3c g_file_storage gadget: bulk-out, length 31: 00000000: 55 53 42 43 3c 00 00 00 00 10 00 00 80 00 0a 28 00000010: 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 g_file_storage gadget: SCSI command: READ(10); Dc=10, Di=4096; Hc=10, Hi=4096 g_file_storage gadget-lun0: file read 4096 @ 0 -> 4096 [start_transfer] 0 0 ept1 in queue len 0x1000, buffer 0xc1338000 len_num 4096, iter_num 0 0: 0x0 4: 0x0 8: 0x0 c: 0x0 len_num 3584, iter_num 1 0: 0x6d903ceb 4: 0x736f646b 8: 0x7366 c: 0x10402 len_num 3072, iter_num 2 0: 0xfffff8 4: 0xfff0 8: 0x0 c: 0x0 len_num 2560, iter_num 3 0: 0x0 4: 0x0 8: 0x0 c: 0x0 len_num 2048, iter_num 4 0: 0xfffff8 4: 0xfff0 8: 0x0 c: 0x0 len_num 1536, iter_num 5 0: 0x0 4: 0x0 8: 0x0 c: 0x0 len_num 1024, iter_num 6 0: 0x6f007442 4: 0x7000 8: 0xfffff00 c: 0xffffc100 len_num 512, iter_num 7 0: 0x0 4: 0x0 8: 0x0 c: 0x0 bulk_in_complete --> 0, 4096/4096 g_file_storage gadget: before calling send_status g_file_storage gadget: bulk-in, length 13: 00000000: 55 53 42 53 3c 00 00 00 00 00 00 00 00 [start_transfer] 53425355 3c ept1 in queue len 0xd, buffer 0xc0c44000 0: 0x53425355 4: 0x3c 8: 0x0 bulk_in_complete --> 0, 13/13 [start_transfer] 0 0 ept1 out queue len 0x200, buffer 0xc1338000 before kagen2_ep_queue after kagen2_ep_queue kagen2_ep_queue 31 512 31 [kagen2_ep_queue] 43425355 3d g_file_storage gadget: bulk-out, length 31: 00000000: 55 53 42 43 3d 00 00 00 c0 00 00 00 80 00 06 1a 00000010: 00 3f 00 c0 00 00 00 00 00 00 00 00 00 00 00 g_file_storage gadget: SCSI command: MODE SENSE(6); Dc=6, Di=192; Hc=6, Hi=192 g_file_storage gadget: bulk-in, length 16: 00000000: 0f 00 00 00 08 0a 04 00 ff ff 00 00 ff ff ff ff [start_transfer] f 40a08 ept1 in queue len 0x10, buffer 0xc1338000 0: 0xf 4: 0x40a08 8: 0xffff c: 0xffffffff bulk_in_complete --> 0, 16/16 g_file_storage gadget: bulk-in set halt kagen2_set_halt 1 1 g_file_storage gadget: before calling send_status g_file_storage gadget: bulk-in, length 13: 00000000: 55 53 42 53 3d 00 00 00 b0 00 00 00 00 [start_transfer] 53425355 3d ept1 in queue len 0xd, buffer 0xc0c44000 0: 0x53425355 4: 0x3d 8: 0xb0 bulk_in_complete --> 0, 13/13 [start_transfer] f 40a08 ept1 out queue len 0x200, buffer 0xc1338000 before kagen2_ep_queue after kagen2_ep_queue kagen2_ep_queue 31 512 31 [kagen2_ep_queue] 43425355 3e g_file_storage gadget: bulk-out, length 31: 00000000: 55 53 42 43 3e 00 00 00 00 10 00 00 80 00 0a 28 00000010: 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 g_file_storage gadget: SCSI command: READ(10); Dc=10, Di=4096; Hc=10, Hi=4096 g_file_storage gadget-lun0: file read 4096 @ 0 -> 4096 [start_transfer] 0 0 ept1 in queue len 0x1000, buffer 0xc1338000 len_num 4096, iter_num 0 0: 0x0 4: 0x0 8: 0x0 c: 0x0 len_num 3584, iter_num 1 0: 0x6d903ceb 4: 0x736f646b 8: 0x7366 c: 0x10402 len_num 3072, iter_num 2 0: 0xfffff8 4: 0xfff0 8: 0x0 c: 0x0 len_num 2560, iter_num 3 0: 0x0 4: 0x0 8: 0x0 c: 0x0 len_num 2048, iter_num 4 0: 0xfffff8 4: 0xfff0 8: 0x0 c: 0x0 len_num 1536, iter_num 5 0: 0x0 4: 0x0 8: 0x0 c: 0x0 len_num 1024, iter_num 6 0: 0x6f007442 4: 0x7000 8: 0xfffff00 c: 0xffffc100 len_num 512, iter_num 7 0: 0x0 4: 0x0 8: 0x0 c: 0x0 bulk_in_complete --> 0, 4096/4096 g_file_storage gadget: before calling send_status g_file_storage gadget: bulk-in, length 13: 00000000: 55 53 42 53 3e 00 00 00 00 00 00 00 00 [start_transfer] 53425355 3e ept1 in queue len 0xd, buffer 0xc0c44000 0: 0x53425355 4: 0x3e 8: 0x0 bulk_in_complete --> 0, 13/13 [start_transfer] 0 0 ept1 out queue len 0x200, buffer 0xc1338000 before kagen2_ep_queue g_file_storage gadget: disconnect or port reset after kagen2_ep_queue kagen2_ep_queue 31 512 31 [kagen2_ep_queue] 43425355 3e g_file_storage gadget: bulk-out, length 31: 00000000: 55 53 42 43 3e 00 00 00 00 10 00 00 80 00 0a 28 00000010: 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 g_file_storage gadget: SCSI command: READ(10); Dc=10, Di=4096; Hc=10, Hi=4096 g_file_storage gadget-lun0: file read 4096 @ 0 -> 4096 g_file_storage gadget: after calling do_scsi_command handle_exception begin handle_exception wait until handle_exception old_state 5 g_file_storage gadget: reset config g_file_storage gadget: reset interface g_file_storage gadget: in handle_exception loop g_file_storage gadget: in fsg->running loop g_file_storage gadget: in fsg->running loop g_file_storage gadget: ep0-setup, length 8: 00000000: 80 06 00 01 00 00 40 00 g_file_storage gadget: get device descriptor ept0 in queue len 0x12, buffer 0xc128f800 ep0_complete g_file_storage gadget: ep0-in, length 18: 00000000: 12 01 00 02 00 00 00 40 25 05 a5 a4 33 03 01 02 00000010: 00 01 g_file_storage gadget: disconnect or port reset handle_exception begin handle_exception wait until handle_exception old_state 5 g_file_storage gadget: in handle_exception loop g_file_storage gadget: in fsg->running loop USB_RECIP_DEVICE fa is 0x32 exit A g_file_storage gadget: ep0-setup, length 8: 00000000: 80 06 00 01 00 00 12 00 g_file_storage gadget: get device descriptor ept0 in queue len 0x12, buffer 0xc128f800 ep0_complete
Attachment:
x100e_usbmon_log
Description: Binary data