Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 55951 - HID_MAX_USAGES undefined in linux-headers-2.6.6-r1
Summary: HID_MAX_USAGES undefined in linux-headers-2.6.6-r1
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Tim Yamin (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-07-03 05:08 UTC by Jeremy Huddleston (RETIRED)
Modified: 2004-07-09 17:40 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jeremy Huddleston (RETIRED) gentoo-dev 2004-07-03 05:08:11 UTC
When compiling apcupsd, it failed because /usr/include/linux/hiddev.h doesn't have 
'HID_MAX_USAGES' defined for it...

gcc -c  -O2 -pipe -fomit-frame-pointer -Wall    -I/mnt/raid0/tmp/portage/apcupsd                                                                                                                                                            -3.10.13/work/apcupsd-3.10.13/include  linux-usb.c
In file included from linux-usb.c:21:
/usr/include/linux/hiddev.h:134: error: `HID_MAX_USAGES' undeclared here (not in                                                                                                                                                             a function)

It is defined in drivers/usb/input/hid.h:
./drivers/usb/input/hid.h:#define HID_MAX_USAGES                        1024


(04:56:46 Sat Jul 03 2004 jeremy@cid x86_64)
/usr/src/linux $ grep -R 'HID_MAX_USAGES' .
./include/linux/hiddev.h:       __s32 values[HID_MAX_USAGES];
./drivers/usb/input/hid.h:#define HID_MAX_USAGES                        1024
./drivers/usb/input/hid.h:      unsigned usage[HID_MAX_USAGES]; /* usage array */
./drivers/usb/input/hid.h:      unsigned collection_index[HID_MAX_USAGES]; /* collection index array */
./drivers/usb/input/hiddev.c:                           if (uref_multi->num_values >= HID_MAX_USAGES || 
./drivers/usb/input/hid-core.c: if (parser->local.usage_index >= HID_MAX_USAGES) {
./drivers/usb/input/hid-core.c:                 if ((parser->global.report_count = item_udata(item)) > HID_MAX_USAGES) {

...

(04:56:46 Sat Jul 03 2004 jeremy@cid x86_64)
/usr/src/linux $ grep -R 'HID_MAX_USAGES' .
./include/linux/hiddev.h:       __s32 values[HID_MAX_USAGES];
./drivers/usb/input/hid.h:#define HID_MAX_USAGES                        1024
./drivers/usb/input/hid.h:      unsigned usage[HID_MAX_USAGES]; /* usage array */
./drivers/usb/input/hid.h:      unsigned collection_index[HID_MAX_USAGES]; /* collection index array */
./drivers/usb/input/hiddev.c:                           if (uref_multi->num_values >= HID_MAX_USAGES || 
./drivers/usb/input/hid-core.c: if (parser->local.usage_index >= HID_MAX_USAGES) {
./drivers/usb/input/hid-core.c:                 if ((parser->global.report_count = item_udata(item)) > HID_MAX_USAGES) {
Comment 1 Tim Yamin (RETIRED) gentoo-dev 2004-07-03 05:14:48 UTC
Yes, the issue is that the #define is inside kernel code and this causes an issue since the headers do not contain kernel code. If you add "#define HID_MAX_USAGES 1024" somewhere, say line 208, before any "#ifdef __KERNEL__"s in /usr/include/linux/hiddev.h, do things compile successfully?
Comment 2 Jeremy Huddleston (RETIRED) gentoo-dev 2004-07-03 05:37:52 UTC
I just added -DHID_MAX_USAGES=1024 to CFLAGS and the package emerged fine.
Comment 3 Tim Yamin (RETIRED) gentoo-dev 2004-07-09 17:40:50 UTC
This issue should now be solved with sys-kernel/linux26-headers >= 2.6.6. Make sure you sync and remerge, and please reopen this bug if this issue still occurs. Thanks!