Lines Matching full:iface

41 static void ppp_update_rx_stats(struct net_if *iface,  in ppp_update_rx_stats()  argument
45 ppp_stats_update_bytes_rx(iface, length); in ppp_update_rx_stats()
46 ppp_stats_update_pkts_rx(iface); in ppp_update_rx_stats()
50 static void ppp_update_tx_stats(struct net_if *iface, in ppp_update_tx_stats() argument
54 ppp_stats_update_bytes_tx(iface, length); in ppp_update_tx_stats()
55 ppp_stats_update_pkts_tx(iface); in ppp_update_tx_stats()
60 typedef enum net_verdict (*ppp_l2_callback_t)(struct net_if *iface,
71 static enum net_verdict process_ppp_msg(struct net_if *iface, in process_ppp_msg() argument
74 struct ppp_context *ctx = net_if_l2_data(iface); in process_ppp_msg()
103 return proto->handler(ctx, iface, pkt); in process_ppp_msg()
114 ppp_send_proto_rej(iface, pkt, protocol); in process_ppp_msg()
130 static enum net_verdict ppp_recv(struct net_if *iface, in ppp_recv() argument
140 return testing_cb(iface, pkt); in ppp_recv()
144 ppp_update_rx_stats(iface, pkt, net_pkt_get_len(pkt)); in ppp_recv()
150 verdict = process_ppp_msg(iface, pkt); in ppp_recv()
157 ppp_stats_update_drop_rx(iface); in ppp_recv()
166 static int ppp_send(struct net_if *iface, struct net_pkt *pkt) in ppp_send() argument
168 const struct ppp_api *api = net_if_get_device(iface)->api; in ppp_send()
169 struct ppp_context *ctx = net_if_l2_data(iface); in ppp_send()
183 ret = net_l2_send(api->send, net_if_get_device(iface), iface, pkt); in ppp_send()
186 ppp_update_tx_stats(iface, pkt, ret); in ppp_send()
193 static enum net_l2_flags ppp_flags(struct net_if *iface) in ppp_flags() argument
195 struct ppp_context *ctx = net_if_l2_data(iface); in ppp_flags()
211 static int ppp_up(struct net_if *iface) in ppp_up() argument
213 const struct ppp_api *ppp = net_if_get_device(iface)->api; in ppp_up()
216 ppp->start(net_if_get_device(iface)); in ppp_up()
268 static int ppp_down(struct net_if *iface) in ppp_down() argument
270 const struct ppp_api *ppp = net_if_get_device(iface)->api; in ppp_down()
271 struct ppp_context *ctx = net_if_l2_data(iface); in ppp_down()
273 if (net_if_is_carrier_ok(iface)) { in ppp_down()
287 ppp->stop(net_if_get_device(iface)); in ppp_down()
293 static int ppp_enable(struct net_if *iface, bool state) in ppp_enable() argument
295 struct ppp_context *ctx = net_if_l2_data(iface); in ppp_enable()
303 ret = ppp_up(iface); in ppp_enable()
305 ret = ppp_down(iface); in ppp_enable()
320 struct net_if **iface) in get_ppp_context() argument
322 *iface = net_if_get_by_index(idx); in get_ppp_context()
324 if (!*iface) { in get_ppp_context()
328 if (net_if_l2(*iface) != &NET_L2_GET_NAME(PPP)) { in get_ppp_context()
332 *ctx = net_if_l2_data(*iface); in get_ppp_context()
353 struct net_if *iface; in net_ppp_ping() local
356 ret = get_ppp_context(idx, &ctx, &iface); in net_ppp_ping()
366 ret = ppp_send_pkt(&ctx->lcp.fsm, iface, PPP_ECHO_REQ, 0, in net_ppp_ping()
388 struct net_if *iface; in net_ppp_context_get() local
392 iface = net_if_get_first_by_type(&NET_L2_GET_NAME(PPP)); in net_ppp_context_get()
393 if (!iface) { in net_ppp_context_get()
397 return net_if_l2_data(iface); in net_ppp_context_get()
400 ret = get_ppp_context(idx, &ctx, &iface); in net_ppp_context_get()
446 struct net_if *iface) in net_ppp_mgmt_evt_handler() argument
450 if (net_if_l2(iface) != &NET_L2_GET_NAME(PPP)) { in net_ppp_mgmt_evt_handler()
454 ctx = net_if_l2_data(iface); in net_ppp_mgmt_evt_handler()
456 if (net_if_is_carrier_ok(iface)) { in net_ppp_mgmt_evt_handler()
457 ppp_mgmt_raise_carrier_on_event(iface); in net_ppp_mgmt_evt_handler()
459 ppp_mgmt_raise_carrier_off_event(iface); in net_ppp_mgmt_evt_handler()
467 if ((mgmt_event == NET_EVENT_IF_DOWN) && (!net_if_is_carrier_ok(iface))) { in net_ppp_mgmt_evt_handler()
472 void net_ppp_init(struct net_if *iface) in net_ppp_init() argument
474 struct ppp_context *ctx = net_if_l2_data(iface); in net_ppp_init()
477 NET_DBG("Initializing PPP L2 %p for iface %p", ctx, iface); in net_ppp_init()
482 ctx->iface = iface; in net_ppp_init()