From owner-svn-src-all@FreeBSD.ORG Thu Mar 19 07:40:41 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB01E106567D; Thu, 19 Mar 2009 07:40:41 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8CB478FC1D; Thu, 19 Mar 2009 07:40:41 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2J7efhb052151; Thu, 19 Mar 2009 07:40:41 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2J7efQm052150; Thu, 19 Mar 2009 07:40:41 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200903190740.n2J7efQm052150@svn.freebsd.org> From: Robert Noland Date: Thu, 19 Mar 2009 07:40:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190017 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/atkbdc dev/cxgb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Mar 2009 07:40:42 -0000 Author: rnoland Date: Thu Mar 19 07:40:41 2009 New Revision: 190017 URL: http://svn.freebsd.org/changeset/base/190017 Log: Merge 189870 Teach psm about O_ASYNC This makes Xorg happy if you aren't using moused. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/atkbdc/psm.c stable/7/sys/dev/cxgb/ (props changed) Modified: stable/7/sys/dev/atkbdc/psm.c ============================================================================== --- stable/7/sys/dev/atkbdc/psm.c Thu Mar 19 07:39:07 2009 (r190016) +++ stable/7/sys/dev/atkbdc/psm.c Thu Mar 19 07:40:41 2009 (r190017) @@ -70,7 +70,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include +#include #include #include #include @@ -212,6 +215,7 @@ struct psm_softc { /* Driver status inf struct cdev *bdev; int lasterr; int cmdcount; + struct sigio *async; /* Processes waiting for SIGIO */ }; static devclass_t psm_devclass; #define PSM_SOFTC(unit) \ @@ -1383,6 +1387,7 @@ psmopen(struct cdev *dev, int flag, int sc->mode.level = sc->dflt_mode.level; sc->mode.protocol = sc->dflt_mode.protocol; sc->watchdog = FALSE; + sc->async = NULL; /* flush the event queue */ sc->queue.count = 0; @@ -1522,6 +1527,12 @@ psmclose(struct cdev *dev, int flag, int /* remove anything left in the output buffer */ empty_aux_buffer(sc->kbdc, 10); + /* clean up and sigio requests */ + if (sc->async != NULL) { + funsetown(&sc->async); + sc->async = NULL; + } + /* close is almost always successful */ sc->state &= ~PSM_OPEN; kbdc_lock(sc->kbdc, FALSE); @@ -2083,6 +2094,15 @@ psmioctl(struct cdev *dev, u_long cmd, c break; #endif /* MOUSE_GETHWID */ + case FIONBIO: + case FIOASYNC: + break; + case FIOSETOWN: + error = fsetown(*(int *)addr, &sc->async); + break; + case FIOGETOWN: + *(int *) addr = fgetown(&sc->async); + break; default: return (ENOTTY); } @@ -2972,6 +2992,9 @@ next: wakeup(sc); } selwakeuppri(&sc->rsel, PZERO); + if (sc->async != NULL) { + pgsigio(&sc->async, SIGIO, 0); + } sc->state &= ~PSM_SOFTARMED; splx(s); }