Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/usb/usb_hid.c
Show First 20 Lines • Show All 616 Lines • ▼ Show 20 Lines | |||||
int | int | ||||
hid_locate(const void *desc, usb_size_t size, int32_t u, enum hid_kind k, | hid_locate(const void *desc, usb_size_t size, int32_t u, enum hid_kind k, | ||||
uint8_t index, struct hid_location *loc, uint32_t *flags, uint8_t *id) | uint8_t index, struct hid_location *loc, uint32_t *flags, uint8_t *id) | ||||
{ | { | ||||
struct hid_data *d; | struct hid_data *d; | ||||
struct hid_item h; | struct hid_item h; | ||||
for (d = hid_start_parse(desc, size, 1 << k); hid_get_item(d, &h);) { | for (d = hid_start_parse(desc, size, 1 << k); hid_get_item(d, &h);) { | ||||
if (h.kind == k && !(h.flags & HIO_CONST) && h.usage == u) { | if (h.kind == k && h.usage == u) { | ||||
if (index--) | if (index--) | ||||
continue; | continue; | ||||
if (loc != NULL) | if (loc != NULL) | ||||
*loc = h.loc; | *loc = h.loc; | ||||
if (flags != NULL) | if (flags != NULL) | ||||
*flags = h.flags; | *flags = h.flags; | ||||
if (id != NULL) | if (id != NULL) | ||||
*id = h.report_ID; | *id = h.report_ID; | ||||
▲ Show 20 Lines • Show All 367 Lines • Show Last 20 Lines |