diff options
author | phk <phk@FreeBSD.org> | 1998-12-16 18:42:38 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1998-12-16 18:42:38 +0000 |
commit | 4674dad527e098e67d75cc31e7d53776b25cc495 (patch) | |
tree | 107318c0be34d58d31886d9714d346ab46b94cea /sys/net | |
parent | 28d6420f45416c97f037bc61378036eaa76779f7 (diff) | |
download | FreeBSD-src-4674dad527e098e67d75cc31e7d53776b25cc495.zip FreeBSD-src-4674dad527e098e67d75cc31e7d53776b25cc495.tar.gz |
Straigthen out the use of the tls and tlf callbacks.
Not tested on the if_sr, if_cx and if_ar drivers, but
expected to work just the same as it used to.
Any users of these drivers (or even better: donors
of hardware for them) please contact phk@freebsd.org
so we can test the next batch of changes to if_sppp.
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/if_spppsubr.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/sys/net/if_spppsubr.c b/sys/net/if_spppsubr.c index 8a64aa4..7da9809 100644 --- a/sys/net/if_spppsubr.c +++ b/sys/net/if_spppsubr.c @@ -17,7 +17,7 @@ * * From: Version 2.4, Thu Apr 30 17:17:21 MSD 1997 * - * $Id: if_spppsubr.c,v 1.46 1998/12/04 22:54:52 archie Exp $ + * $Id: if_spppsubr.c,v 1.47 1998/12/11 21:40:13 phk Exp $ */ #include <sys/param.h> @@ -1405,12 +1405,12 @@ sppp_cp_input(const struct cp *cp, struct sppp *sp, struct mbuf *m) case STATE_ACK_SENT: break; case STATE_CLOSING: - (cp->tlf)(sp); sppp_cp_change_state(cp, sp, STATE_CLOSED); + (cp->tlf)(sp); break; case STATE_STOPPING: - (cp->tlf)(sp); sppp_cp_change_state(cp, sp, STATE_STOPPED); + (cp->tlf)(sp); break; case STATE_ACK_RCVD: sppp_cp_change_state(cp, sp, STATE_REQ_SENT); @@ -1575,8 +1575,9 @@ sppp_down_event(const struct cp *cp, struct sppp *sp) sppp_cp_change_state(cp, sp, STATE_INITIAL); break; case STATE_STOPPED: + sppp_cp_change_state(cp, sp, STATE_STARTING); (cp->tls)(sp); - /* fall through */ + break; case STATE_STOPPING: case STATE_REQ_SENT: case STATE_ACK_RCVD: @@ -1607,8 +1608,8 @@ sppp_open_event(const struct cp *cp, struct sppp *sp) switch (sp->state[cp->protoidx]) { case STATE_INITIAL: - (cp->tls)(sp); sppp_cp_change_state(cp, sp, STATE_STARTING); + (cp->tls)(sp); break; case STATE_STARTING: break; @@ -1647,8 +1648,8 @@ sppp_close_event(const struct cp *cp, struct sppp *sp) case STATE_CLOSING: break; case STATE_STARTING: - (cp->tlf)(sp); sppp_cp_change_state(cp, sp, STATE_INITIAL); + (cp->tlf)(sp); break; case STATE_STOPPED: sppp_cp_change_state(cp, sp, STATE_CLOSED); @@ -1686,18 +1687,18 @@ sppp_to_event(const struct cp *cp, struct sppp *sp) /* TO- event */ switch (sp->state[cp->protoidx]) { case STATE_CLOSING: - (cp->tlf)(sp); sppp_cp_change_state(cp, sp, STATE_CLOSED); + (cp->tlf)(sp); break; case STATE_STOPPING: - (cp->tlf)(sp); sppp_cp_change_state(cp, sp, STATE_STOPPED); + (cp->tlf)(sp); break; case STATE_REQ_SENT: case STATE_ACK_RCVD: case STATE_ACK_SENT: - (cp->tlf)(sp); sppp_cp_change_state(cp, sp, STATE_STOPPED); + (cp->tlf)(sp); break; } else @@ -2336,6 +2337,8 @@ sppp_lcp_tls(struct sppp *sp) /* Notify lower layer if desired. */ if (sp->pp_tls) (sp->pp_tls)(sp); + else + (sp->pp_up)(sp); } static void @@ -2350,6 +2353,8 @@ sppp_lcp_tlf(struct sppp *sp) /* Notify lower layer if desired. */ if (sp->pp_tlf) (sp->pp_tlf)(sp); + else + (sp->pp_down)(sp); } static void |