Lines Matching refs:entry
102 static inline void lec_arp_hold(struct lec_arp_table *entry) in lec_arp_hold() argument
104 atomic_inc(&entry->usage); in lec_arp_hold()
107 static inline void lec_arp_put(struct lec_arp_table *entry) in lec_arp_put() argument
109 if (atomic_dec_and_test(&entry->usage)) in lec_arp_put()
110 kfree(entry); in lec_arp_put()
208 struct lec_arp_table *entry; in lec_start_xmit() local
279 entry = NULL; in lec_start_xmit()
280 vcc = lec_arp_resolve(priv, dst, is_rdesc, &entry); in lec_start_xmit()
282 dev->name, vcc, vcc ? vcc->flags : 0, entry); in lec_start_xmit()
284 if (entry && (entry->tx_wait.qlen < LEC_UNRES_QUE_LEN)) { in lec_start_xmit()
287 skb_queue_tail(&entry->tx_wait, skb); in lec_start_xmit()
301 while (entry && (skb2 = skb_dequeue(&entry->tx_wait))) { in lec_start_xmit()
325 if (entry) in lec_start_xmit()
326 lec_arp_put(entry); in lec_start_xmit()
344 struct lec_arp_table *entry; in lec_atm_send() local
374 entry = lec_arp_find(priv, mesg->content.normal.mac_addr); in lec_atm_send()
375 lec_arp_remove(priv, entry); in lec_atm_send()
623 struct lec_arp_table *entry; in lec_push() local
646 entry = lec_arp_find(priv, src); in lec_push()
647 if (entry && entry->vcc != vcc) { in lec_push()
648 lec_arp_remove(priv, entry); in lec_push()
649 lec_arp_put(entry); in lec_push()
802 static void lec_info(struct seq_file *seq, struct lec_arp_table *entry) in lec_info() argument
807 seq_printf(seq, "%2.2x", entry->mac_addr[i] & 0xff); in lec_info()
810 seq_printf(seq, "%2.2x", entry->atm_addr[i] & 0xff); in lec_info()
811 seq_printf(seq, " %s %4.4x", lec_arp_get_status_string(entry->status), in lec_info()
812 entry->flags & 0xffff); in lec_info()
813 if (entry->vcc) in lec_info()
814 seq_printf(seq, "%3d %3d ", entry->vcc->vpi, entry->vcc->vci); in lec_info()
817 if (entry->recv_vcc) { in lec_info()
818 seq_printf(seq, " %3d %3d", entry->recv_vcc->vpi, in lec_info()
819 entry->recv_vcc->vci); in lec_info()
981 struct lec_arp_table *entry = hlist_entry(state->node, in lec_seq_show() local
986 lec_info(seq, entry); in lec_seq_show()
1189 struct lec_arp_table *entry = lec_arp_find(priv, mac_addr); in lane2_associate_ind()
1191 if (entry == NULL) in lane2_associate_ind()
1194 kfree(entry->tlvs); in lane2_associate_ind()
1196 entry->tlvs = kmemdup(tlvs, sizeoftlvs, GFP_KERNEL); in lane2_associate_ind()
1197 if (entry->tlvs == NULL) in lane2_associate_ind()
1199 entry->sizeoftlvs = sizeoftlvs; in lane2_associate_ind()
1267 static void lec_arp_clear_vccs(struct lec_arp_table *entry) in lec_arp_clear_vccs() argument
1269 if (entry->vcc) { in lec_arp_clear_vccs()
1270 struct atm_vcc *vcc = entry->vcc; in lec_arp_clear_vccs()
1279 vcc->push = entry->old_push; in lec_arp_clear_vccs()
1281 entry->vcc = NULL; in lec_arp_clear_vccs()
1283 if (entry->recv_vcc) { in lec_arp_clear_vccs()
1284 entry->recv_vcc->push = entry->old_recv_push; in lec_arp_clear_vccs()
1285 vcc_release_async(entry->recv_vcc, -EPIPE); in lec_arp_clear_vccs()
1286 entry->recv_vcc = NULL; in lec_arp_clear_vccs()
1295 lec_arp_add(struct lec_priv *priv, struct lec_arp_table *entry) in lec_arp_add() argument
1299 tmp = &priv->lec_arp_tables[HASH(entry->mac_addr[ETH_ALEN - 1])]; in lec_arp_add()
1300 hlist_add_head(&entry->next, tmp); in lec_arp_add()
1302 pr_debug("Added entry:%pM\n", entry->mac_addr); in lec_arp_add()
1311 struct lec_arp_table *entry; in lec_arp_remove() local
1329 hlist_for_each_entry(entry, in lec_arp_remove()
1332 entry->atm_addr, ATM_ESA_LEN) == 0) { in lec_arp_remove()
1490 struct lec_arp_table *entry; in lec_arp_destroy() local
1501 hlist_for_each_entry_safe(entry, next, in lec_arp_destroy()
1503 lec_arp_remove(priv, entry); in lec_arp_destroy()
1504 lec_arp_put(entry); in lec_arp_destroy()
1509 hlist_for_each_entry_safe(entry, next, in lec_arp_destroy()
1511 del_timer_sync(&entry->timer); in lec_arp_destroy()
1512 lec_arp_clear_vccs(entry); in lec_arp_destroy()
1513 hlist_del(&entry->next); in lec_arp_destroy()
1514 lec_arp_put(entry); in lec_arp_destroy()
1518 hlist_for_each_entry_safe(entry, next, in lec_arp_destroy()
1520 del_timer_sync(&entry->timer); in lec_arp_destroy()
1521 lec_arp_clear_vccs(entry); in lec_arp_destroy()
1522 hlist_del(&entry->next); in lec_arp_destroy()
1523 lec_arp_put(entry); in lec_arp_destroy()
1527 hlist_for_each_entry_safe(entry, next, &priv->mcast_fwds, next) { in lec_arp_destroy()
1529 lec_arp_clear_vccs(entry); in lec_arp_destroy()
1530 hlist_del(&entry->next); in lec_arp_destroy()
1531 lec_arp_put(entry); in lec_arp_destroy()
1545 struct lec_arp_table *entry; in lec_arp_find() local
1550 hlist_for_each_entry(entry, head, next) { in lec_arp_find()
1551 if (ether_addr_equal(mac_addr, entry->mac_addr)) in lec_arp_find()
1552 return entry; in lec_arp_find()
1581 struct lec_arp_table *entry; in lec_arp_expire_arp() local
1583 entry = (struct lec_arp_table *)data; in lec_arp_expire_arp()
1586 if (entry->status == ESI_ARP_PENDING) { in lec_arp_expire_arp()
1587 if (entry->no_tries <= entry->priv->max_retry_count) { in lec_arp_expire_arp()
1588 if (entry->is_rdesc) in lec_arp_expire_arp()
1589 send_to_lecd(entry->priv, l_rdesc_arp_xmt, in lec_arp_expire_arp()
1590 entry->mac_addr, NULL, NULL); in lec_arp_expire_arp()
1592 send_to_lecd(entry->priv, l_arp_xmt, in lec_arp_expire_arp()
1593 entry->mac_addr, NULL, NULL); in lec_arp_expire_arp()
1594 entry->no_tries++; in lec_arp_expire_arp()
1596 mod_timer(&entry->timer, jiffies + (1 * HZ)); in lec_arp_expire_arp()
1622 static bool __lec_arp_check_expire(struct lec_arp_table *entry, in __lec_arp_check_expire() argument
1628 if ((entry->flags) & LEC_REMOTE_FLAG && priv->topology_change) in __lec_arp_check_expire()
1634 now, entry->last_used, time_to_check); in __lec_arp_check_expire()
1635 if (time_after(now, entry->last_used + time_to_check) && in __lec_arp_check_expire()
1636 !(entry->flags & LEC_PERMANENT_FLAG) && in __lec_arp_check_expire()
1637 !(entry->mac_addr[0] & 0x01)) { /* LANE2: 7.1.20 */ in __lec_arp_check_expire()
1640 lec_arp_remove(priv, entry); in __lec_arp_check_expire()
1641 lec_arp_put(entry); in __lec_arp_check_expire()
1644 if ((entry->status == ESI_VC_PENDING || in __lec_arp_check_expire()
1645 entry->status == ESI_ARP_PENDING) && in __lec_arp_check_expire()
1646 time_after_eq(now, entry->timestamp + in __lec_arp_check_expire()
1648 entry->timestamp = jiffies; in __lec_arp_check_expire()
1649 entry->packets_flooded = 0; in __lec_arp_check_expire()
1650 if (entry->status == ESI_VC_PENDING) in __lec_arp_check_expire()
1652 entry->mac_addr, in __lec_arp_check_expire()
1653 entry->atm_addr, in __lec_arp_check_expire()
1656 if (entry->status == ESI_FLUSH_PENDING && in __lec_arp_check_expire()
1657 time_after_eq(now, entry->timestamp + in __lec_arp_check_expire()
1659 lec_arp_hold(entry); in __lec_arp_check_expire()
1688 struct lec_arp_table *entry; in lec_arp_check_expire() local
1697 hlist_for_each_entry_safe(entry, next, in lec_arp_check_expire()
1699 if (__lec_arp_check_expire(entry, now, priv)) { in lec_arp_check_expire()
1701 struct atm_vcc *vcc = entry->vcc; in lec_arp_check_expire()
1705 while ((skb = skb_dequeue(&entry->tx_wait))) in lec_arp_check_expire()
1707 entry->last_used = jiffies; in lec_arp_check_expire()
1708 entry->status = ESI_FORWARD_DIRECT; in lec_arp_check_expire()
1709 lec_arp_put(entry); in lec_arp_check_expire()
1730 struct lec_arp_table *entry; in lec_arp_resolve() local
1747 entry = lec_arp_find(priv, mac_to_find); in lec_arp_resolve()
1749 if (entry) { in lec_arp_resolve()
1750 if (entry->status == ESI_FORWARD_DIRECT) { in lec_arp_resolve()
1752 entry->last_used = jiffies; in lec_arp_resolve()
1753 lec_arp_hold(entry); in lec_arp_resolve()
1754 *ret_entry = entry; in lec_arp_resolve()
1755 found = entry->vcc; in lec_arp_resolve()
1762 if (entry->status == ESI_ARP_PENDING) in lec_arp_resolve()
1763 entry->no_tries = 0; in lec_arp_resolve()
1770 if (entry->status != ESI_FLUSH_PENDING && in lec_arp_resolve()
1771 entry->packets_flooded < in lec_arp_resolve()
1773 entry->packets_flooded++; in lec_arp_resolve()
1783 lec_arp_hold(entry); in lec_arp_resolve()
1784 *ret_entry = entry; in lec_arp_resolve()
1785 pr_debug("entry->status %d entry->vcc %p\n", entry->status, in lec_arp_resolve()
1786 entry->vcc); in lec_arp_resolve()
1790 entry = make_entry(priv, mac_to_find); in lec_arp_resolve()
1792 if (!entry) { in lec_arp_resolve()
1796 lec_arp_add(priv, entry); in lec_arp_resolve()
1798 entry->packets_flooded = 1; in lec_arp_resolve()
1799 entry->status = ESI_ARP_PENDING; in lec_arp_resolve()
1800 entry->no_tries = 1; in lec_arp_resolve()
1801 entry->last_used = entry->timestamp = jiffies; in lec_arp_resolve()
1802 entry->is_rdesc = is_rdesc; in lec_arp_resolve()
1803 if (entry->is_rdesc) in lec_arp_resolve()
1808 entry->timer.expires = jiffies + (1 * HZ); in lec_arp_resolve()
1809 entry->timer.function = lec_arp_expire_arp; in lec_arp_resolve()
1810 add_timer(&entry->timer); in lec_arp_resolve()
1825 struct lec_arp_table *entry; in lec_addr_delete() local
1831 hlist_for_each_entry_safe(entry, next, in lec_addr_delete()
1833 if (!memcmp(atm_addr, entry->atm_addr, ATM_ESA_LEN) && in lec_addr_delete()
1835 !(entry->flags & LEC_PERMANENT_FLAG))) { in lec_addr_delete()
1836 lec_arp_remove(priv, entry); in lec_addr_delete()
1837 lec_arp_put(entry); in lec_addr_delete()
1857 struct lec_arp_table *entry, *tmp; in lec_arp_update() local
1864 entry = lec_arp_find(priv, mac_addr); in lec_arp_update()
1865 if (entry == NULL && targetless_le_arp) in lec_arp_update()
1871 hlist_for_each_entry_safe(entry, next, in lec_arp_update()
1873 if (memcmp(entry->atm_addr, atm_addr, ATM_ESA_LEN) == 0) { in lec_arp_update()
1874 hlist_del(&entry->next); in lec_arp_update()
1875 del_timer(&entry->timer); in lec_arp_update()
1881 tmp->vcc = entry->vcc; in lec_arp_update()
1882 tmp->old_push = entry->old_push; in lec_arp_update()
1884 del_timer(&entry->timer); in lec_arp_update()
1885 lec_arp_put(entry); in lec_arp_update()
1886 entry = tmp; in lec_arp_update()
1888 entry->status = ESI_FORWARD_DIRECT; in lec_arp_update()
1889 ether_addr_copy(entry->mac_addr, in lec_arp_update()
1891 entry->last_used = jiffies; in lec_arp_update()
1892 lec_arp_add(priv, entry); in lec_arp_update()
1895 entry->flags |= LEC_REMOTE_FLAG; in lec_arp_update()
1897 entry->flags &= ~LEC_REMOTE_FLAG; in lec_arp_update()
1905 entry = lec_arp_find(priv, mac_addr); in lec_arp_update()
1906 if (!entry) { in lec_arp_update()
1907 entry = make_entry(priv, mac_addr); in lec_arp_update()
1908 if (!entry) in lec_arp_update()
1910 entry->status = ESI_UNKNOWN; in lec_arp_update()
1911 lec_arp_add(priv, entry); in lec_arp_update()
1914 memcpy(entry->atm_addr, atm_addr, ATM_ESA_LEN); in lec_arp_update()
1915 del_timer(&entry->timer); in lec_arp_update()
1919 if (entry != tmp && in lec_arp_update()
1927 entry->vcc = tmp->vcc; in lec_arp_update()
1928 entry->old_push = tmp->old_push; in lec_arp_update()
1930 entry->status = tmp->status; in lec_arp_update()
1936 entry->flags |= LEC_REMOTE_FLAG; in lec_arp_update()
1938 entry->flags &= ~LEC_REMOTE_FLAG; in lec_arp_update()
1939 if (entry->status == ESI_ARP_PENDING || entry->status == ESI_UNKNOWN) { in lec_arp_update()
1940 entry->status = ESI_VC_PENDING; in lec_arp_update()
1941 send_to_lecd(priv, l_svc_setup, entry->mac_addr, atm_addr, NULL); in lec_arp_update()
1958 struct lec_arp_table *entry; in lec_vcc_added() local
1966 entry = lec_arp_find(priv, bus_mac); in lec_vcc_added()
1967 if (!entry) { in lec_vcc_added()
1971 memcpy(entry->atm_addr, ioc_data->atm_addr, ATM_ESA_LEN); in lec_vcc_added()
1972 entry->recv_vcc = vcc; in lec_vcc_added()
1973 entry->old_recv_push = old_push; in lec_vcc_added()
1975 entry = make_entry(priv, bus_mac); in lec_vcc_added()
1976 if (entry == NULL) in lec_vcc_added()
1978 del_timer(&entry->timer); in lec_vcc_added()
1979 memcpy(entry->atm_addr, ioc_data->atm_addr, ATM_ESA_LEN); in lec_vcc_added()
1980 entry->recv_vcc = vcc; in lec_vcc_added()
1981 entry->old_recv_push = old_push; in lec_vcc_added()
1982 hlist_add_head(&entry->next, &priv->mcast_fwds); in lec_vcc_added()
2000 entry = make_entry(priv, bus_mac); in lec_vcc_added()
2001 if (entry == NULL) in lec_vcc_added()
2003 memcpy(entry->atm_addr, ioc_data->atm_addr, ATM_ESA_LEN); in lec_vcc_added()
2004 eth_zero_addr(entry->mac_addr); in lec_vcc_added()
2005 entry->recv_vcc = vcc; in lec_vcc_added()
2006 entry->old_recv_push = old_push; in lec_vcc_added()
2007 entry->status = ESI_UNKNOWN; in lec_vcc_added()
2008 entry->timer.expires = jiffies + priv->vcc_timeout_period; in lec_vcc_added()
2009 entry->timer.function = lec_arp_expire_vcc; in lec_vcc_added()
2010 hlist_add_head(&entry->next, &priv->lec_no_forward); in lec_vcc_added()
2011 add_timer(&entry->timer); in lec_vcc_added()
2027 hlist_for_each_entry(entry, in lec_vcc_added()
2030 (ioc_data->atm_addr, entry->atm_addr, in lec_vcc_added()
2034 entry->vcc ? entry->vcc->vci : 0, in lec_vcc_added()
2035 entry->recv_vcc ? entry->recv_vcc-> in lec_vcc_added()
2038 del_timer(&entry->timer); in lec_vcc_added()
2039 entry->vcc = vcc; in lec_vcc_added()
2040 entry->old_push = old_push; in lec_vcc_added()
2041 if (entry->status == ESI_VC_PENDING) { in lec_vcc_added()
2044 entry->status = in lec_vcc_added()
2047 entry->timestamp = jiffies; in lec_vcc_added()
2048 entry->status = in lec_vcc_added()
2053 entry->atm_addr, in lec_vcc_added()
2083 entry = make_entry(priv, bus_mac); in lec_vcc_added()
2084 if (!entry) in lec_vcc_added()
2086 entry->vcc = vcc; in lec_vcc_added()
2087 entry->old_push = old_push; in lec_vcc_added()
2088 memcpy(entry->atm_addr, ioc_data->atm_addr, ATM_ESA_LEN); in lec_vcc_added()
2089 eth_zero_addr(entry->mac_addr); in lec_vcc_added()
2090 entry->status = ESI_UNKNOWN; in lec_vcc_added()
2091 hlist_add_head(&entry->next, &priv->lec_arp_empty_ones); in lec_vcc_added()
2092 entry->timer.expires = jiffies + priv->vcc_timeout_period; in lec_vcc_added()
2093 entry->timer.function = lec_arp_expire_vcc; in lec_vcc_added()
2094 add_timer(&entry->timer); in lec_vcc_added()
2104 struct lec_arp_table *entry; in lec_flush_complete() local
2111 hlist_for_each_entry(entry, in lec_flush_complete()
2113 if (entry->flush_tran_id == tran_id && in lec_flush_complete()
2114 entry->status == ESI_FLUSH_PENDING) { in lec_flush_complete()
2116 struct atm_vcc *vcc = entry->vcc; in lec_flush_complete()
2118 lec_arp_hold(entry); in lec_flush_complete()
2121 while ((skb = skb_dequeue(&entry->tx_wait))) in lec_flush_complete()
2123 entry->last_used = jiffies; in lec_flush_complete()
2124 entry->status = ESI_FORWARD_DIRECT; in lec_flush_complete()
2125 lec_arp_put(entry); in lec_flush_complete()
2140 struct lec_arp_table *entry; in lec_set_flush_tran_id() local
2145 hlist_for_each_entry(entry, in lec_set_flush_tran_id()
2147 if (!memcmp(atm_addr, entry->atm_addr, ATM_ESA_LEN)) { in lec_set_flush_tran_id()
2148 entry->flush_tran_id = tran_id; in lec_set_flush_tran_id()
2150 tran_id, entry); in lec_set_flush_tran_id()
2198 struct lec_arp_table *entry; in lec_vcc_close() local
2207 hlist_for_each_entry_safe(entry, next, in lec_vcc_close()
2209 if (vcc == entry->vcc) { in lec_vcc_close()
2210 lec_arp_remove(priv, entry); in lec_vcc_close()
2211 lec_arp_put(entry); in lec_vcc_close()
2218 hlist_for_each_entry_safe(entry, next, in lec_vcc_close()
2220 if (entry->vcc == vcc) { in lec_vcc_close()
2221 lec_arp_clear_vccs(entry); in lec_vcc_close()
2222 del_timer(&entry->timer); in lec_vcc_close()
2223 hlist_del(&entry->next); in lec_vcc_close()
2224 lec_arp_put(entry); in lec_vcc_close()
2228 hlist_for_each_entry_safe(entry, next, in lec_vcc_close()
2230 if (entry->recv_vcc == vcc) { in lec_vcc_close()
2231 lec_arp_clear_vccs(entry); in lec_vcc_close()
2232 del_timer(&entry->timer); in lec_vcc_close()
2233 hlist_del(&entry->next); in lec_vcc_close()
2234 lec_arp_put(entry); in lec_vcc_close()
2238 hlist_for_each_entry_safe(entry, next, &priv->mcast_fwds, next) { in lec_vcc_close()
2239 if (entry->recv_vcc == vcc) { in lec_vcc_close()
2240 lec_arp_clear_vccs(entry); in lec_vcc_close()
2242 hlist_del(&entry->next); in lec_vcc_close()
2243 lec_arp_put(entry); in lec_vcc_close()
2257 struct lec_arp_table *entry, *tmp; in lec_arp_check_empties() local
2262 hlist_for_each_entry_safe(entry, next, in lec_arp_check_empties()
2264 if (vcc == entry->vcc) { in lec_arp_check_empties()
2265 del_timer(&entry->timer); in lec_arp_check_empties()
2266 ether_addr_copy(entry->mac_addr, src); in lec_arp_check_empties()
2267 entry->status = ESI_FORWARD_DIRECT; in lec_arp_check_empties()
2268 entry->last_used = jiffies; in lec_arp_check_empties()
2275 hlist_del(&entry->next); in lec_arp_check_empties()
2276 lec_arp_add(priv, entry); in lec_arp_check_empties()