Hi, Thanks for your help. I tried this patch and it works well. So what else I should do? Will you help to merge it to trunk? Thanks for your help. Best Regards Benson On Fri, Mar 10, 2017 at 7:28 PM, Oliver Neukum <oneukum@xxxxxxxx> wrote: > Am Freitag, den 10.03.2017, 17:20 +0800 schrieb 家瑋: >> > > > Hi, > >> I have encounter a problem while sending Serial_State packet of >> CDC-ACM from Linux gadget to Linux host . >> Here is my question: >> The environment is a USB device which runs Linux is using >> CDC-ACM(f_acm.c) to communicate with a Linux host(cdc-acm.c). When >> device tries to send Serial_State packet to host, host always can't >> get correct data. I look into the host driver(cdc-acm.c) and found >> driver calls get_unaligned_le16 on data and this function inverts >> byte >> order of data. >> Following is the link of cdc-acm.c and f_acm.c >> ACM host: http://lxr.free-electrons.com/source/drivers/usb/class/ >> cdc-acm.c#L325 >> ACM gadget: http://lxr.free-electrons.com/source/drivers/usb/gadge >> t/function/f_acm.c#L493 >> From the current code, gadget send Serial_State in big-endian but >> host treat it as little-endian. >> Is this a problem? > > Yes, it is. The gadget driver is exporting its internal endianness. > >> Appreciate for your time >> > Please test the attached patch. > > 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