From: jmatthew Date: Mon, 9 Aug 2021 07:21:48 +0000 (+0000) Subject: Fix up flags passed to usbd_open_pipe_intr() - interrupt pipes are always X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=9d477d6878dc9e2b0fb0d7bc6248ea2e41e08c94;p=openbsd Fix up flags passed to usbd_open_pipe_intr() - interrupt pipes are always opened exclusively, and the flags argument is passed to usbd_setup_xfer(). USBD_EXCLUSIVE_USE has the same value as USBD_NO_COPY, which means that data transferred would not be copied to the buffer where the driver expects it. None of these drivers actually used the interrupt data for anything, and in some the interrupt pipe code was #if 0'd out, so this doesn't change anything, but fixing this up prevents unwary developers like me from copying code that doesn't work. ok mglocker@ --- diff --git a/sys/dev/usb/if_aue.c b/sys/dev/usb/if_aue.c index 79444195935..b77a11ec5ce 100644 --- a/sys/dev/usb/if_aue.c +++ b/sys/dev/usb/if_aue.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_aue.c,v 1.111 2020/07/31 10:49:32 mglocker Exp $ */ +/* $OpenBSD: if_aue.c,v 1.112 2021/08/09 07:21:48 jmatthew Exp $ */ /* $NetBSD: if_aue.c,v 1.82 2003/03/05 17:37:36 shiba Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000 @@ -1355,7 +1355,7 @@ aue_openpipes(struct aue_softc *sc) return (EIO); } err = usbd_open_pipe_intr(sc->aue_iface, sc->aue_ed[AUE_ENDPT_INTR], - USBD_EXCLUSIVE_USE, &sc->aue_ep[AUE_ENDPT_INTR], sc, + 0, &sc->aue_ep[AUE_ENDPT_INTR], sc, &sc->aue_cdata.aue_ibuf, AUE_INTR_PKTLEN, aue_intr, AUE_INTR_INTERVAL); if (err) { diff --git a/sys/dev/usb/if_udav.c b/sys/dev/usb/if_udav.c index d2a9cba551f..156ddde4639 100644 --- a/sys/dev/usb/if_udav.c +++ b/sys/dev/usb/if_udav.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_udav.c,v 1.84 2020/07/31 10:49:32 mglocker Exp $ */ +/* $OpenBSD: if_udav.c,v 1.85 2021/08/09 07:21:48 jmatthew Exp $ */ /* $NetBSD: if_udav.c,v 1.3 2004/04/23 17:25:25 itojun Exp $ */ /* $nabe: if_udav.c,v 1.3 2003/08/21 16:57:19 nabe Exp $ */ /* @@ -769,7 +769,7 @@ udav_openpipes(struct udav_softc *sc) /* XXX: interrupt endpoint is not yet supported */ /* Open Interrupt pipe */ err = usbd_open_pipe_intr(sc->sc_ctl_iface, sc->sc_intrin_no, - USBD_EXCLUSIVE_USE, &sc->sc_pipe_intr, sc, + 0, &sc->sc_pipe_intr, sc, &sc->sc_cdata.udav_ibuf, UDAV_INTR_PKGLEN, udav_intr, UDAV_INTR_INTERVAL); if (err) { diff --git a/sys/dev/usb/if_ugl.c b/sys/dev/usb/if_ugl.c index 73fa329987c..83055849db0 100644 --- a/sys/dev/usb/if_ugl.c +++ b/sys/dev/usb/if_ugl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ugl.c,v 1.26 2020/07/31 10:49:32 mglocker Exp $ */ +/* $OpenBSD: if_ugl.c,v 1.27 2021/08/09 07:21:48 jmatthew Exp $ */ /* $NetBSD: if_upl.c,v 1.19 2002/07/11 21:14:26 augustss Exp $ */ /* * Copyright (c) 2013 SASANO Takayoshi @@ -681,7 +681,7 @@ ugl_openpipes(struct ugl_softc *sc) return (EIO); } err = usbd_open_pipe_intr(sc->sc_iface, sc->sc_ed[UGL_ENDPT_INTR], - USBD_EXCLUSIVE_USE, &sc->sc_ep[UGL_ENDPT_INTR], sc, + 0, &sc->sc_ep[UGL_ENDPT_INTR], sc, sc->sc_ibuf, UGL_INTR_PKTLEN, ugl_intr, UGL_INTR_INTERVAL); if (err) { diff --git a/sys/dev/usb/if_upl.c b/sys/dev/usb/if_upl.c index f095d8d598c..296d5bde489 100644 --- a/sys/dev/usb/if_upl.c +++ b/sys/dev/usb/if_upl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_upl.c,v 1.78 2020/07/31 10:49:32 mglocker Exp $ */ +/* $OpenBSD: if_upl.c,v 1.79 2021/08/09 07:21:48 jmatthew Exp $ */ /* $NetBSD: if_upl.c,v 1.19 2002/07/11 21:14:26 augustss Exp $ */ /* * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -661,7 +661,7 @@ upl_openpipes(struct upl_softc *sc) return (EIO); } err = usbd_open_pipe_intr(sc->sc_iface, sc->sc_ed[UPL_ENDPT_INTR], - USBD_EXCLUSIVE_USE, &sc->sc_ep[UPL_ENDPT_INTR], sc, + 0, &sc->sc_ep[UPL_ENDPT_INTR], sc, &sc->sc_ibuf, UPL_INTR_PKTLEN, upl_intr, UPL_INTR_INTERVAL); if (err) { diff --git a/sys/dev/usb/if_url.c b/sys/dev/usb/if_url.c index 9dd96117492..a368914b0d0 100644 --- a/sys/dev/usb/if_url.c +++ b/sys/dev/usb/if_url.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_url.c,v 1.88 2020/07/31 10:49:33 mglocker Exp $ */ +/* $OpenBSD: if_url.c,v 1.89 2021/08/09 07:21:48 jmatthew Exp $ */ /* $NetBSD: if_url.c,v 1.6 2002/09/29 10:19:21 martin Exp $ */ /* * Copyright (c) 2001, 2002 @@ -635,7 +635,7 @@ url_openpipes(struct url_softc *sc) /* XXX: interrupt endpoint is not yet supported */ /* Open Interrupt pipe */ err = usbd_open_pipe_intr(sc->sc_ctl_iface, sc->sc_intrin_no, - USBD_EXCLUSIVE_USE, &sc->sc_pipe_intr, sc, + 0, &sc->sc_pipe_intr, sc, &sc->sc_cdata.url_ibuf, URL_INTR_PKGLEN, url_intr, URL_INTR_INTERVAL); if (err) { diff --git a/sys/dev/usb/if_wi_usb.c b/sys/dev/usb/if_wi_usb.c index 359b4b77e2c..953ab382ce1 100644 --- a/sys/dev/usb/if_wi_usb.c +++ b/sys/dev/usb/if_wi_usb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_wi_usb.c,v 1.73 2020/07/31 10:49:33 mglocker Exp $ */ +/* $OpenBSD: if_wi_usb.c,v 1.74 2021/08/09 07:21:48 jmatthew Exp $ */ /* * Copyright (c) 2003 Dale Rahn. All rights reserved. @@ -1233,7 +1233,7 @@ wi_usb_open_pipes(struct wi_usb_softc *sc) /* is this used? */ err = usbd_open_pipe_intr(sc->wi_usb_iface, - sc->wi_usb_ed[WI_USB_ENDPT_INTR], USBD_EXCLUSIVE_USE, + sc->wi_usb_ed[WI_USB_ENDPT_INTR], 0, &sc->wi_usb_ep[WI_USB_ENDPT_INTR], sc, &sc->wi_usb_ibuf, WI_USB_INTR_PKTLEN, wi_usb_intr, WI_USB_INTR_INTERVAL); if (err) {