Lines Matching refs:proto

62 struct proto {  struct
73 struct proto protos[IDX_COUNT]; argument
110 static inline struct proto *get_proto(struct net_device *dev, u16 pid) in get_proto()
304 struct proto *proto = get_proto(dev, pid); in ppp_cp_event() local
306 old_state = proto->state; in ppp_cp_event()
312 proto_name(pid), event_names[event], state_names[proto->state]); in ppp_cp_event()
317 proto->state = action & STATE_MASK; in ppp_cp_event()
319 mod_timer(&proto->timer, proto->timeout = in ppp_cp_event()
322 proto->restart_counter = 0; in ppp_cp_event()
324 proto->restart_counter = (proto->state == STOPPING) ? in ppp_cp_event()
328 ppp_tx_cp(dev, pid, CP_CONF_REQ, proto->cr_id = ++ppp->seq, in ppp_cp_event()
341 if (old_state != OPENED && proto->state == OPENED) { in ppp_cp_event()
348 mod_timer(&proto->timer, proto->timeout = in ppp_cp_event()
352 if (old_state == OPENED && proto->state != OPENED) { in ppp_cp_event()
360 if (old_state != CLOSED && proto->state == CLOSED) in ppp_cp_event()
361 del_timer(&proto->timer); in ppp_cp_event()
365 proto_name(pid), event_names[event], state_names[proto->state]); in ppp_cp_event()
438 struct proto *proto; in ppp_rx() local
458 proto = get_proto(dev, pid); in ppp_rx()
459 if (!proto) { in ppp_rx()
501 if (len >= 4 && proto->state == OPENED) in ppp_rx()
522 if (cp->id == proto->cr_id) in ppp_rx()
528 if (cp->id == proto->cr_id) in ppp_rx()
564 struct proto *proto = from_timer(proto, t, timer); in ppp_timer() local
565 struct ppp *ppp = get_ppp(proto->dev); in ppp_timer()
572 if (timer_pending(&proto->timer)) { in ppp_timer()
576 switch (proto->state) { in ppp_timer()
581 if (proto->restart_counter) { in ppp_timer()
582 ppp_cp_event(proto->dev, proto->pid, TO_GOOD, 0, 0, in ppp_timer()
584 proto->restart_counter--; in ppp_timer()
585 } else if (netif_carrier_ok(proto->dev)) in ppp_timer()
586 ppp_cp_event(proto->dev, proto->pid, TO_GOOD, 0, 0, in ppp_timer()
589 ppp_cp_event(proto->dev, proto->pid, TO_BAD, 0, 0, in ppp_timer()
594 if (proto->pid != PID_LCP) in ppp_timer()
598 netdev_info(proto->dev, "Link down\n"); in ppp_timer()
599 ppp_cp_event(proto->dev, PID_LCP, STOP, 0, 0, 0, NULL); in ppp_timer()
600 ppp_cp_event(proto->dev, PID_LCP, START, 0, 0, 0, NULL); in ppp_timer()
603 ppp_tx_cp(proto->dev, PID_LCP, LCP_ECHO_REQ, in ppp_timer()
605 proto->timer.expires = jiffies + in ppp_timer()
607 add_timer(&proto->timer); in ppp_timer()
621 struct proto *proto = &ppp->protos[i]; in ppp_start() local
623 proto->dev = dev; in ppp_start()
624 timer_setup(&proto->timer, ppp_timer, 0); in ppp_start()
625 proto->state = CLOSED; in ppp_start()
644 static struct hdlc_proto proto = { variable
666 if (dev_to_hdlc(dev)->proto != &proto) in ppp_ioctl()
685 result = attach_hdlc_protocol(dev, &proto, sizeof(struct ppp)); in ppp_ioctl()
711 register_hdlc_protocol(&proto); in hdlc_ppp_init()
717 unregister_hdlc_protocol(&proto); in hdlc_ppp_exit()