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()
348 struct lec_arp_table *entry; in lec_atm_send() local
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()
614 struct lec_arp_table *entry; in lec_push() local
637 entry = lec_arp_find(priv, src); in lec_push()
638 if (entry && entry->vcc != vcc) { in lec_push()
639 lec_arp_remove(priv, entry); in lec_push()
640 lec_arp_put(entry); in lec_push()
798 static void lec_info(struct seq_file *seq, struct lec_arp_table *entry) in lec_info() argument
800 seq_printf(seq, "%pM ", entry->mac_addr); in lec_info()
801 seq_printf(seq, "%*phN ", ATM_ESA_LEN, entry->atm_addr); in lec_info()
802 seq_printf(seq, "%s %4.4x", lec_arp_get_status_string(entry->status), in lec_info()
803 entry->flags & 0xffff); in lec_info()
804 if (entry->vcc) in lec_info()
805 seq_printf(seq, "%3d %3d ", entry->vcc->vpi, entry->vcc->vci); in lec_info()
808 if (entry->recv_vcc) { in lec_info()
809 seq_printf(seq, " %3d %3d", entry->recv_vcc->vpi, in lec_info()
810 entry->recv_vcc->vci); in lec_info()
971 struct lec_arp_table *entry = hlist_entry(state->node, in lec_seq_show() local
976 lec_info(seq, entry); in lec_seq_show()
1169 struct lec_arp_table *entry = lec_arp_find(priv, mac_addr); in lane2_associate_ind()
1171 if (entry == NULL) in lane2_associate_ind()
1174 kfree(entry->tlvs); in lane2_associate_ind()
1176 entry->tlvs = kmemdup(tlvs, sizeoftlvs, GFP_KERNEL); in lane2_associate_ind()
1177 if (entry->tlvs == NULL) in lane2_associate_ind()
1179 entry->sizeoftlvs = sizeoftlvs; in lane2_associate_ind()
1247 static void lec_arp_clear_vccs(struct lec_arp_table *entry) in lec_arp_clear_vccs() argument
1249 if (entry->vcc) { in lec_arp_clear_vccs()
1250 struct atm_vcc *vcc = entry->vcc; in lec_arp_clear_vccs()
1259 vcc->push = entry->old_push; in lec_arp_clear_vccs()
1261 entry->vcc = NULL; in lec_arp_clear_vccs()
1263 if (entry->recv_vcc) { in lec_arp_clear_vccs()
1264 struct atm_vcc *vcc = entry->recv_vcc; in lec_arp_clear_vccs()
1270 entry->recv_vcc->push = entry->old_recv_push; in lec_arp_clear_vccs()
1271 vcc_release_async(entry->recv_vcc, -EPIPE); in lec_arp_clear_vccs()
1272 entry->recv_vcc = NULL; in lec_arp_clear_vccs()
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()
1286 hlist_add_head(&entry->next, tmp); in lec_arp_add()
1288 pr_debug("Added entry:%pM\n", entry->mac_addr); in lec_arp_add()
1297 struct lec_arp_table *entry; in lec_arp_remove() local
1315 hlist_for_each_entry(entry, in lec_arp_remove()
1318 entry->atm_addr, ATM_ESA_LEN) == 0) { in lec_arp_remove()
1463 struct lec_arp_table *entry; in lec_arp_destroy() local
1474 hlist_for_each_entry_safe(entry, next, in lec_arp_destroy()
1476 lec_arp_remove(priv, entry); in lec_arp_destroy()
1477 lec_arp_put(entry); in lec_arp_destroy()
1482 hlist_for_each_entry_safe(entry, next, in lec_arp_destroy()
1484 del_timer_sync(&entry->timer); in lec_arp_destroy()
1485 lec_arp_clear_vccs(entry); in lec_arp_destroy()
1486 hlist_del(&entry->next); in lec_arp_destroy()
1487 lec_arp_put(entry); in lec_arp_destroy()
1491 hlist_for_each_entry_safe(entry, next, in lec_arp_destroy()
1493 del_timer_sync(&entry->timer); in lec_arp_destroy()
1494 lec_arp_clear_vccs(entry); in lec_arp_destroy()
1495 hlist_del(&entry->next); in lec_arp_destroy()
1496 lec_arp_put(entry); in lec_arp_destroy()
1500 hlist_for_each_entry_safe(entry, next, &priv->mcast_fwds, next) { in lec_arp_destroy()
1502 lec_arp_clear_vccs(entry); in lec_arp_destroy()
1503 hlist_del(&entry->next); in lec_arp_destroy()
1504 lec_arp_put(entry); in lec_arp_destroy()
1518 struct lec_arp_table *entry; in lec_arp_find() local
1523 hlist_for_each_entry(entry, head, next) { in lec_arp_find()
1524 if (ether_addr_equal(mac_addr, entry->mac_addr)) in lec_arp_find()
1525 return entry; in lec_arp_find()
1551 struct lec_arp_table *entry; in lec_arp_expire_arp() local
1553 entry = from_timer(entry, t, timer); in lec_arp_expire_arp()
1556 if (entry->status == ESI_ARP_PENDING) { in lec_arp_expire_arp()
1557 if (entry->no_tries <= entry->priv->max_retry_count) { in lec_arp_expire_arp()
1558 if (entry->is_rdesc) in lec_arp_expire_arp()
1559 send_to_lecd(entry->priv, l_rdesc_arp_xmt, in lec_arp_expire_arp()
1560 entry->mac_addr, NULL, NULL); in lec_arp_expire_arp()
1562 send_to_lecd(entry->priv, l_arp_xmt, in lec_arp_expire_arp()
1563 entry->mac_addr, NULL, NULL); in lec_arp_expire_arp()
1564 entry->no_tries++; in lec_arp_expire_arp()
1566 mod_timer(&entry->timer, jiffies + (1 * HZ)); in lec_arp_expire_arp()
1592 static bool __lec_arp_check_expire(struct lec_arp_table *entry, in __lec_arp_check_expire() argument
1598 if ((entry->flags) & LEC_REMOTE_FLAG && priv->topology_change) in __lec_arp_check_expire()
1604 now, entry->last_used, time_to_check); in __lec_arp_check_expire()
1605 if (time_after(now, entry->last_used + time_to_check) && in __lec_arp_check_expire()
1606 !(entry->flags & LEC_PERMANENT_FLAG) && in __lec_arp_check_expire()
1607 !(entry->mac_addr[0] & 0x01)) { /* LANE2: 7.1.20 */ in __lec_arp_check_expire()
1610 lec_arp_remove(priv, entry); in __lec_arp_check_expire()
1611 lec_arp_put(entry); in __lec_arp_check_expire()
1614 if ((entry->status == ESI_VC_PENDING || in __lec_arp_check_expire()
1615 entry->status == ESI_ARP_PENDING) && in __lec_arp_check_expire()
1616 time_after_eq(now, entry->timestamp + in __lec_arp_check_expire()
1618 entry->timestamp = jiffies; in __lec_arp_check_expire()
1619 entry->packets_flooded = 0; in __lec_arp_check_expire()
1620 if (entry->status == ESI_VC_PENDING) in __lec_arp_check_expire()
1622 entry->mac_addr, in __lec_arp_check_expire()
1623 entry->atm_addr, in __lec_arp_check_expire()
1626 if (entry->status == ESI_FLUSH_PENDING && in __lec_arp_check_expire()
1627 time_after_eq(now, entry->timestamp + in __lec_arp_check_expire()
1629 lec_arp_hold(entry); in __lec_arp_check_expire()
1658 struct lec_arp_table *entry; in lec_arp_check_expire() local
1667 hlist_for_each_entry_safe(entry, next, in lec_arp_check_expire()
1669 if (__lec_arp_check_expire(entry, now, priv)) { in lec_arp_check_expire()
1671 struct atm_vcc *vcc = entry->vcc; in lec_arp_check_expire()
1675 while ((skb = skb_dequeue(&entry->tx_wait))) in lec_arp_check_expire()
1677 entry->last_used = jiffies; in lec_arp_check_expire()
1678 entry->status = ESI_FORWARD_DIRECT; in lec_arp_check_expire()
1679 lec_arp_put(entry); in lec_arp_check_expire()
1700 struct lec_arp_table *entry; in lec_arp_resolve() local
1717 entry = lec_arp_find(priv, mac_to_find); in lec_arp_resolve()
1719 if (entry) { in lec_arp_resolve()
1720 if (entry->status == ESI_FORWARD_DIRECT) { in lec_arp_resolve()
1722 entry->last_used = jiffies; in lec_arp_resolve()
1723 lec_arp_hold(entry); in lec_arp_resolve()
1724 *ret_entry = entry; in lec_arp_resolve()
1725 found = entry->vcc; in lec_arp_resolve()
1732 if (entry->status == ESI_ARP_PENDING) in lec_arp_resolve()
1733 entry->no_tries = 0; in lec_arp_resolve()
1740 if (entry->status != ESI_FLUSH_PENDING && in lec_arp_resolve()
1741 entry->packets_flooded < in lec_arp_resolve()
1743 entry->packets_flooded++; in lec_arp_resolve()
1753 lec_arp_hold(entry); in lec_arp_resolve()
1754 *ret_entry = entry; in lec_arp_resolve()
1755 pr_debug("entry->status %d entry->vcc %p\n", entry->status, in lec_arp_resolve()
1756 entry->vcc); in lec_arp_resolve()
1760 entry = make_entry(priv, mac_to_find); in lec_arp_resolve()
1762 if (!entry) { in lec_arp_resolve()
1766 lec_arp_add(priv, entry); in lec_arp_resolve()
1768 entry->packets_flooded = 1; in lec_arp_resolve()
1769 entry->status = ESI_ARP_PENDING; in lec_arp_resolve()
1770 entry->no_tries = 1; in lec_arp_resolve()
1771 entry->last_used = entry->timestamp = jiffies; in lec_arp_resolve()
1772 entry->is_rdesc = is_rdesc; in lec_arp_resolve()
1773 if (entry->is_rdesc) in lec_arp_resolve()
1778 entry->timer.expires = jiffies + (1 * HZ); in lec_arp_resolve()
1779 entry->timer.function = lec_arp_expire_arp; in lec_arp_resolve()
1780 add_timer(&entry->timer); in lec_arp_resolve()
1795 struct lec_arp_table *entry; in lec_addr_delete() local
1801 hlist_for_each_entry_safe(entry, next, in lec_addr_delete()
1803 if (!memcmp(atm_addr, entry->atm_addr, ATM_ESA_LEN) && in lec_addr_delete()
1805 !(entry->flags & LEC_PERMANENT_FLAG))) { in lec_addr_delete()
1806 lec_arp_remove(priv, entry); in lec_addr_delete()
1807 lec_arp_put(entry); in lec_addr_delete()
1827 struct lec_arp_table *entry, *tmp; in lec_arp_update() local
1834 entry = lec_arp_find(priv, mac_addr); in lec_arp_update()
1835 if (entry == NULL && targetless_le_arp) in lec_arp_update()
1841 hlist_for_each_entry_safe(entry, next, in lec_arp_update()
1843 if (memcmp(entry->atm_addr, atm_addr, ATM_ESA_LEN) == 0) { in lec_arp_update()
1844 hlist_del(&entry->next); in lec_arp_update()
1845 del_timer(&entry->timer); in lec_arp_update()
1851 tmp->vcc = entry->vcc; in lec_arp_update()
1852 tmp->old_push = entry->old_push; in lec_arp_update()
1854 del_timer(&entry->timer); in lec_arp_update()
1855 lec_arp_put(entry); in lec_arp_update()
1856 entry = tmp; in lec_arp_update()
1858 entry->status = ESI_FORWARD_DIRECT; in lec_arp_update()
1859 ether_addr_copy(entry->mac_addr, in lec_arp_update()
1861 entry->last_used = jiffies; in lec_arp_update()
1862 lec_arp_add(priv, entry); in lec_arp_update()
1865 entry->flags |= LEC_REMOTE_FLAG; in lec_arp_update()
1867 entry->flags &= ~LEC_REMOTE_FLAG; in lec_arp_update()
1875 entry = lec_arp_find(priv, mac_addr); in lec_arp_update()
1876 if (!entry) { in lec_arp_update()
1877 entry = make_entry(priv, mac_addr); in lec_arp_update()
1878 if (!entry) in lec_arp_update()
1880 entry->status = ESI_UNKNOWN; in lec_arp_update()
1881 lec_arp_add(priv, entry); in lec_arp_update()
1884 memcpy(entry->atm_addr, atm_addr, ATM_ESA_LEN); in lec_arp_update()
1885 del_timer(&entry->timer); in lec_arp_update()
1889 if (entry != tmp && in lec_arp_update()
1897 entry->vcc = tmp->vcc; in lec_arp_update()
1898 entry->old_push = tmp->old_push; in lec_arp_update()
1900 entry->status = tmp->status; in lec_arp_update()
1906 entry->flags |= LEC_REMOTE_FLAG; in lec_arp_update()
1908 entry->flags &= ~LEC_REMOTE_FLAG; in lec_arp_update()
1909 if (entry->status == ESI_ARP_PENDING || entry->status == ESI_UNKNOWN) { in lec_arp_update()
1910 entry->status = ESI_VC_PENDING; in lec_arp_update()
1911 send_to_lecd(priv, l_svc_setup, entry->mac_addr, atm_addr, NULL); in lec_arp_update()
1928 struct lec_arp_table *entry; in lec_vcc_added() local
1936 entry = lec_arp_find(priv, bus_mac); in lec_vcc_added()
1937 if (!entry) { in lec_vcc_added()
1941 memcpy(entry->atm_addr, ioc_data->atm_addr, ATM_ESA_LEN); in lec_vcc_added()
1942 entry->recv_vcc = vcc; in lec_vcc_added()
1943 entry->old_recv_push = old_push; in lec_vcc_added()
1945 entry = make_entry(priv, bus_mac); in lec_vcc_added()
1946 if (entry == NULL) in lec_vcc_added()
1948 del_timer(&entry->timer); in lec_vcc_added()
1949 memcpy(entry->atm_addr, ioc_data->atm_addr, ATM_ESA_LEN); in lec_vcc_added()
1950 entry->recv_vcc = vcc; in lec_vcc_added()
1951 entry->old_recv_push = old_push; 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()
1962 if (entry == NULL) in lec_vcc_added()
1964 memcpy(entry->atm_addr, ioc_data->atm_addr, ATM_ESA_LEN); in lec_vcc_added()
1965 eth_zero_addr(entry->mac_addr); in lec_vcc_added()
1966 entry->recv_vcc = vcc; in lec_vcc_added()
1967 entry->old_recv_push = old_push; in lec_vcc_added()
1968 entry->status = ESI_UNKNOWN; in lec_vcc_added()
1969 entry->timer.expires = jiffies + priv->vcc_timeout_period; in lec_vcc_added()
1970 entry->timer.function = lec_arp_expire_vcc; in lec_vcc_added()
1971 hlist_add_head(&entry->next, &priv->lec_no_forward); in lec_vcc_added()
1972 add_timer(&entry->timer); in lec_vcc_added()
1979 hlist_for_each_entry(entry, in lec_vcc_added()
1982 (ioc_data->atm_addr, entry->atm_addr, in lec_vcc_added()
1986 entry->vcc ? entry->vcc->vci : 0, in lec_vcc_added()
1987 entry->recv_vcc ? entry->recv_vcc-> in lec_vcc_added()
1990 del_timer(&entry->timer); in lec_vcc_added()
1991 entry->vcc = vcc; in lec_vcc_added()
1992 entry->old_push = old_push; in lec_vcc_added()
1993 if (entry->status == ESI_VC_PENDING) { in lec_vcc_added()
1996 entry->status = in lec_vcc_added()
1999 entry->timestamp = jiffies; in lec_vcc_added()
2000 entry->status = in lec_vcc_added()
2005 entry->atm_addr, in lec_vcc_added()
2035 entry = make_entry(priv, bus_mac); in lec_vcc_added()
2036 if (!entry) in lec_vcc_added()
2038 entry->vcc = vcc; in lec_vcc_added()
2039 entry->old_push = old_push; in lec_vcc_added()
2040 memcpy(entry->atm_addr, ioc_data->atm_addr, ATM_ESA_LEN); in lec_vcc_added()
2041 eth_zero_addr(entry->mac_addr); in lec_vcc_added()
2042 entry->status = ESI_UNKNOWN; 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()
2045 entry->timer.function = lec_arp_expire_vcc; in lec_vcc_added()
2046 add_timer(&entry->timer); in lec_vcc_added()
2056 struct lec_arp_table *entry; in lec_flush_complete() local
2063 hlist_for_each_entry(entry, in lec_flush_complete()
2065 if (entry->flush_tran_id == tran_id && in lec_flush_complete()
2066 entry->status == ESI_FLUSH_PENDING) { in lec_flush_complete()
2068 struct atm_vcc *vcc = entry->vcc; in lec_flush_complete()
2070 lec_arp_hold(entry); in lec_flush_complete()
2073 while ((skb = skb_dequeue(&entry->tx_wait))) in lec_flush_complete()
2075 entry->last_used = jiffies; in lec_flush_complete()
2076 entry->status = ESI_FORWARD_DIRECT; in lec_flush_complete()
2077 lec_arp_put(entry); in lec_flush_complete()
2092 struct lec_arp_table *entry; in lec_set_flush_tran_id() local
2097 hlist_for_each_entry(entry, in lec_set_flush_tran_id()
2099 if (!memcmp(atm_addr, entry->atm_addr, ATM_ESA_LEN)) { in lec_set_flush_tran_id()
2100 entry->flush_tran_id = tran_id; in lec_set_flush_tran_id()
2102 tran_id, entry); in lec_set_flush_tran_id()
2150 struct lec_arp_table *entry; in lec_vcc_close() local
2159 hlist_for_each_entry_safe(entry, next, in lec_vcc_close()
2161 if (vcc == entry->vcc) { in lec_vcc_close()
2162 lec_arp_remove(priv, entry); in lec_vcc_close()
2163 lec_arp_put(entry); in lec_vcc_close()
2170 hlist_for_each_entry_safe(entry, next, in lec_vcc_close()
2172 if (entry->vcc == vcc) { in lec_vcc_close()
2173 lec_arp_clear_vccs(entry); in lec_vcc_close()
2174 del_timer(&entry->timer); in lec_vcc_close()
2175 hlist_del(&entry->next); in lec_vcc_close()
2176 lec_arp_put(entry); in lec_vcc_close()
2180 hlist_for_each_entry_safe(entry, next, in lec_vcc_close()
2182 if (entry->recv_vcc == vcc) { in lec_vcc_close()
2183 lec_arp_clear_vccs(entry); in lec_vcc_close()
2184 del_timer(&entry->timer); in lec_vcc_close()
2185 hlist_del(&entry->next); in lec_vcc_close()
2186 lec_arp_put(entry); in lec_vcc_close()
2190 hlist_for_each_entry_safe(entry, next, &priv->mcast_fwds, next) { in lec_vcc_close()
2191 if (entry->recv_vcc == vcc) { in lec_vcc_close()
2192 lec_arp_clear_vccs(entry); in lec_vcc_close()
2194 hlist_del(&entry->next); in lec_vcc_close()
2195 lec_arp_put(entry); in lec_vcc_close()
2209 struct lec_arp_table *entry, *tmp; in lec_arp_check_empties() local
2214 hlist_for_each_entry_safe(entry, next, in lec_arp_check_empties()
2216 if (vcc == entry->vcc) { in lec_arp_check_empties()
2217 del_timer(&entry->timer); in lec_arp_check_empties()
2218 ether_addr_copy(entry->mac_addr, src); in lec_arp_check_empties()
2219 entry->status = ESI_FORWARD_DIRECT; in lec_arp_check_empties()
2220 entry->last_used = jiffies; in lec_arp_check_empties()
2227 hlist_del(&entry->next); in lec_arp_check_empties()
2228 lec_arp_add(priv, entry); in lec_arp_check_empties()