Lines Matching refs:priv
67 static struct lec_arp_table *lec_arp_find(struct lec_priv *priv,
69 static int lec_arp_remove(struct lec_priv *priv,
79 static int lec_addr_delete(struct lec_priv *priv, const unsigned char *atm_addr,
81 static void lec_arp_check_empties(struct lec_priv *priv,
83 static void lec_arp_destroy(struct lec_priv *priv);
84 static void lec_arp_init(struct lec_priv *priv);
85 static struct atm_vcc *lec_arp_resolve(struct lec_priv *priv,
89 static void lec_arp_update(struct lec_priv *priv, const unsigned char *mac_addr,
93 static void lec_flush_complete(struct lec_priv *priv, unsigned long tran_id);
94 static int lec_mcast_make(struct lec_priv *priv, struct atm_vcc *vcc);
95 static void lec_set_flush_tran_id(struct lec_priv *priv,
98 static void lec_vcc_added(struct lec_priv *priv,
103 static void lec_vcc_close(struct lec_priv *priv, struct atm_vcc *vcc);
132 struct lec_priv *priv; in lec_handle_bridge() local
155 priv = netdev_priv(dev); in lec_handle_bridge()
156 atm_force_charge(priv->lecd, skb2->truesize); in lec_handle_bridge()
157 sk = sk_atm(priv->lecd); in lec_handle_bridge()
208 struct lec_priv *priv = netdev_priv(dev); in lec_start_xmit() local
217 if (!priv->lecd) { in lec_start_xmit()
248 lec_h->le_header = htons(priv->lecid); in lec_start_xmit()
257 dev->name, skb->len, priv->lecid); in lec_start_xmit()
283 vcc = lec_arp_resolve(priv, dst, is_rdesc, &entry); in lec_start_xmit()
346 struct lec_priv *priv = netdev_priv(dev); in lec_atm_send() local
364 lec_addr_delete(priv, mesg->content.normal.atm_addr, in lec_atm_send()
368 priv->topology_change = mesg->content.normal.flag; in lec_atm_send()
371 lec_flush_complete(priv, mesg->content.normal.flag); in lec_atm_send()
374 spin_lock_irqsave(&priv->lec_arp_lock, flags); in lec_atm_send()
375 entry = lec_arp_find(priv, mesg->content.normal.mac_addr); in lec_atm_send()
376 lec_arp_remove(priv, entry); in lec_atm_send()
377 spin_unlock_irqrestore(&priv->lec_arp_lock, flags); in lec_atm_send()
383 lec_arp_update(priv, mesg->content.normal.mac_addr, in lec_atm_send()
396 priv->maximum_unknown_frame_count = in lec_atm_send()
398 priv->max_unknown_frame_time = in lec_atm_send()
400 priv->max_retry_count = mesg->content.config.max_retry_count; in lec_atm_send()
401 priv->aging_time = (mesg->content.config.aging_time * HZ); in lec_atm_send()
402 priv->forward_delay_time = in lec_atm_send()
404 priv->arp_response_time = in lec_atm_send()
406 priv->flush_timeout = (mesg->content.config.flush_timeout * HZ); in lec_atm_send()
407 priv->path_switching_delay = in lec_atm_send()
409 priv->lane_version = mesg->content.config.lane_version; in lec_atm_send()
411 priv->lane2_ops = NULL; in lec_atm_send()
412 if (priv->lane_version > 1) in lec_atm_send()
413 priv->lane2_ops = &lane2_ops; in lec_atm_send()
419 priv->is_proxy = mesg->content.config.is_proxy; in lec_atm_send()
422 lec_set_flush_tran_id(priv, mesg->content.normal.atm_addr, in lec_atm_send()
426 priv->lecid = in lec_atm_send()
450 atm_force_charge(priv->lecd, skb2->truesize); in lec_atm_send()
451 sk = sk_atm(priv->lecd); in lec_atm_send()
471 struct lec_priv *priv = netdev_priv(dev); in lec_atm_close() local
473 priv->lecd = NULL; in lec_atm_close()
477 lec_arp_destroy(priv); in lec_atm_close()
507 send_to_lecd(struct lec_priv *priv, atmlec_msg_type type, in send_to_lecd() argument
515 if (!priv || !priv->lecd) in send_to_lecd()
533 atm_force_charge(priv->lecd, skb->truesize); in send_to_lecd()
534 sk = sk_atm(priv->lecd); in send_to_lecd()
540 atm_force_charge(priv->lecd, data->truesize); in send_to_lecd()
584 struct lec_priv *priv = netdev_priv(dev); in lec_push() local
592 lec_vcc_close(priv, vcc); in lec_push()
602 dev->name, skb->len, priv->lecid); in lec_push()
618 if (*(__be16 *) skb->data == htons(priv->lecid) || in lec_push()
619 !priv->lecd || !(dev->flags & IFF_UP)) { in lec_push()
634 spin_lock_irqsave(&priv->lec_arp_lock, flags); in lec_push()
637 entry = lec_arp_find(priv, src); in lec_push()
639 lec_arp_remove(priv, entry); in lec_push()
643 spin_unlock_irqrestore(&priv->lec_arp_lock, flags); in lec_push()
646 !priv->is_proxy && /* Proxy wants all the packets */ in lec_push()
651 if (!hlist_empty(&priv->lec_arp_empty_ones)) in lec_push()
652 lec_arp_check_empties(priv, vcc, skb); in lec_push()
725 struct lec_priv *priv; in lecd_attach() local
747 priv = netdev_priv(dev_lec[i]); in lecd_attach()
749 priv = netdev_priv(dev_lec[i]); in lecd_attach()
750 if (priv->lecd) in lecd_attach()
753 lec_arp_init(priv); in lecd_attach()
754 priv->itfnum = i; /* LANE2 addition */ in lecd_attach()
755 priv->lecd = vcc; in lecd_attach()
764 priv->maximum_unknown_frame_count = 1; in lecd_attach()
765 priv->max_unknown_frame_time = (1 * HZ); in lecd_attach()
766 priv->vcc_timeout_period = (1200 * HZ); in lecd_attach()
767 priv->max_retry_count = 1; in lecd_attach()
768 priv->aging_time = (300 * HZ); in lecd_attach()
769 priv->forward_delay_time = (15 * HZ); in lecd_attach()
770 priv->topology_change = 0; in lecd_attach()
771 priv->arp_response_time = (1 * HZ); in lecd_attach()
772 priv->flush_timeout = (4 * HZ); in lecd_attach()
773 priv->path_switching_delay = (6 * HZ); in lecd_attach()
847 struct lec_priv *priv) in lec_arp_walk() argument
853 v = lec_tbl_walk(state, &priv->lec_arp_tables[p], l); in lec_arp_walk()
862 struct lec_priv *priv) in lec_misc_walk() argument
865 &priv->lec_arp_empty_ones, in lec_misc_walk()
866 &priv->lec_no_forward, in lec_misc_walk()
867 &priv->mcast_fwds in lec_misc_walk()
882 struct lec_priv *priv) in lec_priv_walk() argument
885 state->locked = priv; in lec_priv_walk()
886 spin_lock_irqsave(&priv->lec_arp_lock, state->flags); in lec_priv_walk()
888 if (!lec_arp_walk(state, l, priv) && !lec_misc_walk(state, l, priv)) { in lec_priv_walk()
889 spin_unlock_irqrestore(&priv->lec_arp_lock, state->flags); in lec_priv_walk()
1078 struct lec_priv *priv = netdev_priv(dev); in lane2_resolve() local
1084 spin_lock_irqsave(&priv->lec_arp_lock, flags); in lane2_resolve()
1085 table = lec_arp_find(priv, dst_mac); in lane2_resolve()
1086 spin_unlock_irqrestore(&priv->lec_arp_lock, flags); in lane2_resolve()
1100 retval = send_to_lecd(priv, l_arp_xmt, dst_mac, NULL, NULL); in lane2_resolve()
1108 retval = send_to_lecd(priv, l_arp_xmt, dst_mac, NULL, skb); in lane2_resolve()
1125 struct lec_priv *priv = netdev_priv(dev); in lane2_associate_req() local
1130 kfree(priv->tlvs); /* NULL if there was no previous association */ in lane2_associate_req()
1132 priv->tlvs = kmemdup(tlvs, sizeoftlvs, GFP_KERNEL); in lane2_associate_req()
1133 if (priv->tlvs == NULL) in lane2_associate_req()
1135 priv->sizeoftlvs = sizeoftlvs; in lane2_associate_req()
1142 retval = send_to_lecd(priv, l_associate_req, NULL, NULL, skb); in lane2_associate_req()
1162 struct lec_priv *priv = netdev_priv(dev); in lane2_associate_ind() local
1169 struct lec_arp_table *entry = lec_arp_find(priv, mac_addr); in lane2_associate_ind()
1191 if (priv->lane2_ops && priv->lane2_ops->associate_indicator) { in lane2_associate_ind()
1192 priv->lane2_ops->associate_indicator(dev, mac_addr, in lane2_associate_ind()
1233 static void lec_arp_init(struct lec_priv *priv) in lec_arp_init() argument
1238 INIT_HLIST_HEAD(&priv->lec_arp_tables[i]); in lec_arp_init()
1239 INIT_HLIST_HEAD(&priv->lec_arp_empty_ones); in lec_arp_init()
1240 INIT_HLIST_HEAD(&priv->lec_no_forward); in lec_arp_init()
1241 INIT_HLIST_HEAD(&priv->mcast_fwds); in lec_arp_init()
1242 spin_lock_init(&priv->lec_arp_lock); in lec_arp_init()
1243 INIT_DELAYED_WORK(&priv->lec_arp_work, lec_arp_check_expire); in lec_arp_init()
1244 schedule_delayed_work(&priv->lec_arp_work, LEC_ARP_REFRESH_INTERVAL); in lec_arp_init()
1281 lec_arp_add(struct lec_priv *priv, struct lec_arp_table *entry) in lec_arp_add() argument
1285 tmp = &priv->lec_arp_tables[HASH(entry->mac_addr[ETH_ALEN - 1])]; in lec_arp_add()
1295 lec_arp_remove(struct lec_priv *priv, struct lec_arp_table *to_remove) in lec_arp_remove() argument
1316 &priv->lec_arp_tables[i], next) { in lec_arp_remove()
1351 static void dump_arp_table(struct lec_priv *priv) in dump_arp_table() argument
1357 pr_info("Dump %p:\n", priv); in dump_arp_table()
1360 &priv->lec_arp_tables[i], next) { in dump_arp_table()
1385 if (!hlist_empty(&priv->lec_no_forward)) in dump_arp_table()
1387 hlist_for_each_entry(rulla, &priv->lec_no_forward, next) { in dump_arp_table()
1407 if (!hlist_empty(&priv->lec_arp_empty_ones)) in dump_arp_table()
1409 hlist_for_each_entry(rulla, &priv->lec_arp_empty_ones, next) { in dump_arp_table()
1429 if (!hlist_empty(&priv->mcast_fwds)) in dump_arp_table()
1431 hlist_for_each_entry(rulla, &priv->mcast_fwds, next) { in dump_arp_table()
1453 #define dump_arp_table(priv) do { } while (0) argument
1459 static void lec_arp_destroy(struct lec_priv *priv) in lec_arp_destroy() argument
1466 cancel_delayed_work_sync(&priv->lec_arp_work); in lec_arp_destroy()
1472 spin_lock_irqsave(&priv->lec_arp_lock, flags); in lec_arp_destroy()
1475 &priv->lec_arp_tables[i], next) { in lec_arp_destroy()
1476 lec_arp_remove(priv, entry); in lec_arp_destroy()
1479 INIT_HLIST_HEAD(&priv->lec_arp_tables[i]); in lec_arp_destroy()
1483 &priv->lec_arp_empty_ones, next) { in lec_arp_destroy()
1489 INIT_HLIST_HEAD(&priv->lec_arp_empty_ones); in lec_arp_destroy()
1492 &priv->lec_no_forward, next) { in lec_arp_destroy()
1498 INIT_HLIST_HEAD(&priv->lec_no_forward); in lec_arp_destroy()
1500 hlist_for_each_entry_safe(entry, next, &priv->mcast_fwds, next) { in lec_arp_destroy()
1506 INIT_HLIST_HEAD(&priv->mcast_fwds); in lec_arp_destroy()
1507 priv->mcast_vcc = NULL; in lec_arp_destroy()
1508 spin_unlock_irqrestore(&priv->lec_arp_lock, flags); in lec_arp_destroy()
1514 static struct lec_arp_table *lec_arp_find(struct lec_priv *priv, in lec_arp_find() argument
1522 head = &priv->lec_arp_tables[HASH(mac_addr[ETH_ALEN - 1])]; in lec_arp_find()
1530 static struct lec_arp_table *make_entry(struct lec_priv *priv, in make_entry() argument
1542 to_return->priv = priv; in make_entry()
1557 if (entry->no_tries <= entry->priv->max_retry_count) { in lec_arp_expire_arp()
1559 send_to_lecd(entry->priv, l_rdesc_arp_xmt, in lec_arp_expire_arp()
1562 send_to_lecd(entry->priv, l_arp_xmt, in lec_arp_expire_arp()
1575 struct lec_priv *priv = to_remove->priv; in lec_arp_expire_vcc() local
1580 to_remove, priv, in lec_arp_expire_vcc()
1584 spin_lock_irqsave(&priv->lec_arp_lock, flags); in lec_arp_expire_vcc()
1586 spin_unlock_irqrestore(&priv->lec_arp_lock, flags); in lec_arp_expire_vcc()
1594 struct lec_priv *priv) in __lec_arp_check_expire() argument
1598 if ((entry->flags) & LEC_REMOTE_FLAG && priv->topology_change) in __lec_arp_check_expire()
1599 time_to_check = priv->forward_delay_time; in __lec_arp_check_expire()
1601 time_to_check = priv->aging_time; in __lec_arp_check_expire()
1610 lec_arp_remove(priv, entry); in __lec_arp_check_expire()
1617 priv->max_unknown_frame_time)) { in __lec_arp_check_expire()
1621 send_to_lecd(priv, l_svc_setup, in __lec_arp_check_expire()
1628 priv->path_switching_delay)) { in __lec_arp_check_expire()
1655 struct lec_priv *priv = in lec_arp_check_expire() local
1662 pr_debug("%p\n", priv); in lec_arp_check_expire()
1665 spin_lock_irqsave(&priv->lec_arp_lock, flags); in lec_arp_check_expire()
1668 &priv->lec_arp_tables[i], next) { in lec_arp_check_expire()
1669 if (__lec_arp_check_expire(entry, now, priv)) { in lec_arp_check_expire()
1673 spin_unlock_irqrestore(&priv->lec_arp_lock, in lec_arp_check_expire()
1685 spin_unlock_irqrestore(&priv->lec_arp_lock, flags); in lec_arp_check_expire()
1687 schedule_delayed_work(&priv->lec_arp_work, LEC_ARP_REFRESH_INTERVAL); in lec_arp_check_expire()
1694 static struct atm_vcc *lec_arp_resolve(struct lec_priv *priv, in lec_arp_resolve() argument
1704 switch (priv->lane_version) { in lec_arp_resolve()
1706 return priv->mcast_vcc; in lec_arp_resolve()
1709 return priv->mcast_vcc; in lec_arp_resolve()
1716 spin_lock_irqsave(&priv->lec_arp_lock, flags); in lec_arp_resolve()
1717 entry = lec_arp_find(priv, mac_to_find); in lec_arp_resolve()
1742 priv->maximum_unknown_frame_count) { in lec_arp_resolve()
1745 found = priv->mcast_vcc; in lec_arp_resolve()
1760 entry = make_entry(priv, mac_to_find); in lec_arp_resolve()
1763 found = priv->mcast_vcc; in lec_arp_resolve()
1766 lec_arp_add(priv, entry); in lec_arp_resolve()
1774 send_to_lecd(priv, l_rdesc_arp_xmt, mac_to_find, NULL, in lec_arp_resolve()
1777 send_to_lecd(priv, l_arp_xmt, mac_to_find, NULL, NULL); in lec_arp_resolve()
1781 found = priv->mcast_vcc; in lec_arp_resolve()
1785 spin_unlock_irqrestore(&priv->lec_arp_lock, flags); in lec_arp_resolve()
1790 lec_addr_delete(struct lec_priv *priv, const unsigned char *atm_addr, in lec_addr_delete() argument
1799 spin_lock_irqsave(&priv->lec_arp_lock, flags); in lec_addr_delete()
1802 &priv->lec_arp_tables[i], next) { in lec_addr_delete()
1806 lec_arp_remove(priv, entry); in lec_addr_delete()
1809 spin_unlock_irqrestore(&priv->lec_arp_lock, flags); in lec_addr_delete()
1813 spin_unlock_irqrestore(&priv->lec_arp_lock, flags); in lec_addr_delete()
1821 lec_arp_update(struct lec_priv *priv, const unsigned char *mac_addr, in lec_arp_update() argument
1833 spin_lock_irqsave(&priv->lec_arp_lock, flags); in lec_arp_update()
1834 entry = lec_arp_find(priv, mac_addr); in lec_arp_update()
1840 if (!hlist_empty(&priv->lec_arp_empty_ones)) { in lec_arp_update()
1842 &priv->lec_arp_empty_ones, next) { in lec_arp_update()
1846 tmp = lec_arp_find(priv, mac_addr); in lec_arp_update()
1862 lec_arp_add(priv, entry); in lec_arp_update()
1869 dump_arp_table(priv); in lec_arp_update()
1875 entry = lec_arp_find(priv, mac_addr); in lec_arp_update()
1877 entry = make_entry(priv, mac_addr); in lec_arp_update()
1881 lec_arp_add(priv, entry); in lec_arp_update()
1888 &priv->lec_arp_tables[i], next) { in lec_arp_update()
1911 send_to_lecd(priv, l_svc_setup, entry->mac_addr, atm_addr, NULL); in lec_arp_update()
1914 dump_arp_table(priv); in lec_arp_update()
1916 spin_unlock_irqrestore(&priv->lec_arp_lock, flags); in lec_arp_update()
1923 lec_vcc_added(struct lec_priv *priv, const struct atmlec_ioc *ioc_data, in lec_vcc_added() argument
1931 spin_lock_irqsave(&priv->lec_arp_lock, flags); in lec_vcc_added()
1936 entry = lec_arp_find(priv, bus_mac); in lec_vcc_added()
1945 entry = make_entry(priv, bus_mac); in lec_vcc_added()
1952 hlist_add_head(&entry->next, &priv->mcast_fwds); in lec_vcc_added()
1961 entry = make_entry(priv, bus_mac); in lec_vcc_added()
1969 entry->timer.expires = jiffies + priv->vcc_timeout_period; in lec_vcc_added()
1971 hlist_add_head(&entry->next, &priv->lec_no_forward); in lec_vcc_added()
1973 dump_arp_table(priv); in lec_vcc_added()
1980 &priv->lec_arp_tables[i], next) { in lec_vcc_added()
1994 if (priv->maximum_unknown_frame_count in lec_vcc_added()
2003 send_to_lecd(priv, l_flush_xmt, in lec_vcc_added()
2028 dump_arp_table(priv); in lec_vcc_added()
2035 entry = make_entry(priv, bus_mac); in lec_vcc_added()
2043 hlist_add_head(&entry->next, &priv->lec_arp_empty_ones); in lec_vcc_added()
2044 entry->timer.expires = jiffies + priv->vcc_timeout_period; in lec_vcc_added()
2048 dump_arp_table(priv); in lec_vcc_added()
2050 spin_unlock_irqrestore(&priv->lec_arp_lock, flags); in lec_vcc_added()
2053 static void lec_flush_complete(struct lec_priv *priv, unsigned long tran_id) in lec_flush_complete() argument
2061 spin_lock_irqsave(&priv->lec_arp_lock, flags); in lec_flush_complete()
2064 &priv->lec_arp_tables[i], next) { in lec_flush_complete()
2071 spin_unlock_irqrestore(&priv->lec_arp_lock, in lec_flush_complete()
2083 spin_unlock_irqrestore(&priv->lec_arp_lock, flags); in lec_flush_complete()
2084 dump_arp_table(priv); in lec_flush_complete()
2088 lec_set_flush_tran_id(struct lec_priv *priv, in lec_set_flush_tran_id() argument
2095 spin_lock_irqsave(&priv->lec_arp_lock, flags); in lec_set_flush_tran_id()
2098 &priv->lec_arp_tables[i], next) { in lec_set_flush_tran_id()
2105 spin_unlock_irqrestore(&priv->lec_arp_lock, flags); in lec_set_flush_tran_id()
2108 static int lec_mcast_make(struct lec_priv *priv, struct atm_vcc *vcc) in lec_mcast_make() argument
2125 spin_lock_irqsave(&priv->lec_arp_lock, flags); in lec_mcast_make()
2126 to_add = make_entry(priv, mac_addr); in lec_mcast_make()
2139 priv->mcast_vcc = vcc; in lec_mcast_make()
2140 lec_arp_add(priv, to_add); in lec_mcast_make()
2142 spin_unlock_irqrestore(&priv->lec_arp_lock, flags); in lec_mcast_make()
2146 static void lec_vcc_close(struct lec_priv *priv, struct atm_vcc *vcc) in lec_vcc_close() argument
2154 dump_arp_table(priv); in lec_vcc_close()
2156 spin_lock_irqsave(&priv->lec_arp_lock, flags); in lec_vcc_close()
2160 &priv->lec_arp_tables[i], next) { in lec_vcc_close()
2162 lec_arp_remove(priv, entry); in lec_vcc_close()
2164 if (priv->mcast_vcc == vcc) in lec_vcc_close()
2165 priv->mcast_vcc = NULL; in lec_vcc_close()
2171 &priv->lec_arp_empty_ones, next) { in lec_vcc_close()
2181 &priv->lec_no_forward, next) { in lec_vcc_close()
2190 hlist_for_each_entry_safe(entry, next, &priv->mcast_fwds, next) { in lec_vcc_close()
2199 spin_unlock_irqrestore(&priv->lec_arp_lock, flags); in lec_vcc_close()
2200 dump_arp_table(priv); in lec_vcc_close()
2204 lec_arp_check_empties(struct lec_priv *priv, in lec_arp_check_empties() argument
2213 spin_lock_irqsave(&priv->lec_arp_lock, flags); in lec_arp_check_empties()
2215 &priv->lec_arp_empty_ones, next) { in lec_arp_check_empties()
2222 tmp = lec_arp_find(priv, src); in lec_arp_check_empties()
2224 lec_arp_remove(priv, tmp); in lec_arp_check_empties()
2228 lec_arp_add(priv, entry); in lec_arp_check_empties()
2234 spin_unlock_irqrestore(&priv->lec_arp_lock, flags); in lec_arp_check_empties()