On Thu, Jan 15, 2004 at 04:32:08PM +0100, Marcel Holtmann wrote: > is there any reason why this patch is not yet submitted to Marcelo and > Linus? It is needed for switching a Logitech HID/Bluetooth dongle from > HID into HCI mode.
> > I've brought this up before and now that 2.6.0 is released, I'll > > bring it up again. Can we get the HID layer to support duplicating > > the last usage for controls w/o a explicitly specified usage. Not > > having this breaks some devices, most notably Phidget controllers. > > > > I've been using this simple 2 line patch to make them work (though > > I'm sure it breaks other devices) It is against 2.4.22 directly, but > > applies to 2.6.0-test10 (haven't tried against 2.6.0) > > offset = report->size; > > report->size += parser->global.report_size * parser->global.report_count; > > +if (usages < parser->global.report_count) > > +usages = parser->global.report_count; > > > > if (usages == 0) > > return 0; /* ignore padding fields */ The patch is trying to fix a real bug (the code never expects the number of usages to be less than the number of values in a report), however the fix is wrong, because later in the hid_add_field() function it can cause the loop whic assigns usages to the field->usage array to access data beyond the end of the parser->local.usage array. Could you do a proper fix? (Setting the field->usage array to the last defined usage?) -- Vojtech Pavlik SuSE Labs, SuSE CR ------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel