Module Name:    src
Committed By:   maxv
Date:           Tue Mar 31 16:28:29 UTC 2020

Modified Files:
        src/distrib/sets/lists/comp: mi
        src/sys/dev/usb: Makefile vhci.c
Added Files:
        src/sys/dev/usb: vhci.h

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


To generate a diff of this commit:
cvs rdiff -u -r1.2316 -r1.2317 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/usb/Makefile
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/usb/vhci.c
cvs rdiff -u -r0 -r1.1 src/sys/dev/usb/vhci.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.2316 src/distrib/sets/lists/comp/mi:1.2317
--- src/distrib/sets/lists/comp/mi:1.2316	Wed Mar 25 18:45:42 2020
+++ src/distrib/sets/lists/comp/mi	Tue Mar 31 16:28:28 2020
@@ -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

Index: src/sys/dev/usb/Makefile
diff -u src/sys/dev/usb/Makefile:1.11 src/sys/dev/usb/Makefile:1.12
--- src/sys/dev/usb/Makefile:1.11	Wed Jan 29 21:52:16 2020
+++ src/sys/dev/usb/Makefile	Tue Mar 31 16:28:28 2020
@@ -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>

Index: src/sys/dev/usb/vhci.c
diff -u src/sys/dev/usb/vhci.c:1.14 src/sys/dev/usb/vhci.c:1.15
--- src/sys/dev/usb/vhci.c:1.14	Tue Mar 31 16:17:32 2020
+++ src/sys/dev/usb/vhci.c	Tue Mar 31 16:28:28 2020
@@ -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 @@ __KERNEL_RCSID(0, "$NetBSD: vhci.c,v 1.1
 #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 @@ vhci_root_intr_done(struct usbd_xfer *xf
 
 /* -------------------------------------------------------------------------- */
 
-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)
 {

Added files:

Index: src/sys/dev/usb/vhci.h
diff -u /dev/null src/sys/dev/usb/vhci.h:1.1
--- /dev/null	Tue Mar 31 16:28:29 2020
+++ src/sys/dev/usb/vhci.h	Tue Mar 31 16:28:28 2020
@@ -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)

Reply via email to