Lines Matching refs:entry

105 static inline void lec_arp_hold(struct lec_arp_table *entry)  in lec_arp_hold()  argument
107 refcount_inc(&entry->usage); in lec_arp_hold()
110 static inline void lec_arp_put(struct lec_arp_table *entry) in lec_arp_put() argument
112 if (refcount_dec_and_test(&entry->usage)) in lec_arp_put()
113 kfree(entry); in lec_arp_put()
210 struct lec_arp_table *entry; in lec_start_xmit() local
281 entry = NULL; in lec_start_xmit()
282 vcc = lec_arp_resolve(priv, dst, is_rdesc, &entry); in lec_start_xmit()
284 dev->name, vcc, vcc ? vcc->flags : 0, entry); in lec_start_xmit()
286 if (entry && (entry->tx_wait.qlen < LEC_UNRES_QUE_LEN)) { in lec_start_xmit()
289 skb_queue_tail(&entry->tx_wait, skb); in lec_start_xmit()
303 while (entry && (skb2 = skb_dequeue(&entry->tx_wait))) { in lec_start_xmit()
327 if (entry) in lec_start_xmit()
328 lec_arp_put(entry); in lec_start_xmit()
346 struct lec_arp_table *entry; in lec_atm_send() local
376 entry = lec_arp_find(priv, mesg->content.normal.mac_addr); in lec_atm_send()
377 lec_arp_remove(priv, entry); in lec_atm_send()
615 struct lec_arp_table *entry; in lec_push() local
638 entry = lec_arp_find(priv, src); in lec_push()
639 if (entry && entry->vcc != vcc) { in lec_push()
640 lec_arp_remove(priv, entry); in lec_push()
641 lec_arp_put(entry); in lec_push()
797 static void lec_info(struct seq_file *seq, struct lec_arp_table *entry) in lec_info() argument
802 seq_printf(seq, "%2.2x", entry->mac_addr[i] & 0xff); in lec_info()
805 seq_printf(seq, "%2.2x", entry->atm_addr[i] & 0xff); in lec_info()
806 seq_printf(seq, " %s %4.4x", lec_arp_get_status_string(entry->status), in lec_info()
807 entry->flags & 0xffff); in lec_info()
808 if (entry->vcc) in lec_info()
809 seq_printf(seq, "%3d %3d ", entry->vcc->vpi, entry->vcc->vci); in lec_info()
812 if (entry->recv_vcc) { in lec_info()
813 seq_printf(seq, " %3d %3d", entry->recv_vcc->vpi, in lec_info()
814 entry->recv_vcc->vci); in lec_info()
976 struct lec_arp_table *entry = hlist_entry(state->node, in lec_seq_show() local
981 lec_info(seq, entry); in lec_seq_show()
1174 struct lec_arp_table *entry = lec_arp_find(priv, mac_addr); in lane2_associate_ind()
1176 if (entry == NULL) in lane2_associate_ind()
1179 kfree(entry->tlvs); in lane2_associate_ind()
1181 entry->tlvs = kmemdup(tlvs, sizeoftlvs, GFP_KERNEL); in lane2_associate_ind()
1182 if (entry->tlvs == NULL) in lane2_associate_ind()
1184 entry->sizeoftlvs = sizeoftlvs; in lane2_associate_ind()
1252 static void lec_arp_clear_vccs(struct lec_arp_table *entry) in lec_arp_clear_vccs() argument
1254 if (entry->vcc) { in lec_arp_clear_vccs()
1255 struct atm_vcc *vcc = entry->vcc; in lec_arp_clear_vccs()
1264 vcc->push = entry->old_push; in lec_arp_clear_vccs()
1266 entry->vcc = NULL; in lec_arp_clear_vccs()
1268 if (entry->recv_vcc) { in lec_arp_clear_vccs()
1269 entry->recv_vcc->push = entry->old_recv_push; in lec_arp_clear_vccs()
1270 vcc_release_async(entry->recv_vcc, -EPIPE); in lec_arp_clear_vccs()
1271 entry->recv_vcc = NULL; in lec_arp_clear_vccs()
1280 lec_arp_add(struct lec_priv *priv, struct lec_arp_table *entry) in lec_arp_add() argument
1284 tmp = &priv->lec_arp_tables[HASH(entry->mac_addr[ETH_ALEN - 1])]; in lec_arp_add()
1285 hlist_add_head(&entry->next, tmp); in lec_arp_add()
1287 pr_debug("Added entry:%pM\n", entry->mac_addr); in lec_arp_add()
1296 struct lec_arp_table *entry; in lec_arp_remove() local
1314 hlist_for_each_entry(entry, in lec_arp_remove()
1317 entry->atm_addr, ATM_ESA_LEN) == 0) { in lec_arp_remove()
1475 struct lec_arp_table *entry; in lec_arp_destroy() local
1486 hlist_for_each_entry_safe(entry, next, in lec_arp_destroy()
1488 lec_arp_remove(priv, entry); in lec_arp_destroy()
1489 lec_arp_put(entry); in lec_arp_destroy()
1494 hlist_for_each_entry_safe(entry, next, in lec_arp_destroy()
1496 del_timer_sync(&entry->timer); in lec_arp_destroy()
1497 lec_arp_clear_vccs(entry); in lec_arp_destroy()
1498 hlist_del(&entry->next); in lec_arp_destroy()
1499 lec_arp_put(entry); in lec_arp_destroy()
1503 hlist_for_each_entry_safe(entry, next, in lec_arp_destroy()
1505 del_timer_sync(&entry->timer); in lec_arp_destroy()
1506 lec_arp_clear_vccs(entry); in lec_arp_destroy()
1507 hlist_del(&entry->next); in lec_arp_destroy()
1508 lec_arp_put(entry); in lec_arp_destroy()
1512 hlist_for_each_entry_safe(entry, next, &priv->mcast_fwds, next) { in lec_arp_destroy()
1514 lec_arp_clear_vccs(entry); in lec_arp_destroy()
1515 hlist_del(&entry->next); in lec_arp_destroy()
1516 lec_arp_put(entry); in lec_arp_destroy()
1530 struct lec_arp_table *entry; in lec_arp_find() local
1535 hlist_for_each_entry(entry, head, next) { in lec_arp_find()
1536 if (ether_addr_equal(mac_addr, entry->mac_addr)) in lec_arp_find()
1537 return entry; in lec_arp_find()
1565 struct lec_arp_table *entry; in lec_arp_expire_arp() local
1567 entry = from_timer(entry, t, timer); in lec_arp_expire_arp()
1570 if (entry->status == ESI_ARP_PENDING) { in lec_arp_expire_arp()
1571 if (entry->no_tries <= entry->priv->max_retry_count) { in lec_arp_expire_arp()
1572 if (entry->is_rdesc) in lec_arp_expire_arp()
1573 send_to_lecd(entry->priv, l_rdesc_arp_xmt, in lec_arp_expire_arp()
1574 entry->mac_addr, NULL, NULL); in lec_arp_expire_arp()
1576 send_to_lecd(entry->priv, l_arp_xmt, in lec_arp_expire_arp()
1577 entry->mac_addr, NULL, NULL); in lec_arp_expire_arp()
1578 entry->no_tries++; in lec_arp_expire_arp()
1580 mod_timer(&entry->timer, jiffies + (1 * HZ)); in lec_arp_expire_arp()
1606 static bool __lec_arp_check_expire(struct lec_arp_table *entry, in __lec_arp_check_expire() argument
1612 if ((entry->flags) & LEC_REMOTE_FLAG && priv->topology_change) in __lec_arp_check_expire()
1618 now, entry->last_used, time_to_check); in __lec_arp_check_expire()
1619 if (time_after(now, entry->last_used + time_to_check) && in __lec_arp_check_expire()
1620 !(entry->flags & LEC_PERMANENT_FLAG) && in __lec_arp_check_expire()
1621 !(entry->mac_addr[0] & 0x01)) { /* LANE2: 7.1.20 */ in __lec_arp_check_expire()
1624 lec_arp_remove(priv, entry); in __lec_arp_check_expire()
1625 lec_arp_put(entry); in __lec_arp_check_expire()
1628 if ((entry->status == ESI_VC_PENDING || in __lec_arp_check_expire()
1629 entry->status == ESI_ARP_PENDING) && in __lec_arp_check_expire()
1630 time_after_eq(now, entry->timestamp + in __lec_arp_check_expire()
1632 entry->timestamp = jiffies; in __lec_arp_check_expire()
1633 entry->packets_flooded = 0; in __lec_arp_check_expire()
1634 if (entry->status == ESI_VC_PENDING) in __lec_arp_check_expire()
1636 entry->mac_addr, in __lec_arp_check_expire()
1637 entry->atm_addr, in __lec_arp_check_expire()
1640 if (entry->status == ESI_FLUSH_PENDING && in __lec_arp_check_expire()
1641 time_after_eq(now, entry->timestamp + in __lec_arp_check_expire()
1643 lec_arp_hold(entry); in __lec_arp_check_expire()
1672 struct lec_arp_table *entry; in lec_arp_check_expire() local
1681 hlist_for_each_entry_safe(entry, next, in lec_arp_check_expire()
1683 if (__lec_arp_check_expire(entry, now, priv)) { in lec_arp_check_expire()
1685 struct atm_vcc *vcc = entry->vcc; in lec_arp_check_expire()
1689 while ((skb = skb_dequeue(&entry->tx_wait))) in lec_arp_check_expire()
1691 entry->last_used = jiffies; in lec_arp_check_expire()
1692 entry->status = ESI_FORWARD_DIRECT; in lec_arp_check_expire()
1693 lec_arp_put(entry); in lec_arp_check_expire()
1714 struct lec_arp_table *entry; in lec_arp_resolve() local
1731 entry = lec_arp_find(priv, mac_to_find); in lec_arp_resolve()
1733 if (entry) { in lec_arp_resolve()
1734 if (entry->status == ESI_FORWARD_DIRECT) { in lec_arp_resolve()
1736 entry->last_used = jiffies; in lec_arp_resolve()
1737 lec_arp_hold(entry); in lec_arp_resolve()
1738 *ret_entry = entry; in lec_arp_resolve()
1739 found = entry->vcc; in lec_arp_resolve()
1746 if (entry->status == ESI_ARP_PENDING) in lec_arp_resolve()
1747 entry->no_tries = 0; in lec_arp_resolve()
1754 if (entry->status != ESI_FLUSH_PENDING && in lec_arp_resolve()
1755 entry->packets_flooded < in lec_arp_resolve()
1757 entry->packets_flooded++; in lec_arp_resolve()
1767 lec_arp_hold(entry); in lec_arp_resolve()
1768 *ret_entry = entry; in lec_arp_resolve()
1769 pr_debug("entry->status %d entry->vcc %p\n", entry->status, in lec_arp_resolve()
1770 entry->vcc); in lec_arp_resolve()
1774 entry = make_entry(priv, mac_to_find); in lec_arp_resolve()
1776 if (!entry) { in lec_arp_resolve()
1780 lec_arp_add(priv, entry); in lec_arp_resolve()
1782 entry->packets_flooded = 1; in lec_arp_resolve()
1783 entry->status = ESI_ARP_PENDING; in lec_arp_resolve()
1784 entry->no_tries = 1; in lec_arp_resolve()
1785 entry->last_used = entry->timestamp = jiffies; in lec_arp_resolve()
1786 entry->is_rdesc = is_rdesc; in lec_arp_resolve()
1787 if (entry->is_rdesc) in lec_arp_resolve()
1792 entry->timer.expires = jiffies + (1 * HZ); in lec_arp_resolve()
1793 entry->timer.function = lec_arp_expire_arp; in lec_arp_resolve()
1794 add_timer(&entry->timer); in lec_arp_resolve()
1809 struct lec_arp_table *entry; in lec_addr_delete() local
1815 hlist_for_each_entry_safe(entry, next, in lec_addr_delete()
1817 if (!memcmp(atm_addr, entry->atm_addr, ATM_ESA_LEN) && in lec_addr_delete()
1819 !(entry->flags & LEC_PERMANENT_FLAG))) { in lec_addr_delete()
1820 lec_arp_remove(priv, entry); in lec_addr_delete()
1821 lec_arp_put(entry); in lec_addr_delete()
1841 struct lec_arp_table *entry, *tmp; in lec_arp_update() local
1848 entry = lec_arp_find(priv, mac_addr); in lec_arp_update()
1849 if (entry == NULL && targetless_le_arp) in lec_arp_update()
1855 hlist_for_each_entry_safe(entry, next, in lec_arp_update()
1857 if (memcmp(entry->atm_addr, atm_addr, ATM_ESA_LEN) == 0) { in lec_arp_update()
1858 hlist_del(&entry->next); in lec_arp_update()
1859 del_timer(&entry->timer); in lec_arp_update()
1865 tmp->vcc = entry->vcc; in lec_arp_update()
1866 tmp->old_push = entry->old_push; in lec_arp_update()
1868 del_timer(&entry->timer); in lec_arp_update()
1869 lec_arp_put(entry); in lec_arp_update()
1870 entry = tmp; in lec_arp_update()
1872 entry->status = ESI_FORWARD_DIRECT; in lec_arp_update()
1873 ether_addr_copy(entry->mac_addr, in lec_arp_update()
1875 entry->last_used = jiffies; in lec_arp_update()
1876 lec_arp_add(priv, entry); in lec_arp_update()
1879 entry->flags |= LEC_REMOTE_FLAG; in lec_arp_update()
1881 entry->flags &= ~LEC_REMOTE_FLAG; in lec_arp_update()
1889 entry = lec_arp_find(priv, mac_addr); in lec_arp_update()
1890 if (!entry) { in lec_arp_update()
1891 entry = make_entry(priv, mac_addr); in lec_arp_update()
1892 if (!entry) in lec_arp_update()
1894 entry->status = ESI_UNKNOWN; in lec_arp_update()
1895 lec_arp_add(priv, entry); in lec_arp_update()
1898 memcpy(entry->atm_addr, atm_addr, ATM_ESA_LEN); in lec_arp_update()
1899 del_timer(&entry->timer); in lec_arp_update()
1903 if (entry != tmp && in lec_arp_update()
1911 entry->vcc = tmp->vcc; in lec_arp_update()
1912 entry->old_push = tmp->old_push; in lec_arp_update()
1914 entry->status = tmp->status; in lec_arp_update()
1920 entry->flags |= LEC_REMOTE_FLAG; in lec_arp_update()
1922 entry->flags &= ~LEC_REMOTE_FLAG; in lec_arp_update()
1923 if (entry->status == ESI_ARP_PENDING || entry->status == ESI_UNKNOWN) { in lec_arp_update()
1924 entry->status = ESI_VC_PENDING; in lec_arp_update()
1925 send_to_lecd(priv, l_svc_setup, entry->mac_addr, atm_addr, NULL); in lec_arp_update()
1942 struct lec_arp_table *entry; in lec_vcc_added() local
1950 entry = lec_arp_find(priv, bus_mac); in lec_vcc_added()
1951 if (!entry) { in lec_vcc_added()
1955 memcpy(entry->atm_addr, ioc_data->atm_addr, ATM_ESA_LEN); in lec_vcc_added()
1956 entry->recv_vcc = vcc; in lec_vcc_added()
1957 entry->old_recv_push = old_push; in lec_vcc_added()
1959 entry = make_entry(priv, bus_mac); in lec_vcc_added()
1960 if (entry == NULL) in lec_vcc_added()
1962 del_timer(&entry->timer); in lec_vcc_added()
1963 memcpy(entry->atm_addr, ioc_data->atm_addr, ATM_ESA_LEN); in lec_vcc_added()
1964 entry->recv_vcc = vcc; in lec_vcc_added()
1965 entry->old_recv_push = old_push; in lec_vcc_added()
1966 hlist_add_head(&entry->next, &priv->mcast_fwds); in lec_vcc_added()
1984 entry = make_entry(priv, bus_mac); in lec_vcc_added()
1985 if (entry == NULL) in lec_vcc_added()
1987 memcpy(entry->atm_addr, ioc_data->atm_addr, ATM_ESA_LEN); in lec_vcc_added()
1988 eth_zero_addr(entry->mac_addr); in lec_vcc_added()
1989 entry->recv_vcc = vcc; in lec_vcc_added()
1990 entry->old_recv_push = old_push; in lec_vcc_added()
1991 entry->status = ESI_UNKNOWN; in lec_vcc_added()
1992 entry->timer.expires = jiffies + priv->vcc_timeout_period; in lec_vcc_added()
1993 entry->timer.function = lec_arp_expire_vcc; in lec_vcc_added()
1994 hlist_add_head(&entry->next, &priv->lec_no_forward); in lec_vcc_added()
1995 add_timer(&entry->timer); in lec_vcc_added()
2011 hlist_for_each_entry(entry, in lec_vcc_added()
2014 (ioc_data->atm_addr, entry->atm_addr, in lec_vcc_added()
2018 entry->vcc ? entry->vcc->vci : 0, in lec_vcc_added()
2019 entry->recv_vcc ? entry->recv_vcc-> in lec_vcc_added()
2022 del_timer(&entry->timer); in lec_vcc_added()
2023 entry->vcc = vcc; in lec_vcc_added()
2024 entry->old_push = old_push; in lec_vcc_added()
2025 if (entry->status == ESI_VC_PENDING) { in lec_vcc_added()
2028 entry->status = in lec_vcc_added()
2031 entry->timestamp = jiffies; in lec_vcc_added()
2032 entry->status = in lec_vcc_added()
2037 entry->atm_addr, in lec_vcc_added()
2067 entry = make_entry(priv, bus_mac); in lec_vcc_added()
2068 if (!entry) in lec_vcc_added()
2070 entry->vcc = vcc; in lec_vcc_added()
2071 entry->old_push = old_push; in lec_vcc_added()
2072 memcpy(entry->atm_addr, ioc_data->atm_addr, ATM_ESA_LEN); in lec_vcc_added()
2073 eth_zero_addr(entry->mac_addr); in lec_vcc_added()
2074 entry->status = ESI_UNKNOWN; in lec_vcc_added()
2075 hlist_add_head(&entry->next, &priv->lec_arp_empty_ones); in lec_vcc_added()
2076 entry->timer.expires = jiffies + priv->vcc_timeout_period; in lec_vcc_added()
2077 entry->timer.function = lec_arp_expire_vcc; in lec_vcc_added()
2078 add_timer(&entry->timer); in lec_vcc_added()
2088 struct lec_arp_table *entry; in lec_flush_complete() local
2095 hlist_for_each_entry(entry, in lec_flush_complete()
2097 if (entry->flush_tran_id == tran_id && in lec_flush_complete()
2098 entry->status == ESI_FLUSH_PENDING) { in lec_flush_complete()
2100 struct atm_vcc *vcc = entry->vcc; in lec_flush_complete()
2102 lec_arp_hold(entry); in lec_flush_complete()
2105 while ((skb = skb_dequeue(&entry->tx_wait))) in lec_flush_complete()
2107 entry->last_used = jiffies; in lec_flush_complete()
2108 entry->status = ESI_FORWARD_DIRECT; in lec_flush_complete()
2109 lec_arp_put(entry); in lec_flush_complete()
2124 struct lec_arp_table *entry; in lec_set_flush_tran_id() local
2129 hlist_for_each_entry(entry, in lec_set_flush_tran_id()
2131 if (!memcmp(atm_addr, entry->atm_addr, ATM_ESA_LEN)) { in lec_set_flush_tran_id()
2132 entry->flush_tran_id = tran_id; in lec_set_flush_tran_id()
2134 tran_id, entry); in lec_set_flush_tran_id()
2182 struct lec_arp_table *entry; in lec_vcc_close() local
2191 hlist_for_each_entry_safe(entry, next, in lec_vcc_close()
2193 if (vcc == entry->vcc) { in lec_vcc_close()
2194 lec_arp_remove(priv, entry); in lec_vcc_close()
2195 lec_arp_put(entry); in lec_vcc_close()
2202 hlist_for_each_entry_safe(entry, next, in lec_vcc_close()
2204 if (entry->vcc == vcc) { in lec_vcc_close()
2205 lec_arp_clear_vccs(entry); in lec_vcc_close()
2206 del_timer(&entry->timer); in lec_vcc_close()
2207 hlist_del(&entry->next); in lec_vcc_close()
2208 lec_arp_put(entry); in lec_vcc_close()
2212 hlist_for_each_entry_safe(entry, next, in lec_vcc_close()
2214 if (entry->recv_vcc == vcc) { in lec_vcc_close()
2215 lec_arp_clear_vccs(entry); in lec_vcc_close()
2216 del_timer(&entry->timer); in lec_vcc_close()
2217 hlist_del(&entry->next); in lec_vcc_close()
2218 lec_arp_put(entry); in lec_vcc_close()
2222 hlist_for_each_entry_safe(entry, next, &priv->mcast_fwds, next) { in lec_vcc_close()
2223 if (entry->recv_vcc == vcc) { in lec_vcc_close()
2224 lec_arp_clear_vccs(entry); in lec_vcc_close()
2226 hlist_del(&entry->next); in lec_vcc_close()
2227 lec_arp_put(entry); in lec_vcc_close()
2241 struct lec_arp_table *entry, *tmp; in lec_arp_check_empties() local
2246 hlist_for_each_entry_safe(entry, next, in lec_arp_check_empties()
2248 if (vcc == entry->vcc) { in lec_arp_check_empties()
2249 del_timer(&entry->timer); in lec_arp_check_empties()
2250 ether_addr_copy(entry->mac_addr, src); in lec_arp_check_empties()
2251 entry->status = ESI_FORWARD_DIRECT; in lec_arp_check_empties()
2252 entry->last_used = jiffies; in lec_arp_check_empties()
2259 hlist_del(&entry->next); in lec_arp_check_empties()
2260 lec_arp_add(priv, entry); in lec_arp_check_empties()