summaryrefslogtreecommitdiffstats
path: root/cpukit/libnetworking
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-10-07 16:28:04 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-10-07 16:35:13 +0200
commit7fd5e89c96cc92254e36012eee733748d255ff29 (patch)
treee17930368a0dbdd460e99808795beaa1f815497f /cpukit/libnetworking
parenttermios: Separate flow control from normal handler (diff)
downloadrtems-7fd5e89c96cc92254e36012eee733748d255ff29.tar.bz2
termios: Partially hide rtems_termios_tty
Move interrupt lock to device context and expose only this structure to the read, write and set attributes device handler. This makes these device handler independent of the general Termios infrastructure suitable for direct use in printk() support.
Diffstat (limited to 'cpukit/libnetworking')
-rw-r--r--cpukit/libnetworking/net/if_ppp.c2
-rw-r--r--cpukit/libnetworking/net/ppp_tty.c5
2 files changed, 4 insertions, 3 deletions
diff --git a/cpukit/libnetworking/net/if_ppp.c b/cpukit/libnetworking/net/if_ppp.c
index a1d7a62568..95fa556f25 100644
--- a/cpukit/libnetworking/net/if_ppp.c
+++ b/cpukit/libnetworking/net/if_ppp.c
@@ -387,7 +387,7 @@ static rtems_task ppp_txdaemon(rtems_task_argument arg)
/* write out frame byte to start the transmission */
sc->sc_outchar = (u_char)PPP_FLAG;
- (*tp->handler.write)(tp, (char *)&sc->sc_outchar, 1);
+ (*tp->handler.write)(tp->device_context, (char *)&sc->sc_outchar, 1);
}
/* check to see if we need to free some empty mbufs */
diff --git a/cpukit/libnetworking/net/ppp_tty.c b/cpukit/libnetworking/net/ppp_tty.c
index 613d9c5f82..85a336cbf4 100644
--- a/cpukit/libnetworking/net/ppp_tty.c
+++ b/cpukit/libnetworking/net/ppp_tty.c
@@ -568,6 +568,7 @@ pppstart(struct rtems_termios_tty *tp)
u_long ioffset = (u_long )0;
struct mbuf *m = (struct mbuf *)0;
struct ppp_softc *sc = tp->t_sc;
+ rtems_termios_device_context *ctx = rtems_termios_get_device_context(tp);
/* ensure input is valid and we are busy */
if (( sc != NULL ) && ( sc->sc_outflag & SC_TX_BUSY )) {
@@ -606,7 +607,7 @@ pppstart(struct rtems_termios_tty *tp)
sc->sc_outflag |= SC_TX_LASTCHAR;
sc->sc_outflag &=~(SC_TX_FCS);
sc->sc_outchar = (u_char)PPP_FLAG;
- (*tp->handler.write)(tp, (char *)&sc->sc_outchar, 1);
+ (*tp->handler.write)(ctx, (char *)&sc->sc_outchar, 1);
return(0);
}
}
@@ -643,7 +644,7 @@ pppstart(struct rtems_termios_tty *tp)
}
/* write out the character(s) and update the stats */
- (*tp->handler.write)(tp, (char *)sendBegin, (ioffset > 0) ? ioffset : 1);
+ (*tp->handler.write)(ctx, (char *)sendBegin, (ioffset > 0) ? ioffset : 1);
sc->sc_stats.ppp_obytes += (ioffset > 0) ? ioffset : 1;
sc->sc_outoff += ioffset;
}