Install line discipline the new way.
This commit is contained in:
+8
-13
@@ -143,6 +143,11 @@ void pppinput __P((int c, struct tty *tp));
|
||||
int pppioctl __P((struct ifnet *ifp, int cmd, caddr_t data));
|
||||
void pppstart __P((struct tty *tp));
|
||||
|
||||
static struct linesw pppdisc = {
|
||||
pppopen, pppclose, pppread, pppwrite, ppptioctl,
|
||||
pppinput, pppstart, nullmodem
|
||||
};
|
||||
|
||||
static int pppasyncstart __P((struct ppp_softc *));
|
||||
static u_short pppfcs __P((u_short fcs, u_char *cp, int len));
|
||||
static int pppgetm __P((struct ppp_softc *sc));
|
||||
@@ -188,11 +193,13 @@ pppattach()
|
||||
register struct ppp_softc *sc;
|
||||
register int i = 0;
|
||||
|
||||
linesw[PPPDISC] = pppdisc;
|
||||
|
||||
for (sc = ppp_softc; i < NPPP; sc++) {
|
||||
sc->sc_if.if_name = "ppp";
|
||||
sc->sc_if.if_unit = i++;
|
||||
sc->sc_if.if_mtu = PPP_MTU;
|
||||
sc->sc_if.if_flags = IFF_POINTOPOINT | IFF_MULTICAST;
|
||||
sc->sc_if.if_flags = IFF_POINTOPOINT;
|
||||
sc->sc_if.if_type = IFT_PPP;
|
||||
sc->sc_if.if_hdrlen = PPP_HDRLEN;
|
||||
sc->sc_if.if_ioctl = pppioctl;
|
||||
@@ -1489,18 +1496,6 @@ pppioctl(ifp, cmd, data)
|
||||
case SIOCGIFMTU:
|
||||
ifr->ifr_mtu = sc->sc_if.if_mtu;
|
||||
break;
|
||||
case SIOCADDMULTI:
|
||||
case SIOCDELMULTI:
|
||||
switch(ifr->ifr_addr.sa_family) {
|
||||
#ifdef INET
|
||||
case AF_INET:
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
error = EAFNOSUPPORT;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
error = EINVAL;
|
||||
|
||||
+11
-2
@@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)if_sl.c 8.6 (Berkeley) 2/1/94
|
||||
* $Id: if_sl.c,v 1.6 1994/09/12 11:49:49 davidg Exp $
|
||||
* $Id: if_sl.c,v 1.7 1994/09/13 16:05:50 davidg Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -184,6 +184,13 @@ struct sl_softc sl_softc[NSL];
|
||||
static int slinit __P((struct sl_softc *));
|
||||
static struct mbuf *sl_btom __P((struct sl_softc *, int));
|
||||
|
||||
|
||||
#define ttyerrio ((int (*) __P((struct tty *, struct uio *, int)))enodev)
|
||||
|
||||
static struct linesw slipdisc =
|
||||
{ slopen, slclose, ttyerrio, ttyerrio, sltioctl,
|
||||
slinput, slstart, nullmodem };
|
||||
|
||||
/*
|
||||
* Called from boot code to establish sl interfaces.
|
||||
*/
|
||||
@@ -193,6 +200,8 @@ slattach()
|
||||
register struct sl_softc *sc;
|
||||
register int i = 0;
|
||||
|
||||
linesw[SLIPDISC] = slipdisc;
|
||||
|
||||
for (sc = sl_softc; i < NSL; sc++) {
|
||||
sc->sc_if.if_name = "sl";
|
||||
sc->sc_if.if_next = NULL;
|
||||
@@ -212,7 +221,7 @@ slattach()
|
||||
}
|
||||
}
|
||||
|
||||
TEXT_SET(pseudo_set, slattach);
|
||||
PSEUDO_SET(slattach);
|
||||
|
||||
static int
|
||||
slinit(sc)
|
||||
|
||||
Reference in New Issue
Block a user