Module Name: src Committed By: riastradh Date: Mon Mar 28 12:43:22 UTC 2022
Modified Files: src/sys/dev/usb: uhidev.c uhidev.h Log Message: uhidev(9): Move struct uhidev_softc into uhidev.c. No longer part of any ABI for uhidev modules. To generate a diff of this commit: cvs rdiff -u -r1.84 -r1.85 src/sys/dev/usb/uhidev.c cvs rdiff -u -r1.23 -r1.24 src/sys/dev/usb/uhidev.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/usb/uhidev.c diff -u src/sys/dev/usb/uhidev.c:1.84 src/sys/dev/usb/uhidev.c:1.85 --- src/sys/dev/usb/uhidev.c:1.84 Mon Mar 28 12:43:03 2022 +++ src/sys/dev/usb/uhidev.c Mon Mar 28 12:43:22 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: uhidev.c,v 1.84 2022/03/28 12:43:03 riastradh Exp $ */ +/* $NetBSD: uhidev.c,v 1.85 2022/03/28 12:43:22 riastradh Exp $ */ /* * Copyright (c) 2001, 2012 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: uhidev.c,v 1.84 2022/03/28 12:43:03 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uhidev.c,v 1.85 2022/03/28 12:43:22 riastradh Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -74,6 +74,46 @@ __KERNEL_RCSID(0, "$NetBSD: uhidev.c,v 1 #include "locators.h" +struct uhidev_softc { + device_t sc_dev; /* base device */ + struct usbd_device *sc_udev; + struct usbd_interface *sc_iface; /* interface */ + int sc_iep_addr; + int sc_oep_addr; + u_int sc_isize; + + int sc_repdesc_size; + void *sc_repdesc; + + u_int sc_nrepid; + device_t *sc_subdevs; + + kmutex_t sc_lock; + kcondvar_t sc_cv; + + /* Read/written under sc_lock. */ + struct lwp *sc_writelock; + struct lwp *sc_configlock; + int sc_refcnt; + int sc_writereportid; + u_char sc_dying; + + /* + * - Read under sc_lock, provided sc_refcnt > 0. + * - Written under sc_configlock only when transitioning to and + * from sc_refcnt = 0. + */ + u_char *sc_ibuf; + struct usbd_pipe *sc_ipipe; /* input interrupt pipe */ + struct usbd_pipe *sc_opipe; /* output interrupt pipe */ + struct usbd_xfer *sc_oxfer; /* write request */ + usbd_callback sc_writecallback; /* async write request callback */ + void *sc_writecookie; + + u_int sc_flags; +#define UHIDEV_F_XB1 0x0001 /* Xbox 1 controller */ +}; + #ifdef UHIDEV_DEBUG #define DPRINTF(x) if (uhidevdebug) printf x #define DPRINTFN(n,x) if (uhidevdebug>(n)) printf x Index: src/sys/dev/usb/uhidev.h diff -u src/sys/dev/usb/uhidev.h:1.23 src/sys/dev/usb/uhidev.h:1.24 --- src/sys/dev/usb/uhidev.h:1.23 Mon Mar 28 12:43:03 2022 +++ src/sys/dev/usb/uhidev.h Mon Mar 28 12:43:22 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: uhidev.h,v 1.23 2022/03/28 12:43:03 riastradh Exp $ */ +/* $NetBSD: uhidev.h,v 1.24 2022/03/28 12:43:22 riastradh Exp $ */ /* * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -35,46 +35,6 @@ #include <sys/rndsource.h> -struct uhidev_softc { - device_t sc_dev; /* base device */ - struct usbd_device *sc_udev; - struct usbd_interface *sc_iface; /* interface */ - int sc_iep_addr; - int sc_oep_addr; - u_int sc_isize; - - int sc_repdesc_size; - void *sc_repdesc; - - u_int sc_nrepid; - device_t *sc_subdevs; - - kmutex_t sc_lock; - kcondvar_t sc_cv; - - /* Read/written under sc_lock. */ - struct lwp *sc_writelock; - struct lwp *sc_configlock; - int sc_refcnt; - int sc_writereportid; - u_char sc_dying; - - /* - * - Read under sc_lock, provided sc_refcnt > 0. - * - Written under sc_configlock only when transitioning to and - * from sc_refcnt = 0. - */ - u_char *sc_ibuf; - struct usbd_pipe *sc_ipipe; /* input interrupt pipe */ - struct usbd_pipe *sc_opipe; /* output interrupt pipe */ - struct usbd_xfer *sc_oxfer; /* write request */ - usbd_callback sc_writecallback; /* async write request callback */ - void *sc_writecookie; - - u_int sc_flags; -#define UHIDEV_F_XB1 0x0001 /* Xbox 1 controller */ -}; - struct uhidev { device_t sc_dev; /* base device */ struct uhidev_softc *sc_parent;