-/* $OpenBSD: ucc.c,v 1.24 2021/09/02 15:15:12 anton Exp $ */
+/* $OpenBSD: ucc.c,v 1.25 2021/09/10 05:47:38 anton Exp $ */
/*
* Copyright (c) 2021 Anton Lindqvist <anton@openbsd.org>
void *desc;
int size;
- uhidev_get_report_desc(uha->parent, &desc, &size);
- if (hid_report_size(desc, size, hid_input, uha->reportid) == 0)
+ if (uha->isize == 0)
return UMATCH_NONE;
+ uhidev_get_report_desc(uha->parent, &desc, &size);
if (!ucc_hid_match(desc, size, uha->reportid))
return UMATCH_NONE;
struct ucc_softc *sc = (struct ucc_softc *)self;
struct uhidev_attach_arg *uha = (struct uhidev_attach_arg *)aux;
void *desc;
- int error, repid, size;
+ int error, size;
sc->sc_mode = WSKBD_TRANSLATED;
sc->sc_last_translate = -1;
sc->sc_hdev.sc_report_id = uha->reportid;
uhidev_get_report_desc(uha->parent, &desc, &size);
- repid = uha->reportid;
- sc->sc_hdev.sc_isize = hid_report_size(desc, size, hid_input, repid);
- sc->sc_hdev.sc_osize = hid_report_size(desc, size, hid_output, repid);
- sc->sc_hdev.sc_fsize = hid_report_size(desc, size, hid_feature, repid);
+ sc->sc_hdev.sc_isize = uha->isize;
+ sc->sc_hdev.sc_osize = uha->osize;
+ sc->sc_hdev.sc_fsize = uha->fsize;
error = ucc_hid_parse(sc, desc, size);
if (error) {
-/* $OpenBSD: ugold.c,v 1.17 2021/04/05 16:26:06 landry Exp $ */
+/* $OpenBSD: ugold.c,v 1.18 2021/09/10 05:47:38 anton Exp $ */
/*
* Copyright (c) 2013 Takayoshi SASANO <uaa@openbsd.org>
{
struct ugold_softc *sc = (struct ugold_softc *)self;
struct uhidev_attach_arg *uha = aux;
- int size, repid;
+ int size;
void *desc;
sc->sc_udev = uha->parent->sc_udev;
}
uhidev_get_report_desc(uha->parent, &desc, &size);
- repid = uha->reportid;
- sc->sc_hdev.sc_isize = hid_report_size(desc, size, hid_input, repid);
- sc->sc_hdev.sc_osize = hid_report_size(desc, size, hid_output, repid);
- sc->sc_hdev.sc_fsize = hid_report_size(desc, size, hid_feature, repid);
+ sc->sc_hdev.sc_isize = uha->isize;
+ sc->sc_hdev.sc_osize = uha->osize;
+ sc->sc_hdev.sc_fsize = uha->fsize;
if (uhidev_open(&sc->sc_hdev)) {
printf(", unable to open interrupt pipe\n");
-/* $OpenBSD: uhid.c,v 1.84 2021/03/08 14:35:57 jcs Exp $ */
+/* $OpenBSD: uhid.c,v 1.85 2021/09/10 05:47:38 anton Exp $ */
/* $NetBSD: uhid.c,v 1.57 2003/03/11 16:44:00 augustss Exp $ */
/*
{
struct uhid_softc *sc = (struct uhid_softc *)self;
struct uhidev_attach_arg *uha = (struct uhidev_attach_arg *)aux;
- int size, repid;
+ int size;
void *desc;
sc->sc_hdev.sc_intr = uhid_intr;
sc->sc_hdev.sc_report_id = uha->reportid;
uhidev_get_report_desc(uha->parent, &desc, &size);
- repid = uha->reportid;
- sc->sc_hdev.sc_isize = hid_report_size(desc, size, hid_input, repid);
- sc->sc_hdev.sc_osize = hid_report_size(desc, size, hid_output, repid);
- sc->sc_hdev.sc_fsize = hid_report_size(desc, size, hid_feature, repid);
+ sc->sc_hdev.sc_isize = uha->isize;
+ sc->sc_hdev.sc_osize = uha->osize;
+ sc->sc_hdev.sc_fsize = uha->fsize;
printf(": input=%d, output=%d, feature=%d\n",
sc->sc_hdev.sc_isize, sc->sc_hdev.sc_osize, sc->sc_hdev.sc_fsize);
-/* $OpenBSD: uhidev.c,v 1.93 2021/09/10 05:46:01 anton Exp $ */
+/* $OpenBSD: uhidev.c,v 1.94 2021/09/10 05:47:38 anton Exp $ */
/* $NetBSD: uhidev.c,v 1.14 2003/03/11 16:44:00 augustss Exp $ */
/*
uha.reportid = UHIDEV_CLAIM_MULTIPLE_REPORTID;
uha.nreports = nrepid;
uha.claimed = malloc(nrepid, M_TEMP, M_WAITOK|M_ZERO);
+ uha.isize = uha.osize = uha.fsize = 0;
/* Look for a driver claiming multiple report IDs first. */
dev = config_found_sm(self, &uha, NULL, uhidevsubmatch);
uha.claimed = NULL;
for (repid = 0; repid < nrepid; repid++) {
+ int isize, osize, fsize;
+
DPRINTF(("%s: try repid=%d\n", __func__, repid));
- if (hid_report_size(desc, size, hid_input, repid) == 0 &&
- hid_report_size(desc, size, hid_output, repid) == 0 &&
- hid_report_size(desc, size, hid_feature, repid) == 0)
+ if ((isize = hid_report_size(desc, size, hid_input, repid)) == 0 &&
+ (osize = hid_report_size(desc, size, hid_output, repid)) == 0 &&
+ (fsize = hid_report_size(desc, size, hid_feature, repid)) == 0)
continue;
/* Could already be assigned by uhidev_set_report_dev(). */
continue;
uha.reportid = repid;
+ uha.isize = isize;
+ uha.osize = osize;
+ uha.fsize = fsize;
dev = config_found_sm(self, &uha, uhidevprint, uhidevsubmatch);
sc->sc_subdevs[repid] = (struct uhidev *)dev;
}
-/* $OpenBSD: uhidev.h,v 1.29 2021/03/18 09:21:53 anton Exp $ */
+/* $OpenBSD: uhidev.h,v 1.30 2021/09/10 05:47:38 anton Exp $ */
/* $NetBSD: uhidev.h,v 1.3 2002/10/08 09:56:17 dan Exp $ */
/*
#define UHIDEV_CLAIM_MULTIPLE_REPORTID 255
uint8_t nreports;
uint8_t *claimed;
+ int isize;
+ int osize;
+ int fsize;
};
int uhidev_report_type_conv(int);
-/* $OpenBSD: ukbd.c,v 1.82 2021/01/29 16:59:41 sthen Exp $ */
+/* $OpenBSD: ukbd.c,v 1.83 2021/09/10 05:47:38 anton Exp $ */
/* $NetBSD: ukbd.c,v 1.85 2003/03/11 16:44:00 augustss Exp $ */
/*
uhidev_get_report_desc(uha->parent, &desc, &dlen);
repid = uha->reportid;
- sc->sc_hdev.sc_isize = hid_report_size(desc, dlen, hid_input, repid);
- sc->sc_hdev.sc_osize = hid_report_size(desc, dlen, hid_output, repid);
- sc->sc_hdev.sc_fsize = hid_report_size(desc, dlen, hid_feature, repid);
+ sc->sc_hdev.sc_isize = uha->isize;
+ sc->sc_hdev.sc_osize = uha->osize;
+ sc->sc_hdev.sc_fsize = uha->fsize;
/*
* Since the HID-Proxy is always detected before any
-/* $OpenBSD: ums.c,v 1.48 2021/03/24 02:49:57 jcs Exp $ */
+/* $OpenBSD: ums.c,v 1.49 2021/09/10 05:47:38 anton Exp $ */
/* $NetBSD: ums.c,v 1.60 2003/03/11 16:44:00 augustss Exp $ */
/*
struct hidms *ms = &sc->sc_ms;
struct uhidev_attach_arg *uha = (struct uhidev_attach_arg *)aux;
struct usb_attach_arg *uaa = uha->uaa;
- int size, repid;
+ int size;
void *desc;
u_int32_t qflags = 0;
if (uaa->vendor == USB_VENDOR_ELECOM)
ums_fix_elecom_descriptor(sc, desc, size, uaa->product);
- repid = uha->reportid;
- sc->sc_hdev.sc_isize = hid_report_size(desc, size, hid_input, repid);
- sc->sc_hdev.sc_osize = hid_report_size(desc, size, hid_output, repid);
- sc->sc_hdev.sc_fsize = hid_report_size(desc, size, hid_feature, repid);
+ sc->sc_hdev.sc_isize = uha->isize;
+ sc->sc_hdev.sc_osize = uha->osize;
+ sc->sc_hdev.sc_fsize = uha->fsize;
if (sc->sc_quirks & UQ_MS_REVZ)
qflags |= HIDMS_REVZ;
-/* $OpenBSD: umstc.c,v 1.4 2021/03/08 14:39:34 jcs Exp $ */
+/* $OpenBSD: umstc.c,v 1.5 2021/09/10 05:47:38 anton Exp $ */
/*
* Copyright (c) 2020 joshua stein <jcs@jcs.org>
struct umstc_softc *sc = (struct umstc_softc *)self;
struct uhidev_attach_arg *uha = (struct uhidev_attach_arg *)aux;
struct usb_attach_arg *uaa = uha->uaa;
- int size, repid;
+ int size;
void *desc;
sc->sc_hdev.sc_intr = umstc_intr;
usbd_set_idle(uha->parent->sc_udev, uha->parent->sc_ifaceno, 0, 0);
uhidev_get_report_desc(uha->parent, &desc, &size);
- repid = uha->reportid;
- sc->sc_hdev.sc_isize = hid_report_size(desc, size, hid_input, repid);
- sc->sc_hdev.sc_osize = hid_report_size(desc, size, hid_output, repid);
- sc->sc_hdev.sc_fsize = hid_report_size(desc, size, hid_feature, repid);
+ sc->sc_hdev.sc_isize = uha->isize;
+ sc->sc_hdev.sc_osize = uha->osize;
+ sc->sc_hdev.sc_fsize = uha->fsize;
uhidev_open(&sc->sc_hdev);
-/* $OpenBSD: uwacom.c,v 1.2 2020/08/23 11:08:02 mglocker Exp $ */
+/* $OpenBSD: uwacom.c,v 1.3 2021/09/10 05:47:38 anton Exp $ */
/*
* Copyright (c) 2016 Frank Groeneveld <frank@frankgroeneveld.nl>
struct hidms *ms = &sc->sc_ms;
struct uhidev_attach_arg *uha = (struct uhidev_attach_arg *)aux;
struct usb_attach_arg *uaa = uha->uaa;
- int size, repid;
+ int size;
void *desc;
sc->sc_hdev.sc_intr = uwacom_intr;
usbd_set_idle(uha->parent->sc_udev, uha->parent->sc_ifaceno, 0, 0);
uhidev_get_report_desc(uha->parent, &desc, &size);
- repid = uha->reportid;
- sc->sc_hdev.sc_isize = hid_report_size(desc, size, hid_input, repid);
- sc->sc_hdev.sc_osize = hid_report_size(desc, size, hid_output, repid);
- sc->sc_hdev.sc_fsize = hid_report_size(desc, size, hid_feature, repid);
+ sc->sc_hdev.sc_isize = uha->isize;
+ sc->sc_hdev.sc_osize = uha->osize;
+ sc->sc_hdev.sc_fsize = uha->fsize;
ms->sc_device = self;
ms->sc_rawmode = 1;