Lines Matching +full:vcc +full:- +full:p
44 /* Hardening for Spectre-v1 */
81 struct atm_vcc *vcc, struct sk_buff *skb);
93 static int lec_mcast_make(struct lec_priv *priv, struct atm_vcc *vcc);
99 struct atm_vcc *vcc,
100 void (*old_push)(struct atm_vcc *vcc,
102 static void lec_vcc_close(struct lec_priv *priv, struct atm_vcc *vcc);
107 refcount_inc(&entry->usage); in lec_arp_hold()
112 if (refcount_dec_and_test(&entry->usage)) in lec_arp_put()
138 buff = skb->data + skb->dev->hard_header_len; in lec_handle_bridge()
147 skb2->len = sizeof(struct atmlec_msg); in lec_handle_bridge()
148 mesg = (struct atmlec_msg *)skb2->data; in lec_handle_bridge()
149 mesg->type = l_topology_change; in lec_handle_bridge()
151 mesg->content.normal.flag = *buff & 0x01; in lec_handle_bridge()
155 atm_force_charge(priv->lecd, skb2->truesize); in lec_handle_bridge()
156 sk = sk_atm(priv->lecd); in lec_handle_bridge()
157 skb_queue_tail(&sk->sk_receive_queue, skb2); in lec_handle_bridge()
158 sk->sk_data_ready(sk); in lec_handle_bridge()
169 * there is non-reboot way to recover if something goes wrong.
180 lec_send(struct atm_vcc *vcc, struct sk_buff *skb) in lec_send() argument
182 struct net_device *dev = skb->dev; in lec_send()
184 ATM_SKB(skb)->vcc = vcc; in lec_send()
185 atm_account_tx(vcc, skb); in lec_send()
187 if (vcc->send(vcc, skb) < 0) { in lec_send()
188 dev->stats.tx_dropped++; in lec_send()
192 dev->stats.tx_packets++; in lec_send()
193 dev->stats.tx_bytes += skb->len; in lec_send()
198 pr_info("%s\n", dev->name); in lec_tx_timeout()
209 struct atm_vcc *vcc; in lec_start_xmit() local
216 if (!priv->lecd) { in lec_start_xmit()
217 pr_info("%s:No lecd attached\n", dev->name); in lec_start_xmit()
218 dev->stats.tx_errors++; in lec_start_xmit()
225 (long)skb->head, (long)skb->data, (long)skb_tail_pointer(skb), in lec_start_xmit()
228 if (memcmp(skb->data, bridge_ula_lec, sizeof(bridge_ula_lec)) == 0) in lec_start_xmit()
246 lec_h = (struct lecdatahdr_8023 *)skb->data; in lec_start_xmit()
247 lec_h->le_header = htons(priv->lecid); in lec_start_xmit()
256 dev->name, skb->len, priv->lecid); in lec_start_xmit()
258 skb->data, min(skb->len, MAX_DUMP_SKB), true); in lec_start_xmit()
261 /* Minimum ethernet-frame size */ in lec_start_xmit()
263 if (skb->len < min_frame_size) { in lec_start_xmit()
264 if ((skb->len + skb_tailroom(skb)) < min_frame_size) { in lec_start_xmit()
266 min_frame_size - skb->truesize, in lec_start_xmit()
270 dev->stats.tx_dropped++; in lec_start_xmit()
275 skb_put(skb, min_frame_size - skb->len); in lec_start_xmit()
278 /* Send to right vcc */ in lec_start_xmit()
280 dst = lec_h->h_dest; in lec_start_xmit()
282 vcc = lec_arp_resolve(priv, dst, is_rdesc, &entry); in lec_start_xmit()
283 pr_debug("%s:vcc:%p vcc_flags:%lx, entry:%p\n", in lec_start_xmit()
284 dev->name, vcc, vcc ? vcc->flags : 0, entry); in lec_start_xmit()
285 if (!vcc || !test_bit(ATM_VF_READY, &vcc->flags)) { in lec_start_xmit()
286 if (entry && (entry->tx_wait.qlen < LEC_UNRES_QUE_LEN)) { in lec_start_xmit()
288 dev->name, lec_h->h_dest); in lec_start_xmit()
289 skb_queue_tail(&entry->tx_wait, skb); in lec_start_xmit()
292 dev->name, lec_h->h_dest); in lec_start_xmit()
293 dev->stats.tx_dropped++; in lec_start_xmit()
300 dev->name, vcc->vpi, vcc->vci); in lec_start_xmit()
303 while (entry && (skb2 = skb_dequeue(&entry->tx_wait))) { in lec_start_xmit()
304 pr_debug("emptying tx queue, MAC address %pM\n", lec_h->h_dest); in lec_start_xmit()
305 lec_send(vcc, skb2); in lec_start_xmit()
308 lec_send(vcc, skb); in lec_start_xmit()
310 if (!atm_may_send(vcc, 0)) { in lec_start_xmit()
311 struct lec_vcc_priv *vpriv = LEC_VCC_PRIV(vcc); in lec_start_xmit()
313 vpriv->xoff = 1; in lec_start_xmit()
317 * vcc->pop() might have occurred in between, making in lec_start_xmit()
318 * the vcc usuable again. Since xmit is serialized, in lec_start_xmit()
319 * this is the only situation we have to re-test. in lec_start_xmit()
322 if (atm_may_send(vcc, 0)) in lec_start_xmit()
340 static int lec_atm_send(struct atm_vcc *vcc, struct sk_buff *skb) in lec_atm_send() argument
343 struct net_device *dev = (struct net_device *)vcc->proto_data; in lec_atm_send()
350 WARN_ON(refcount_sub_and_test(skb->truesize, &sk_atm(vcc)->sk_wmem_alloc)); in lec_atm_send()
351 mesg = (struct atmlec_msg *)skb->data; in lec_atm_send()
352 tmp = skb->data; in lec_atm_send()
354 pr_debug("%s: msg from zeppelin:%d\n", dev->name, mesg->type); in lec_atm_send()
355 switch (mesg->type) { in lec_atm_send()
358 dev->dev_addr[i] = mesg->content.normal.mac_addr[i]; in lec_atm_send()
362 dev->dev_addr[i] = 0; in lec_atm_send()
365 lec_addr_delete(priv, mesg->content.normal.atm_addr, in lec_atm_send()
366 mesg->content.normal.flag); in lec_atm_send()
369 priv->topology_change = mesg->content.normal.flag; in lec_atm_send()
372 lec_flush_complete(priv, mesg->content.normal.flag); in lec_atm_send()
375 spin_lock_irqsave(&priv->lec_arp_lock, flags); in lec_atm_send()
376 entry = lec_arp_find(priv, mesg->content.normal.mac_addr); in lec_atm_send()
378 spin_unlock_irqrestore(&priv->lec_arp_lock, flags); in lec_atm_send()
380 if (mesg->content.normal.no_source_le_narp) in lec_atm_send()
384 lec_arp_update(priv, mesg->content.normal.mac_addr, in lec_atm_send()
385 mesg->content.normal.atm_addr, in lec_atm_send()
386 mesg->content.normal.flag, in lec_atm_send()
387 mesg->content.normal.targetless_le_arp); in lec_atm_send()
389 if (mesg->sizeoftlvs != 0) { /* LANE2 3.1.5 */ in lec_atm_send()
391 mesg->sizeoftlvs); in lec_atm_send()
392 lane2_associate_ind(dev, mesg->content.normal.mac_addr, in lec_atm_send()
393 tmp, mesg->sizeoftlvs); in lec_atm_send()
397 priv->maximum_unknown_frame_count = in lec_atm_send()
398 mesg->content.config.maximum_unknown_frame_count; in lec_atm_send()
399 priv->max_unknown_frame_time = in lec_atm_send()
400 (mesg->content.config.max_unknown_frame_time * HZ); in lec_atm_send()
401 priv->max_retry_count = mesg->content.config.max_retry_count; in lec_atm_send()
402 priv->aging_time = (mesg->content.config.aging_time * HZ); in lec_atm_send()
403 priv->forward_delay_time = in lec_atm_send()
404 (mesg->content.config.forward_delay_time * HZ); in lec_atm_send()
405 priv->arp_response_time = in lec_atm_send()
406 (mesg->content.config.arp_response_time * HZ); in lec_atm_send()
407 priv->flush_timeout = (mesg->content.config.flush_timeout * HZ); in lec_atm_send()
408 priv->path_switching_delay = in lec_atm_send()
409 (mesg->content.config.path_switching_delay * HZ); in lec_atm_send()
410 priv->lane_version = mesg->content.config.lane_version; in lec_atm_send()
412 priv->lane2_ops = NULL; in lec_atm_send()
413 if (priv->lane_version > 1) in lec_atm_send()
414 priv->lane2_ops = &lane2_ops; in lec_atm_send()
416 if (dev_set_mtu(dev, mesg->content.config.mtu)) in lec_atm_send()
418 dev->name, mesg->content.config.mtu); in lec_atm_send()
420 priv->is_proxy = mesg->content.config.is_proxy; in lec_atm_send()
423 lec_set_flush_tran_id(priv, mesg->content.normal.atm_addr, in lec_atm_send()
424 mesg->content.normal.flag); in lec_atm_send()
427 priv->lecid = in lec_atm_send()
428 (unsigned short)(0xffff & mesg->content.normal.flag); in lec_atm_send()
434 dev->name, mesg->content.proxy.mac_addr); in lec_atm_send()
439 if (br_fdb_test_addr_hook(dev, mesg->content.proxy.mac_addr)) { in lec_atm_send()
445 dev->name); in lec_atm_send()
449 skb2->len = sizeof(struct atmlec_msg); in lec_atm_send()
451 atm_force_charge(priv->lecd, skb2->truesize); in lec_atm_send()
452 sk = sk_atm(priv->lecd); in lec_atm_send()
453 skb_queue_tail(&sk->sk_receive_queue, skb2); in lec_atm_send()
454 sk->sk_data_ready(sk); in lec_atm_send()
460 pr_info("%s: Unknown message type %d\n", dev->name, mesg->type); in lec_atm_send()
462 return -EINVAL; in lec_atm_send()
468 static void lec_atm_close(struct atm_vcc *vcc) in lec_atm_close() argument
471 struct net_device *dev = (struct net_device *)vcc->proto_data; in lec_atm_close()
474 priv->lecd = NULL; in lec_atm_close()
480 if (skb_peek(&sk_atm(vcc)->sk_receive_queue)) in lec_atm_close()
481 pr_info("%s closing with messages pending\n", dev->name); in lec_atm_close()
482 while ((skb = skb_dequeue(&sk_atm(vcc)->sk_receive_queue))) { in lec_atm_close()
483 atm_return(vcc, skb->truesize); in lec_atm_close()
487 pr_info("%s: Shut down!\n", dev->name); in lec_atm_close()
516 if (!priv || !priv->lecd) in send_to_lecd()
517 return -1; in send_to_lecd()
520 return -1; in send_to_lecd()
521 skb->len = sizeof(struct atmlec_msg); in send_to_lecd()
522 mesg = (struct atmlec_msg *)skb->data; in send_to_lecd()
524 mesg->type = type; in send_to_lecd()
526 mesg->sizeoftlvs = data->len; in send_to_lecd()
528 ether_addr_copy(mesg->content.normal.mac_addr, mac_addr); in send_to_lecd()
530 mesg->content.normal.targetless_le_arp = 1; in send_to_lecd()
532 memcpy(&mesg->content.normal.atm_addr, atm_addr, ATM_ESA_LEN); in send_to_lecd()
534 atm_force_charge(priv->lecd, skb->truesize); in send_to_lecd()
535 sk = sk_atm(priv->lecd); in send_to_lecd()
536 skb_queue_tail(&sk->sk_receive_queue, skb); in send_to_lecd()
537 sk->sk_data_ready(sk); in send_to_lecd()
540 pr_debug("about to send %d bytes of data\n", data->len); in send_to_lecd()
541 atm_force_charge(priv->lecd, data->truesize); in send_to_lecd()
542 skb_queue_tail(&sk->sk_receive_queue, data); in send_to_lecd()
543 sk->sk_data_ready(sk); in send_to_lecd()
575 static int lec_is_data_direct(struct atm_vcc *vcc) in lec_is_data_direct() argument
577 return ((vcc->sap.blli[0].l3.tr9577.snap[4] == LEC_DATA_DIRECT_8023) || in lec_is_data_direct()
578 (vcc->sap.blli[0].l3.tr9577.snap[4] == LEC_DATA_DIRECT_8025)); in lec_is_data_direct()
581 static void lec_push(struct atm_vcc *vcc, struct sk_buff *skb) in lec_push() argument
584 struct net_device *dev = (struct net_device *)vcc->proto_data; in lec_push()
588 printk(KERN_DEBUG "%s: vcc vpi:%d vci:%d\n", in lec_push()
589 dev->name, vcc->vpi, vcc->vci); in lec_push()
592 pr_debug("%s: null skb\n", dev->name); in lec_push()
593 lec_vcc_close(priv, vcc); in lec_push()
603 dev->name, skb->len, priv->lecid); in lec_push()
605 skb->data, min(MAX_SKB_DUMP, skb->len), true); in lec_push()
607 if (memcmp(skb->data, lec_ctrl_magic, 4) == 0) { in lec_push()
609 struct sock *sk = sk_atm(vcc); in lec_push()
611 pr_debug("%s: To daemon\n", dev->name); in lec_push()
612 skb_queue_tail(&sk->sk_receive_queue, skb); in lec_push()
613 sk->sk_data_ready(sk); in lec_push()
618 atm_return(vcc, skb->truesize); in lec_push()
619 if (*(__be16 *) skb->data == htons(priv->lecid) || in lec_push()
620 !priv->lecd || !(dev->flags & IFF_UP)) { in lec_push()
629 dst = ((struct lecdatahdr_8023 *)skb->data)->h_dest; in lec_push()
632 * If this is a Data Direct VCC, and the VCC does not match in lec_push()
635 spin_lock_irqsave(&priv->lec_arp_lock, flags); in lec_push()
636 if (lec_is_data_direct(vcc)) { in lec_push()
637 src = ((struct lecdatahdr_8023 *)skb->data)->h_source; in lec_push()
639 if (entry && entry->vcc != vcc) { in lec_push()
644 spin_unlock_irqrestore(&priv->lec_arp_lock, flags); in lec_push()
647 !priv->is_proxy && /* Proxy wants all the packets */ in lec_push()
648 memcmp(dst, dev->dev_addr, dev->addr_len)) { in lec_push()
652 if (!hlist_empty(&priv->lec_arp_empty_ones)) in lec_push()
653 lec_arp_check_empties(priv, vcc, skb); in lec_push()
655 skb->protocol = eth_type_trans(skb, dev); in lec_push()
656 dev->stats.rx_packets++; in lec_push()
657 dev->stats.rx_bytes += skb->len; in lec_push()
663 static void lec_pop(struct atm_vcc *vcc, struct sk_buff *skb) in lec_pop() argument
665 struct lec_vcc_priv *vpriv = LEC_VCC_PRIV(vcc); in lec_pop()
666 struct net_device *dev = skb->dev; in lec_pop()
673 vpriv->old_pop(vcc, skb); in lec_pop()
675 if (vpriv->xoff && atm_may_send(vcc, 0)) { in lec_pop()
676 vpriv->xoff = 0; in lec_pop()
682 static int lec_vcc_attach(struct atm_vcc *vcc, void __user *arg) in lec_vcc_attach() argument
693 return -EINVAL; in lec_vcc_attach()
696 return -EINVAL; in lec_vcc_attach()
699 return -ENOMEM; in lec_vcc_attach()
700 vpriv->xoff = 0; in lec_vcc_attach()
701 vpriv->old_pop = vcc->pop; in lec_vcc_attach()
702 vcc->user_back = vpriv; in lec_vcc_attach()
703 vcc->pop = lec_pop; in lec_vcc_attach()
705 &ioc_data, vcc, vcc->push); in lec_vcc_attach()
706 vcc->proto_data = dev_lec[ioc_data.dev_num]; in lec_vcc_attach()
707 vcc->push = lec_push; in lec_vcc_attach()
711 static int lec_mcast_attach(struct atm_vcc *vcc, int arg) in lec_mcast_attach() argument
714 return -EINVAL; in lec_mcast_attach()
717 return -EINVAL; in lec_mcast_attach()
718 vcc->proto_data = dev_lec[arg]; in lec_mcast_attach()
719 return lec_mcast_make(netdev_priv(dev_lec[arg]), vcc); in lec_mcast_attach()
723 static int lecd_attach(struct atm_vcc *vcc, int arg) in lecd_attach() argument
733 return -EINVAL; in lecd_attach()
741 return -ENOMEM; in lecd_attach()
742 dev_lec[i]->netdev_ops = &lec_netdev_ops; in lecd_attach()
743 dev_lec[i]->max_mtu = 18190; in lecd_attach()
744 snprintf(dev_lec[i]->name, IFNAMSIZ, "lec%d", i); in lecd_attach()
747 return -EINVAL; in lecd_attach()
753 if (priv->lecd) in lecd_attach()
754 return -EADDRINUSE; in lecd_attach()
757 priv->itfnum = i; /* LANE2 addition */ in lecd_attach()
758 priv->lecd = vcc; in lecd_attach()
759 vcc->dev = &lecatm_dev; in lecd_attach()
760 vcc_insert_socket(sk_atm(vcc)); in lecd_attach()
762 vcc->proto_data = dev_lec[i]; in lecd_attach()
763 set_bit(ATM_VF_META, &vcc->flags); in lecd_attach()
764 set_bit(ATM_VF_READY, &vcc->flags); in lecd_attach()
767 priv->maximum_unknown_frame_count = 1; in lecd_attach()
768 priv->max_unknown_frame_time = (1 * HZ); in lecd_attach()
769 priv->vcc_timeout_period = (1200 * HZ); in lecd_attach()
770 priv->max_retry_count = 1; in lecd_attach()
771 priv->aging_time = (300 * HZ); in lecd_attach()
772 priv->forward_delay_time = (15 * HZ); in lecd_attach()
773 priv->topology_change = 0; in lecd_attach()
774 priv->arp_response_time = (1 * HZ); in lecd_attach()
775 priv->flush_timeout = (4 * HZ); in lecd_attach()
776 priv->path_switching_delay = (6 * HZ); in lecd_attach()
778 if (dev_lec[i]->flags & IFF_UP) in lecd_attach()
806 seq_printf(seq, "%2.2x", entry->mac_addr[i] & 0xff); in lec_info()
809 seq_printf(seq, "%2.2x", entry->atm_addr[i] & 0xff); in lec_info()
810 seq_printf(seq, " %s %4.4x", lec_arp_get_status_string(entry->status), in lec_info()
811 entry->flags & 0xffff); in lec_info()
812 if (entry->vcc) in lec_info()
813 seq_printf(seq, "%3d %3d ", entry->vcc->vpi, entry->vcc->vci); in lec_info()
816 if (entry->recv_vcc) { in lec_info()
817 seq_printf(seq, " %3d %3d", entry->recv_vcc->vpi, in lec_info()
818 entry->recv_vcc->vci); in lec_info()
836 struct hlist_node *e = state->node; in lec_tbl_walk()
839 e = tbl->first; in lec_tbl_walk()
841 e = tbl->first; in lec_tbl_walk()
842 --*l; in lec_tbl_walk()
845 for (; e; e = e->next) { in lec_tbl_walk()
846 if (--*l < 0) in lec_tbl_walk()
849 state->node = e; in lec_tbl_walk()
858 int p; in lec_arp_walk() local
860 for (p = state->arp_table; p < LEC_ARP_TABLE_SIZE; p++) { in lec_arp_walk()
861 v = lec_tbl_walk(state, &priv->lec_arp_tables[p], l); in lec_arp_walk()
865 state->arp_table = p; in lec_arp_walk()
873 &priv->lec_arp_empty_ones, in lec_misc_walk()
874 &priv->lec_no_forward, in lec_misc_walk()
875 &priv->mcast_fwds in lec_misc_walk()
880 for (q = state->misc_table; q < ARRAY_SIZE(lec_misc_tables); q++) { in lec_misc_walk()
885 state->misc_table = q; in lec_misc_walk()
892 if (!state->locked) { in lec_priv_walk()
893 state->locked = priv; in lec_priv_walk()
894 spin_lock_irqsave(&priv->lec_arp_lock, state->flags); in lec_priv_walk()
897 spin_unlock_irqrestore(&priv->lec_arp_lock, state->flags); in lec_priv_walk()
898 state->locked = NULL; in lec_priv_walk()
900 state->arp_table = state->misc_table = 0; in lec_priv_walk()
902 return state->locked; in lec_priv_walk()
910 dev = state->dev ? state->dev : dev_lec[state->itf]; in lec_itf_walk()
918 state->dev = dev; in lec_itf_walk()
926 for (; state->itf < MAX_LEC_ITF; state->itf++) { in lec_get_idx()
936 struct lec_state *state = seq->private; in lec_seq_start()
938 state->itf = 0; in lec_seq_start()
939 state->dev = NULL; in lec_seq_start()
940 state->locked = NULL; in lec_seq_start()
941 state->arp_table = 0; in lec_seq_start()
942 state->misc_table = 0; in lec_seq_start()
943 state->node = SEQ_START_TOKEN; in lec_seq_start()
950 struct lec_state *state = seq->private; in lec_seq_stop()
952 if (state->dev) { in lec_seq_stop()
953 spin_unlock_irqrestore(&state->locked->lec_arp_lock, in lec_seq_stop()
954 state->flags); in lec_seq_stop()
955 dev_put(state->dev); in lec_seq_stop()
961 struct lec_state *state = seq->private; in lec_seq_next()
978 struct lec_state *state = seq->private; in lec_seq_show()
979 struct net_device *dev = state->dev; in lec_seq_show()
980 struct lec_arp_table *entry = hlist_entry(state->node, in lec_seq_show()
984 seq_printf(seq, "%s ", dev->name); in lec_seq_show()
1000 struct atm_vcc *vcc = ATM_SD(sock); in lane_ioctl() local
1008 return -EPERM; in lane_ioctl()
1011 return -ENOIOCTLCMD; in lane_ioctl()
1016 err = lecd_attach(vcc, (int)arg); in lane_ioctl()
1018 sock->state = SS_CONNECTED; in lane_ioctl()
1021 err = lec_mcast_attach(vcc, (int)arg); in lane_ioctl()
1024 err = lec_vcc_attach(vcc, (void __user *)arg); in lane_ioctl()
1039 struct proc_dir_entry *p; in lane_module_init() local
1041 p = proc_create_seq_private("lec", 0444, atm_proc_root, &lec_seq_ops, in lane_module_init()
1043 if (!p) { in lane_module_init()
1045 return -ENOMEM; in lane_module_init()
1093 spin_lock_irqsave(&priv->lec_arp_lock, flags); in lane2_resolve()
1095 spin_unlock_irqrestore(&priv->lec_arp_lock, flags); in lane2_resolve()
1097 return -1; in lane2_resolve()
1099 *tlvs = kmemdup(table->tlvs, table->sizeoftlvs, GFP_ATOMIC); in lane2_resolve()
1101 return -1; in lane2_resolve()
1103 *sizeoftlvs = table->sizeoftlvs; in lane2_resolve()
1114 return -1; in lane2_resolve()
1115 skb->len = *sizeoftlvs; in lane2_resolve()
1136 if (!ether_addr_equal(lan_dst, dev->dev_addr)) in lane2_associate_req()
1139 kfree(priv->tlvs); /* NULL if there was no previous association */ in lane2_associate_req()
1141 priv->tlvs = kmemdup(tlvs, sizeoftlvs, GFP_KERNEL); in lane2_associate_req()
1142 if (priv->tlvs == NULL) in lane2_associate_req()
1144 priv->sizeoftlvs = sizeoftlvs; in lane2_associate_req()
1149 skb->len = sizeoftlvs; in lane2_associate_req()
1183 kfree(entry->tlvs); in lane2_associate_ind()
1185 entry->tlvs = kmemdup(tlvs, sizeoftlvs, GFP_KERNEL); in lane2_associate_ind()
1186 if (entry->tlvs == NULL) in lane2_associate_ind()
1188 entry->sizeoftlvs = sizeoftlvs; in lane2_associate_ind()
1200 if (priv->lane2_ops && priv->lane2_ops->associate_indicator) { in lane2_associate_ind()
1201 priv->lane2_ops->associate_indicator(dev, mac_addr, in lane2_associate_ind()
1237 #define HASH(ch) (ch & (LEC_ARP_TABLE_SIZE - 1))
1240 * Initialization of arp-cache
1247 INIT_HLIST_HEAD(&priv->lec_arp_tables[i]); in lec_arp_init()
1248 INIT_HLIST_HEAD(&priv->lec_arp_empty_ones); in lec_arp_init()
1249 INIT_HLIST_HEAD(&priv->lec_no_forward); in lec_arp_init()
1250 INIT_HLIST_HEAD(&priv->mcast_fwds); in lec_arp_init()
1251 spin_lock_init(&priv->lec_arp_lock); in lec_arp_init()
1252 INIT_DELAYED_WORK(&priv->lec_arp_work, lec_arp_check_expire); in lec_arp_init()
1253 schedule_delayed_work(&priv->lec_arp_work, LEC_ARP_REFRESH_INTERVAL); in lec_arp_init()
1258 if (entry->vcc) { in lec_arp_clear_vccs()
1259 struct atm_vcc *vcc = entry->vcc; in lec_arp_clear_vccs() local
1260 struct lec_vcc_priv *vpriv = LEC_VCC_PRIV(vcc); in lec_arp_clear_vccs()
1261 struct net_device *dev = (struct net_device *)vcc->proto_data; in lec_arp_clear_vccs()
1263 vcc->pop = vpriv->old_pop; in lec_arp_clear_vccs()
1264 if (vpriv->xoff) in lec_arp_clear_vccs()
1267 vcc->user_back = NULL; in lec_arp_clear_vccs()
1268 vcc->push = entry->old_push; in lec_arp_clear_vccs()
1269 vcc_release_async(vcc, -EPIPE); in lec_arp_clear_vccs()
1270 entry->vcc = NULL; in lec_arp_clear_vccs()
1272 if (entry->recv_vcc) { in lec_arp_clear_vccs()
1273 struct atm_vcc *vcc = entry->recv_vcc; in lec_arp_clear_vccs() local
1274 struct lec_vcc_priv *vpriv = LEC_VCC_PRIV(vcc); in lec_arp_clear_vccs()
1277 vcc->user_back = NULL; in lec_arp_clear_vccs()
1279 entry->recv_vcc->push = entry->old_recv_push; in lec_arp_clear_vccs()
1280 vcc_release_async(entry->recv_vcc, -EPIPE); in lec_arp_clear_vccs()
1281 entry->recv_vcc = NULL; in lec_arp_clear_vccs()
1294 tmp = &priv->lec_arp_tables[HASH(entry->mac_addr[ETH_ALEN - 1])]; in lec_arp_add()
1295 hlist_add_head(&entry->next, tmp); in lec_arp_add()
1297 pr_debug("Added entry:%pM\n", entry->mac_addr); in lec_arp_add()
1310 return -1; in lec_arp_remove()
1312 hlist_del(&to_remove->next); in lec_arp_remove()
1313 del_timer(&to_remove->timer); in lec_arp_remove()
1316 * If this is the only MAC connected to this VCC, in lec_arp_remove()
1317 * also tear down the VCC in lec_arp_remove()
1319 if (to_remove->status >= ESI_FLUSH_PENDING) { in lec_arp_remove()
1325 &priv->lec_arp_tables[i], next) { in lec_arp_remove()
1326 if (memcmp(to_remove->atm_addr, in lec_arp_remove()
1327 entry->atm_addr, ATM_ESA_LEN) == 0) { in lec_arp_remove()
1336 skb_queue_purge(&to_remove->tx_wait); /* FIXME: good place for this? */ in lec_arp_remove()
1338 pr_debug("Removed entry:%pM\n", to_remove->mac_addr); in lec_arp_remove()
1366 pr_info("Dump %p:\n", priv); in dump_arp_table()
1369 &priv->lec_arp_tables[i], next) { in dump_arp_table()
1371 offset += sprintf(buf, "%d: %p\n", i, rulla); in dump_arp_table()
1373 rulla->mac_addr); in dump_arp_table()
1378 rulla->atm_addr[j] & 0xff); in dump_arp_table()
1381 "Vcc vpi:%d vci:%d, Recv_vcc vpi:%d vci:%d Last_used:%lx, Timestamp:%lx, No_tries:%d ", in dump_arp_table()
1382 rulla->vcc ? rulla->vcc->vpi : 0, in dump_arp_table()
1383 rulla->vcc ? rulla->vcc->vci : 0, in dump_arp_table()
1384 rulla->recv_vcc ? rulla->recv_vcc-> in dump_arp_table()
1386 rulla->recv_vcc ? rulla->recv_vcc-> in dump_arp_table()
1387 vci : 0, rulla->last_used, in dump_arp_table()
1388 rulla->timestamp, rulla->no_tries); in dump_arp_table()
1392 rulla->flags, rulla->packets_flooded, in dump_arp_table()
1393 get_status_string(rulla->status)); in dump_arp_table()
1398 if (!hlist_empty(&priv->lec_no_forward)) in dump_arp_table()
1400 hlist_for_each_entry(rulla, &priv->lec_no_forward, next) { in dump_arp_table()
1402 offset += sprintf(buf + offset, "Mac: %pM", rulla->mac_addr); in dump_arp_table()
1406 rulla->atm_addr[j] & 0xff); in dump_arp_table()
1409 "Vcc vpi:%d vci:%d, Recv_vcc vpi:%d vci:%d Last_used:%lx, Timestamp:%lx, No_tries:%d ", in dump_arp_table()
1410 rulla->vcc ? rulla->vcc->vpi : 0, in dump_arp_table()
1411 rulla->vcc ? rulla->vcc->vci : 0, in dump_arp_table()
1412 rulla->recv_vcc ? rulla->recv_vcc->vpi : 0, in dump_arp_table()
1413 rulla->recv_vcc ? rulla->recv_vcc->vci : 0, in dump_arp_table()
1414 rulla->last_used, in dump_arp_table()
1415 rulla->timestamp, rulla->no_tries); in dump_arp_table()
1418 rulla->flags, rulla->packets_flooded, in dump_arp_table()
1419 get_status_string(rulla->status)); in dump_arp_table()
1423 if (!hlist_empty(&priv->lec_arp_empty_ones)) in dump_arp_table()
1425 hlist_for_each_entry(rulla, &priv->lec_arp_empty_ones, next) { in dump_arp_table()
1427 offset += sprintf(buf + offset, "Mac: %pM", rulla->mac_addr); in dump_arp_table()
1431 rulla->atm_addr[j] & 0xff); in dump_arp_table()
1434 "Vcc vpi:%d vci:%d, Recv_vcc vpi:%d vci:%d Last_used:%lx, Timestamp:%lx, No_tries:%d ", in dump_arp_table()
1435 rulla->vcc ? rulla->vcc->vpi : 0, in dump_arp_table()
1436 rulla->vcc ? rulla->vcc->vci : 0, in dump_arp_table()
1437 rulla->recv_vcc ? rulla->recv_vcc->vpi : 0, in dump_arp_table()
1438 rulla->recv_vcc ? rulla->recv_vcc->vci : 0, in dump_arp_table()
1439 rulla->last_used, in dump_arp_table()
1440 rulla->timestamp, rulla->no_tries); in dump_arp_table()
1443 rulla->flags, rulla->packets_flooded, in dump_arp_table()
1444 get_status_string(rulla->status)); in dump_arp_table()
1448 if (!hlist_empty(&priv->mcast_fwds)) in dump_arp_table()
1450 hlist_for_each_entry(rulla, &priv->mcast_fwds, next) { in dump_arp_table()
1452 offset += sprintf(buf + offset, "Mac: %pM", rulla->mac_addr); in dump_arp_table()
1456 rulla->atm_addr[j] & 0xff); in dump_arp_table()
1459 "Vcc vpi:%d vci:%d, Recv_vcc vpi:%d vci:%d Last_used:%lx, Timestamp:%lx, No_tries:%d ", in dump_arp_table()
1460 rulla->vcc ? rulla->vcc->vpi : 0, in dump_arp_table()
1461 rulla->vcc ? rulla->vcc->vci : 0, in dump_arp_table()
1462 rulla->recv_vcc ? rulla->recv_vcc->vpi : 0, in dump_arp_table()
1463 rulla->recv_vcc ? rulla->recv_vcc->vci : 0, in dump_arp_table()
1464 rulla->last_used, in dump_arp_table()
1465 rulla->timestamp, rulla->no_tries); in dump_arp_table()
1468 rulla->flags, rulla->packets_flooded, in dump_arp_table()
1469 get_status_string(rulla->status)); in dump_arp_table()
1479 * Destruction of arp-cache
1488 cancel_delayed_work_sync(&priv->lec_arp_work); in lec_arp_destroy()
1494 spin_lock_irqsave(&priv->lec_arp_lock, flags); in lec_arp_destroy()
1497 &priv->lec_arp_tables[i], next) { in lec_arp_destroy()
1501 INIT_HLIST_HEAD(&priv->lec_arp_tables[i]); in lec_arp_destroy()
1505 &priv->lec_arp_empty_ones, next) { in lec_arp_destroy()
1506 del_timer_sync(&entry->timer); in lec_arp_destroy()
1508 hlist_del(&entry->next); in lec_arp_destroy()
1511 INIT_HLIST_HEAD(&priv->lec_arp_empty_ones); in lec_arp_destroy()
1514 &priv->lec_no_forward, next) { in lec_arp_destroy()
1515 del_timer_sync(&entry->timer); in lec_arp_destroy()
1517 hlist_del(&entry->next); in lec_arp_destroy()
1520 INIT_HLIST_HEAD(&priv->lec_no_forward); in lec_arp_destroy()
1522 hlist_for_each_entry_safe(entry, next, &priv->mcast_fwds, next) { in lec_arp_destroy()
1525 hlist_del(&entry->next); in lec_arp_destroy()
1528 INIT_HLIST_HEAD(&priv->mcast_fwds); in lec_arp_destroy()
1529 priv->mcast_vcc = NULL; in lec_arp_destroy()
1530 spin_unlock_irqrestore(&priv->lec_arp_lock, flags); in lec_arp_destroy()
1544 head = &priv->lec_arp_tables[HASH(mac_addr[ETH_ALEN - 1])]; in lec_arp_find()
1546 if (ether_addr_equal(mac_addr, entry->mac_addr)) in lec_arp_find()
1562 ether_addr_copy(to_return->mac_addr, mac_addr); in make_entry()
1563 INIT_HLIST_NODE(&to_return->next); in make_entry()
1564 timer_setup(&to_return->timer, lec_arp_expire_arp, 0); in make_entry()
1565 to_return->last_used = jiffies; in make_entry()
1566 to_return->priv = priv; in make_entry()
1567 skb_queue_head_init(&to_return->tx_wait); in make_entry()
1568 refcount_set(&to_return->usage, 1); in make_entry()
1580 if (entry->status == ESI_ARP_PENDING) { in lec_arp_expire_arp()
1581 if (entry->no_tries <= entry->priv->max_retry_count) { in lec_arp_expire_arp()
1582 if (entry->is_rdesc) in lec_arp_expire_arp()
1583 send_to_lecd(entry->priv, l_rdesc_arp_xmt, in lec_arp_expire_arp()
1584 entry->mac_addr, NULL, NULL); in lec_arp_expire_arp()
1586 send_to_lecd(entry->priv, l_arp_xmt, in lec_arp_expire_arp()
1587 entry->mac_addr, NULL, NULL); in lec_arp_expire_arp()
1588 entry->no_tries++; in lec_arp_expire_arp()
1590 mod_timer(&entry->timer, jiffies + (1 * HZ)); in lec_arp_expire_arp()
1594 /* Unknown/unused vcc expire, remove associated entry */
1599 struct lec_priv *priv = to_remove->priv; in lec_arp_expire_vcc()
1601 del_timer(&to_remove->timer); in lec_arp_expire_vcc()
1603 pr_debug("%p %p: vpi:%d vci:%d\n", in lec_arp_expire_vcc()
1605 to_remove->vcc ? to_remove->recv_vcc->vpi : 0, in lec_arp_expire_vcc()
1606 to_remove->vcc ? to_remove->recv_vcc->vci : 0); in lec_arp_expire_vcc()
1608 spin_lock_irqsave(&priv->lec_arp_lock, flags); in lec_arp_expire_vcc()
1609 hlist_del(&to_remove->next); in lec_arp_expire_vcc()
1610 spin_unlock_irqrestore(&priv->lec_arp_lock, flags); in lec_arp_expire_vcc()
1622 if ((entry->flags) & LEC_REMOTE_FLAG && priv->topology_change) in __lec_arp_check_expire()
1623 time_to_check = priv->forward_delay_time; in __lec_arp_check_expire()
1625 time_to_check = priv->aging_time; in __lec_arp_check_expire()
1627 pr_debug("About to expire: %lx - %lx > %lx\n", in __lec_arp_check_expire()
1628 now, entry->last_used, time_to_check); in __lec_arp_check_expire()
1629 if (time_after(now, entry->last_used + time_to_check) && in __lec_arp_check_expire()
1630 !(entry->flags & LEC_PERMANENT_FLAG) && in __lec_arp_check_expire()
1631 !(entry->mac_addr[0] & 0x01)) { /* LANE2: 7.1.20 */ in __lec_arp_check_expire()
1638 if ((entry->status == ESI_VC_PENDING || in __lec_arp_check_expire()
1639 entry->status == ESI_ARP_PENDING) && in __lec_arp_check_expire()
1640 time_after_eq(now, entry->timestamp + in __lec_arp_check_expire()
1641 priv->max_unknown_frame_time)) { in __lec_arp_check_expire()
1642 entry->timestamp = jiffies; in __lec_arp_check_expire()
1643 entry->packets_flooded = 0; in __lec_arp_check_expire()
1644 if (entry->status == ESI_VC_PENDING) in __lec_arp_check_expire()
1646 entry->mac_addr, in __lec_arp_check_expire()
1647 entry->atm_addr, in __lec_arp_check_expire()
1650 if (entry->status == ESI_FLUSH_PENDING && in __lec_arp_check_expire()
1651 time_after_eq(now, entry->timestamp + in __lec_arp_check_expire()
1652 priv->path_switching_delay)) { in __lec_arp_check_expire()
1662 * 1. Re-set timer
1686 pr_debug("%p\n", priv); in lec_arp_check_expire()
1689 spin_lock_irqsave(&priv->lec_arp_lock, flags); in lec_arp_check_expire()
1692 &priv->lec_arp_tables[i], next) { in lec_arp_check_expire()
1695 struct atm_vcc *vcc = entry->vcc; in lec_arp_check_expire() local
1697 spin_unlock_irqrestore(&priv->lec_arp_lock, in lec_arp_check_expire()
1699 while ((skb = skb_dequeue(&entry->tx_wait))) in lec_arp_check_expire()
1700 lec_send(vcc, skb); in lec_arp_check_expire()
1701 entry->last_used = jiffies; in lec_arp_check_expire()
1702 entry->status = ESI_FORWARD_DIRECT; in lec_arp_check_expire()
1709 spin_unlock_irqrestore(&priv->lec_arp_lock, flags); in lec_arp_check_expire()
1711 schedule_delayed_work(&priv->lec_arp_work, LEC_ARP_REFRESH_INTERVAL); in lec_arp_check_expire()
1715 * Try to find vcc where mac_address is attached.
1728 switch (priv->lane_version) { in lec_arp_resolve()
1730 return priv->mcast_vcc; in lec_arp_resolve()
1733 return priv->mcast_vcc; in lec_arp_resolve()
1740 spin_lock_irqsave(&priv->lec_arp_lock, flags); in lec_arp_resolve()
1744 if (entry->status == ESI_FORWARD_DIRECT) { in lec_arp_resolve()
1746 entry->last_used = jiffies; in lec_arp_resolve()
1749 found = entry->vcc; in lec_arp_resolve()
1756 if (entry->status == ESI_ARP_PENDING) in lec_arp_resolve()
1757 entry->no_tries = 0; in lec_arp_resolve()
1764 if (entry->status != ESI_FLUSH_PENDING && in lec_arp_resolve()
1765 entry->packets_flooded < in lec_arp_resolve()
1766 priv->maximum_unknown_frame_count) { in lec_arp_resolve()
1767 entry->packets_flooded++; in lec_arp_resolve()
1769 found = priv->mcast_vcc; in lec_arp_resolve()
1773 * We got here because entry->status == ESI_FLUSH_PENDING in lec_arp_resolve()
1779 pr_debug("entry->status %d entry->vcc %p\n", entry->status, in lec_arp_resolve()
1780 entry->vcc); in lec_arp_resolve()
1787 found = priv->mcast_vcc; in lec_arp_resolve()
1791 /* We want arp-request(s) to be sent */ in lec_arp_resolve()
1792 entry->packets_flooded = 1; in lec_arp_resolve()
1793 entry->status = ESI_ARP_PENDING; in lec_arp_resolve()
1794 entry->no_tries = 1; in lec_arp_resolve()
1795 entry->last_used = entry->timestamp = jiffies; in lec_arp_resolve()
1796 entry->is_rdesc = is_rdesc; in lec_arp_resolve()
1797 if (entry->is_rdesc) in lec_arp_resolve()
1802 entry->timer.expires = jiffies + (1 * HZ); in lec_arp_resolve()
1803 entry->timer.function = lec_arp_expire_arp; in lec_arp_resolve()
1804 add_timer(&entry->timer); in lec_arp_resolve()
1805 found = priv->mcast_vcc; in lec_arp_resolve()
1809 spin_unlock_irqrestore(&priv->lec_arp_lock, flags); in lec_arp_resolve()
1823 spin_lock_irqsave(&priv->lec_arp_lock, flags); in lec_addr_delete()
1826 &priv->lec_arp_tables[i], next) { in lec_addr_delete()
1827 if (!memcmp(atm_addr, entry->atm_addr, ATM_ESA_LEN) && in lec_addr_delete()
1829 !(entry->flags & LEC_PERMANENT_FLAG))) { in lec_addr_delete()
1833 spin_unlock_irqrestore(&priv->lec_arp_lock, flags); in lec_addr_delete()
1837 spin_unlock_irqrestore(&priv->lec_arp_lock, flags); in lec_addr_delete()
1838 return -1; in lec_addr_delete()
1857 spin_lock_irqsave(&priv->lec_arp_lock, flags); in lec_arp_update()
1864 if (!hlist_empty(&priv->lec_arp_empty_ones)) { in lec_arp_update()
1866 &priv->lec_arp_empty_ones, next) { in lec_arp_update()
1867 if (memcmp(entry->atm_addr, atm_addr, ATM_ESA_LEN) == 0) { in lec_arp_update()
1868 hlist_del(&entry->next); in lec_arp_update()
1869 del_timer(&entry->timer); in lec_arp_update()
1872 del_timer(&tmp->timer); in lec_arp_update()
1873 tmp->status = ESI_FORWARD_DIRECT; in lec_arp_update()
1874 memcpy(tmp->atm_addr, atm_addr, ATM_ESA_LEN); in lec_arp_update()
1875 tmp->vcc = entry->vcc; in lec_arp_update()
1876 tmp->old_push = entry->old_push; in lec_arp_update()
1877 tmp->last_used = jiffies; in lec_arp_update()
1878 del_timer(&entry->timer); in lec_arp_update()
1882 entry->status = ESI_FORWARD_DIRECT; in lec_arp_update()
1883 ether_addr_copy(entry->mac_addr, in lec_arp_update()
1885 entry->last_used = jiffies; in lec_arp_update()
1889 entry->flags |= LEC_REMOTE_FLAG; in lec_arp_update()
1891 entry->flags &= ~LEC_REMOTE_FLAG; in lec_arp_update()
1904 entry->status = ESI_UNKNOWN; in lec_arp_update()
1908 memcpy(entry->atm_addr, atm_addr, ATM_ESA_LEN); in lec_arp_update()
1909 del_timer(&entry->timer); in lec_arp_update()
1912 &priv->lec_arp_tables[i], next) { in lec_arp_update()
1914 !memcmp(tmp->atm_addr, atm_addr, ATM_ESA_LEN)) { in lec_arp_update()
1915 /* Vcc to this host exists */ in lec_arp_update()
1916 if (tmp->status > ESI_VC_PENDING) { in lec_arp_update()
1921 entry->vcc = tmp->vcc; in lec_arp_update()
1922 entry->old_push = tmp->old_push; in lec_arp_update()
1924 entry->status = tmp->status; in lec_arp_update()
1930 entry->flags |= LEC_REMOTE_FLAG; in lec_arp_update()
1932 entry->flags &= ~LEC_REMOTE_FLAG; in lec_arp_update()
1933 if (entry->status == ESI_ARP_PENDING || entry->status == ESI_UNKNOWN) { in lec_arp_update()
1934 entry->status = ESI_VC_PENDING; in lec_arp_update()
1935 send_to_lecd(priv, l_svc_setup, entry->mac_addr, atm_addr, NULL); in lec_arp_update()
1940 spin_unlock_irqrestore(&priv->lec_arp_lock, flags); in lec_arp_update()
1944 * Notifies: Vcc setup ready
1948 struct atm_vcc *vcc, in lec_vcc_added() argument
1949 void (*old_push) (struct atm_vcc *vcc, struct sk_buff *skb)) in lec_vcc_added()
1955 spin_lock_irqsave(&priv->lec_arp_lock, flags); in lec_vcc_added()
1956 /* Vcc for Multicast Forward. No timer, LANEv2 7.1.20 and 2.3.5.3 */ in lec_vcc_added()
1957 if (ioc_data->receive == 2) { in lec_vcc_added()
1965 memcpy(entry->atm_addr, ioc_data->atm_addr, ATM_ESA_LEN); in lec_vcc_added()
1966 entry->recv_vcc = vcc; in lec_vcc_added()
1967 entry->old_recv_push = old_push; in lec_vcc_added()
1972 del_timer(&entry->timer); in lec_vcc_added()
1973 memcpy(entry->atm_addr, ioc_data->atm_addr, ATM_ESA_LEN); in lec_vcc_added()
1974 entry->recv_vcc = vcc; in lec_vcc_added()
1975 entry->old_recv_push = old_push; in lec_vcc_added()
1976 hlist_add_head(&entry->next, &priv->mcast_fwds); in lec_vcc_added()
1978 } else if (ioc_data->receive == 1) { in lec_vcc_added()
1980 * Vcc which we don't want to make default vcc, in lec_vcc_added()
1984 ioc_data->atm_addr[0], ioc_data->atm_addr[1], in lec_vcc_added()
1985 ioc_data->atm_addr[2], ioc_data->atm_addr[3], in lec_vcc_added()
1986 ioc_data->atm_addr[4], ioc_data->atm_addr[5], in lec_vcc_added()
1987 ioc_data->atm_addr[6], ioc_data->atm_addr[7], in lec_vcc_added()
1988 ioc_data->atm_addr[8], ioc_data->atm_addr[9], in lec_vcc_added()
1989 ioc_data->atm_addr[10], ioc_data->atm_addr[11], in lec_vcc_added()
1990 ioc_data->atm_addr[12], ioc_data->atm_addr[13], in lec_vcc_added()
1991 ioc_data->atm_addr[14], ioc_data->atm_addr[15], in lec_vcc_added()
1992 ioc_data->atm_addr[16], ioc_data->atm_addr[17], in lec_vcc_added()
1993 ioc_data->atm_addr[18], ioc_data->atm_addr[19]); in lec_vcc_added()
1997 memcpy(entry->atm_addr, ioc_data->atm_addr, ATM_ESA_LEN); in lec_vcc_added()
1998 eth_zero_addr(entry->mac_addr); in lec_vcc_added()
1999 entry->recv_vcc = vcc; in lec_vcc_added()
2000 entry->old_recv_push = old_push; in lec_vcc_added()
2001 entry->status = ESI_UNKNOWN; in lec_vcc_added()
2002 entry->timer.expires = jiffies + priv->vcc_timeout_period; in lec_vcc_added()
2003 entry->timer.function = lec_arp_expire_vcc; in lec_vcc_added()
2004 hlist_add_head(&entry->next, &priv->lec_no_forward); in lec_vcc_added()
2005 add_timer(&entry->timer); in lec_vcc_added()
2010 ioc_data->atm_addr[0], ioc_data->atm_addr[1], in lec_vcc_added()
2011 ioc_data->atm_addr[2], ioc_data->atm_addr[3], in lec_vcc_added()
2012 ioc_data->atm_addr[4], ioc_data->atm_addr[5], in lec_vcc_added()
2013 ioc_data->atm_addr[6], ioc_data->atm_addr[7], in lec_vcc_added()
2014 ioc_data->atm_addr[8], ioc_data->atm_addr[9], in lec_vcc_added()
2015 ioc_data->atm_addr[10], ioc_data->atm_addr[11], in lec_vcc_added()
2016 ioc_data->atm_addr[12], ioc_data->atm_addr[13], in lec_vcc_added()
2017 ioc_data->atm_addr[14], ioc_data->atm_addr[15], in lec_vcc_added()
2018 ioc_data->atm_addr[16], ioc_data->atm_addr[17], in lec_vcc_added()
2019 ioc_data->atm_addr[18], ioc_data->atm_addr[19]); in lec_vcc_added()
2022 &priv->lec_arp_tables[i], next) { in lec_vcc_added()
2024 (ioc_data->atm_addr, entry->atm_addr, in lec_vcc_added()
2027 pr_debug("Currently -> Vcc: %d, Rvcc:%d\n", in lec_vcc_added()
2028 entry->vcc ? entry->vcc->vci : 0, in lec_vcc_added()
2029 entry->recv_vcc ? entry->recv_vcc-> in lec_vcc_added()
2032 del_timer(&entry->timer); in lec_vcc_added()
2033 entry->vcc = vcc; in lec_vcc_added()
2034 entry->old_push = old_push; in lec_vcc_added()
2035 if (entry->status == ESI_VC_PENDING) { in lec_vcc_added()
2036 if (priv->maximum_unknown_frame_count in lec_vcc_added()
2038 entry->status = in lec_vcc_added()
2041 entry->timestamp = jiffies; in lec_vcc_added()
2042 entry->status = in lec_vcc_added()
2047 entry->atm_addr, in lec_vcc_added()
2057 * we formed into default VCC (8.1.11). in lec_vcc_added()
2069 pr_debug("After vcc was added\n"); in lec_vcc_added()
2075 * from this vcc in lec_vcc_added()
2080 entry->vcc = vcc; in lec_vcc_added()
2081 entry->old_push = old_push; in lec_vcc_added()
2082 memcpy(entry->atm_addr, ioc_data->atm_addr, ATM_ESA_LEN); in lec_vcc_added()
2083 eth_zero_addr(entry->mac_addr); in lec_vcc_added()
2084 entry->status = ESI_UNKNOWN; in lec_vcc_added()
2085 hlist_add_head(&entry->next, &priv->lec_arp_empty_ones); in lec_vcc_added()
2086 entry->timer.expires = jiffies + priv->vcc_timeout_period; in lec_vcc_added()
2087 entry->timer.function = lec_arp_expire_vcc; in lec_vcc_added()
2088 add_timer(&entry->timer); in lec_vcc_added()
2089 pr_debug("After vcc was added\n"); in lec_vcc_added()
2092 spin_unlock_irqrestore(&priv->lec_arp_lock, flags); in lec_vcc_added()
2103 spin_lock_irqsave(&priv->lec_arp_lock, flags); in lec_flush_complete()
2106 &priv->lec_arp_tables[i], next) { in lec_flush_complete()
2107 if (entry->flush_tran_id == tran_id && in lec_flush_complete()
2108 entry->status == ESI_FLUSH_PENDING) { in lec_flush_complete()
2110 struct atm_vcc *vcc = entry->vcc; in lec_flush_complete() local
2113 spin_unlock_irqrestore(&priv->lec_arp_lock, in lec_flush_complete()
2115 while ((skb = skb_dequeue(&entry->tx_wait))) in lec_flush_complete()
2116 lec_send(vcc, skb); in lec_flush_complete()
2117 entry->last_used = jiffies; in lec_flush_complete()
2118 entry->status = ESI_FORWARD_DIRECT; in lec_flush_complete()
2125 spin_unlock_irqrestore(&priv->lec_arp_lock, flags); in lec_flush_complete()
2137 spin_lock_irqsave(&priv->lec_arp_lock, flags); in lec_set_flush_tran_id()
2140 &priv->lec_arp_tables[i], next) { in lec_set_flush_tran_id()
2141 if (!memcmp(atm_addr, entry->atm_addr, ATM_ESA_LEN)) { in lec_set_flush_tran_id()
2142 entry->flush_tran_id = tran_id; in lec_set_flush_tran_id()
2143 pr_debug("Set flush transaction id to %lx for %p\n", in lec_set_flush_tran_id()
2147 spin_unlock_irqrestore(&priv->lec_arp_lock, flags); in lec_set_flush_tran_id()
2150 static int lec_mcast_make(struct lec_priv *priv, struct atm_vcc *vcc) in lec_mcast_make() argument
2162 return -ENOMEM; in lec_mcast_make()
2163 vpriv->xoff = 0; in lec_mcast_make()
2164 vpriv->old_pop = vcc->pop; in lec_mcast_make()
2165 vcc->user_back = vpriv; in lec_mcast_make()
2166 vcc->pop = lec_pop; in lec_mcast_make()
2167 spin_lock_irqsave(&priv->lec_arp_lock, flags); in lec_mcast_make()
2170 vcc->pop = vpriv->old_pop; in lec_mcast_make()
2172 err = -ENOMEM; in lec_mcast_make()
2175 memcpy(to_add->atm_addr, vcc->remote.sas_addr.prv, ATM_ESA_LEN); in lec_mcast_make()
2176 to_add->status = ESI_FORWARD_DIRECT; in lec_mcast_make()
2177 to_add->flags |= LEC_PERMANENT_FLAG; in lec_mcast_make()
2178 to_add->vcc = vcc; in lec_mcast_make()
2179 to_add->old_push = vcc->push; in lec_mcast_make()
2180 vcc->push = lec_push; in lec_mcast_make()
2181 priv->mcast_vcc = vcc; in lec_mcast_make()
2184 spin_unlock_irqrestore(&priv->lec_arp_lock, flags); in lec_mcast_make()
2188 static void lec_vcc_close(struct lec_priv *priv, struct atm_vcc *vcc) in lec_vcc_close() argument
2195 pr_debug("LEC_ARP: lec_vcc_close vpi:%d vci:%d\n", vcc->vpi, vcc->vci); in lec_vcc_close()
2198 spin_lock_irqsave(&priv->lec_arp_lock, flags); in lec_vcc_close()
2202 &priv->lec_arp_tables[i], next) { in lec_vcc_close()
2203 if (vcc == entry->vcc) { in lec_vcc_close()
2206 if (priv->mcast_vcc == vcc) in lec_vcc_close()
2207 priv->mcast_vcc = NULL; in lec_vcc_close()
2213 &priv->lec_arp_empty_ones, next) { in lec_vcc_close()
2214 if (entry->vcc == vcc) { in lec_vcc_close()
2216 del_timer(&entry->timer); in lec_vcc_close()
2217 hlist_del(&entry->next); in lec_vcc_close()
2223 &priv->lec_no_forward, next) { in lec_vcc_close()
2224 if (entry->recv_vcc == vcc) { in lec_vcc_close()
2226 del_timer(&entry->timer); in lec_vcc_close()
2227 hlist_del(&entry->next); in lec_vcc_close()
2232 hlist_for_each_entry_safe(entry, next, &priv->mcast_fwds, next) { in lec_vcc_close()
2233 if (entry->recv_vcc == vcc) { in lec_vcc_close()
2236 hlist_del(&entry->next); in lec_vcc_close()
2241 spin_unlock_irqrestore(&priv->lec_arp_lock, flags); in lec_vcc_close()
2247 struct atm_vcc *vcc, struct sk_buff *skb) in lec_arp_check_empties() argument
2252 struct lecdatahdr_8023 *hdr = (struct lecdatahdr_8023 *)skb->data; in lec_arp_check_empties()
2253 unsigned char *src = hdr->h_source; in lec_arp_check_empties()
2255 spin_lock_irqsave(&priv->lec_arp_lock, flags); in lec_arp_check_empties()
2257 &priv->lec_arp_empty_ones, next) { in lec_arp_check_empties()
2258 if (vcc == entry->vcc) { in lec_arp_check_empties()
2259 del_timer(&entry->timer); in lec_arp_check_empties()
2260 ether_addr_copy(entry->mac_addr, src); in lec_arp_check_empties()
2261 entry->status = ESI_FORWARD_DIRECT; in lec_arp_check_empties()
2262 entry->last_used = jiffies; in lec_arp_check_empties()
2269 hlist_del(&entry->next); in lec_arp_check_empties()
2276 spin_unlock_irqrestore(&priv->lec_arp_lock, flags); in lec_arp_check_empties()