NetBSD-Bugs archive

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

Re: kern/47142: usbhidctl vs. SDL et al.



The following reply was made to PR kern/47142; it has been noted by GNATS.

From: Thomas Klausner <wiz%NetBSD.org@localhost>
To: NetBSD bugtracking <gnats-bugs%NetBSD.org@localhost>
Cc: 
Subject: Re: kern/47142: usbhidctl vs. SDL et al.
Date: Wed, 30 Sep 2015 12:01:19 +0200

 --RYJh/3oyKhIjGcML
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 mrg suggested the attached diff.
 
 With that diff, mame starts fine when usbhidaction is already running,
 but the multimedia keys on my keyboard afterwards don't work (even
 though the usbhidaction process is still running).
  Thomas
 
 --RYJh/3oyKhIjGcML
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: attachment; filename="uhid.diff"
 
 Index: uhid.c
 ===================================================================
 RCS file: /cvsroot/src/sys/dev/usb/uhid.c,v
 retrieving revision 1.94
 diff -u -r1.94 uhid.c
 --- uhid.c	20 Mar 2015 03:04:48 -0000	1.94
 +++ uhid.c	30 Sep 2015 10:00:15 -0000
 @@ -316,28 +316,22 @@
  	if (sc->sc_dying)
  		return ENXIO;
  
 -	mutex_enter(&sc->sc_access_lock);
 -
  	/*
  	 * uhid interrupts aren't enabled yet, so setup sc_q now, as
  	 * long as they're not already allocated.
  	 */
  	if (sc->sc_hdev.sc_state & UHIDEV_OPEN) {
 -		mutex_exit(&sc->sc_access_lock);
  		return EBUSY;
  	}
  	if (clalloc(&sc->sc_q, UHID_BSIZE, 0) == -1) {
 -		mutex_exit(&sc->sc_access_lock);
  		return ENOMEM;
  	}
  
  	error = uhidev_open(&sc->sc_hdev);
  	if (error) {
  		clfree(&sc->sc_q);
 -		mutex_exit(&sc->sc_access_lock);
  		return error;
  	}
 -	mutex_exit(&sc->sc_access_lock);
  
  	sc->sc_obuf = malloc(sc->sc_osize, M_USBDEV, M_WAITOK);
  	sc->sc_state &= ~UHID_IMMED;
 
 --RYJh/3oyKhIjGcML--
 


Home | Main Index | Thread Index | Old Index