Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/usb usbdi(9): Nix resurrected usbd_request_async.



details:   https://anonhg.NetBSD.org/src/rev/2c0d7813d8f3
branches:  trunk
changeset: 369490:2c0d7813d8f3
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sat Aug 20 11:32:20 2022 +0000

description:
usbdi(9): Nix resurrected usbd_request_async.

We killed this back in 2013, but it came back from the dead on a
driver imported from OpenBSD.

diffstat:

 sys/dev/usb/usbdi.c |  35 ++---------------------------------
 sys/dev/usb/usbdi.h |   4 +---
 2 files changed, 3 insertions(+), 36 deletions(-)

diffs (81 lines):

diff -r e60029e5e401 -r 2c0d7813d8f3 sys/dev/usb/usbdi.c
--- a/sys/dev/usb/usbdi.c       Sat Aug 20 11:32:08 2022 +0000
+++ b/sys/dev/usb/usbdi.c       Sat Aug 20 11:32:20 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: usbdi.c,v 1.242 2022/04/06 22:01:45 mlelstv Exp $      */
+/*     $NetBSD: usbdi.c,v 1.243 2022/08/20 11:32:20 riastradh Exp $    */
 
 /*
  * Copyright (c) 1998, 2012, 2015 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.242 2022/04/06 22:01:45 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.243 2022/08/20 11:32:20 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -137,7 +137,6 @@
 static void usbd_free_buffer(struct usbd_xfer *);
 static struct usbd_xfer *usbd_alloc_xfer(struct usbd_device *, unsigned int);
 static void usbd_free_xfer(struct usbd_xfer *);
-static void usbd_request_async_cb(struct usbd_xfer *, void *, usbd_status);
 static void usbd_xfer_timeout(void *);
 static void usbd_xfer_timeout_task(void *);
 static bool usbd_xfer_probe_timeout(struct usbd_xfer *);
@@ -1333,36 +1332,6 @@
        return err;
 }
 
-static void
-usbd_request_async_cb(struct usbd_xfer *xfer, void *priv, usbd_status status)
-{
-       usbd_destroy_xfer(xfer);
-}
-
-/*
- * Execute a request without waiting for completion.
- * Can be used from interrupt context.
- */
-usbd_status
-usbd_request_async(struct usbd_device *dev, struct usbd_xfer *xfer,
-    usb_device_request_t *req, void *priv, usbd_callback callback)
-{
-       usbd_status err;
-
-       if (callback == NULL)
-               callback = usbd_request_async_cb;
-
-       usbd_setup_default_xfer(xfer, dev, priv,
-           USBD_DEFAULT_TIMEOUT, req, NULL, UGETW(req->wLength), 0,
-           callback);
-       err = usbd_transfer(xfer);
-       if (err != USBD_IN_PROGRESS) {
-               usbd_destroy_xfer(xfer);
-               return (err);
-       }
-       return (USBD_NORMAL_COMPLETION);
-}
-
 const struct usbd_quirks *
 usbd_get_quirks(struct usbd_device *dev)
 {
diff -r e60029e5e401 -r 2c0d7813d8f3 sys/dev/usb/usbdi.h
--- a/sys/dev/usb/usbdi.h       Sat Aug 20 11:32:08 2022 +0000
+++ b/sys/dev/usb/usbdi.h       Sat Aug 20 11:32:20 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: usbdi.h,v 1.107 2022/03/03 06:09:33 riastradh Exp $    */
+/*     $NetBSD: usbdi.h,v 1.108 2022/08/20 11:32:20 riastradh Exp $    */
 /*     $FreeBSD: src/sys/dev/usb/usbdi.h,v 1.18 1999/11/17 22:33:49 n_hibma Exp $      */
 
 /*
@@ -146,8 +146,6 @@
 usbd_status usbd_sync_transfer_sig(struct usbd_xfer *);
 
 usbd_status usbd_do_request(struct usbd_device *, usb_device_request_t *, void *);
-usbd_status usbd_request_async(struct usbd_device *, struct usbd_xfer *,
-    usb_device_request_t *, void *, usbd_callback);
 usbd_status usbd_do_request_flags(struct usbd_device *, usb_device_request_t *,
     void *, uint16_t, int *, uint32_t);
 usbd_status usbd_do_request_len(struct usbd_device *dev,



Home | Main Index | Thread Index | Old Index