Lines Matching refs:proto
65 struct proto { struct
76 struct proto protos[IDX_COUNT]; argument
112 static inline struct proto* get_proto(struct net_device *dev, u16 pid) in get_proto()
309 struct proto *proto = get_proto(dev, pid); in ppp_cp_event() local
311 old_state = proto->state; in ppp_cp_event()
317 proto_name(pid), event_names[event], state_names[proto->state]); in ppp_cp_event()
322 proto->state = action & STATE_MASK; in ppp_cp_event()
324 mod_timer(&proto->timer, proto->timeout = in ppp_cp_event()
327 proto->restart_counter = 0; in ppp_cp_event()
329 proto->restart_counter = (proto->state == STOPPING) ? in ppp_cp_event()
333 ppp_tx_cp(dev, pid, CP_CONF_REQ, proto->cr_id = ++ppp->seq, in ppp_cp_event()
346 if (old_state != OPENED && proto->state == OPENED) { in ppp_cp_event()
353 mod_timer(&proto->timer, proto->timeout = in ppp_cp_event()
357 if (old_state == OPENED && proto->state != OPENED) { in ppp_cp_event()
365 if (old_state != CLOSED && proto->state == CLOSED) in ppp_cp_event()
366 del_timer(&proto->timer); in ppp_cp_event()
370 proto_name(pid), event_names[event], state_names[proto->state]); in ppp_cp_event()
437 struct proto *proto; in ppp_rx() local
457 proto = get_proto(dev, pid); in ppp_rx()
458 if (!proto) { in ppp_rx()
500 if (len >= 4 && proto->state == OPENED) in ppp_rx()
521 if (cp->id == proto->cr_id) in ppp_rx()
527 if (cp->id == proto->cr_id) in ppp_rx()
563 struct proto *proto = (struct proto *)arg; in ppp_timer() local
564 struct ppp *ppp = get_ppp(proto->dev); in ppp_timer()
568 switch (proto->state) { in ppp_timer()
573 if (proto->restart_counter) { in ppp_timer()
574 ppp_cp_event(proto->dev, proto->pid, TO_GOOD, 0, 0, in ppp_timer()
576 proto->restart_counter--; in ppp_timer()
578 ppp_cp_event(proto->dev, proto->pid, TO_BAD, 0, 0, in ppp_timer()
583 if (proto->pid != PID_LCP) in ppp_timer()
587 netdev_info(proto->dev, "Link down\n"); in ppp_timer()
588 ppp_cp_event(proto->dev, PID_LCP, STOP, 0, 0, 0, NULL); in ppp_timer()
589 ppp_cp_event(proto->dev, PID_LCP, START, 0, 0, 0, NULL); in ppp_timer()
592 ppp_tx_cp(proto->dev, PID_LCP, LCP_ECHO_REQ, in ppp_timer()
594 proto->timer.expires = jiffies + in ppp_timer()
596 add_timer(&proto->timer); in ppp_timer()
611 struct proto *proto = &ppp->protos[i]; in ppp_start() local
612 proto->dev = dev; in ppp_start()
613 init_timer(&proto->timer); in ppp_start()
614 proto->timer.function = ppp_timer; in ppp_start()
615 proto->timer.data = (unsigned long)proto; in ppp_start()
616 proto->state = CLOSED; in ppp_start()
635 static struct hdlc_proto proto = { variable
657 if (dev_to_hdlc(dev)->proto != &proto) in ppp_ioctl()
675 result = attach_hdlc_protocol(dev, &proto, sizeof(struct ppp)); in ppp_ioctl()
701 register_hdlc_protocol(&proto); in mod_init()
707 unregister_hdlc_protocol(&proto); in mod_exit()