Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/usb Put the ioctl definitions in a header, and insta...



details:   https://anonhg.NetBSD.org/src/rev/504e7a5ded7b
branches:  trunk
changeset: 1008694:504e7a5ded7b
user:      maxv <maxv%NetBSD.org@localhost>
date:      Tue Mar 31 16:28:28 2020 +0000

description:
Put the ioctl definitions in a header, and install it.

diffstat:

 distrib/sets/lists/comp/mi |   3 +-
 sys/dev/usb/Makefile       |   4 +-
 sys/dev/usb/vhci.c         |  31 ++-----------------------
 sys/dev/usb/vhci.h         |  56 ++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 63 insertions(+), 31 deletions(-)

diffs (153 lines):

diff -r 400daa0aa87b -r 504e7a5ded7b distrib/sets/lists/comp/mi
--- a/distrib/sets/lists/comp/mi        Tue Mar 31 16:17:32 2020 +0000
+++ b/distrib/sets/lists/comp/mi        Tue Mar 31 16:28:28 2020 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: mi,v 1.2316 2020/03/25 18:45:42 kre Exp $
+#      $NetBSD: mi,v 1.2317 2020/03/31 16:28:28 maxv Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 ./etc/mtree/set.comp                           comp-sys-root
@@ -762,6 +762,7 @@
 ./usr/include/dev/usb/usbdevs.h                        comp-obsolete           obsolete
 ./usr/include/dev/usb/usbhid.h                 comp-c-include
 ./usr/include/dev/usb/utoppy.h                 comp-c-include
+./usr/include/dev/usb/vhci.h                   comp-c-include
 ./usr/include/dev/vinum/request.h              comp-obsolete           obsolete
 ./usr/include/dev/vinum/statetexts.h           comp-obsolete           obsolete
 ./usr/include/dev/vinum/vinumext.h             comp-obsolete           obsolete
diff -r 400daa0aa87b -r 504e7a5ded7b sys/dev/usb/Makefile
--- a/sys/dev/usb/Makefile      Tue Mar 31 16:17:32 2020 +0000
+++ b/sys/dev/usb/Makefile      Tue Mar 31 16:28:28 2020 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.11 2020/01/29 21:52:16 mlelstv Exp $
+#      $NetBSD: Makefile,v 1.12 2020/03/31 16:28:28 maxv Exp $
 
 # use 'make -f Makefile.usbdevs' to make usbdevs.h and usbdevs_data.h
 # _after_ you committed usbdevs. See comment in Makefile.usbdevs
@@ -6,6 +6,6 @@
 INCSDIR= /usr/include/dev/usb
 
 # Only install includes which are used by userland
-INCS=  if_umbreg.h mbim.h ukyopon.h usb.h usbhid.h utoppy.h
+INCS=  if_umbreg.h mbim.h ukyopon.h usb.h usbhid.h utoppy.h vhci.h
 
 .include <bsd.kinc.mk>
diff -r 400daa0aa87b -r 504e7a5ded7b sys/dev/usb/vhci.c
--- a/sys/dev/usb/vhci.c        Tue Mar 31 16:17:32 2020 +0000
+++ b/sys/dev/usb/vhci.c        Tue Mar 31 16:28:28 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vhci.c,v 1.14 2020/03/31 16:17:32 maxv Exp $ */
+/*     $NetBSD: vhci.c,v 1.15 2020/03/31 16:28:28 maxv Exp $ */
 
 /*
  * Copyright (c) 2019-2020 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vhci.c,v 1.14 2020/03/31 16:17:32 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vhci.c,v 1.15 2020/03/31 16:28:28 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -61,6 +61,7 @@
 #include <dev/usb/usbdivar.h>
 
 #include <dev/usb/usbroothub.h>
+#include <dev/usb/vhci.h>
 
 #ifdef VHCI_DEBUG
 #define DPRINTF(fmt, ...)      printf(fmt, __VA_ARGS__)
@@ -816,32 +817,6 @@
 
 /* -------------------------------------------------------------------------- */
 
-struct vhci_ioc_get_info {
-       /* General. */
-       size_t nports;
-
-       /* Current port. */
-       u_int port;
-       int status;
-
-       /* Current addr. */
-       uint8_t addr;
-};
-
-struct vhci_ioc_set_port {
-       u_int port;
-};
-
-struct vhci_ioc_set_addr {
-       uint8_t addr;
-};
-
-#define VHCI_IOC_GET_INFO      _IOR('V', 0, struct vhci_ioc_get_info)
-#define VHCI_IOC_SET_PORT      _IOW('V', 1, struct vhci_ioc_set_port)
-#define VHCI_IOC_SET_ADDR      _IOW('V', 2, struct vhci_ioc_set_addr)
-#define VHCI_IOC_USB_ATTACH    _IO ('V', 10)
-#define VHCI_IOC_USB_DETACH    _IO ('V', 11)
-
 static int
 vhci_usb_attach(vhci_fd_t *vfd)
 {
diff -r 400daa0aa87b -r 504e7a5ded7b sys/dev/usb/vhci.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/dev/usb/vhci.h        Tue Mar 31 16:28:28 2020 +0000
@@ -0,0 +1,56 @@
+/*     $NetBSD: vhci.h,v 1.1 2020/03/31 16:28:28 maxv Exp $ */
+
+/*
+ * Copyright (c) 2019-2020 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Maxime Villard.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+struct vhci_ioc_get_info {
+       /* General. */
+       size_t nports;
+
+       /* Current port. */
+       u_int port;
+       int status;
+
+       /* Current addr. */
+       uint8_t addr;
+};
+
+struct vhci_ioc_set_port {
+       u_int port;
+};
+
+struct vhci_ioc_set_addr {
+       uint8_t addr;
+};
+
+#define VHCI_IOC_GET_INFO      _IOR('V', 0, struct vhci_ioc_get_info)
+#define VHCI_IOC_SET_PORT      _IOW('V', 1, struct vhci_ioc_set_port)
+#define VHCI_IOC_SET_ADDR      _IOW('V', 2, struct vhci_ioc_set_addr)
+#define VHCI_IOC_USB_ATTACH    _IO ('V', 10)
+#define VHCI_IOC_USB_DETACH    _IO ('V', 11)



Home | Main Index | Thread Index | Old Index