On Tue, Oct 17, 2006 at 08:33:06PM -0400, Adam Kropelin wrote:
...
> > If someone needs either function to handle more than 24-bits, please
> > document why - point at a specification or specific USB hid device - in
> > comments in the code.
> 
> Ummm. Ok. How many pages of the HID 1.11 spec shall I paste in?

Just a URL or other reference to a section in the document.
one or two examples of a device that has sizeof(bit fields) >= 32
would also be helpful.
Ie something I can test to verify the ops are working correctly.

> I'm not sure what makes you think there's some magic 24 bit limit.

ISTR it's a side effect of the shifts and the size of the register
on a 32-bit architecture. Maybe I'm not giving gcc enough credit
to handle 64-bit quantities correctly on a 32-bit arch.
If not, it should be easy enough to make the code work with u64.
Care to take a whack at that?

If the bit field is "naturally aligned" on a byte boundary, I hope
(but haven't verified) one could extract/implement a 32 bit field
with the current patch.

But it's been over a year since I've looked at this code and
created this patch. So please work through it first before flaming me.

> I see no limit specified, although in practice I've never seen anything
> larger than 32 bits. The size of a report field (in bits) is set by
> the Report Size global item, the data portion of which can be at most
> a 32 bit integer, thus giving a maximum field width of 4 Gbits.
> Clearly taking it that far would be insane, but limiting it to 24 bits
> arbitrarily is equally nuts.

It's not arbitrary. It's a limit of the code (vs a spec).

> I can send report descriptors of devices in my possession which have 32
> bit wide fields.

That would be helpful.  Adding examples of input to the code makes it
_way_ easier to work through changes.

>  I'm the guy who patched the original extract() from 
> "& ((1 << n)" to "& ((1ULL << n)" precisely because it didn't work on
> such devices, a bug which you've kindly recreated.

2.6.12-rc5 didn't have the "ULL".
The original patch was posted on:
http://lists.parisc-linux.org/pipermail/parisc-linux/2005-June/026611.html

or if you prefer gmane:
http://article.gmane.org/gmane.linux.usb.devel/35278/match=grundler



> Please, revert this patch or fix it to handle 32 bit fields.

Can you demonstrate it's broken for the USB devices you have?
ie show me the parameters to extract and/or implement that don't
work with the patch and tell me which device it is.
I'll take another look at it with that info.

As willy mentioned, this patch works for the simple devices I have
on parisc and mips.  I expect it to also work for PPC.
The previous code (with or without ULL) did not.

thanks,
grant

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to