On Wed, 10 Jan 2007 10:25:54 +0100, Paolo Abeni <[EMAIL PROTECTED]> wrote:
> I have an issue related to the new usbmon binary API. > AFAIK the header added from the kernel to each event is in host byte > order, except for the setup header part, which is in little endian byte > order. All the remaining data is little endian, too. The basic rule is, the unstructured data is in the wire order, and the structured data is in host order (and also naturally aligned). I chose to deliver the setup raw, so you have to use s[3]<<8|s[2] and such to parse it. > Shouldn't be reasonable to update the code to make the header little > endian, too ? This will make more uniform the processing of each event > at the application level. I think not, because it can be cut both ways, and usbmon aims to be as transparent as possible, without losing essential abstractions. The USB core does not parse setup once it was packaged, so usbmon follows. Actually, this is not quite true, because the text API groups bytes of status when printing them. But that is because of text. But remember that at one point you were going to allocate setup packet separately, as it were the same thing as the data. It is a legitimate view. > I'm sorry to have came to this a little too late... Yeah, that's the main issue. We could have defined the status to be structured and have a guaranteed alignment earlier, if anyone cared back then. How much of a problem is it? -- Pete ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel