ppp: Let the upper layer handle open / up events

This removes the need for the layer_started functions in lcp and ipcp.
For LCP the link is always up unless the socket has been closed, and for
IPCP the link should be opened as soon as LCP is ready anyway.
This commit is contained in:
Denis Kenzior 2010-04-13 13:58:12 -05:00
parent 87939c2fcf
commit 9116b7e8f8
3 changed files with 2 additions and 19 deletions

View File

@ -385,6 +385,7 @@ static void ppp_transition_phase(GAtPPP *ppp, enum ppp_phase phase)
/* bring network phase up */
ppp_net_open(ppp->net);
pppcp_signal_open(ppp->ipcp);
pppcp_signal_up(ppp->ipcp);
break;
}
}
@ -481,6 +482,7 @@ void g_at_ppp_open(GAtPPP *ppp)
{
/* send an open event to the lcp layer */
pppcp_signal_open(ppp->lcp);
pppcp_signal_up(ppp->lcp);
}
void g_at_ppp_set_credentials(GAtPPP *ppp, const char *username,

View File

@ -149,14 +149,6 @@ static void ipcp_down(struct pppcp_data *pppcp)
pppcp_set_local_options(pppcp, ipcp->options, ipcp->options_len);
}
/*
* Tell the protocol to start the handshake
*/
static void ipcp_started(struct pppcp_data *data)
{
pppcp_signal_up(data);
}
static void ipcp_finished(struct pppcp_data *pppcp)
{
}
@ -300,7 +292,6 @@ struct pppcp_proto ipcp_proto = {
.supported_codes = IPCP_SUPPORTED_CODES,
.this_layer_up = ipcp_up,
.this_layer_down = ipcp_down,
.this_layer_started = ipcp_started,
.this_layer_finished = ipcp_finished,
.rca = ipcp_rca,
.rcn_nak = ipcp_rcn_nak,

View File

@ -117,15 +117,6 @@ static void lcp_down(struct pppcp_data *pppcp)
pppcp_set_local_options(pppcp, lcp->options, lcp->options_len);
}
/*
* Indicate that the lower layer is now needed
* Should trigger Up event
*/
static void lcp_started(struct pppcp_data *pppcp)
{
ppp_generate_event(pppcp_get_ppp(pppcp), PPP_UP);
}
/*
* Indicate that the lower layer is not needed
* Should trigger Down event
@ -233,7 +224,6 @@ struct pppcp_proto lcp_proto = {
.supported_codes = LCP_SUPPORTED_CODES,
.this_layer_up = lcp_up,
.this_layer_down = lcp_down,
.this_layer_started = lcp_started,
.this_layer_finished = lcp_finished,
.rca = lcp_rca,
.rcn_nak = lcp_rcn_nak,