summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorAnton Lindqvist <anton@cvs.openbsd.org>2021-11-15 15:36:25 +0000
committerAnton Lindqvist <anton@cvs.openbsd.org>2021-11-15 15:36:25 +0000
commit2e7327dcf520f7ecffd43f6afc352e8e7d4d4626 (patch)
tree5618bd32fc5d54cdab584a1ccdda2b6e4dc04596 /sys
parent5a93c8ec06b1efb5de2aaddafe4d83dc9e9bf711 (diff)
In preparation for once again trying the resolve the claim multiple
report ids conflict, extract the claim multiple report ids conditional in order to minimize the required upcoming changes to resolve the conflict. Tested by gnezdo@
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/usb/fido.c4
-rw-r--r--sys/dev/usb/ucycom.c4
-rw-r--r--sys/dev/usb/ugold.c4
-rw-r--r--sys/dev/usb/uhid.c4
-rw-r--r--sys/dev/usb/uhidev.c6
-rw-r--r--sys/dev/usb/uhidev.h7
-rw-r--r--sys/dev/usb/ujoy.c4
-rw-r--r--sys/dev/usb/umt.c4
-rw-r--r--sys/dev/usb/uoaklux.c4
-rw-r--r--sys/dev/usb/uoakrh.c4
-rw-r--r--sys/dev/usb/uoakv.c4
-rw-r--r--sys/dev/usb/upd.c4
-rw-r--r--sys/dev/usb/uslhcom.c4
-rw-r--r--sys/dev/usb/uthum.c4
-rw-r--r--sys/dev/usb/utrh.c4
-rw-r--r--sys/dev/usb/utwitch.c4
16 files changed, 36 insertions, 33 deletions
diff --git a/sys/dev/usb/fido.c b/sys/dev/usb/fido.c
index c6d846aaa84..c40257e4f0b 100644
--- a/sys/dev/usb/fido.c
+++ b/sys/dev/usb/fido.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fido.c,v 1.3 2021/03/08 14:35:57 jcs Exp $ */
+/* $OpenBSD: fido.c,v 1.4 2021/11/15 15:36:24 anton Exp $ */
/*
* Copyright (c) 2019 Reyk Floeter <reyk@openbsd.org>
@@ -63,7 +63,7 @@ fido_match(struct device *parent, void *match, void *aux)
void *desc;
int ret = UMATCH_NONE;
- if (uha->reportid == UHIDEV_CLAIM_MULTIPLE_REPORTID)
+ if (UHIDEV_CLAIM_MULTIPLE_REPORTID(uha))
return (ret);
/* Find the FIDO usage page and U2F collection */
diff --git a/sys/dev/usb/ucycom.c b/sys/dev/usb/ucycom.c
index ca8636f0a7f..cd1feaeedc0 100644
--- a/sys/dev/usb/ucycom.c
+++ b/sys/dev/usb/ucycom.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ucycom.c,v 1.39 2021/03/08 14:35:57 jcs Exp $ */
+/* $OpenBSD: ucycom.c,v 1.40 2021/11/15 15:36:24 anton Exp $ */
/* $NetBSD: ucycom.c,v 1.3 2005/08/05 07:27:47 skrll Exp $ */
/*
@@ -165,7 +165,7 @@ ucycom_match(struct device *parent, void *match, void *aux)
{
struct uhidev_attach_arg *uha = aux;
- if (uha->reportid == UHIDEV_CLAIM_MULTIPLE_REPORTID)
+ if (UHIDEV_CLAIM_MULTIPLE_REPORTID(uha))
return (UMATCH_NONE);
return (usb_lookup(ucycom_devs, uha->uaa->vendor, uha->uaa->product) != NULL ?
diff --git a/sys/dev/usb/ugold.c b/sys/dev/usb/ugold.c
index b83d8edd8e8..e90b1c54fcb 100644
--- a/sys/dev/usb/ugold.c
+++ b/sys/dev/usb/ugold.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ugold.c,v 1.19 2021/09/12 06:58:08 anton Exp $ */
+/* $OpenBSD: ugold.c,v 1.20 2021/11/15 15:36:24 anton Exp $ */
/*
* Copyright (c) 2013 Takayoshi SASANO <uaa@openbsd.org>
@@ -113,7 +113,7 @@ ugold_match(struct device *parent, void *match, void *aux)
int size;
void *desc;
- if (uha->reportid == UHIDEV_CLAIM_MULTIPLE_REPORTID)
+ if (UHIDEV_CLAIM_MULTIPLE_REPORTID(uha))
return (UMATCH_NONE);
if (usb_lookup(ugold_devs, uha->uaa->vendor, uha->uaa->product) == NULL)
diff --git a/sys/dev/usb/uhid.c b/sys/dev/usb/uhid.c
index 90a75d878e3..c5325f9c0a8 100644
--- a/sys/dev/usb/uhid.c
+++ b/sys/dev/usb/uhid.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uhid.c,v 1.87 2021/09/15 04:57:47 anton Exp $ */
+/* $OpenBSD: uhid.c,v 1.88 2021/11/15 15:36:24 anton Exp $ */
/* $NetBSD: uhid.c,v 1.57 2003/03/11 16:44:00 augustss Exp $ */
/*
@@ -115,7 +115,7 @@ uhid_match(struct device *parent, void *match, void *aux)
{
struct uhidev_attach_arg *uha = aux;
- if (uha->reportid == UHIDEV_CLAIM_MULTIPLE_REPORTID)
+ if (UHIDEV_CLAIM_MULTIPLE_REPORTID(uha))
return (UMATCH_NONE);
return (UMATCH_IFACECLASS_GENERIC);
diff --git a/sys/dev/usb/uhidev.c b/sys/dev/usb/uhidev.c
index 3ce1684893b..b50d4385a02 100644
--- a/sys/dev/usb/uhidev.c
+++ b/sys/dev/usb/uhidev.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uhidev.c,v 1.99 2021/11/11 07:04:45 anton Exp $ */
+/* $OpenBSD: uhidev.c,v 1.100 2021/11/15 15:36:24 anton Exp $ */
/* $NetBSD: uhidev.c,v 1.14 2003/03/11 16:44:00 augustss Exp $ */
/*
@@ -248,7 +248,7 @@ uhidev_attach(struct device *parent, struct device *self, void *aux)
uha.uaa = uaa;
uha.parent = sc;
- uha.reportid = UHIDEV_CLAIM_MULTIPLE_REPORTID;
+ uha.reportid = __UHIDEV_CLAIM_MULTIPLE_REPORTID;
uha.nreports = nrepid;
uha.claimed = malloc(nrepid, M_TEMP, M_WAITOK|M_ZERO);
@@ -360,7 +360,7 @@ uhidevprint(void *aux, const char *pnp)
if (pnp)
printf("uhid at %s", pnp);
- if (uha->reportid != 0 && uha->reportid != UHIDEV_CLAIM_MULTIPLE_REPORTID)
+ if (uha->reportid != 0 && uha->reportid != __UHIDEV_CLAIM_MULTIPLE_REPORTID)
printf(" reportid %d", uha->reportid);
return (UNCONF);
}
diff --git a/sys/dev/usb/uhidev.h b/sys/dev/usb/uhidev.h
index b2b7608b083..aa315c16582 100644
--- a/sys/dev/usb/uhidev.h
+++ b/sys/dev/usb/uhidev.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: uhidev.h,v 1.37 2021/11/11 07:04:45 anton Exp $ */
+/* $OpenBSD: uhidev.h,v 1.38 2021/11/15 15:36:24 anton Exp $ */
/* $NetBSD: uhidev.h,v 1.3 2002/10/08 09:56:17 dan Exp $ */
/*
@@ -75,11 +75,14 @@ struct uhidev_attach_arg {
struct usb_attach_arg *uaa;
struct uhidev_softc *parent;
uint8_t reportid;
-#define UHIDEV_CLAIM_MULTIPLE_REPORTID 255
uint8_t nreports;
uint8_t *claimed;
};
+#define UHIDEV_CLAIM_MULTIPLE_REPORTID(u) \
+ ((u)->reportid == __UHIDEV_CLAIM_MULTIPLE_REPORTID)
+#define __UHIDEV_CLAIM_MULTIPLE_REPORTID 255 /* XXX */
+
int uhidev_report_type_conv(int);
void uhidev_get_report_desc(struct uhidev_softc *, void **, int *);
int uhidev_open(struct uhidev *);
diff --git a/sys/dev/usb/ujoy.c b/sys/dev/usb/ujoy.c
index ca461e5969a..ce02e1fb964 100644
--- a/sys/dev/usb/ujoy.c
+++ b/sys/dev/usb/ujoy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ujoy.c,v 1.2 2021/03/08 14:35:57 jcs Exp $ */
+/* $OpenBSD: ujoy.c,v 1.3 2021/11/15 15:36:24 anton Exp $ */
/*
* Copyright (c) 2021 Thomas Frohwein <thfr@openbsd.org>
@@ -104,7 +104,7 @@ ujoy_match(struct device *parent, void *match, void *aux)
void *desc;
int ret = UMATCH_NONE;
- if (uha->reportid == UHIDEV_CLAIM_MULTIPLE_REPORTID)
+ if (UHIDEV_CLAIM_MULTIPLE_REPORTID(uha))
return (ret);
/* Find the general usage page and gamecontroller collections */
diff --git a/sys/dev/usb/umt.c b/sys/dev/usb/umt.c
index 3aa45bf298a..44a903f23c7 100644
--- a/sys/dev/usb/umt.c
+++ b/sys/dev/usb/umt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: umt.c,v 1.4 2021/03/24 02:49:57 jcs Exp $ */
+/* $OpenBSD: umt.c,v 1.5 2021/11/15 15:36:24 anton Exp $ */
/*
* USB multitouch touchpad driver for devices conforming to
* Windows Precision Touchpad standard
@@ -90,7 +90,7 @@ umt_match(struct device *parent, void *match, void *aux)
int size;
void *desc;
- if (uha->reportid == UHIDEV_CLAIM_MULTIPLE_REPORTID) {
+ if (UHIDEV_CLAIM_MULTIPLE_REPORTID(uha)) {
uhidev_get_report_desc(uha->parent, &desc, &size);
if (umt_find_winptp_reports(uha->parent, desc, size, &input,
&conf, &cap)) {
diff --git a/sys/dev/usb/uoaklux.c b/sys/dev/usb/uoaklux.c
index c97bdf57285..cde56d5b2ea 100644
--- a/sys/dev/usb/uoaklux.c
+++ b/sys/dev/usb/uoaklux.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uoaklux.c,v 1.14 2021/03/08 14:35:57 jcs Exp $ */
+/* $OpenBSD: uoaklux.c,v 1.15 2021/11/15 15:36:24 anton Exp $ */
/*
* Copyright (c) 2012 Yojiro UO <yuo@nui.org>
@@ -107,7 +107,7 @@ uoaklux_match(struct device *parent, void *match, void *aux)
{
struct uhidev_attach_arg *uha = aux;
- if (uha->reportid == UHIDEV_CLAIM_MULTIPLE_REPORTID)
+ if (UHIDEV_CLAIM_MULTIPLE_REPORTID(uha))
return (UMATCH_NONE);
if (uoaklux_lookup(uha->uaa->vendor, uha->uaa->product) == NULL)
diff --git a/sys/dev/usb/uoakrh.c b/sys/dev/usb/uoakrh.c
index 1e1e49a426c..beb324eb7c0 100644
--- a/sys/dev/usb/uoakrh.c
+++ b/sys/dev/usb/uoakrh.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uoakrh.c,v 1.16 2021/03/08 14:35:57 jcs Exp $ */
+/* $OpenBSD: uoakrh.c,v 1.17 2021/11/15 15:36:24 anton Exp $ */
/*
* Copyright (c) 2012 Yojiro UO <yuo@nui.org>
@@ -110,7 +110,7 @@ uoakrh_match(struct device *parent, void *match, void *aux)
{
struct uhidev_attach_arg *uha = aux;
- if (uha->reportid == UHIDEV_CLAIM_MULTIPLE_REPORTID)
+ if (UHIDEV_CLAIM_MULTIPLE_REPORTID(uha))
return (UMATCH_NONE);
if (uoakrh_lookup(uha->uaa->vendor, uha->uaa->product) == NULL)
diff --git a/sys/dev/usb/uoakv.c b/sys/dev/usb/uoakv.c
index 2963e47da0d..72588c49042 100644
--- a/sys/dev/usb/uoakv.c
+++ b/sys/dev/usb/uoakv.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uoakv.c,v 1.14 2021/03/08 14:35:57 jcs Exp $ */
+/* $OpenBSD: uoakv.c,v 1.15 2021/11/15 15:36:24 anton Exp $ */
/*
* Copyright (c) 2012 Yojiro UO <yuo@nui.org>
@@ -110,7 +110,7 @@ uoakv_match(struct device *parent, void *match, void *aux)
{
struct uhidev_attach_arg *uha = aux;
- if (uha->reportid == UHIDEV_CLAIM_MULTIPLE_REPORTID)
+ if (UHIDEV_CLAIM_MULTIPLE_REPORTID(uha))
return (UMATCH_NONE);
if (uoakv_lookup(uha->uaa->vendor, uha->uaa->product) == NULL)
diff --git a/sys/dev/usb/upd.c b/sys/dev/usb/upd.c
index b4eb6f9bb31..c65ef9f54cd 100644
--- a/sys/dev/usb/upd.c
+++ b/sys/dev/usb/upd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: upd.c,v 1.30 2021/08/06 17:46:45 abieber Exp $ */
+/* $OpenBSD: upd.c,v 1.31 2021/11/15 15:36:24 anton Exp $ */
/*
* Copyright (c) 2015 David Higgs <higgsd@gmail.com>
@@ -155,7 +155,7 @@ upd_match(struct device *parent, void *match, void *aux)
int ret = UMATCH_NONE;
int i;
- if (uha->reportid != UHIDEV_CLAIM_MULTIPLE_REPORTID)
+ if (!UHIDEV_CLAIM_MULTIPLE_REPORTID(uha))
return (ret);
DPRINTF(("upd: vendor=0x%04x, product=0x%04x\n", uha->uaa->vendor,
diff --git a/sys/dev/usb/uslhcom.c b/sys/dev/usb/uslhcom.c
index 15291aae645..e818205d755 100644
--- a/sys/dev/usb/uslhcom.c
+++ b/sys/dev/usb/uslhcom.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uslhcom.c,v 1.7 2021/03/08 14:35:57 jcs Exp $ */
+/* $OpenBSD: uslhcom.c,v 1.8 2021/11/15 15:36:24 anton Exp $ */
/*
* Copyright (c) 2015 SASANO Takayoshi <uaa@openbsd.org>
@@ -115,7 +115,7 @@ uslhcom_match(struct device *parent, void *match, void *aux)
struct uhidev_attach_arg *uha = aux;
/* use all report IDs */
- if (uha->reportid != UHIDEV_CLAIM_MULTIPLE_REPORTID)
+ if (!UHIDEV_CLAIM_MULTIPLE_REPORTID(uha))
return UMATCH_NONE;
return (usb_lookup(uslhcom_devs,
diff --git a/sys/dev/usb/uthum.c b/sys/dev/usb/uthum.c
index 280cb177ecf..e1a288645ed 100644
--- a/sys/dev/usb/uthum.c
+++ b/sys/dev/usb/uthum.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uthum.c,v 1.36 2021/10/26 16:49:12 matthieu Exp $ */
+/* $OpenBSD: uthum.c,v 1.37 2021/11/15 15:36:24 anton Exp $ */
/*
* Copyright (c) 2009, 2010 Yojiro UO <yuo@nui.org>
@@ -168,7 +168,7 @@ uthum_match(struct device *parent, void *match, void *aux)
{
struct uhidev_attach_arg *uha = aux;
- if (uha->reportid == UHIDEV_CLAIM_MULTIPLE_REPORTID)
+ if (UHIDEV_CLAIM_MULTIPLE_REPORTID(uha))
return (UMATCH_NONE);
if (uthum_lookup(uha->uaa->vendor, uha->uaa->product) == NULL)
diff --git a/sys/dev/usb/utrh.c b/sys/dev/usb/utrh.c
index c74ca0746ca..32badfc9c2b 100644
--- a/sys/dev/usb/utrh.c
+++ b/sys/dev/usb/utrh.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: utrh.c,v 1.24 2021/03/08 14:35:57 jcs Exp $ */
+/* $OpenBSD: utrh.c,v 1.25 2021/11/15 15:36:24 anton Exp $ */
/*
* Copyright (c) 2009 Yojiro UO <yuo@nui.org>
@@ -93,7 +93,7 @@ utrh_match(struct device *parent, void *match, void *aux)
{
struct uhidev_attach_arg *uha = aux;
- if (uha->reportid == UHIDEV_CLAIM_MULTIPLE_REPORTID)
+ if (UHIDEV_CLAIM_MULTIPLE_REPORTID(uha))
return (UMATCH_NONE);
return (usb_lookup(utrh_devs, uha->uaa->vendor, uha->uaa->product) != NULL ?
diff --git a/sys/dev/usb/utwitch.c b/sys/dev/usb/utwitch.c
index a7a5479700f..1a1ff0cbc97 100644
--- a/sys/dev/usb/utwitch.c
+++ b/sys/dev/usb/utwitch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: utwitch.c,v 1.21 2021/03/08 14:35:57 jcs Exp $ */
+/* $OpenBSD: utwitch.c,v 1.22 2021/11/15 15:36:24 anton Exp $ */
/*
* Copyright (c) 2010 Yojiro UO <yuo@nui.org>
@@ -107,7 +107,7 @@ utwitch_match(struct device *parent, void *match, void *aux)
{
struct uhidev_attach_arg *uha = aux;
- if (uha->reportid == UHIDEV_CLAIM_MULTIPLE_REPORTID)
+ if (UHIDEV_CLAIM_MULTIPLE_REPORTID(uha))
return (UMATCH_NONE);
return (usb_lookup(utwitch_devs, uha->uaa->vendor, uha->uaa->product) != NULL ?