Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 Aug 2008 11:30:22 GMT
From:      Ed Schouten <ed@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 146764 for review
Message-ID:  <200808061130.m76BUMYF017235@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);
 }
 



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