Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Sep 2014 16:08:28 +0300
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        Kevin Lo <kevlo@FreeBSD.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r271159 - in head: . share/man/man4 sys/conf sys/dev/usb sys/dev/usb/misc sys/dev/usb/quirk sys/modules/usb sys/modules/usb/uled
Message-ID:  <20140905130828.GQ2737@kib.kiev.ua>
In-Reply-To: <201409051125.s85BPwaE056586@svn.freebsd.org>
References:  <201409051125.s85BPwaE056586@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--adQrqeOhWOaS1Na2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Fri, Sep 05, 2014 at 11:25:58AM +0000, Kevin Lo wrote:
> Author: kevlo
> Date: Fri Sep  5 11:25:58 2014
> New Revision: 271159
> URL: http://svnweb.freebsd.org/changeset/base/271159
>=20
> Log:
>   The USB LED driver for the Dream Cheeky WebMail Notifier.
>  =20
>   Reviewed by:	hselasky
>=20
> Added:
>   head/share/man/man4/uled.4   (contents, props changed)
>   head/sys/dev/usb/misc/uled.c   (contents, props changed)
>   head/sys/dev/usb/uled_ioctl.h   (contents, props changed)
>   head/sys/modules/usb/uled/
>   head/sys/modules/usb/uled/Makefile   (contents, props changed)
> Modified:
>   head/Makefile
^^^^^^^^^

>   head/share/man/man4/Makefile
>   head/sys/conf/NOTES
>   head/sys/conf/files
>   head/sys/dev/usb/quirk/usb_quirk.c
>   head/sys/dev/usb/usbdevs
>   head/sys/modules/usb/Makefile
>=20
> Modified: head/Makefile
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/Makefile	Fri Sep  5 11:11:15 2014	(r271158)
> +++ head/Makefile	Fri Sep  5 11:25:58 2014	(r271159)
> @@ -1,6 +1,42 @@
>  #
>  # $FreeBSD$
>  #
> +# Copyright (c) 2014 Kevin Lo. All rights reserved.
> +#
> +# 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 AUTHOR 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 PUR=
POSE
> +# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
> +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUEN=
TIAL
> +# 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, ST=
RICT
> +# 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.
> +#
> +
> +S=3D     ${.CURDIR}/../../..
> +
> +.PATH: $S/dev/usb/misc
> +
> +KMOD=3D	uled
> +SRCS=3D	opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h vnode_if.h usb=
devs.h \
> +	uled.c
> +
> +.include <bsd.kmod.mk>
> +#
> +# $FreeBSD$
> +#
>  # The user-driven targets are:
>  #
>  # universe            - *Really* build *everything* (buildworld and
>=20
It seems you mis-patched the commit tree.

> Modified: head/share/man/man4/Makefile
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/share/man/man4/Makefile	Fri Sep  5 11:11:15 2014	(r271158)
> +++ head/share/man/man4/Makefile	Fri Sep  5 11:25:58 2014	(r271159)
> @@ -527,6 +527,7 @@ MAN=3D	aac.4 \
>  	uhso.4 \
>  	uipaq.4 \
>  	ukbd.4 \
> +	uled.4 \
>  	ulpt.4 \
>  	umass.4 \
>  	umcs.4 \
>=20
> Added: head/share/man/man4/uled.4
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- /dev/null	00:00:00 1970	(empty, because file is newly added)
> +++ head/share/man/man4/uled.4	Fri Sep  5 11:25:58 2014	(r271159)
> @@ -0,0 +1,95 @@
> +.\"
> +.\" Copyright (c) 2014 Kevin Lo
> +.\" All rights reserved.
> +.\"
> +.\" 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 t=
he
> +.\"    documentation and/or other materials provided with the distributi=
on.
> +.\"
> +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' A=
ND
> +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
> +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR P=
URPOSE
> +.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIA=
BLE
> +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQU=
ENTIAL
> +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GO=
ODS
> +.\" 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 AN=
Y WAY
> +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY =
OF
> +.\" SUCH DAMAGE.
> +.\"
> +.\" $FreeBSD$
> +.\"
> +.Dd September 5, 2014
> +.Dt ULED 4
> +.Os
> +.Sh NAME
> +.Nm uled
> +.Nd USB LED driver
> +.Sh SYNOPSIS
> +To compile this driver into the kernel, place the following lines into
> +your kernel configuration file:
> +.Bd -ragged -offset indent
> +.Cd "device uled"
> +.Cd "device usb"
> +.Ed
> +.Pp
> +Alternatively, to load the driver as a module at boot time,
> +place the following line in
> +.Xr loader.conf 5 :
> +.Bd -literal -offset indent
> +uled_load=3D"YES"
> +.Ed
> +.Sh DESCRIPTION
> +The
> +.Nm
> +driver provides support for the Dream Cheeky WebMail Notifier device.
> +.Pp
> +Subsequently, the
> +.Pa /dev/uled0
> +device can be used by userland applications.
> +.Sh IOCTLS
> +The following
> +.Xr ioctl 2
> +commands can be performed on
> +.Pa /dev/uled0 ,
> +which are defined in
> +.In dev/usb/uled_ioctl.h :
> +.Bl -tag -width indent
> +.It Dv ULED_GET_COLOR
> +The command returns LED colors with values for RGB.
> +This
> +.Xr ioctl 2
> +takes the following structure:
> +.Bd -literal
> +struct uled_color {
> +	uint8_t	red;
> +	uint8_t	green;
> +	uint8_t	blue;
> +};
> +.Ed
> +.Pp
> +.It Dv ULED_SET_COLOR
> +The command sets LED colors with values for RGB.
> +It uses the same structure as above.
> +.El
> +.Sh FILES
> +.Bl -tag -width ".Pa /dev/uled0" -compact
> +.It Pa /dev/uled0
> +blocking device node
> +.El
> +.Sh SEE ALSO
> +.Xr ohci 4 ,
> +.Xr uhci 4 ,
> +.Xr usb 4
> +.Sh AUTHORS
> +.An -nosplit
> +The
> +.Nm
> +driver was written by
> +.An Kevin Lo Aq Mt kevlo@FreeBSD.org .
>=20
> Modified: head/sys/conf/NOTES
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/sys/conf/NOTES	Fri Sep  5 11:11:15 2014	(r271158)
> +++ head/sys/conf/NOTES	Fri Sep  5 11:25:58 2014	(r271159)
> @@ -2653,6 +2653,8 @@ device		usb
>  device		udbp
>  # USB Fm Radio
>  device		ufm
> +# USB LED
> +device		uled
>  # Human Interface Device (anything with buttons and dials)
>  device		uhid
>  # USB keyboard
>=20
> Modified: head/sys/conf/files
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/sys/conf/files	Fri Sep  5 11:11:15 2014	(r271158)
> +++ head/sys/conf/files	Fri Sep  5 11:25:58 2014	(r271159)
> @@ -2542,6 +2542,7 @@ dev/usb/serial/usb_serial.c 	optional uc
>  #
>  dev/usb/misc/ufm.c		optional ufm
>  dev/usb/misc/udbp.c		optional udbp
> +dev/usb/misc/uled.c		optional uled
>  #
>  # USB input drivers
>  #
>=20
> Added: head/sys/dev/usb/misc/uled.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- /dev/null	00:00:00 1970	(empty, because file is newly added)
> +++ head/sys/dev/usb/misc/uled.c	Fri Sep  5 11:25:58 2014	(r271159)
> @@ -0,0 +1,275 @@
> +/*-
> + * Copyright (c) 2014 Kevin Lo
> + * All rights reserved.
> + *
> + * 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 distributio=
n.
> + *
> + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 PU=
RPOSE
> + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABL=
E FOR
> + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
> + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOO=
DS
> + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, S=
TRICT
> + * 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.
> + *
> + */
> +
> +#include <sys/cdefs.h>
> +__FBSDID("$FreeBSD$");
> +
> +#include <sys/stdint.h>
> +#include <sys/stddef.h>
> +#include <sys/param.h>
> +#include <sys/queue.h>
> +#include <sys/types.h>
> +#include <sys/systm.h>
> +#include <sys/kernel.h>
> +#include <sys/bus.h>
> +#include <sys/module.h>
> +#include <sys/lock.h>
> +#include <sys/mutex.h>
> +#include <sys/condvar.h>
> +#include <sys/sysctl.h>
> +#include <sys/sx.h>
> +#include <sys/unistd.h>
> +#include <sys/callout.h>
> +#include <sys/malloc.h>
> +#include <sys/priv.h>
> +#include <sys/conf.h>
> +#include <sys/fcntl.h>
> +
> +#include <dev/usb/usb.h>
> +#include <dev/usb/usbdi.h>
> +#include <dev/usb/usbhid.h>
> +#include "usbdevs.h"
> +
> +#define	USB_DEBUG_VAR usb_debug
> +#include <dev/usb/usb_debug.h>
> +
> +#include <dev/usb/uled_ioctl.h>
> +
> +struct uled_softc {
> +	struct usb_fifo_sc	sc_fifo;
> +	struct mtx		sc_mtx;
> +
> +	struct usb_device	*sc_udev;
> +	struct uled_color	sc_color;
> +
> +	uint8_t			sc_state;
> +#define	ULED_ENABLED	0x01
> +};
> +
> +/* prototypes */
> +
> +static device_probe_t	uled_probe;
> +static device_attach_t	uled_attach;
> +static device_detach_t	uled_detach;
> +
> +static usb_fifo_open_t	uled_open;
> +static usb_fifo_close_t	uled_close;
> +static usb_fifo_ioctl_t	uled_ioctl;
> +
> +static struct usb_fifo_methods uled_fifo_methods =3D {
> +	.f_open =3D &uled_open,
> +	.f_close =3D &uled_close,
> +	.f_ioctl =3D &uled_ioctl,
> +	.basename[0] =3D "uled",
> +};
> +
> +static usb_error_t	uled_ctrl_msg(struct uled_softc *, uint8_t, uint8_t,
> +			    uint16_t, uint16_t, void *buf, uint16_t);
> +static int		uled_enable(struct uled_softc *);
> +
> +static devclass_t uled_devclass;
> +
> +static device_method_t uled_methods[] =3D {
> +	DEVMETHOD(device_probe,		uled_probe),
> +	DEVMETHOD(device_attach,	uled_attach),
> +	DEVMETHOD(device_detach,	uled_detach),
> +
> +	DEVMETHOD_END
> +};
> +
> +static driver_t uled_driver =3D {
> +	.name =3D "uled",
> +	.methods =3D uled_methods,
> +	.size =3D sizeof(struct uled_softc),
> +};
> +
> +DRIVER_MODULE(uled, uhub, uled_driver, uled_devclass, NULL, NULL);
> +MODULE_DEPEND(uled, usb, 1, 1, 1);
> +MODULE_VERSION(uled, 1);
> +
> +static const STRUCT_USB_HOST_ID uled_devs[] =3D {
> +	{USB_VPI(USB_VENDOR_DREAMLINK, USB_PRODUCT_DREAMLINK_DL100B, 0)},
> +};
> +
> +static int
> +uled_probe(device_t dev)
> +{
> +	struct usb_attach_arg *uaa;
> +
> +	uaa =3D device_get_ivars(dev);
> +	if (uaa->usb_mode !=3D USB_MODE_HOST)
> +		return (ENXIO);
> +	if (uaa->info.bInterfaceClass !=3D UICLASS_HID)
> +		return (ENXIO);
> +
> +	return (usbd_lookup_id_by_uaa(uled_devs, sizeof(uled_devs), uaa));
> +}
> +
> +static int
> +uled_attach(device_t dev)
> +{
> +	struct usb_attach_arg *uaa;
> +	struct uled_softc *sc;
> +	int unit;
> +	usb_error_t error;
> +
> +	uaa =3D device_get_ivars(dev);
> +	sc =3D device_get_softc(dev);
> +	unit =3D device_get_unit(dev);
> +
> +	device_set_usb_desc(dev);
> +	mtx_init(&sc->sc_mtx, "uled lock", NULL, MTX_DEF | MTX_RECURSE);
> +
> +	sc->sc_udev =3D uaa->device;
> +
> +	error =3D usb_fifo_attach(uaa->device, sc, &sc->sc_mtx,
> +	    &uled_fifo_methods, &sc->sc_fifo, unit, -1,
> +	    uaa->info.bIfaceIndex, UID_ROOT, GID_OPERATOR, 0644);
> +	if (error !=3D 0)
> +		goto detach;
> +
> +	sc->sc_color.red =3D 0;
> +	sc->sc_color.green =3D 0;
> +	sc->sc_color.blue =3D 0;
> +
> +	return (0);
> +
> +detach:
> +	uled_detach(dev);
> +	return (ENOMEM);
> +}
> +
> +static int
> +uled_detach(device_t dev)
> +{
> +	struct uled_softc *sc;
> +
> +	sc =3D device_get_softc(dev);
> +	usb_fifo_detach(&sc->sc_fifo);
> +	mtx_destroy(&sc->sc_mtx);
> +	return (0);
> +}
> +
> +static usb_error_t
> +uled_ctrl_msg(struct uled_softc *sc, uint8_t rt, uint8_t reqno,
> +    uint16_t value, uint16_t index, void *buf, uint16_t buflen)
> +{
> +	struct usb_device_request req;
> +
> +	req.bmRequestType =3D rt;
> +	req.bRequest =3D reqno;
> +	USETW(req.wValue, value);
> +	USETW(req.wIndex, index);
> +	USETW(req.wLength, buflen);
> +
> +	return (usbd_do_request_flags(sc->sc_udev, &sc->sc_mtx, &req, buf,
> +	    0, NULL, 2000));
> +}
> +
> +static int
> +uled_enable(struct uled_softc *sc)
> +{
> +	static uint8_t cmdbuf[] =3D { 0x1f, 0x02, 0x00, 0x5f, 0x00, 0x00, 0x1a,
> +	    0x03 };
> +	int error;
> +
> +	sc->sc_state |=3D ULED_ENABLED;
> +	mtx_lock(&sc->sc_mtx);
> +	error =3D uled_ctrl_msg(sc, UT_WRITE_CLASS_INTERFACE, UR_SET_REPORT,
> +	    0x200, 0, cmdbuf, sizeof(cmdbuf));
> +	mtx_unlock(&sc->sc_mtx);
> +	return (error);
> +}
> +
> +static int
> +uled_open(struct usb_fifo *fifo, int fflags)
> +{
> +	if (fflags & FREAD) {
> +		struct uled_softc *sc;
> +		int rc;
> +
> +		sc =3D usb_fifo_softc(fifo);
> +		if (sc->sc_state & ULED_ENABLED)
> +			return (EBUSY);
> +		if ((rc =3D uled_enable(sc)) !=3D 0)
> +			return (rc);
> +	}
> +	return (0);
> +}
> +
> +static void
> +uled_close(struct usb_fifo *fifo, int fflags)
> +{
> +	if (fflags & FREAD) {
> +		struct uled_softc *sc;
> +
> +		sc =3D usb_fifo_softc(fifo);
> +		sc->sc_state &=3D ~ULED_ENABLED;
> +	}
> +}
> +		=09
> +static int
> +uled_ioctl(struct usb_fifo *fifo, u_long cmd, void *addr, int fflags)
> +{
> +	struct uled_softc *sc;
> +	struct uled_color color;
> +	int error;
> +
> +	sc =3D usb_fifo_softc(fifo);
> +	error =3D 0;
> +
> +	mtx_lock(&sc->sc_mtx);
> +
> +	switch(cmd) {
> +	case ULED_GET_COLOR:
> +		*(struct uled_color *)addr =3D sc->sc_color;
> +		break;
> +	case ULED_SET_COLOR:
> +		color =3D *(struct uled_color *)addr;
> +		uint8_t buf[8];
> +
> +		sc->sc_color.red =3D color.red;
> +		sc->sc_color.green =3D color.green;
> +		sc->sc_color.blue =3D color.blue;
> +
> +		buf[0] =3D color.red;
> +		buf[1] =3D color.green;
> +		buf[2] =3D color.blue;
> +		buf[3] =3D buf[4] =3D buf[5] =3D 0;
> +		buf[6] =3D 0x1a;
> +		buf[7] =3D 0x05;
> +		error =3D uled_ctrl_msg(sc, UT_WRITE_CLASS_INTERFACE,
> +		    UR_SET_REPORT, 0x200, 0, buf, sizeof(buf));
> +		break;
> +	default:
> +		error =3D ENOTTY;
> +		break;
> +	}
> +
> +	mtx_unlock(&sc->sc_mtx);
> +	return (error);
> +}
>=20
> Modified: head/sys/dev/usb/quirk/usb_quirk.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/sys/dev/usb/quirk/usb_quirk.c	Fri Sep  5 11:11:15 2014	(r271158)
> +++ head/sys/dev/usb/quirk/usb_quirk.c	Fri Sep  5 11:25:58 2014	(r271159)
> @@ -110,6 +110,7 @@ static struct usb_quirk_entry usb_quirks
>  	USB_QUIRK(CYBERPOWER, 1500CAVRLCD, 0x0000, 0xffff, UQ_HID_IGNORE),
>  	USB_QUIRK(CYPRESS, SILVERSHIELD, 0x0000, 0xffff, UQ_HID_IGNORE),
>  	USB_QUIRK(DELORME, EARTHMATE, 0x0000, 0xffff, UQ_HID_IGNORE),
> +	USB_QUIRK(DREAMLINK, DL100B, 0x0000, 0xffff, UQ_HID_IGNORE),
>  	USB_QUIRK(ITUNERNET, USBLCD2X20, 0x0000, 0xffff, UQ_HID_IGNORE),
>  	USB_QUIRK(ITUNERNET, USBLCD4X20, 0x0000, 0xffff, UQ_HID_IGNORE),
>  	USB_QUIRK(LIEBERT, POWERSURE_PXT, 0x0000, 0xffff, UQ_HID_IGNORE),
>=20
> Added: head/sys/dev/usb/uled_ioctl.h
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- /dev/null	00:00:00 1970	(empty, because file is newly added)
> +++ head/sys/dev/usb/uled_ioctl.h	Fri Sep  5 11:25:58 2014	(r271159)
> @@ -0,0 +1,43 @@
> +/*-
> + * Copyright (c) 2014 Kevin Lo
> + * All rights reserved.
> + *
> + * 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 distributio=
n.
> + *
> + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 PU=
RPOSE
> + * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIAB=
LE
> + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUE=
NTIAL
> + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOO=
DS
> + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, S=
TRICT
> + * 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.
> + *
> + * $FreeBSD$
> + */
> +
> +#ifndef _ULED_IOCTL_H_
> +#define _ULED_IOCTL_H_
> +
> +#include <sys/ioccom.h>
> +
> +struct uled_color {
> +	uint8_t	red;
> +	uint8_t	green;
> +	uint8_t	blue;
> +};
> +
> +#define	ULED_GET_COLOR	_IOR('U', 205, struct uled_color)
> +#define	ULED_SET_COLOR	_IOW('U', 206, struct uled_color)
> +
> +#endif	/* _ULED_IOCTL_H_ */
>=20
> Modified: head/sys/dev/usb/usbdevs
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/sys/dev/usb/usbdevs	Fri Sep  5 11:11:15 2014	(r271158)
> +++ head/sys/dev/usb/usbdevs	Fri Sep  5 11:25:58 2014	(r271159)
> @@ -713,6 +713,7 @@ vendor LONGCHEER	0x1c9e	Longcheer Holdin
>  vendor MPMAN		0x1cae	MpMan
>  vendor DRESDENELEKTRONIK 0x1cf1 dresden elektronik
>  vendor NEOTEL		0x1d09	Neotel
> +vendor DREAMLINK	0x1d34	Dream Link
>  vendor PEGATRON		0x1d4d	Pegatron
>  vendor QISDA		0x1da5  Qisda
>  vendor METAGEEK2	0x1dd5	MetaGeek
> @@ -1657,6 +1658,9 @@ product DMI DISK		0x2bcf	Generic Disk
>  /* DrayTek products */
>  product DRAYTEK VIGOR550	0x0550	Vigor550
> =20
> +/* Dream Link products */
> +product DREAMLINK DL100B	0x0004	USB Webmail Notifier
> +
>  /* dresden elektronik products */
>  product DRESDENELEKTRONIK SENSORTERMINALBOARD  0x0001 SensorTerminalBoard
>  product DRESDENELEKTRONIK WIRELESSHANDHELDTERMINAL  0x0004 Wireless Hand=
held Terminal
>=20
> Modified: head/sys/modules/usb/Makefile
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/sys/modules/usb/Makefile	Fri Sep  5 11:11:15 2014	(r271158)
> +++ head/sys/modules/usb/Makefile	Fri Sep  5 11:25:58 2014	(r271159)
> @@ -48,7 +48,7 @@ SUBDIR +=3D ${_dwc_otg} ehci ${_musb} ohci
>  	  ${_atmegadci} ${_avr32dci} ${_rsu} ${_rsufw} ${_saf1761otg}
>  SUBDIR +=3D ${_rum} ${_run} ${_runfw} ${_uath} upgt usie ural ${_zyd} ${=
_urtw}=20
>  SUBDIR +=3D ${_urtwn} ${_urtwnfw}
> -SUBDIR +=3D atp uhid ukbd ums udbp ufm uep wsp
> +SUBDIR +=3D atp uhid ukbd ums udbp ufm uep wsp uled
>  SUBDIR +=3D ucom u3g uark ubsa ubser uchcom ucycom ufoma uftdi ugensa ui=
paq ulpt \
>  	  umct umcs umodem umoscom uplcom uslcom uvisor uvscom
>  SUBDIR +=3D uether aue axe axge cdce cue ${_kue} mos rue smsc udav uhso =
ipheth
>=20
> Added: head/sys/modules/usb/uled/Makefile
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- /dev/null	00:00:00 1970	(empty, because file is newly added)
> +++ head/sys/modules/usb/uled/Makefile	Fri Sep  5 11:25:58 2014	(r271159)
> @@ -0,0 +1,36 @@
> +#
> +# $FreeBSD$
> +#
> +# Copyright (c) 2014 Kevin Lo. All rights reserved.
> +#
> +# 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 AUTHOR 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 PUR=
POSE
> +# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
> +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUEN=
TIAL
> +# 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, ST=
RICT
> +# 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.
> +#
> +
> +S=3D     ${.CURDIR}/../../..
> +
> +.PATH: $S/dev/usb/misc
> +
> +KMOD=3D	uled
> +SRCS=3D	opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h vnode_if.h usb=
devs.h \
> +	uled.c
> +
> +.include <bsd.kmod.mk>

--adQrqeOhWOaS1Na2
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBAgAGBQJUCbXMAAoJEJDCuSvBvK1BWNwP/2hMU+81dZny2AwZ2jOATW/n
Dh2xMpmOGVDKsGB7Q8zDA5YrL0bb210PZvN+tTxHLmKnIxVqrq7jNIi2G6YP1dzJ
p7sRqN2R1Uo7ragbA1vN0A6X81PCSeB1Dc1tB5fvMW2czZbGsVqU+cDdXv2arU75
CWpmtw2nUM6puD57FP8Rt9gF5LlA0bjyGZlLwnMy++/4OlJgOdFVOp/TCRKPmNHd
Ie2kzzB8ogBqhfMbHy5WNRDoEH3vxtOzTfseh2Gbhk4B5Qp5G8DVXb6GIDf3QnYd
FEvPWH9DUuAuVLEWLc8UUHZ/xdgTq6haIeVen8HTUoUETxpxeGQBMvOnsCUuv4FX
RRKxyQiwMvbcxAzlkZtM+RuAlKBJm9T8KZRF7ENNwbw+CSHcZrKUhE39jHe7q4P4
cFO8RYoiZHhFhQCEoNt3gW8no+G6XIK1UyIA3862uOtP1v+Q6orIDAPX6BTR5tzt
TOJJH0qYBu/o4QD/6lSxSRQarKntYeUyDvq9fmOlR6n50Hq938lOlBUUe6+YapLo
l1riBWh392dJywOvWv8VqmQP3KwqP7RXC238QzvOc+wDFkS4+RXmAlrrFWqg7yAY
Qxncp0Yme5qIzbj6DIsjy2/Fxjg/j35fzOFfLnW1v4/qFGb8GRDPKPohr0LxB6jW
C22dYgmvm/tiMLTBWlVf
=L1Un
-----END PGP SIGNATURE-----

--adQrqeOhWOaS1Na2--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140905130828.GQ2737>