Re: Linux USB file storage gadget with new UDC

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

 



Hi,

>> Understand, UDC driver will call driver->setup(), and if the return
>> value is negative, UDC driver has to set dev->protocol_stall = 1 and
>> maybe call usb_ep_set_halt(). However, the hardware won't be able to
>> send out zero length response.
>
> Don't be silly; of course it can.  Nobody would be foolish enough to
> design a piece of USB hardware that couldn't send a zero-length DATA
> packet.
>
>>  I think the purpose of zero length
>> response is to get an ACK from the host.
>
> The purpose of the zero-length response is to complete the Status stage
> of a control-OUT transfer.

Thanks, the halt feature is ok now. The SCSI_READ_10 command has a
problem. The reply value from do_read is -5, which means -EIO. The
for(;;) loop in do_read() was probably broken at "if (amount_left ==
0)". Is this if-statement valid?

Here is the gadget log when receiving SCSI_READ_10 from Linux host.

g_file_storage gadget: bulk-out, length 31:
00000000: 55 53 42 43 0f 00 00 00 00 10 00 00 80 00 0a 28
00000010: 00 00 00 00 00 00 00 08 00 00 00 00 e0 f8 02
SCSI CDB: 28 00 00 00 00 00 00 00 08 00
g_file_storage gadget: SCSI command: READ(10);  Dc=10, Di=4096;  Hc=10, Hi=4096
<.... driver read from SD card .....>
g_file_storage gadget-lun0: file read 4096 @ 0 -> 4096
READ_10 reply -5                           *** printk added by me***
g_file_storage gadget: bulk-in, length 13:
00000000: 55 53 42 53 0f 00 00 00 00 00 00 00 00

Thanks,
victor
--
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