#SUBDIR= controller input misc net quirk serial storage template
-SUBDIR= usb audio controller storage
+SUBDIR= usb audio controller input storage
.include <bsd.subdir.mk>
--- /dev/null
+SUBDIR= uep uhid ukbd ums
+
+.include <bsd.subdir.mk>
#include <sys/sysctl.h>
#include <sys/systm.h>
-#include <dev/usb/usb.h>
-#include <dev/usb/usbdi.h>
-#include <dev/usb/usbdi_util.h>
-#include <dev/usb/usbhid.h>
-#include "usbdevs.h"
+#include <bus/u4b/usb.h>
+#include <bus/u4b/usbdi.h>
+#include <bus/u4b/usbdi_util.h>
+#include <bus/u4b/usbhid.h>
+#include <bus/u4b/usbdevs.h>
#include <sys/ioccom.h>
#include <sys/fcntl.h>
#include <sys/tty.h>
#define USB_DEBUG_VAR uep_debug
-#include <dev/usb/usb_debug.h>
+#include <bus/u4b/usb_debug.h>
#ifdef USB_DEBUG
static int uep_debug = 0;
};
struct uep_softc {
- struct mtx mtx;
+ struct lock lock;
struct usb_xfer *xfer[UEP_N_TRANSFER];
struct usb_fifo_sc fifo;
device_set_usb_desc(dev);
- mtx_init(&sc->mtx, "uep lock", NULL, MTX_DEF);
+ lockinit(&sc->lock, "uep lock", 0, 0);
error = usbd_transfer_setup(uaa->device, &uaa->info.bIfaceIndex,
- sc->xfer, uep_config, UEP_N_TRANSFER, sc, &sc->mtx);
+ sc->xfer, uep_config, UEP_N_TRANSFER, sc, &sc->lock);
if (error) {
DPRINTF("usbd_transfer_setup error=%s\n", usbd_errstr(error));
goto detach;
}
- error = usb_fifo_attach(uaa->device, sc, &sc->mtx, &uep_fifo_methods,
+ error = usb_fifo_attach(uaa->device, sc, &sc->lock, &uep_fifo_methods,
&sc->fifo, device_get_unit(dev), 0 - 1, uaa->info.bIfaceIndex,
UID_ROOT, GID_OPERATOR, 0644);
usbd_transfer_unsetup(sc->xfer, UEP_N_TRANSFER);
- mtx_destroy(&sc->mtx);
+ lockuninit(&sc->lock);
return (0);
}
--- /dev/null
+.PATH: ${.CURDIR}/..
+
+KMOD= uep
+
+SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h \
+ uep.c
+
+.include <bsd.kmod.mk>
* $NetBSD: uhid.c,v 1.54 2002/09/23 05:51:21 simonb Exp $
*/
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
* All rights reserved.
*/
#include <sys/stdint.h>
-#include <sys/stddef.h>
#include <sys/param.h>
#include <sys/queue.h>
#include <sys/types.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/conf.h>
#include <sys/fcntl.h>
-#include "usbdevs.h"
-#include <dev/usb/usb.h>
-#include <dev/usb/usbdi.h>
-#include <dev/usb/usbdi_util.h>
-#include <dev/usb/usbhid.h>
-#include <dev/usb/usb_ioctl.h>
+#include <bus/u4b/usbdevs.h>
+#include <bus/u4b/usb.h>
+#include <bus/u4b/usbdi.h>
+#include <bus/u4b/usbdi_util.h>
+#include <bus/u4b/usbhid.h>
+#include <bus/u4b/usb_ioctl.h>
#define USB_DEBUG_VAR uhid_debug
-#include <dev/usb/usb_debug.h>
+#include <bus/u4b/usb_debug.h>
-#include <dev/usb/input/usb_rdesc.h>
-#include <dev/usb/quirk/usb_quirk.h>
+#include <bus/u4b/input/usb_rdesc.h>
+#include <bus/u4b/quirk/usb_quirk.h>
#ifdef USB_DEBUG
static int uhid_debug = 0;
struct uhid_softc {
struct usb_fifo_sc sc_fifo;
- struct mtx sc_mtx;
+ struct lock sc_lock;
struct usb_xfer *sc_xfer[UHID_N_TRANSFER];
struct usb_device *sc_udev;
uint8_t free_data = 0;
if (kern_data == NULL) {
- kern_data = malloc(len, M_USBDEV, M_WAITOK);
+ kern_data = kmalloc(len, M_USBDEV, M_WAITOK);
if (kern_data == NULL) {
err = ENOMEM;
goto done;
}
done:
if (free_data) {
- free(kern_data, M_USBDEV);
+ kfree(kern_data, M_USBDEV);
}
return (err);
}
uint8_t free_data = 0;
if (kern_data == NULL) {
- kern_data = malloc(len, M_USBDEV, M_WAITOK);
+ kern_data = kmalloc(len, M_USBDEV, M_WAITOK);
if (kern_data == NULL) {
err = ENOMEM;
goto done;
}
done:
if (free_data) {
- free(kern_data, M_USBDEV);
+ kfree(kern_data, M_USBDEV);
}
return (err);
}
if (error) {
break;
}
- mtx_lock(&sc->sc_mtx);
+ lockmgr(&sc->sc_lock, LK_EXCLUSIVE);
sc->sc_flags |= UHID_FLAG_IMMED;
- mtx_unlock(&sc->sc_mtx);
+ lockmgr(&sc->sc_lock, LK_RELEASE);
} else {
- mtx_lock(&sc->sc_mtx);
+ lockmgr(&sc->sc_lock, LK_EXCLUSIVE);
sc->sc_flags &= ~UHID_FLAG_IMMED;
- mtx_unlock(&sc->sc_mtx);
+ lockmgr(&sc->sc_lock, LK_RELEASE);
}
break;
device_set_usb_desc(dev);
- mtx_init(&sc->sc_mtx, "uhid lock", NULL, MTX_DEF | MTX_RECURSE);
+ lockinit(&sc->sc_lock, "uhid lock", 0, LK_CANRECURSE);
sc->sc_udev = uaa->device;
error = usbd_transfer_setup(uaa->device,
&uaa->info.bIfaceIndex, sc->sc_xfer, uhid_config,
- UHID_N_TRANSFER, sc, &sc->sc_mtx);
+ UHID_N_TRANSFER, sc, &sc->sc_lock);
if (error) {
DPRINTF("error=%s\n", usbd_errstr(error));
sc->sc_fsize = UHID_BSIZE;
}
- error = usb_fifo_attach(uaa->device, sc, &sc->sc_mtx,
+ error = usb_fifo_attach(uaa->device, sc, &sc->sc_lock,
&uhid_fifo_methods, &sc->sc_fifo,
unit, 0 - 1, uaa->info.bIfaceIndex,
UID_ROOT, GID_OPERATOR, 0644);
if (sc->sc_repdesc_ptr) {
if (!(sc->sc_flags & UHID_FLAG_STATIC_DESC)) {
- free(sc->sc_repdesc_ptr, M_USBDEV);
+ kfree(sc->sc_repdesc_ptr, M_USBDEV);
}
}
- mtx_destroy(&sc->sc_mtx);
+ lockuninit(&sc->sc_lock);
return (0);
}
--- /dev/null
+.PATH: ${.CURDIR}/..
+
+KMOD= uhid
+
+SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h \
+ uhid.c
+
+.include <bsd.kmod.mk>
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
* All rights reserved.
#include "opt_ukbd.h"
#include <sys/stdint.h>
-#include <sys/stddef.h>
#include <sys/param.h>
#include <sys/queue.h>
#include <sys/types.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/proc.h>
#include <sys/sched.h>
-#include <sys/kdb.h>
+#include <sys/thread2.h>
-#include <dev/usb/usb.h>
-#include <dev/usb/usbdi.h>
-#include <dev/usb/usbdi_util.h>
-#include <dev/usb/usbhid.h>
+#include <bus/u4b/usb.h>
+#include <bus/u4b/usbdi.h>
+#include <bus/u4b/usbdi_util.h>
+#include <bus/u4b/usbhid.h>
#define USB_DEBUG_VAR ukbd_debug
-#include <dev/usb/usb_debug.h>
+#include <bus/u4b/usb_debug.h>
-#include <dev/usb/quirk/usb_quirk.h>
+#include <bus/u4b/quirk/usb_quirk.h>
#include <sys/ioccom.h>
#include <sys/filio.h>
#include <sys/tty.h>
#include <sys/kbio.h>
-#include <dev/kbd/kbdreg.h>
+#include <dev/misc/kbd/kbdreg.h>
/* the initial key map, accent map and fkey strings */
#if defined(UKBD_DFLT_KEYMAP) && !defined(KLD_MODULE)
#endif
/* the following file must be included after "ukbdmap.h" */
-#include <dev/kbd/kbdtables.h>
+#include <dev/misc/kbd/kbdtables.h>
#ifdef USB_DEBUG
static int ukbd_debug = 0;
};
struct ukbd_softc {
+ device_t sc_dev;
+ struct lock sc_lock;
keyboard_t sc_kbd;
keymap_t sc_keymap;
accentmap_t sc_accmap;
+
fkeytab_t sc_fkeymap[UKBD_NFKEY];
struct hid_location sc_loc_apple_eject;
struct hid_location sc_loc_apple_fn;
SCAN_PREFIX_CTL | SCAN_PREFIX_SHIFT)
#define SCAN_CHAR(c) ((c) & 0x7f)
-#define UKBD_LOCK() mtx_lock(&Giant)
-#define UKBD_UNLOCK() mtx_unlock(&Giant)
+#define UKBD_LOCK(sc) lockmgr(&(sc)->sc_lock, LK_EXCLUSIVE)
+#define UKBD_UNLOCK(sc) lockmgr(&(sc)->sc_lock, LK_RELEASE)
#ifdef INVARIANTS
* Assert that the lock is held in all contexts
* where the code can be executed.
*/
-#define UKBD_LOCK_ASSERT() mtx_assert(&Giant, MA_OWNED)
+#define UKBD_LOCK_ASSERT()
/*
* Assert that the lock is held in the contexts
* where it really has to be so.
*/
-#define UKBD_CTX_LOCK_ASSERT() \
- do { \
- if (!kdb_active && panicstr == NULL) \
- mtx_assert(&Giant, MA_OWNED); \
- } while (0)
+#define UKBD_CTX_LOCK_ASSERT()
#else
#define UKBD_LOCK_ASSERT() (void)0
KASSERT((sc->sc_flags & UKBD_FLAG_POLLING) != 0,
("ukbd_do_poll called when not polling\n"));
DPRINTFN(2, "polling\n");
-
+#if 0 /* XXX */
if (!kdb_active && !SCHEDULER_STOPPED()) {
+#endif
/*
* In this context the kernel is polling for input,
* but the USB subsystem works in normal interrupt-driven
* Give USB threads a chance to run. Note that
* kern_yield performs DROP_GIANT + PICKUP_GIANT.
*/
- kern_yield(PRI_UNCHANGED);
+ lwkt_yield();
if (!wait)
break;
}
return;
+#if 0
}
+#endif
while (sc->sc_inputs == 0) {
int32_t c;
UKBD_CTX_LOCK_ASSERT();
+#if 0
KASSERT((!kdb_active && !SCHEDULER_STOPPED())
|| (sc->sc_flags & UKBD_FLAG_POLLING) != 0,
("not polling in kdb or panic\n"));
+#endif
if (sc->sc_inputs == 0) {
/* start transfer, if not already started */
int error;
uint16_t d_len;
- UKBD_LOCK_ASSERT();
DPRINTFN(11, "\n");
if (sw == NULL) {
} else
error = ENXIO;
- free(d_ptr, M_TEMP);
+ kfree(d_ptr, M_TEMP);
return (error);
}
uint16_t n;
uint16_t hid_len;
- UKBD_LOCK_ASSERT();
-
- kbd_init_struct(kbd, UKBD_DRIVER_NAME, KB_OTHER, unit, 0, 0, 0);
+ lockinit(&sc->sc_lock, "ukbd", 0, 0);
+ kbd_init_struct(kbd, UKBD_DRIVER_NAME, KB_OTHER,
+ unit, 0, KB_PRI_USB, 0, 0);
kbd->kb_data = (void *)sc;
sc->sc_iface_no = uaa->info.bIfaceNum;
sc->sc_mode = K_XLATE;
- usb_callout_init_mtx(&sc->sc_callout, &Giant, 0);
+ usb_callout_init_mtx(&sc->sc_callout, &sc->sc_lock, 0);
err = usbd_transfer_setup(uaa->device,
&uaa->info.bIfaceIndex, sc->sc_xfer, ukbd_config,
- UKBD_N_TRANSFER, sc, &Giant);
+ UKBD_N_TRANSFER, sc, &sc->sc_lock);
if (err) {
DPRINTF("error=%s\n", usbd_errstr(err));
ukbd_parse_hid(sc, hid_ptr, hid_len);
- free(hid_ptr, M_TEMP);
+ kfree(hid_ptr, M_TEMP);
}
/* check if we should use the boot protocol */
}
/* start the keyboard */
+ UKBD_LOCK(sc);
usbd_transfer_start(sc->sc_xfer[UKBD_INTR_DT]);
+ UKBD_UNLOCK(sc);
return (0); /* success */
struct ukbd_softc *sc = device_get_softc(dev);
int error;
- UKBD_LOCK_ASSERT();
-
DPRINTF("\n");
sc->sc_flags |= UKBD_FLAG_GONE;
{
struct ukbd_softc *sc = device_get_softc(dev);
- UKBD_LOCK_ASSERT();
-
ukbd_clear_state(&sc->sc_kbd);
return (0);
static int
ukbd_enable(keyboard_t *kbd)
{
+ struct ukbd_softc *sc = kbd->kb_data;
- UKBD_LOCK();
+ UKBD_LOCK(sc);
KBD_ACTIVATE(kbd);
- UKBD_UNLOCK();
+ UKBD_UNLOCK(sc);
return (0);
}
static int
ukbd_disable(keyboard_t *kbd)
{
+ struct ukbd_softc *sc = kbd->kb_data;
- UKBD_LOCK();
+ UKBD_LOCK(sc);
KBD_DEACTIVATE(kbd);
- UKBD_UNLOCK();
+ UKBD_UNLOCK(sc);
return (0);
}
{
struct ukbd_softc *sc = kbd->kb_data;
- UKBD_CTX_LOCK_ASSERT();
-
if (!KBD_IS_ACTIVE(kbd))
return (0);
{
struct ukbd_softc *sc = kbd->kb_data;
- UKBD_CTX_LOCK_ASSERT();
-
if (!KBD_IS_ACTIVE(kbd))
return (0);
ukbd_check_char(keyboard_t *kbd)
{
int result;
+#if 0
+ struct ukbd_softc *sc = kbd->kb_data;
- UKBD_LOCK();
+ UKBD_LOCK(sc);
+#endif
result = ukbd_check_char_locked(kbd);
- UKBD_UNLOCK();
+#if 0
+ UKBD_UNLOCK(sc);
+#endif
return (result);
}
#endif
- UKBD_CTX_LOCK_ASSERT();
-
if (!KBD_IS_ACTIVE(kbd))
return (-1);
uint32_t scancode;
#endif
- UKBD_CTX_LOCK_ASSERT();
-
if (!KBD_IS_ACTIVE(kbd))
return (NOKEY);
ukbd_read_char(keyboard_t *kbd, int wait)
{
uint32_t keycode;
+#if 0
+ struct ukbd_softc *sc = kbd->kb_data;
- UKBD_LOCK();
+ UKBD_LOCK(sc);
+#endif
keycode = ukbd_read_char_locked(kbd, wait);
- UKBD_UNLOCK();
+#if 0
+ UKBD_UNLOCK(sc);
+#endif
return (keycode);
}
#endif
- UKBD_LOCK_ASSERT();
-
switch (cmd) {
case KDGKBMODE: /* get keyboard mode */
*(int *)arg = sc->sc_mode;
break;
+#if 0 /* XXX */
#if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) || \
defined(COMPAT_FREEBSD4) || defined(COMPAT_43)
case _IO('K', 7):
arg = (caddr_t)&ival;
/* FALLTHROUGH */
#endif
+#endif
case KDSKBMODE: /* set keyboard mode */
switch (*(int *)arg) {
case K_XLATE:
case KDGETLED: /* get keyboard LED */
*(int *)arg = KBD_LED_VAL(kbd);
break;
+#if 0 /* XXX */
#if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) || \
defined(COMPAT_FREEBSD4) || defined(COMPAT_43)
case _IO('K', 66):
arg = (caddr_t)&ival;
/* FALLTHROUGH */
#endif
+#endif
case KDSETLED: /* set keyboard LED */
/* NOTE: lock key state in "sc_state" won't be changed */
if (*(int *)arg & ~LOCK_MASK)
case KDGKBSTATE: /* get lock key state */
*(int *)arg = sc->sc_state & LOCK_MASK;
break;
+#if 0 /* XXX */
#if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) || \
defined(COMPAT_FREEBSD4) || defined(COMPAT_43)
case _IO('K', 20):
arg = (caddr_t)&ival;
/* FALLTHROUGH */
#endif
+#endif
case KDSKBSTATE: /* set lock key state */
if (*(int *)arg & ~LOCK_MASK) {
return (EINVAL);
kbd->kb_delay2 = ((int *)arg)[1];
return (0);
+#if 0 /* XXX */
#if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) || \
defined(COMPAT_FREEBSD4) || defined(COMPAT_43)
case _IO('K', 67):
arg = (caddr_t)&ival;
/* FALLTHROUGH */
#endif
+#endif
case KDSETRAD: /* set keyboard repeat rate (old
* interface) */
return (ukbd_set_typematic(kbd, *(int *)arg));
case PIO_KEYMAP: /* set keyboard translation table */
- case OPIO_KEYMAP: /* set keyboard translation table
- * (compat) */
case PIO_KEYMAPENT: /* set keyboard translation table
* entry */
case PIO_DEADKEYMAP: /* set accent key translation table */
ukbd_ioctl(keyboard_t *kbd, u_long cmd, caddr_t arg)
{
int result;
+ struct ukbd_softc *sc = kbd->kb_data;
/*
* XXX KDGKBSTATE, KDSKBSTATE and KDSETLED can be called from any
case KDGKBSTATE:
case KDSKBSTATE:
case KDSETLED:
- if (!mtx_owned(&Giant) && !SCHEDULER_STOPPED())
- return (EDEADLK); /* best I could come up with */
+ return (EDEADLK); /* best I could come up with */
/* FALLTHROUGH */
default:
- UKBD_LOCK();
+ UKBD_LOCK(sc);
result = ukbd_ioctl_locked(kbd, cmd, arg);
- UKBD_UNLOCK();
+ UKBD_UNLOCK(sc);
return (result);
}
}
{
struct ukbd_softc *sc = kbd->kb_data;
- UKBD_CTX_LOCK_ASSERT();
-
sc->sc_flags &= ~(UKBD_FLAG_COMPOSE | UKBD_FLAG_POLLING);
sc->sc_state &= LOCK_MASK; /* preserve locking key state */
sc->sc_accents = 0;
{
struct ukbd_softc *sc = kbd->kb_data;
- UKBD_LOCK();
+ UKBD_LOCK(sc);
if (on) {
sc->sc_flags |= UKBD_FLAG_POLLING;
sc->sc_poll_thread = curthread;
sc->sc_flags &= ~UKBD_FLAG_POLLING;
ukbd_start_timer(sc); /* start timer */
}
- UKBD_UNLOCK();
+ UKBD_UNLOCK(sc);
return (0);
}
ukbd_set_leds(struct ukbd_softc *sc, uint8_t leds)
{
- UKBD_LOCK_ASSERT();
DPRINTF("leds=0x%02x\n", leds);
sc->sc_leds = leds;
--- /dev/null
+.PATH: ${.CURDIR}/..
+
+KMOD= ukbd
+
+SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h \
+ ukbd.c
+
+.include <bsd.kmod.mk>
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
/*
* HID spec: http://www.usb.org/developers/devclass_docs/HID1_11.pdf
*/
#include <sys/stdint.h>
-#include <sys/stddef.h>
#include <sys/param.h>
#include <sys/queue.h>
#include <sys/types.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/fcntl.h>
#include <sys/sbuf.h>
-#include <dev/usb/usb.h>
-#include <dev/usb/usbdi.h>
-#include <dev/usb/usbdi_util.h>
-#include <dev/usb/usbhid.h>
-#include "usbdevs.h"
+#include <bus/u4b/usb.h>
+#include <bus/u4b/usbdi.h>
+#include <bus/u4b/usbdi_util.h>
+#include <bus/u4b/usbhid.h>
+#include <bus/u4b/usbdevs.h>
#define USB_DEBUG_VAR ums_debug
-#include <dev/usb/usb_debug.h>
+#include <bus/u4b/usb_debug.h>
-#include <dev/usb/quirk/usb_quirk.h>
+#include <bus/u4b/quirk/usb_quirk.h>
#include <sys/ioccom.h>
#include <sys/filio.h>
struct ums_softc {
struct usb_fifo_sc sc_fifo;
- struct mtx sc_mtx;
+ struct lock sc_lock;
struct usb_callout sc_callout;
struct ums_info sc_info[UMS_INFO_MAX];
{
struct ums_softc *sc = __sc;
- mtx_assert(&sc->sc_mtx, MA_OWNED);
+ KKASSERT(lockowned(&sc->sc_lock));
ums_put_queue(sc, 0, 0, 0, 0, 0);
}
}
}
hid_end_parse(hd);
- free(d_ptr, M_TEMP);
+ kfree(d_ptr, M_TEMP);
return (found ? BUS_PROBE_DEFAULT : ENXIO);
}
device_set_usb_desc(dev);
- mtx_init(&sc->sc_mtx, "ums lock", NULL, MTX_DEF | MTX_RECURSE);
+ lockinit(&sc->sc_lock, "ums lock", 0, LK_CANRECURSE);
- usb_callout_init_mtx(&sc->sc_callout, &sc->sc_mtx, 0);
+ usb_callout_init_mtx(&sc->sc_callout, &sc->sc_lock, 0);
/*
* Force the report (non-boot) protocol.
err = usbd_transfer_setup(uaa->device,
&uaa->info.bIfaceIndex, sc->sc_xfer, ums_config,
- UMS_N_TRANSFER, sc, &sc->sc_mtx);
+ UMS_N_TRANSFER, sc, &sc->sc_lock);
if (err) {
DPRINTF("error=%s\n", usbd_errstr(err));
"than interrupt size, %d bytes!\n", isize,
usbd_xfer_max_framelen(sc->sc_xfer[UMS_INTR_DT]));
}
- free(d_ptr, M_TEMP);
+ kfree(d_ptr, M_TEMP);
d_ptr = NULL;
#ifdef USB_DEBUG
sc->sc_mode.syncmask[0] = MOUSE_MSC_SYNCMASK;
sc->sc_mode.syncmask[1] = MOUSE_MSC_SYNC;
- err = usb_fifo_attach(uaa->device, sc, &sc->sc_mtx,
+ err = usb_fifo_attach(uaa->device, sc, &sc->sc_lock,
&ums_fifo_methods, &sc->sc_fifo,
device_get_unit(dev), 0 - 1, uaa->info.bIfaceIndex,
UID_ROOT, GID_OPERATOR, 0644);
if (err) {
goto detach;
}
+#if 0 /* XXXDF */
SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
OID_AUTO, "parseinfo", CTLTYPE_STRING|CTLFLAG_RD,
sc, 0, ums_sysctl_handler_parseinfo,
"", "Dump of parsed HID report descriptor");
+#endif
return (0);
detach:
if (d_ptr) {
- free(d_ptr, M_TEMP);
+ kfree(d_ptr, M_TEMP);
}
ums_detach(dev);
return (ENOMEM);
usb_callout_drain(&sc->sc_callout);
- mtx_destroy(&sc->sc_mtx);
+ lockuninit(&sc->sc_lock);
return (0);
}
DPRINTFN(2, "\n");
- mtx_lock(&sc->sc_mtx);
+ lockmgr(&sc->sc_lock, LK_EXCLUSIVE);
switch (cmd) {
case MOUSE_GETHWINFO:
}
done:
- mtx_unlock(&sc->sc_mtx);
+ lockmgr(&sc->sc_lock, LK_RELEASE);
return (error);
}
--- /dev/null
+.PATH: ${.CURDIR}/..
+
+KMOD= ums
+
+SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h \
+ ums.c
+
+.include <bsd.kmod.mk>