Lines Matching refs:entry
106 static inline void lec_arp_hold(struct lec_arp_table *entry) in lec_arp_hold() argument
108 refcount_inc(&entry->usage); in lec_arp_hold()
111 static inline void lec_arp_put(struct lec_arp_table *entry) in lec_arp_put() argument
113 if (refcount_dec_and_test(&entry->usage)) in lec_arp_put()
114 kfree(entry); in lec_arp_put()
211 struct lec_arp_table *entry; in lec_start_xmit() local
282 entry = NULL; in lec_start_xmit()
283 vcc = lec_arp_resolve(priv, dst, is_rdesc, &entry); in lec_start_xmit()
285 dev->name, vcc, vcc ? vcc->flags : 0, entry); in lec_start_xmit()
287 if (entry && (entry->tx_wait.qlen < LEC_UNRES_QUE_LEN)) { in lec_start_xmit()
290 skb_queue_tail(&entry->tx_wait, skb); in lec_start_xmit()
304 while (entry && (skb2 = skb_dequeue(&entry->tx_wait))) { in lec_start_xmit()
328 if (entry) in lec_start_xmit()
329 lec_arp_put(entry); in lec_start_xmit()
347 struct lec_arp_table *entry; in lec_atm_send() local
377 entry = lec_arp_find(priv, mesg->content.normal.mac_addr); in lec_atm_send()
378 lec_arp_remove(priv, entry); in lec_atm_send()
616 struct lec_arp_table *entry; in lec_push() local
639 entry = lec_arp_find(priv, src); in lec_push()
640 if (entry && entry->vcc != vcc) { in lec_push()
641 lec_arp_remove(priv, entry); in lec_push()
642 lec_arp_put(entry); in lec_push()
800 static void lec_info(struct seq_file *seq, struct lec_arp_table *entry) in lec_info() argument
802 seq_printf(seq, "%pM ", entry->mac_addr); in lec_info()
803 seq_printf(seq, "%*phN ", ATM_ESA_LEN, entry->atm_addr); in lec_info()
804 seq_printf(seq, "%s %4.4x", lec_arp_get_status_string(entry->status), in lec_info()
805 entry->flags & 0xffff); in lec_info()
806 if (entry->vcc) in lec_info()
807 seq_printf(seq, "%3d %3d ", entry->vcc->vpi, entry->vcc->vci); in lec_info()
810 if (entry->recv_vcc) { in lec_info()
811 seq_printf(seq, " %3d %3d", entry->recv_vcc->vpi, in lec_info()
812 entry->recv_vcc->vci); in lec_info()
973 struct lec_arp_table *entry = hlist_entry(state->node, in lec_seq_show() local
978 lec_info(seq, entry); in lec_seq_show()
1171 struct lec_arp_table *entry = lec_arp_find(priv, mac_addr); in lane2_associate_ind()
1173 if (entry == NULL) in lane2_associate_ind()
1176 kfree(entry->tlvs); in lane2_associate_ind()
1178 entry->tlvs = kmemdup(tlvs, sizeoftlvs, GFP_KERNEL); in lane2_associate_ind()
1179 if (entry->tlvs == NULL) in lane2_associate_ind()
1181 entry->sizeoftlvs = sizeoftlvs; in lane2_associate_ind()
1249 static void lec_arp_clear_vccs(struct lec_arp_table *entry) in lec_arp_clear_vccs() argument
1251 if (entry->vcc) { in lec_arp_clear_vccs()
1252 struct atm_vcc *vcc = entry->vcc; in lec_arp_clear_vccs()
1261 vcc->push = entry->old_push; in lec_arp_clear_vccs()
1263 entry->vcc = NULL; in lec_arp_clear_vccs()
1265 if (entry->recv_vcc) { in lec_arp_clear_vccs()
1266 struct atm_vcc *vcc = entry->recv_vcc; in lec_arp_clear_vccs()
1272 entry->recv_vcc->push = entry->old_recv_push; in lec_arp_clear_vccs()
1273 vcc_release_async(entry->recv_vcc, -EPIPE); in lec_arp_clear_vccs()
1274 entry->recv_vcc = NULL; in lec_arp_clear_vccs()
1283 lec_arp_add(struct lec_priv *priv, struct lec_arp_table *entry) in lec_arp_add() argument
1287 tmp = &priv->lec_arp_tables[HASH(entry->mac_addr[ETH_ALEN - 1])]; in lec_arp_add()
1288 hlist_add_head(&entry->next, tmp); in lec_arp_add()
1290 pr_debug("Added entry:%pM\n", entry->mac_addr); in lec_arp_add()
1299 struct lec_arp_table *entry; in lec_arp_remove() local
1317 hlist_for_each_entry(entry, in lec_arp_remove()
1320 entry->atm_addr, ATM_ESA_LEN) == 0) { in lec_arp_remove()
1465 struct lec_arp_table *entry; in lec_arp_destroy() local
1476 hlist_for_each_entry_safe(entry, next, in lec_arp_destroy()
1478 lec_arp_remove(priv, entry); in lec_arp_destroy()
1479 lec_arp_put(entry); in lec_arp_destroy()
1484 hlist_for_each_entry_safe(entry, next, in lec_arp_destroy()
1486 del_timer_sync(&entry->timer); in lec_arp_destroy()
1487 lec_arp_clear_vccs(entry); in lec_arp_destroy()
1488 hlist_del(&entry->next); in lec_arp_destroy()
1489 lec_arp_put(entry); in lec_arp_destroy()
1493 hlist_for_each_entry_safe(entry, next, in lec_arp_destroy()
1495 del_timer_sync(&entry->timer); in lec_arp_destroy()
1496 lec_arp_clear_vccs(entry); in lec_arp_destroy()
1497 hlist_del(&entry->next); in lec_arp_destroy()
1498 lec_arp_put(entry); in lec_arp_destroy()
1502 hlist_for_each_entry_safe(entry, next, &priv->mcast_fwds, next) { in lec_arp_destroy()
1504 lec_arp_clear_vccs(entry); in lec_arp_destroy()
1505 hlist_del(&entry->next); in lec_arp_destroy()
1506 lec_arp_put(entry); in lec_arp_destroy()
1520 struct lec_arp_table *entry; in lec_arp_find() local
1525 hlist_for_each_entry(entry, head, next) { in lec_arp_find()
1526 if (ether_addr_equal(mac_addr, entry->mac_addr)) in lec_arp_find()
1527 return entry; in lec_arp_find()
1553 struct lec_arp_table *entry; in lec_arp_expire_arp() local
1555 entry = from_timer(entry, t, timer); in lec_arp_expire_arp()
1558 if (entry->status == ESI_ARP_PENDING) { in lec_arp_expire_arp()
1559 if (entry->no_tries <= entry->priv->max_retry_count) { in lec_arp_expire_arp()
1560 if (entry->is_rdesc) in lec_arp_expire_arp()
1561 send_to_lecd(entry->priv, l_rdesc_arp_xmt, in lec_arp_expire_arp()
1562 entry->mac_addr, NULL, NULL); in lec_arp_expire_arp()
1564 send_to_lecd(entry->priv, l_arp_xmt, in lec_arp_expire_arp()
1565 entry->mac_addr, NULL, NULL); in lec_arp_expire_arp()
1566 entry->no_tries++; in lec_arp_expire_arp()
1568 mod_timer(&entry->timer, jiffies + (1 * HZ)); in lec_arp_expire_arp()
1594 static bool __lec_arp_check_expire(struct lec_arp_table *entry, in __lec_arp_check_expire() argument
1600 if ((entry->flags) & LEC_REMOTE_FLAG && priv->topology_change) in __lec_arp_check_expire()
1606 now, entry->last_used, time_to_check); in __lec_arp_check_expire()
1607 if (time_after(now, entry->last_used + time_to_check) && in __lec_arp_check_expire()
1608 !(entry->flags & LEC_PERMANENT_FLAG) && in __lec_arp_check_expire()
1609 !(entry->mac_addr[0] & 0x01)) { /* LANE2: 7.1.20 */ in __lec_arp_check_expire()
1612 lec_arp_remove(priv, entry); in __lec_arp_check_expire()
1613 lec_arp_put(entry); in __lec_arp_check_expire()
1616 if ((entry->status == ESI_VC_PENDING || in __lec_arp_check_expire()
1617 entry->status == ESI_ARP_PENDING) && in __lec_arp_check_expire()
1618 time_after_eq(now, entry->timestamp + in __lec_arp_check_expire()
1620 entry->timestamp = jiffies; in __lec_arp_check_expire()
1621 entry->packets_flooded = 0; in __lec_arp_check_expire()
1622 if (entry->status == ESI_VC_PENDING) in __lec_arp_check_expire()
1624 entry->mac_addr, in __lec_arp_check_expire()
1625 entry->atm_addr, in __lec_arp_check_expire()
1628 if (entry->status == ESI_FLUSH_PENDING && in __lec_arp_check_expire()
1629 time_after_eq(now, entry->timestamp + in __lec_arp_check_expire()
1631 lec_arp_hold(entry); in __lec_arp_check_expire()
1660 struct lec_arp_table *entry; in lec_arp_check_expire() local
1669 hlist_for_each_entry_safe(entry, next, in lec_arp_check_expire()
1671 if (__lec_arp_check_expire(entry, now, priv)) { in lec_arp_check_expire()
1673 struct atm_vcc *vcc = entry->vcc; in lec_arp_check_expire()
1677 while ((skb = skb_dequeue(&entry->tx_wait))) in lec_arp_check_expire()
1679 entry->last_used = jiffies; in lec_arp_check_expire()
1680 entry->status = ESI_FORWARD_DIRECT; in lec_arp_check_expire()
1681 lec_arp_put(entry); in lec_arp_check_expire()
1702 struct lec_arp_table *entry; in lec_arp_resolve() local
1719 entry = lec_arp_find(priv, mac_to_find); in lec_arp_resolve()
1721 if (entry) { in lec_arp_resolve()
1722 if (entry->status == ESI_FORWARD_DIRECT) { in lec_arp_resolve()
1724 entry->last_used = jiffies; in lec_arp_resolve()
1725 lec_arp_hold(entry); in lec_arp_resolve()
1726 *ret_entry = entry; in lec_arp_resolve()
1727 found = entry->vcc; in lec_arp_resolve()
1734 if (entry->status == ESI_ARP_PENDING) in lec_arp_resolve()
1735 entry->no_tries = 0; in lec_arp_resolve()
1742 if (entry->status != ESI_FLUSH_PENDING && in lec_arp_resolve()
1743 entry->packets_flooded < in lec_arp_resolve()
1745 entry->packets_flooded++; in lec_arp_resolve()
1755 lec_arp_hold(entry); in lec_arp_resolve()
1756 *ret_entry = entry; in lec_arp_resolve()
1757 pr_debug("entry->status %d entry->vcc %p\n", entry->status, in lec_arp_resolve()
1758 entry->vcc); in lec_arp_resolve()
1762 entry = make_entry(priv, mac_to_find); in lec_arp_resolve()
1764 if (!entry) { in lec_arp_resolve()
1768 lec_arp_add(priv, entry); in lec_arp_resolve()
1770 entry->packets_flooded = 1; in lec_arp_resolve()
1771 entry->status = ESI_ARP_PENDING; in lec_arp_resolve()
1772 entry->no_tries = 1; in lec_arp_resolve()
1773 entry->last_used = entry->timestamp = jiffies; in lec_arp_resolve()
1774 entry->is_rdesc = is_rdesc; in lec_arp_resolve()
1775 if (entry->is_rdesc) in lec_arp_resolve()
1780 entry->timer.expires = jiffies + (1 * HZ); in lec_arp_resolve()
1781 entry->timer.function = lec_arp_expire_arp; in lec_arp_resolve()
1782 add_timer(&entry->timer); in lec_arp_resolve()
1797 struct lec_arp_table *entry; in lec_addr_delete() local
1803 hlist_for_each_entry_safe(entry, next, in lec_addr_delete()
1805 if (!memcmp(atm_addr, entry->atm_addr, ATM_ESA_LEN) && in lec_addr_delete()
1807 !(entry->flags & LEC_PERMANENT_FLAG))) { in lec_addr_delete()
1808 lec_arp_remove(priv, entry); in lec_addr_delete()
1809 lec_arp_put(entry); in lec_addr_delete()
1829 struct lec_arp_table *entry, *tmp; in lec_arp_update() local
1836 entry = lec_arp_find(priv, mac_addr); in lec_arp_update()
1837 if (entry == NULL && targetless_le_arp) in lec_arp_update()
1843 hlist_for_each_entry_safe(entry, next, in lec_arp_update()
1845 if (memcmp(entry->atm_addr, atm_addr, ATM_ESA_LEN) == 0) { in lec_arp_update()
1846 hlist_del(&entry->next); in lec_arp_update()
1847 del_timer(&entry->timer); in lec_arp_update()
1853 tmp->vcc = entry->vcc; in lec_arp_update()
1854 tmp->old_push = entry->old_push; in lec_arp_update()
1856 del_timer(&entry->timer); in lec_arp_update()
1857 lec_arp_put(entry); in lec_arp_update()
1858 entry = tmp; in lec_arp_update()
1860 entry->status = ESI_FORWARD_DIRECT; in lec_arp_update()
1861 ether_addr_copy(entry->mac_addr, in lec_arp_update()
1863 entry->last_used = jiffies; in lec_arp_update()
1864 lec_arp_add(priv, entry); in lec_arp_update()
1867 entry->flags |= LEC_REMOTE_FLAG; in lec_arp_update()
1869 entry->flags &= ~LEC_REMOTE_FLAG; in lec_arp_update()
1877 entry = lec_arp_find(priv, mac_addr); in lec_arp_update()
1878 if (!entry) { in lec_arp_update()
1879 entry = make_entry(priv, mac_addr); in lec_arp_update()
1880 if (!entry) in lec_arp_update()
1882 entry->status = ESI_UNKNOWN; in lec_arp_update()
1883 lec_arp_add(priv, entry); in lec_arp_update()
1886 memcpy(entry->atm_addr, atm_addr, ATM_ESA_LEN); in lec_arp_update()
1887 del_timer(&entry->timer); in lec_arp_update()
1891 if (entry != tmp && in lec_arp_update()
1899 entry->vcc = tmp->vcc; in lec_arp_update()
1900 entry->old_push = tmp->old_push; in lec_arp_update()
1902 entry->status = tmp->status; in lec_arp_update()
1908 entry->flags |= LEC_REMOTE_FLAG; in lec_arp_update()
1910 entry->flags &= ~LEC_REMOTE_FLAG; in lec_arp_update()
1911 if (entry->status == ESI_ARP_PENDING || entry->status == ESI_UNKNOWN) { in lec_arp_update()
1912 entry->status = ESI_VC_PENDING; in lec_arp_update()
1913 send_to_lecd(priv, l_svc_setup, entry->mac_addr, atm_addr, NULL); in lec_arp_update()
1930 struct lec_arp_table *entry; in lec_vcc_added() local
1938 entry = lec_arp_find(priv, bus_mac); in lec_vcc_added()
1939 if (!entry) { in lec_vcc_added()
1943 memcpy(entry->atm_addr, ioc_data->atm_addr, ATM_ESA_LEN); in lec_vcc_added()
1944 entry->recv_vcc = vcc; in lec_vcc_added()
1945 entry->old_recv_push = old_push; in lec_vcc_added()
1947 entry = make_entry(priv, bus_mac); in lec_vcc_added()
1948 if (entry == NULL) in lec_vcc_added()
1950 del_timer(&entry->timer); in lec_vcc_added()
1951 memcpy(entry->atm_addr, ioc_data->atm_addr, ATM_ESA_LEN); in lec_vcc_added()
1952 entry->recv_vcc = vcc; in lec_vcc_added()
1953 entry->old_recv_push = old_push; in lec_vcc_added()
1954 hlist_add_head(&entry->next, &priv->mcast_fwds); in lec_vcc_added()
1963 entry = make_entry(priv, bus_mac); in lec_vcc_added()
1964 if (entry == NULL) in lec_vcc_added()
1966 memcpy(entry->atm_addr, ioc_data->atm_addr, ATM_ESA_LEN); in lec_vcc_added()
1967 eth_zero_addr(entry->mac_addr); in lec_vcc_added()
1968 entry->recv_vcc = vcc; in lec_vcc_added()
1969 entry->old_recv_push = old_push; in lec_vcc_added()
1970 entry->status = ESI_UNKNOWN; in lec_vcc_added()
1971 entry->timer.expires = jiffies + priv->vcc_timeout_period; in lec_vcc_added()
1972 entry->timer.function = lec_arp_expire_vcc; in lec_vcc_added()
1973 hlist_add_head(&entry->next, &priv->lec_no_forward); in lec_vcc_added()
1974 add_timer(&entry->timer); in lec_vcc_added()
1981 hlist_for_each_entry(entry, in lec_vcc_added()
1984 (ioc_data->atm_addr, entry->atm_addr, in lec_vcc_added()
1988 entry->vcc ? entry->vcc->vci : 0, in lec_vcc_added()
1989 entry->recv_vcc ? entry->recv_vcc-> in lec_vcc_added()
1992 del_timer(&entry->timer); in lec_vcc_added()
1993 entry->vcc = vcc; in lec_vcc_added()
1994 entry->old_push = old_push; in lec_vcc_added()
1995 if (entry->status == ESI_VC_PENDING) { in lec_vcc_added()
1998 entry->status = in lec_vcc_added()
2001 entry->timestamp = jiffies; in lec_vcc_added()
2002 entry->status = in lec_vcc_added()
2007 entry->atm_addr, in lec_vcc_added()
2037 entry = make_entry(priv, bus_mac); in lec_vcc_added()
2038 if (!entry) in lec_vcc_added()
2040 entry->vcc = vcc; in lec_vcc_added()
2041 entry->old_push = old_push; in lec_vcc_added()
2042 memcpy(entry->atm_addr, ioc_data->atm_addr, ATM_ESA_LEN); in lec_vcc_added()
2043 eth_zero_addr(entry->mac_addr); in lec_vcc_added()
2044 entry->status = ESI_UNKNOWN; in lec_vcc_added()
2045 hlist_add_head(&entry->next, &priv->lec_arp_empty_ones); in lec_vcc_added()
2046 entry->timer.expires = jiffies + priv->vcc_timeout_period; in lec_vcc_added()
2047 entry->timer.function = lec_arp_expire_vcc; in lec_vcc_added()
2048 add_timer(&entry->timer); in lec_vcc_added()
2058 struct lec_arp_table *entry; in lec_flush_complete() local
2065 hlist_for_each_entry(entry, in lec_flush_complete()
2067 if (entry->flush_tran_id == tran_id && in lec_flush_complete()
2068 entry->status == ESI_FLUSH_PENDING) { in lec_flush_complete()
2070 struct atm_vcc *vcc = entry->vcc; in lec_flush_complete()
2072 lec_arp_hold(entry); in lec_flush_complete()
2075 while ((skb = skb_dequeue(&entry->tx_wait))) in lec_flush_complete()
2077 entry->last_used = jiffies; in lec_flush_complete()
2078 entry->status = ESI_FORWARD_DIRECT; in lec_flush_complete()
2079 lec_arp_put(entry); in lec_flush_complete()
2094 struct lec_arp_table *entry; in lec_set_flush_tran_id() local
2099 hlist_for_each_entry(entry, in lec_set_flush_tran_id()
2101 if (!memcmp(atm_addr, entry->atm_addr, ATM_ESA_LEN)) { in lec_set_flush_tran_id()
2102 entry->flush_tran_id = tran_id; in lec_set_flush_tran_id()
2104 tran_id, entry); in lec_set_flush_tran_id()
2152 struct lec_arp_table *entry; in lec_vcc_close() local
2161 hlist_for_each_entry_safe(entry, next, in lec_vcc_close()
2163 if (vcc == entry->vcc) { in lec_vcc_close()
2164 lec_arp_remove(priv, entry); in lec_vcc_close()
2165 lec_arp_put(entry); in lec_vcc_close()
2172 hlist_for_each_entry_safe(entry, next, in lec_vcc_close()
2174 if (entry->vcc == vcc) { in lec_vcc_close()
2175 lec_arp_clear_vccs(entry); in lec_vcc_close()
2176 del_timer(&entry->timer); in lec_vcc_close()
2177 hlist_del(&entry->next); in lec_vcc_close()
2178 lec_arp_put(entry); in lec_vcc_close()
2182 hlist_for_each_entry_safe(entry, next, in lec_vcc_close()
2184 if (entry->recv_vcc == vcc) { in lec_vcc_close()
2185 lec_arp_clear_vccs(entry); in lec_vcc_close()
2186 del_timer(&entry->timer); in lec_vcc_close()
2187 hlist_del(&entry->next); in lec_vcc_close()
2188 lec_arp_put(entry); in lec_vcc_close()
2192 hlist_for_each_entry_safe(entry, next, &priv->mcast_fwds, next) { in lec_vcc_close()
2193 if (entry->recv_vcc == vcc) { in lec_vcc_close()
2194 lec_arp_clear_vccs(entry); in lec_vcc_close()
2196 hlist_del(&entry->next); in lec_vcc_close()
2197 lec_arp_put(entry); in lec_vcc_close()
2211 struct lec_arp_table *entry, *tmp; in lec_arp_check_empties() local
2216 hlist_for_each_entry_safe(entry, next, in lec_arp_check_empties()
2218 if (vcc == entry->vcc) { in lec_arp_check_empties()
2219 del_timer(&entry->timer); in lec_arp_check_empties()
2220 ether_addr_copy(entry->mac_addr, src); in lec_arp_check_empties()
2221 entry->status = ESI_FORWARD_DIRECT; in lec_arp_check_empties()
2222 entry->last_used = jiffies; in lec_arp_check_empties()
2229 hlist_del(&entry->next); in lec_arp_check_empties()
2230 lec_arp_add(priv, entry); in lec_arp_check_empties()