From owner-p4-projects@FreeBSD.ORG Wed Aug 6 11:30:23 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 7B9821065676; Wed, 6 Aug 2008 11:30:23 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3FB201065687 for ; Wed, 6 Aug 2008 11:30:23 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 2EBCB8FC17 for ; Wed, 6 Aug 2008 11:30:23 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.2/8.14.2) with ESMTP id m76BUMuq017237 for ; Wed, 6 Aug 2008 11:30:22 GMT (envelope-from ed@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.2/8.14.1/Submit) id m76BUMYF017235 for perforce@freebsd.org; Wed, 6 Aug 2008 11:30:22 GMT (envelope-from ed@FreeBSD.org) Date: Wed, 6 Aug 2008 11:30:22 GMT Message-Id: <200808061130.m76BUMYF017235@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to ed@FreeBSD.org using -f From: Ed Schouten To: Perforce Change Reviews Cc: Subject: PERFORCE change 146764 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Aug 2008 11:30:23 -0000 http://perforce.freebsd.org/chv.cgi?CH=146764 Change 146764 by ed@ed_flippo on 2008/08/06 11:30:07 Small bug in the previous commit: we have to wake up the other device of the pair to cause data to be transmitted to us. Affected files ... .. //depot/projects/mpsafetty/sys/dev/nmdm/nmdm.c#7 edit Differences ... ==== //depot/projects/mpsafetty/sys/dev/nmdm/nmdm.c#7 (text+ko) ==== @@ -54,14 +54,15 @@ MALLOC_DEFINE(M_NMDM, "nullmodem", "nullmodem data structures"); -static void nmdm_wakeup(struct tty *); +static tsw_inwakeup_t nmdm_outwakeup; +static tsw_outwakeup_t nmdm_inwakeup; static tsw_param_t nmdm_param; static tsw_modem_t nmdm_modem; static struct ttydevsw nmdm_class = { .tsw_flags = TF_NOPREFIX, - .tsw_inwakeup = nmdm_wakeup, - .tsw_outwakeup = nmdm_wakeup, + .tsw_inwakeup = nmdm_inwakeup, + .tsw_outwakeup = nmdm_outwakeup, .tsw_param = nmdm_param, .tsw_modem = nmdm_modem, }; @@ -320,10 +321,20 @@ } static void -nmdm_wakeup(struct tty *tp) +nmdm_inwakeup(struct tty *tp) +{ + struct nmdmpart *np = tty_softc(tp); + + /* We can receive again, so wake up the other side */ + taskqueue_enqueue(taskqueue_swi, &np->np_other->np_task); +} + +static void +nmdm_outwakeup(struct tty *tp) { struct nmdmpart *np = tty_softc(tp); + /* We can transmit again, so wake up our side */ taskqueue_enqueue(taskqueue_swi, &np->np_task); }