for as of now unknown reasons.
-/* $OpenBSD: ucc.c,v 1.25 2021/09/10 05:47:38 anton Exp $ */
+/* $OpenBSD: ucc.c,v 1.26 2021/09/12 06:58:08 anton Exp $ */
/*
* Copyright (c) 2021 Anton Lindqvist <anton@openbsd.org>
void *desc;
int size;
- if (uha->isize == 0)
- return UMATCH_NONE;
uhidev_get_report_desc(uha->parent, &desc, &size);
+ if (hid_report_size(desc, size, hid_input, uha->reportid) == 0)
+ return UMATCH_NONE;
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, size;
+ int error, repid, 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);
- sc->sc_hdev.sc_isize = uha->isize;
- sc->sc_hdev.sc_osize = uha->osize;
- sc->sc_hdev.sc_fsize = uha->fsize;
+ 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);
error = ucc_hid_parse(sc, desc, size);
if (error) {
-/* $OpenBSD: ugold.c,v 1.18 2021/09/10 05:47:38 anton Exp $ */
+/* $OpenBSD: ugold.c,v 1.19 2021/09/12 06:58:08 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;
+ int size, repid;
void *desc;
sc->sc_udev = uha->parent->sc_udev;
}
uhidev_get_report_desc(uha->parent, &desc, &size);
- sc->sc_hdev.sc_isize = uha->isize;
- sc->sc_hdev.sc_osize = uha->osize;
- sc->sc_hdev.sc_fsize = uha->fsize;
+ 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);
if (uhidev_open(&sc->sc_hdev)) {
printf(", unable to open interrupt pipe\n");
-/* $OpenBSD: uhid.c,v 1.85 2021/09/10 05:47:38 anton Exp $ */
+/* $OpenBSD: uhid.c,v 1.86 2021/09/12 06:58:08 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;
+ int size, repid;
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);
- sc->sc_hdev.sc_isize = uha->isize;
- sc->sc_hdev.sc_osize = uha->osize;
- sc->sc_hdev.sc_fsize = uha->fsize;
+ 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);
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.94 2021/09/10 05:47:38 anton Exp $ */
+/* $OpenBSD: uhidev.c,v 1.95 2021/09/12 06:58:08 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 ((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)
+ 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)
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.31 2021/09/10 05:48:43 anton Exp $ */
+/* $OpenBSD: uhidev.h,v 1.32 2021/09/12 06:58:08 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.83 2021/09/10 05:47:38 anton Exp $ */
+/* $OpenBSD: ukbd.c,v 1.84 2021/09/12 06:58:08 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 = uha->isize;
- sc->sc_hdev.sc_osize = uha->osize;
- sc->sc_hdev.sc_fsize = uha->fsize;
+ 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);
/*
* Since the HID-Proxy is always detected before any
-/* $OpenBSD: ums.c,v 1.49 2021/09/10 05:47:38 anton Exp $ */
+/* $OpenBSD: ums.c,v 1.50 2021/09/12 06:58:08 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;
+ int size, repid;
void *desc;
u_int32_t qflags = 0;
if (uaa->vendor == USB_VENDOR_ELECOM)
ums_fix_elecom_descriptor(sc, desc, size, uaa->product);
- sc->sc_hdev.sc_isize = uha->isize;
- sc->sc_hdev.sc_osize = uha->osize;
- sc->sc_hdev.sc_fsize = uha->fsize;
+ 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);
if (sc->sc_quirks & UQ_MS_REVZ)
qflags |= HIDMS_REVZ;
-/* $OpenBSD: umstc.c,v 1.5 2021/09/10 05:47:38 anton Exp $ */
+/* $OpenBSD: umstc.c,v 1.6 2021/09/12 06:58:08 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;
+ int size, repid;
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);
- sc->sc_hdev.sc_isize = uha->isize;
- sc->sc_hdev.sc_osize = uha->osize;
- sc->sc_hdev.sc_fsize = uha->fsize;
+ 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);
uhidev_open(&sc->sc_hdev);
-/* $OpenBSD: uwacom.c,v 1.3 2021/09/10 05:47:38 anton Exp $ */
+/* $OpenBSD: uwacom.c,v 1.4 2021/09/12 06:58:08 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;
+ int size, repid;
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);
- sc->sc_hdev.sc_isize = uha->isize;
- sc->sc_hdev.sc_osize = uha->osize;
- sc->sc_hdev.sc_fsize = uha->fsize;
+ 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);
ms->sc_device = self;
ms->sc_rawmode = 1;