Lines Matching refs:pid
69 u16 pid; /* protocol ID */ member
112 static inline struct proto* get_proto(struct net_device *dev, u16 pid) in get_proto() argument
116 switch (pid) { in get_proto()
128 static inline const char* proto_name(u16 pid) in proto_name() argument
130 switch (pid) { in proto_name()
207 static void ppp_tx_cp(struct net_device *dev, u16 pid, u8 code, in ppp_tx_cp() argument
220 if (pid == PID_LCP && (code == LCP_ECHO_REQ || code == LCP_ECHO_REPLY)) in ppp_tx_cp()
250 proto_name(pid), code_names[code], id, debug_buffer); in ppp_tx_cp()
253 ppp_hard_header(skb, dev, pid, NULL, NULL, 0); in ppp_tx_cp()
304 static void ppp_cp_event(struct net_device *dev, u16 pid, u16 event, u8 code, in ppp_cp_event() argument
309 struct proto *proto = get_proto(dev, pid); in ppp_cp_event()
317 proto_name(pid), event_names[event], state_names[proto->state]); in ppp_cp_event()
333 ppp_tx_cp(dev, pid, CP_CONF_REQ, proto->cr_id = ++ppp->seq, in ppp_cp_event()
336 ppp_tx_cp(dev, pid, CP_CONF_ACK, id, len, data); in ppp_cp_event()
338 ppp_tx_cp(dev, pid, code, id, len, data); in ppp_cp_event()
340 ppp_tx_cp(dev, pid, CP_TERM_REQ, ++ppp->seq, 0, NULL); in ppp_cp_event()
342 ppp_tx_cp(dev, pid, CP_TERM_ACK, id, 0, NULL); in ppp_cp_event()
344 ppp_tx_cp(dev, pid, CP_CODE_REJ, ++ppp->seq, len, data); in ppp_cp_event()
347 netdev_info(dev, "%s up\n", proto_name(pid)); in ppp_cp_event()
348 if (pid == PID_LCP) { in ppp_cp_event()
358 netdev_info(dev, "%s down\n", proto_name(pid)); in ppp_cp_event()
359 if (pid == PID_LCP) { in ppp_cp_event()
370 proto_name(pid), event_names[event], state_names[proto->state]); in ppp_cp_event()
375 static void ppp_cp_parse_cr(struct net_device *dev, u16 pid, u8 id, in ppp_cp_parse_cr() argument
395 if (pid == PID_LCP) in ppp_cp_parse_cr()
423 ppp_cp_event(dev, pid, RCR_BAD, CP_CONF_REJ, id, rej_len, out); in ppp_cp_parse_cr()
425 ppp_cp_event(dev, pid, RCR_BAD, CP_CONF_NAK, id, nak_len, out); in ppp_cp_parse_cr()
427 ppp_cp_event(dev, pid, RCR_GOOD, CP_CONF_ACK, id, req_len, data); in ppp_cp_parse_cr()
441 u16 pid; in ppp_rx() local
456 pid = ntohs(hdr->protocol); in ppp_rx()
457 proto = get_proto(dev, pid); in ppp_rx()
484 printk(KERN_DEBUG "%s: RX %s %s\n", dev->name, proto_name(pid), in ppp_rx()
489 if (pid == PID_LCP) in ppp_rx()
492 pid = ntohs(*(__be16*)skb->data); in ppp_rx()
493 if (pid == PID_LCP || pid == PID_IPCP || in ppp_rx()
494 pid == PID_IPV6CP) in ppp_rx()
495 ppp_cp_event(dev, pid, RXJ_BAD, 0, 0, in ppp_rx()
517 ppp_cp_parse_cr(dev, pid, cp->id, len, skb->data); in ppp_rx()
522 ppp_cp_event(dev, pid, RCA, 0, 0, 0, NULL); in ppp_rx()
528 ppp_cp_event(dev, pid, RCN, 0, 0, 0, NULL); in ppp_rx()
532 ppp_cp_event(dev, pid, RTR, 0, cp->id, 0, NULL); in ppp_rx()
536 ppp_cp_event(dev, pid, RTA, 0, 0, 0, NULL); in ppp_rx()
540 ppp_cp_event(dev, pid, RXJ_BAD, 0, 0, 0, NULL); in ppp_rx()
547 ppp_cp_event(dev, pid, RUC, 0, 0, len, cp); in ppp_rx()
574 ppp_cp_event(proto->dev, proto->pid, TO_GOOD, 0, 0, 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()
618 ppp->protos[IDX_LCP].pid = PID_LCP; in ppp_start()
619 ppp->protos[IDX_IPCP].pid = PID_IPCP; in ppp_start()
620 ppp->protos[IDX_IPV6CP].pid = PID_IPV6CP; in ppp_start()