From ad745cbbe81832c6a87c8f955dd968cd1988b1e3 Mon Sep 17 00:00:00 2001 From: Marcus Glocker Date: Mon, 21 Sep 2009 07:41:19 +0000 Subject: Document a private ioctl range for wscons drivers (from Miod). Therefore change the UDLIO_DAMAGE ioctl from 0 to 128 and move the ioctl part from udl.h to udlio.h so we can include it in userland applications. Suggested and OK miod@ --- sys/dev/usb/udl.c | 3 ++- sys/dev/usb/udl.h | 16 +--------------- sys/dev/usb/udlio.h | 31 +++++++++++++++++++++++++++++++ sys/dev/wscons/wsconsio.h | 5 +++-- 4 files changed, 37 insertions(+), 18 deletions(-) create mode 100644 sys/dev/usb/udlio.h (limited to 'sys/dev') diff --git a/sys/dev/usb/udl.c b/sys/dev/usb/udl.c index d26edf13fbe..799a382906f 100644 --- a/sys/dev/usb/udl.c +++ b/sys/dev/usb/udl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: udl.c,v 1.49 2009/09/20 11:24:02 mglocker Exp $ */ +/* $OpenBSD: udl.c,v 1.50 2009/09/21 07:41:18 mglocker Exp $ */ /* * Copyright (c) 2009 Marcus Glocker @@ -45,6 +45,7 @@ #include #include +#include /* * Defines. diff --git a/sys/dev/usb/udl.h b/sys/dev/usb/udl.h index cd4c66e4be9..c67d5980a40 100644 --- a/sys/dev/usb/udl.h +++ b/sys/dev/usb/udl.h @@ -1,4 +1,4 @@ -/* $OpenBSD: udl.h,v 1.12 2009/09/20 10:18:20 mglocker Exp $ */ +/* $OpenBSD: udl.h,v 1.13 2009/09/21 07:41:18 mglocker Exp $ */ /* * Copyright (c) 2009 Marcus Glocker @@ -102,20 +102,6 @@ struct udl_softc { uint32_t, uint32_t, uint32_t, uint32_t); }; -/* - * udl IOCTLs. - */ -struct udl_ioctl_damage { - int x1; - int x2; - int y1; - int y2; -#define UDLIO_STATUS_OK 0 -#define UDLIO_STATUS_FAILED 1 - int status; -}; -#define UDLIO_DAMAGE _IOWR('W', 0, struct udl_ioctl_damage) - /* * Chip commands. */ diff --git a/sys/dev/usb/udlio.h b/sys/dev/usb/udlio.h new file mode 100644 index 00000000000..5cfbc5f12e0 --- /dev/null +++ b/sys/dev/usb/udlio.h @@ -0,0 +1,31 @@ +/* $OpenBSD: udlio.h,v 1.1 2009/09/21 07:41:18 mglocker Exp $ */ + +/* + * Copyright (c) 2009 Marcus Glocker + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +/* + * udl IOCTLs. + */ +struct udl_ioctl_damage { + int x1; + int x2; + int y1; + int y2; +#define UDLIO_STATUS_OK 0 +#define UDLIO_STATUS_FAILED 1 + int status; +}; +#define UDLIO_DAMAGE _IOWR('W', 128, struct udl_ioctl_damage) diff --git a/sys/dev/wscons/wsconsio.h b/sys/dev/wscons/wsconsio.h index 3bb2a2ff037..b74f4bc7219 100644 --- a/sys/dev/wscons/wsconsio.h +++ b/sys/dev/wscons/wsconsio.h @@ -1,4 +1,4 @@ -/* $OpenBSD: wsconsio.h,v 1.55 2009/07/03 17:37:02 kettenis Exp $ */ +/* $OpenBSD: wsconsio.h,v 1.56 2009/09/21 07:41:18 mglocker Exp $ */ /* $NetBSD: wsconsio.h,v 1.74 2005/04/28 07:15:44 martin Exp $ */ /* @@ -42,7 +42,8 @@ * 32-63 mouse ioctls (WSMOUSEIO) * 64-95 display ioctls (WSDISPLAYIO) * 96-127 mux ioctls (WSMUXIO) - * 128-255 reserved for future use + * 128-159 driver private ioctls + * 160-255 reserved for future use */ #include -- cgit v1.2.3