On Tuesday 09 July 2013 09:29:50 WangChen wrote: Hi, > Sorry, I still have not understood why we need to get the var - available by "dev->bulk_in_filled - dev->bulk_in_copied". dev->bulk_in_copied is always reset as zero in skel_do_read_io, right? Well, no. If skel_do_read_io() runs, it is zero. But there's no guarantee that skel_do_read_io() runs. > So when we go to line 289, I think it happens after read callback returns, maybe > and at that time, bulk_in_copied should have been set as zero. Though I see at line 315, bulk_in_copied is given new data, but it will be reset to zero in next retry - skel_do_read_io, right? Only if no data is left. Otherwise no new IO is triggered. > Maybe I have not understood the reset case you mentioned makes me can not reach your idea. > For the case there may be data left from the last read, I have the same quesiton. I don't know what the bulk_in_copied is used for. Maybe I have to do some more practice test to see how these codes work. You need to know which part of the buffer is already used up. Regards Oliver -- 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