Sync with NetBSD:

Print unknown usages with 4 digits.
Mask in page extraction.
This commit is contained in:
n_hibma 2000-08-26 13:53:27 +00:00
parent 55b1f4b48e
commit 23d99a41e2
6 changed files with 14 additions and 14 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: usb.h,v 1.7 2000/04/02 11:10:53 augustss Exp $ */
/* $NetBSD: usb.h,v 1.8 2000/08/13 22:22:02 augustss Exp $ */
/*
* Copyright (c) 1999 Lennart Augustsson <augustss@netbsd.org>
@ -72,7 +72,7 @@ typedef struct hid_item {
struct hid_item *next;
} hid_item_t;
#define HID_PAGE(u) ((u) >> 16)
#define HID_PAGE(u) (((u) >> 16) & 0xffff)
#define HID_USAGE(u) ((u) & 0xffff)
/* Obtaining a report descriptor, descr.c: */

View File

@ -1,4 +1,4 @@
/* $NetBSD: usage.c,v 1.5 2000/04/02 11:10:53 augustss Exp $ */
/* $NetBSD: usage.c,v 1.6 2000/08/13 22:22:02 augustss Exp $ */
/*
* Copyright (c) 1999 Lennart Augustsson <augustss@netbsd.org>
@ -165,7 +165,7 @@ hid_usage_page(int i)
for (k = 0; k < npages; k++)
if (pages[k].usage == i)
return pages[k].name;
sprintf(b, "0x%02x", i);
sprintf(b, "0x%04x", i);
return b;
}
@ -192,6 +192,6 @@ hid_usage_in_page(unsigned int u)
return pages[k].page_contents[j].name;
}
bad:
sprintf(b, "0x%02x", i);
sprintf(b, "0x%04x", i);
return b;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: usb.h,v 1.7 2000/04/02 11:10:53 augustss Exp $ */
/* $NetBSD: usb.h,v 1.8 2000/08/13 22:22:02 augustss Exp $ */
/*
* Copyright (c) 1999 Lennart Augustsson <augustss@netbsd.org>
@ -72,7 +72,7 @@ typedef struct hid_item {
struct hid_item *next;
} hid_item_t;
#define HID_PAGE(u) ((u) >> 16)
#define HID_PAGE(u) (((u) >> 16) & 0xffff)
#define HID_USAGE(u) ((u) & 0xffff)
/* Obtaining a report descriptor, descr.c: */

View File

@ -1,4 +1,4 @@
/* $NetBSD: usb.h,v 1.7 2000/04/02 11:10:53 augustss Exp $ */
/* $NetBSD: usb.h,v 1.8 2000/08/13 22:22:02 augustss Exp $ */
/*
* Copyright (c) 1999 Lennart Augustsson <augustss@netbsd.org>
@ -72,7 +72,7 @@ typedef struct hid_item {
struct hid_item *next;
} hid_item_t;
#define HID_PAGE(u) ((u) >> 16)
#define HID_PAGE(u) (((u) >> 16) & 0xffff)
#define HID_USAGE(u) ((u) & 0xffff)
/* Obtaining a report descriptor, descr.c: */

View File

@ -1,4 +1,4 @@
/* $NetBSD: usage.c,v 1.5 2000/04/02 11:10:53 augustss Exp $ */
/* $NetBSD: usage.c,v 1.6 2000/08/13 22:22:02 augustss Exp $ */
/*
* Copyright (c) 1999 Lennart Augustsson <augustss@netbsd.org>
@ -165,7 +165,7 @@ hid_usage_page(int i)
for (k = 0; k < npages; k++)
if (pages[k].usage == i)
return pages[k].name;
sprintf(b, "0x%02x", i);
sprintf(b, "0x%04x", i);
return b;
}
@ -192,6 +192,6 @@ hid_usage_in_page(unsigned int u)
return pages[k].page_contents[j].name;
}
bad:
sprintf(b, "0x%02x", i);
sprintf(b, "0x%04x", i);
return b;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: usb.h,v 1.7 2000/04/02 11:10:53 augustss Exp $ */
/* $NetBSD: usb.h,v 1.8 2000/08/13 22:22:02 augustss Exp $ */
/*
* Copyright (c) 1999 Lennart Augustsson <augustss@netbsd.org>
@ -72,7 +72,7 @@ typedef struct hid_item {
struct hid_item *next;
} hid_item_t;
#define HID_PAGE(u) ((u) >> 16)
#define HID_PAGE(u) (((u) >> 16) & 0xffff)
#define HID_USAGE(u) ((u) & 0xffff)
/* Obtaining a report descriptor, descr.c: */