Lines Matching +full:entry +full:- +full:name
1 // SPDX-License-Identifier: GPL-2.0-only
68 /* mpc_daemon -> kernel */
87 static void purge_egress_shortcut(struct atm_vcc *vcc, eg_cache_entry *entry);
134 if (mpc->dev_num == itf) in find_mpc_by_itfnum()
136 mpc = mpc->next; in find_mpc_by_itfnum()
148 if (mpc->mpoad_vcc == vcc) in find_mpc_by_vcc()
150 mpc = mpc->next; in find_mpc_by_vcc()
162 if (mpc->dev == dev) in find_mpc_by_lec()
164 mpc = mpc->next; in find_mpc_by_lec()
175 * Overwrites the old entry or makes a new one.
179 struct atm_mpoa_qos *entry; in atm_mpoa_add_qos() local
181 entry = atm_mpoa_search_qos(dst_ip); in atm_mpoa_add_qos()
182 if (entry != NULL) { in atm_mpoa_add_qos()
183 entry->qos = *qos; in atm_mpoa_add_qos()
184 return entry; in atm_mpoa_add_qos()
187 entry = kmalloc(sizeof(struct atm_mpoa_qos), GFP_KERNEL); in atm_mpoa_add_qos()
188 if (entry == NULL) { in atm_mpoa_add_qos()
190 return entry; in atm_mpoa_add_qos()
193 entry->ipaddr = dst_ip; in atm_mpoa_add_qos()
194 entry->qos = *qos; in atm_mpoa_add_qos()
196 entry->next = qos_head; in atm_mpoa_add_qos()
197 qos_head = entry; in atm_mpoa_add_qos()
199 return entry; in atm_mpoa_add_qos()
208 if (qos->ipaddr == dst_ip) in atm_mpoa_search_qos()
210 qos = qos->next; in atm_mpoa_search_qos()
219 int atm_mpoa_delete_qos(struct atm_mpoa_qos *entry) in atm_mpoa_delete_qos() argument
223 if (entry == NULL) in atm_mpoa_delete_qos()
225 if (entry == qos_head) { in atm_mpoa_delete_qos()
226 qos_head = qos_head->next; in atm_mpoa_delete_qos()
227 kfree(entry); in atm_mpoa_delete_qos()
233 if (curr->next == entry) { in atm_mpoa_delete_qos()
234 curr->next = entry->next; in atm_mpoa_delete_qos()
235 kfree(entry); in atm_mpoa_delete_qos()
238 curr = curr->next; in atm_mpoa_delete_qos()
244 /* this is buggered - we need locking for qos_head */
254 seq_printf(m, "%pI4\n %-7d %-7d %-7d %-7d %-7d\n %-7d %-7d %-7d %-7d %-7d\n", in atm_mpoa_disp_qos()
255 &qos->ipaddr, in atm_mpoa_disp_qos()
256 qos->qos.txtp.max_pcr, in atm_mpoa_disp_qos()
257 qos->qos.txtp.pcr, in atm_mpoa_disp_qos()
258 qos->qos.txtp.min_pcr, in atm_mpoa_disp_qos()
259 qos->qos.txtp.max_cdv, in atm_mpoa_disp_qos()
260 qos->qos.txtp.max_sdu, in atm_mpoa_disp_qos()
261 qos->qos.rxtp.max_pcr, in atm_mpoa_disp_qos()
262 qos->qos.rxtp.pcr, in atm_mpoa_disp_qos()
263 qos->qos.rxtp.min_pcr, in atm_mpoa_disp_qos()
264 qos->qos.rxtp.max_cdv, in atm_mpoa_disp_qos()
265 qos->qos.rxtp.max_sdu); in atm_mpoa_disp_qos()
266 qos = qos->next; in atm_mpoa_disp_qos()
273 char name[IFNAMSIZ]; in find_lec_by_itfnum() local
275 sprintf(name, "lec%d", itf); in find_lec_by_itfnum()
276 dev = dev_get_by_name(&init_net, name); in find_lec_by_itfnum()
288 rwlock_init(&mpc->ingress_lock); in alloc_mpc()
289 rwlock_init(&mpc->egress_lock); in alloc_mpc()
290 mpc->next = mpcs; in alloc_mpc()
293 mpc->parameters.mpc_p1 = MPC_P1; in alloc_mpc()
294 mpc->parameters.mpc_p2 = MPC_P2; in alloc_mpc()
295 memset(mpc->parameters.mpc_p3, 0, sizeof(mpc->parameters.mpc_p3)); in alloc_mpc()
296 mpc->parameters.mpc_p4 = MPC_P4; in alloc_mpc()
297 mpc->parameters.mpc_p5 = MPC_P5; in alloc_mpc()
298 mpc->parameters.mpc_p6 = MPC_P6; in alloc_mpc()
315 dprintk("(%s)\n", mpc->dev->name); in start_mpc()
316 if (!dev->netdev_ops) in start_mpc()
317 pr_info("(%s) not starting\n", dev->name); in start_mpc()
319 mpc->old_ops = dev->netdev_ops; in start_mpc()
320 mpc->new_ops = *mpc->old_ops; in start_mpc()
321 mpc->new_ops.ndo_start_xmit = mpc_send_packet; in start_mpc()
322 dev->netdev_ops = &mpc->new_ops; in start_mpc()
328 struct net_device *dev = mpc->dev; in stop_mpc()
329 dprintk("(%s)", mpc->dev->name); in stop_mpc()
331 /* Lets not nullify lec device's dev->hard_start_xmit */ in stop_mpc()
332 if (dev->netdev_ops != &mpc->new_ops) { in stop_mpc()
338 dev->netdev_ops = mpc->old_ops; in stop_mpc()
339 mpc->old_ops = NULL; in stop_mpc()
350 return "non-MPOA device"; in mpoa_device_type_string()
359 return "unspecified (non-MPOA) device"; in mpoa_device_type_string()
363 * lec device calls this via its netdev_priv(dev)->lane2_ops
364 * ->associate_indicator() when it sees a TLV in LE_ARP packet.
384 dprintk("(%s) received TLV(s), ", dev->name); in lane2_assoc_ind()
386 mpc = find_mpc_by_lec(dev); /* Sampo-Fix: moved here from below */ in lane2_assoc_ind()
388 pr_info("(%s) no mpc\n", dev->name); in lane2_assoc_ind()
392 while (end_of_tlvs - tlvs >= 5) { in lane2_assoc_ind()
405 dev->name); in lane2_assoc_ind()
416 dev->name, mpoa_device_type_string(mpoa_device_type)); in lane2_assoc_ind()
420 dev->name); in lane2_assoc_ind()
425 pr_info("(%s) short MPOA Device Type TLV\n", dev->name); in lane2_assoc_ind()
430 dprintk("ignoring non-MPS device "); in lane2_assoc_ind()
437 pr_info("(%s) MPS_AND_MPC has zero MACs\n", dev->name); in lane2_assoc_ind()
454 if (end_of_tlvs - tlvs != 0) in lane2_assoc_ind()
456 dev->name, end_of_tlvs - tlvs); in lane2_assoc_ind()
461 * plus the possible MAC address(es) to mpc->mps_macs.
462 * For a freshly allocated MPOA client mpc->mps_macs == 0.
472 if (mpc->number_of_mps_macs != num_macs) { /* need to reallocate? */ in copy_macs()
473 if (mpc->number_of_mps_macs != 0) in copy_macs()
474 kfree(mpc->mps_macs); in copy_macs()
475 mpc->number_of_mps_macs = 0; in copy_macs()
476 mpc->mps_macs = kmalloc_array(ETH_ALEN, num_macs, GFP_KERNEL); in copy_macs()
477 if (mpc->mps_macs == NULL) { in copy_macs()
478 pr_info("(%s) out of mem\n", mpc->dev->name); in copy_macs()
482 ether_addr_copy(mpc->mps_macs, router_mac); in copy_macs()
485 memcpy(mpc->mps_macs, tlvs, mps_macs*ETH_ALEN); in copy_macs()
487 mpc->number_of_mps_macs = num_macs; in copy_macs()
494 in_cache_entry *entry; in send_via_shortcut() local
507 buff = skb->data + mpc->dev->hard_header_len; in send_via_shortcut()
509 ipaddr = iph->daddr; in send_via_shortcut()
512 mpc->dev->name, ipaddr); in send_via_shortcut()
514 entry = mpc->in_ops->get(ipaddr, mpc); in send_via_shortcut()
515 if (entry == NULL) { in send_via_shortcut()
516 entry = mpc->in_ops->add_entry(ipaddr, mpc); in send_via_shortcut()
517 if (entry != NULL) in send_via_shortcut()
518 mpc->in_ops->put(entry); in send_via_shortcut()
522 if (mpc->in_ops->cache_hit(entry, mpc) != OPEN) { in send_via_shortcut()
524 mpc->dev->name); in send_via_shortcut()
525 mpc->in_ops->put(entry); in send_via_shortcut()
530 mpc->dev->name); in send_via_shortcut()
532 if (iph->ttl <= 1) { in send_via_shortcut()
534 mpc->dev->name, iph->ttl); in send_via_shortcut()
535 mpc->in_ops->put(entry); in send_via_shortcut()
538 iph->ttl--; in send_via_shortcut()
539 iph->check = 0; in send_via_shortcut()
540 iph->check = ip_fast_csum((unsigned char *)iph, iph->ihl); in send_via_shortcut()
542 if (entry->ctrl_info.tag != 0) { in send_via_shortcut()
544 mpc->dev->name, entry->ctrl_info.tag); in send_via_shortcut()
545 tagged_llc_snap_hdr.tag = entry->ctrl_info.tag; in send_via_shortcut()
559 atm_account_tx(entry->shortcut, skb); in send_via_shortcut()
560 entry->shortcut->send(entry->shortcut, skb); in send_via_shortcut()
561 entry->packets_fwded++; in send_via_shortcut()
562 mpc->in_ops->put(entry); in send_via_shortcut()
579 pr_info("(%s) no MPC found\n", dev->name); in mpc_send_packet()
583 eth = (struct ethhdr *)skb->data; in mpc_send_packet()
584 if (eth->h_proto != htons(ETH_P_IP)) in mpc_send_packet()
585 goto non_ip; /* Multi-Protocol Over ATM :-) */ in mpc_send_packet()
588 if (skb->len < ETH_HLEN + sizeof(struct iphdr)) in mpc_send_packet()
591 if (skb->len < ETH_HLEN + ip_hdr(skb)->ihl * 4 || ip_hdr(skb)->ihl < 5) in mpc_send_packet()
594 while (i < mpc->number_of_mps_macs) { in mpc_send_packet()
595 if (ether_addr_equal(eth->h_dest, mpc->mps_macs + i * ETH_ALEN)) in mpc_send_packet()
602 return __netdev_start_xmit(mpc->old_ops, skb, dev, false); in mpc_send_packet()
617 return -EFAULT; in atm_mpoa_vcc_attach()
621 return -EINVAL; in atm_mpoa_vcc_attach()
625 return -EINVAL; in atm_mpoa_vcc_attach()
628 in_entry = mpc->in_ops->get(ipaddr, mpc); in atm_mpoa_vcc_attach()
630 in_entry->entry_state < INGRESS_RESOLVED) { in atm_mpoa_vcc_attach()
631 pr_info("(%s) did not find RESOLVED entry from ingress cache\n", in atm_mpoa_vcc_attach()
632 mpc->dev->name); in atm_mpoa_vcc_attach()
634 mpc->in_ops->put(in_entry); in atm_mpoa_vcc_attach()
635 return -EINVAL; in atm_mpoa_vcc_attach()
637 pr_info("(%s) attaching ingress SVC, entry = %pI4\n", in atm_mpoa_vcc_attach()
638 mpc->dev->name, &in_entry->ctrl_info.in_dst_ip); in atm_mpoa_vcc_attach()
639 in_entry->shortcut = vcc; in atm_mpoa_vcc_attach()
640 mpc->in_ops->put(in_entry); in atm_mpoa_vcc_attach()
642 pr_info("(%s) attaching egress SVC\n", mpc->dev->name); in atm_mpoa_vcc_attach()
645 vcc->proto_data = mpc->dev; in atm_mpoa_vcc_attach()
646 vcc->push = mpc_push; in atm_mpoa_vcc_attach()
662 pr_info("(%s) close for unknown MPC\n", dev->name); in mpc_vcc_close()
666 dprintk("(%s)\n", dev->name); in mpc_vcc_close()
667 in_entry = mpc->in_ops->get_by_vcc(vcc, mpc); in mpc_vcc_close()
670 mpc->dev->name, &in_entry->ctrl_info.in_dst_ip); in mpc_vcc_close()
671 in_entry->shortcut = NULL; in mpc_vcc_close()
672 mpc->in_ops->put(in_entry); in mpc_vcc_close()
674 eg_entry = mpc->eg_ops->get_by_vcc(vcc, mpc); in mpc_vcc_close()
676 dprintk("(%s) egress SVC closed\n", mpc->dev->name); in mpc_vcc_close()
677 eg_entry->shortcut = NULL; in mpc_vcc_close()
678 mpc->eg_ops->put(eg_entry); in mpc_vcc_close()
682 dprintk("(%s) unused vcc closed\n", dev->name); in mpc_vcc_close()
687 struct net_device *dev = (struct net_device *)vcc->proto_data; in mpc_push()
694 ddprintk("(%s)\n", dev->name); in mpc_push()
696 dprintk("(%s) null skb, closing VCC\n", dev->name); in mpc_push()
701 skb->dev = dev; in mpc_push()
702 if (memcmp(skb->data, &llc_snap_mpoa_ctrl, in mpc_push()
706 dprintk("(%s) control packet arrived\n", dev->name); in mpc_push()
708 skb_queue_tail(&sk->sk_receive_queue, skb); in mpc_push()
709 sk->sk_data_ready(sk); in mpc_push()
714 atm_return(vcc, skb->truesize); in mpc_push()
718 pr_info("(%s) unknown MPC\n", dev->name); in mpc_push()
722 if (memcmp(skb->data, &llc_snap_mpoa_data_tagged, in mpc_push()
724 ddprintk("(%s) tagged data packet arrived\n", dev->name); in mpc_push()
726 } else if (memcmp(skb->data, &llc_snap_mpoa_data, in mpc_push()
728 pr_info("(%s) Unsupported non-tagged data packet arrived. Purging\n", in mpc_push()
729 dev->name); in mpc_push()
733 pr_info("(%s) garbage arrived, purging\n", dev->name); in mpc_push()
738 tmp = skb->data + sizeof(struct llc_snap_hdr); in mpc_push()
741 eg = mpc->eg_ops->get_by_tag(tag, mpc); in mpc_push()
743 pr_info("mpoa: (%s) Didn't find egress cache entry, tag = %u\n", in mpc_push()
744 dev->name, tag); in mpc_push()
752 * This means we have a bi-directional vcc opened by us. in mpc_push()
754 if (eg->shortcut == NULL) { in mpc_push()
755 eg->shortcut = vcc; in mpc_push()
756 pr_info("(%s) egress SVC in use\n", dev->name); in mpc_push()
761 new_skb = skb_realloc_headroom(skb, eg->ctrl_info.DH_length); in mpc_push()
765 mpc->eg_ops->put(eg); in mpc_push()
768 skb_push(new_skb, eg->ctrl_info.DH_length); /* add MAC header */ in mpc_push()
769 skb_copy_to_linear_data(new_skb, eg->ctrl_info.DLL_header, in mpc_push()
770 eg->ctrl_info.DH_length); in mpc_push()
771 new_skb->protocol = eth_type_trans(new_skb, dev); in mpc_push()
774 eg->latest_ip_addr = ip_hdr(new_skb)->saddr; in mpc_push()
775 eg->packets_rcvd++; in mpc_push()
776 mpc->eg_ops->put(eg); in mpc_push()
817 return -ENOMEM; in atm_mpoa_mpoad_attach()
818 mpc->dev_num = arg; in atm_mpoa_mpoad_attach()
819 mpc->dev = find_lec_by_itfnum(arg); in atm_mpoa_mpoad_attach()
822 if (mpc->mpoad_vcc) { in atm_mpoa_mpoad_attach()
824 return -EADDRINUSE; in atm_mpoa_mpoad_attach()
827 if (mpc->dev) { /* check if the lec is LANE2 capable */ in atm_mpoa_mpoad_attach()
828 priv = netdev_priv(mpc->dev); in atm_mpoa_mpoad_attach()
829 if (priv->lane_version < 2) { in atm_mpoa_mpoad_attach()
830 dev_put(mpc->dev); in atm_mpoa_mpoad_attach()
831 mpc->dev = NULL; in atm_mpoa_mpoad_attach()
833 priv->lane2_ops->associate_indicator = lane2_assoc_ind; in atm_mpoa_mpoad_attach()
836 mpc->mpoad_vcc = vcc; in atm_mpoa_mpoad_attach()
837 vcc->dev = &mpc_dev; in atm_mpoa_mpoad_attach()
839 set_bit(ATM_VF_META, &vcc->flags); in atm_mpoa_mpoad_attach()
840 set_bit(ATM_VF_READY, &vcc->flags); in atm_mpoa_mpoad_attach()
842 if (mpc->dev) { in atm_mpoa_mpoad_attach()
846 start_mpc(mpc, mpc->dev); in atm_mpoa_mpoad_attach()
850 if (memcmp(mpc->mps_ctrl_addr, empty, ATM_ESA_LEN) != 0) in atm_mpoa_mpoad_attach()
851 send_set_mps_ctrl_addr(mpc->mps_ctrl_addr, mpc); in atm_mpoa_mpoad_attach()
862 memcpy(mpc->mps_ctrl_addr, addr, ATM_ESA_LEN); in send_set_mps_ctrl_addr()
879 if (!mpc->mpoad_vcc) { in mpoad_close()
880 pr_info("close for non-present mpoad\n"); in mpoad_close()
884 mpc->mpoad_vcc = NULL; in mpoad_close()
885 if (mpc->dev) { in mpoad_close()
886 struct lec_priv *priv = netdev_priv(mpc->dev); in mpoad_close()
887 priv->lane2_ops->associate_indicator = NULL; in mpoad_close()
889 dev_put(mpc->dev); in mpoad_close()
892 mpc->in_ops->destroy_cache(mpc); in mpoad_close()
893 mpc->eg_ops->destroy_cache(mpc); in mpoad_close()
895 while ((skb = skb_dequeue(&sk_atm(vcc)->sk_receive_queue))) { in mpoad_close()
896 atm_return(vcc, skb->truesize); in mpoad_close()
901 (mpc->dev) ? mpc->dev->name : "<unknown>"); in mpoad_close()
912 struct k_message *mesg = (struct k_message *)skb->data; in msg_from_mpoad()
913 WARN_ON(refcount_sub_and_test(skb->truesize, &sk_atm(vcc)->sk_wmem_alloc)); in msg_from_mpoad()
919 dprintk("(%s)", mpc->dev ? mpc->dev->name : "<unknown>"); in msg_from_mpoad()
920 switch (mesg->type) { in msg_from_mpoad()
963 mpc->parameters = mesg->content.params; in msg_from_mpoad()
966 dprintk_cont("unknown message %d\n", mesg->type); in msg_from_mpoad()
980 if (mpc == NULL || !mpc->mpoad_vcc) { in msg_to_mpoad()
981 pr_info("mesg %d to a non-existent mpoad\n", mesg->type); in msg_to_mpoad()
982 return -ENXIO; in msg_to_mpoad()
987 return -ENOMEM; in msg_to_mpoad()
990 atm_force_charge(mpc->mpoad_vcc, skb->truesize); in msg_to_mpoad()
992 sk = sk_atm(mpc->mpoad_vcc); in msg_to_mpoad()
993 skb_queue_tail(&sk->sk_receive_queue, skb); in msg_to_mpoad()
994 sk->sk_data_ready(sk); in msg_to_mpoad()
1009 if (strncmp(dev->name, "lec", 3)) in mpoa_event_listener()
1015 if (priv->lane_version < 2) in mpoa_event_listener()
1017 priv->lane2_ops->associate_indicator = lane2_assoc_ind; in mpoa_event_listener()
1018 mpc = find_mpc_by_itfnum(priv->itfnum); in mpoa_event_listener()
1020 dprintk("allocating new mpc for %s\n", dev->name); in mpoa_event_listener()
1027 mpc->dev_num = priv->itfnum; in mpoa_event_listener()
1028 mpc->dev = dev; in mpoa_event_listener()
1030 dprintk("(%s) was initialized\n", dev->name); in mpoa_event_listener()
1037 dprintk("device (%s) was deallocated\n", dev->name); in mpoa_event_listener()
1039 dev_put(mpc->dev); in mpoa_event_listener()
1040 mpc->dev = NULL; in mpoa_event_listener()
1047 if (mpc->mpoad_vcc != NULL) in mpoa_event_listener()
1058 if (mpc->mpoad_vcc != NULL) in mpoa_event_listener()
1082 __be32 dst_ip = msg->content.in_info.in_dst_ip; in MPOA_trigger_rcvd()
1083 in_cache_entry *entry; in MPOA_trigger_rcvd() local
1085 entry = mpc->in_ops->get(dst_ip, mpc); in MPOA_trigger_rcvd()
1086 if (entry == NULL) { in MPOA_trigger_rcvd()
1087 entry = mpc->in_ops->add_entry(dst_ip, mpc); in MPOA_trigger_rcvd()
1088 entry->entry_state = INGRESS_RESOLVING; in MPOA_trigger_rcvd()
1089 msg->type = SND_MPOA_RES_RQST; in MPOA_trigger_rcvd()
1090 msg->content.in_info = entry->ctrl_info; in MPOA_trigger_rcvd()
1092 entry->reply_wait = ktime_get_seconds(); in MPOA_trigger_rcvd()
1093 mpc->in_ops->put(entry); in MPOA_trigger_rcvd()
1097 if (entry->entry_state == INGRESS_INVALID) { in MPOA_trigger_rcvd()
1098 entry->entry_state = INGRESS_RESOLVING; in MPOA_trigger_rcvd()
1099 msg->type = SND_MPOA_RES_RQST; in MPOA_trigger_rcvd()
1100 msg->content.in_info = entry->ctrl_info; in MPOA_trigger_rcvd()
1102 entry->reply_wait = ktime_get_seconds(); in MPOA_trigger_rcvd()
1103 mpc->in_ops->put(entry); in MPOA_trigger_rcvd()
1107 pr_info("(%s) entry already in resolving state\n", in MPOA_trigger_rcvd()
1108 (mpc->dev) ? mpc->dev->name : "<unknown>"); in MPOA_trigger_rcvd()
1109 mpc->in_ops->put(entry); in MPOA_trigger_rcvd()
1118 in_cache_entry *entry) in check_qos_and_open_shortcut() argument
1120 __be32 dst_ip = msg->content.in_info.in_dst_ip; in check_qos_and_open_shortcut()
1122 eg_cache_entry *eg_entry = client->eg_ops->get_by_src_ip(dst_ip, client); in check_qos_and_open_shortcut()
1124 if (eg_entry && eg_entry->shortcut) { in check_qos_and_open_shortcut()
1125 if (eg_entry->shortcut->qos.txtp.traffic_class & in check_qos_and_open_shortcut()
1126 msg->qos.txtp.traffic_class & in check_qos_and_open_shortcut()
1127 (qos ? qos->qos.txtp.traffic_class : ATM_UBR | ATM_CBR)) { in check_qos_and_open_shortcut()
1128 if (eg_entry->shortcut->qos.txtp.traffic_class == ATM_UBR) in check_qos_and_open_shortcut()
1129 entry->shortcut = eg_entry->shortcut; in check_qos_and_open_shortcut()
1130 else if (eg_entry->shortcut->qos.txtp.max_pcr > 0) in check_qos_and_open_shortcut()
1131 entry->shortcut = eg_entry->shortcut; in check_qos_and_open_shortcut()
1133 if (entry->shortcut) { in check_qos_and_open_shortcut()
1135 client->dev->name, &dst_ip); in check_qos_and_open_shortcut()
1136 client->eg_ops->put(eg_entry); in check_qos_and_open_shortcut()
1141 client->eg_ops->put(eg_entry); in check_qos_and_open_shortcut()
1144 msg->type = OPEN_INGRESS_SVC; in check_qos_and_open_shortcut()
1146 (qos->qos.txtp.traffic_class == msg->qos.txtp.traffic_class)) { in check_qos_and_open_shortcut()
1147 msg->qos = qos->qos; in check_qos_and_open_shortcut()
1149 client->dev->name); in check_qos_and_open_shortcut()
1151 memset(&msg->qos, 0, sizeof(struct atm_qos)); in check_qos_and_open_shortcut()
1157 __be32 dst_ip = msg->content.in_info.in_dst_ip; in MPOA_res_reply_rcvd()
1158 in_cache_entry *entry = mpc->in_ops->get(dst_ip, mpc); in MPOA_res_reply_rcvd() local
1161 mpc->dev->name, &dst_ip); in MPOA_res_reply_rcvd()
1162 ddprintk("(%s) entry = %p", in MPOA_res_reply_rcvd()
1163 mpc->dev->name, entry); in MPOA_res_reply_rcvd()
1164 if (entry == NULL) { in MPOA_res_reply_rcvd()
1165 pr_info("(%s) ARGH, received res. reply for an entry that doesn't exist.\n", in MPOA_res_reply_rcvd()
1166 mpc->dev->name); in MPOA_res_reply_rcvd()
1169 ddprintk_cont(" entry_state = %d ", entry->entry_state); in MPOA_res_reply_rcvd()
1171 if (entry->entry_state == INGRESS_RESOLVED) { in MPOA_res_reply_rcvd()
1172 pr_info("(%s) RESOLVED entry!\n", mpc->dev->name); in MPOA_res_reply_rcvd()
1173 mpc->in_ops->put(entry); in MPOA_res_reply_rcvd()
1177 entry->ctrl_info = msg->content.in_info; in MPOA_res_reply_rcvd()
1178 entry->time = ktime_get_seconds(); in MPOA_res_reply_rcvd()
1180 entry->reply_wait = ktime_get_seconds(); in MPOA_res_reply_rcvd()
1181 entry->refresh_time = 0; in MPOA_res_reply_rcvd()
1182 ddprintk_cont("entry->shortcut = %p\n", entry->shortcut); in MPOA_res_reply_rcvd()
1184 if (entry->entry_state == INGRESS_RESOLVING && in MPOA_res_reply_rcvd()
1185 entry->shortcut != NULL) { in MPOA_res_reply_rcvd()
1186 entry->entry_state = INGRESS_RESOLVED; in MPOA_res_reply_rcvd()
1187 mpc->in_ops->put(entry); in MPOA_res_reply_rcvd()
1191 if (entry->shortcut != NULL) { in MPOA_res_reply_rcvd()
1192 pr_info("(%s) entry->shortcut != NULL, impossible!\n", in MPOA_res_reply_rcvd()
1193 mpc->dev->name); in MPOA_res_reply_rcvd()
1194 mpc->in_ops->put(entry); in MPOA_res_reply_rcvd()
1198 check_qos_and_open_shortcut(msg, mpc, entry); in MPOA_res_reply_rcvd()
1199 entry->entry_state = INGRESS_RESOLVED; in MPOA_res_reply_rcvd()
1200 mpc->in_ops->put(entry); in MPOA_res_reply_rcvd()
1208 __be32 dst_ip = msg->content.in_info.in_dst_ip; in ingress_purge_rcvd()
1209 __be32 mask = msg->ip_mask; in ingress_purge_rcvd()
1210 in_cache_entry *entry = mpc->in_ops->get_with_mask(dst_ip, mpc, mask); in ingress_purge_rcvd() local
1212 if (entry == NULL) { in ingress_purge_rcvd()
1213 pr_info("(%s) purge for a non-existing entry, ip = %pI4\n", in ingress_purge_rcvd()
1214 mpc->dev->name, &dst_ip); in ingress_purge_rcvd()
1219 dprintk("(%s) removing an ingress entry, ip = %pI4\n", in ingress_purge_rcvd()
1220 mpc->dev->name, &dst_ip); in ingress_purge_rcvd()
1221 write_lock_bh(&mpc->ingress_lock); in ingress_purge_rcvd()
1222 mpc->in_ops->remove_entry(entry, mpc); in ingress_purge_rcvd()
1223 write_unlock_bh(&mpc->ingress_lock); in ingress_purge_rcvd()
1224 mpc->in_ops->put(entry); in ingress_purge_rcvd()
1225 entry = mpc->in_ops->get_with_mask(dst_ip, mpc, mask); in ingress_purge_rcvd()
1226 } while (entry != NULL); in ingress_purge_rcvd()
1231 __be32 cache_id = msg->content.eg_info.cache_id; in egress_purge_rcvd()
1232 eg_cache_entry *entry = mpc->eg_ops->get_by_cache_id(cache_id, mpc); in egress_purge_rcvd() local
1234 if (entry == NULL) { in egress_purge_rcvd()
1235 dprintk("(%s) purge for a non-existing entry\n", in egress_purge_rcvd()
1236 mpc->dev->name); in egress_purge_rcvd()
1240 write_lock_irq(&mpc->egress_lock); in egress_purge_rcvd()
1241 mpc->eg_ops->remove_entry(entry, mpc); in egress_purge_rcvd()
1242 write_unlock_irq(&mpc->egress_lock); in egress_purge_rcvd()
1244 mpc->eg_ops->put(entry); in egress_purge_rcvd()
1247 static void purge_egress_shortcut(struct atm_vcc *vcc, eg_cache_entry *entry) in purge_egress_shortcut() argument
1266 memset(skb->data, 0, sizeof(struct k_message)); in purge_egress_shortcut()
1267 purge_msg = (struct k_message *)skb->data; in purge_egress_shortcut()
1268 purge_msg->type = DATA_PLANE_PURGE; in purge_egress_shortcut()
1269 if (entry != NULL) in purge_egress_shortcut()
1270 purge_msg->content.eg_info = entry->ctrl_info; in purge_egress_shortcut()
1272 atm_force_charge(vcc, skb->truesize); in purge_egress_shortcut()
1275 skb_queue_tail(&sk->sk_receive_queue, skb); in purge_egress_shortcut()
1276 sk->sk_data_ready(sk); in purge_egress_shortcut()
1286 eg_cache_entry *entry; in mps_death() local
1288 dprintk("(%s)\n", mpc->dev->name); in mps_death()
1290 if (memcmp(msg->MPS_ctrl, mpc->mps_ctrl_addr, ATM_ESA_LEN)) { in mps_death()
1291 pr_info("(%s) wrong MPS\n", mpc->dev->name); in mps_death()
1296 read_lock_irq(&mpc->egress_lock); in mps_death()
1297 entry = mpc->eg_cache; in mps_death()
1298 while (entry != NULL) { in mps_death()
1299 purge_egress_shortcut(entry->shortcut, entry); in mps_death()
1300 entry = entry->next; in mps_death()
1302 read_unlock_irq(&mpc->egress_lock); in mps_death()
1304 mpc->in_ops->destroy_cache(mpc); in mps_death()
1305 mpc->eg_ops->destroy_cache(mpc); in mps_death()
1312 eg_cache_entry *entry = mpc->eg_ops->get_by_cache_id(msg->content.eg_info.cache_id, mpc); in MPOA_cache_impos_rcvd() local
1314 holding_time = msg->content.eg_info.holding_time; in MPOA_cache_impos_rcvd()
1315 dprintk("(%s) entry = %p, holding_time = %u\n", in MPOA_cache_impos_rcvd()
1316 mpc->dev->name, entry, holding_time); in MPOA_cache_impos_rcvd()
1317 if (entry == NULL && holding_time) { in MPOA_cache_impos_rcvd()
1318 entry = mpc->eg_ops->add_entry(msg, mpc); in MPOA_cache_impos_rcvd()
1319 mpc->eg_ops->put(entry); in MPOA_cache_impos_rcvd()
1323 mpc->eg_ops->update(entry, holding_time); in MPOA_cache_impos_rcvd()
1327 write_lock_irq(&mpc->egress_lock); in MPOA_cache_impos_rcvd()
1328 mpc->eg_ops->remove_entry(entry, mpc); in MPOA_cache_impos_rcvd()
1329 write_unlock_irq(&mpc->egress_lock); in MPOA_cache_impos_rcvd()
1331 mpc->eg_ops->put(entry); in MPOA_cache_impos_rcvd()
1347 memcpy(&tlv[7], mesg->MPS_ctrl, ATM_ESA_LEN); /* MPC ctrl ATM addr */ in set_mpc_ctrl_addr_rcvd()
1348 memcpy(mpc->our_ctrl_addr, mesg->MPS_ctrl, ATM_ESA_LEN); in set_mpc_ctrl_addr_rcvd()
1351 mpc->dev ? mpc->dev->name : "<unknown>"); in set_mpc_ctrl_addr_rcvd()
1356 if (mpc->dev) { in set_mpc_ctrl_addr_rcvd()
1357 priv = netdev_priv(mpc->dev); in set_mpc_ctrl_addr_rcvd()
1358 retval = priv->lane2_ops->associate_req(mpc->dev, in set_mpc_ctrl_addr_rcvd()
1359 mpc->dev->dev_addr, in set_mpc_ctrl_addr_rcvd()
1363 mpc->dev->name); in set_mpc_ctrl_addr_rcvd()
1364 retval = priv->lane2_ops->resolve(mpc->dev, NULL, 1, NULL, NULL); in set_mpc_ctrl_addr_rcvd()
1367 mpc->dev->name); in set_mpc_ctrl_addr_rcvd()
1375 if (client->number_of_mps_macs) in set_mps_mac_addr_rcvd()
1376 kfree(client->mps_macs); in set_mps_mac_addr_rcvd()
1377 client->number_of_mps_macs = 0; in set_mps_mac_addr_rcvd()
1378 client->mps_macs = kmemdup(msg->MPS_ctrl, ETH_ALEN, GFP_KERNEL); in set_mps_mac_addr_rcvd()
1379 if (client->mps_macs == NULL) { in set_mps_mac_addr_rcvd()
1383 client->number_of_mps_macs = 1; in set_mps_mac_addr_rcvd()
1392 eg_cache_entry *entry; in clean_up() local
1393 msg->type = SND_EGRESS_PURGE; in clean_up()
1397 read_lock_irq(&mpc->egress_lock); in clean_up()
1398 entry = mpc->eg_cache; in clean_up()
1399 while (entry != NULL) { in clean_up()
1400 msg->content.eg_info = entry->ctrl_info; in clean_up()
1401 dprintk("cache_id %u\n", entry->ctrl_info.cache_id); in clean_up()
1403 entry = entry->next; in clean_up()
1405 read_unlock_irq(&mpc->egress_lock); in clean_up()
1407 msg->type = action; in clean_up()
1427 mpc->in_ops->clear_count(mpc); in mpc_cache_check()
1428 mpc->eg_ops->clear_expired(mpc); in mpc_cache_check()
1429 if (checking_time - previous_resolving_check_time > in mpc_cache_check()
1430 mpc->parameters.mpc_p4 * HZ) { in mpc_cache_check()
1431 mpc->in_ops->check_resolving(mpc); in mpc_cache_check()
1434 if (checking_time - previous_refresh_time > in mpc_cache_check()
1435 mpc->parameters.mpc_p5 * HZ) { in mpc_cache_check()
1436 mpc->in_ops->refresh(mpc); in mpc_cache_check()
1439 mpc = mpc->next; in mpc_cache_check()
1451 return -ENOIOCTLCMD; in atm_mpoa_ioctl()
1454 return -EPERM; in atm_mpoa_ioctl()
1460 sock->state = SS_CONNECTED; in atm_mpoa_ioctl()
1503 tmp = mpc->next; in atm_mpoa_cleanup()
1504 if (mpc->dev != NULL) { in atm_mpoa_cleanup()
1506 priv = netdev_priv(mpc->dev); in atm_mpoa_cleanup()
1507 if (priv->lane2_ops != NULL) in atm_mpoa_cleanup()
1508 priv->lane2_ops->associate_indicator = NULL; in atm_mpoa_cleanup()
1511 mpc->in_ops->destroy_cache(mpc); in atm_mpoa_cleanup()
1512 mpc->eg_ops->destroy_cache(mpc); in atm_mpoa_cleanup()
1514 kfree(mpc->mps_macs); in atm_mpoa_cleanup()
1525 nextqos = qos->next; in atm_mpoa_cleanup()
1526 dprintk("freeing qos entry %p\n", qos); in atm_mpoa_cleanup()