On Thu, 17 Jun 2004, Mick Cornut wrote: > Hye, > > I use the g_file_storage gadget and I've got problem with this function: > > static int received_cbw(struct fsg_dev *fsg, struct fsg_buffhd *bh)
> since cbw->DataTransferLength and cbw->Tag are both u32 > It works better when I use: > fsg->data_size = cpu_to_le32(cbw->DataTransferLength); > ... > fsg->tag = cpu_to_le32(cbw->Tag); > > Am I rigth? You're right about the DataTransferLength, and thanks for pointing it out. It's amazing how easy it is to miss these things on a platform that doesn't need them. The Tag field doesn't need byte-swapping because the value isn't used directly; it's just copied back into the CSW. But there is one other value to change that neither of us spotted: the residue field in the CSW. I'll submit patches to fix this for all three incarnations of g_file_storage (2.4, 2.6, and gadget-2.4). Alan Stern ------------------------------------------------------- This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
