Lines Matching refs:orig_node
68 struct batadv_orig_node *orig_node);
73 struct batadv_orig_node *orig_node,
361 * for orig_node identified by vid
362 * @orig_node: the originator for which the table has to be modified
366 static void batadv_tt_global_size_mod(struct batadv_orig_node *orig_node,
371 vlan = batadv_orig_node_vlan_new(orig_node, vid);
376 spin_lock_bh(&orig_node->vlan_list_lock);
381 spin_unlock_bh(&orig_node->vlan_list_lock);
390 * @orig_node: the originator which global table size has to be decreased
393 static void batadv_tt_global_size_inc(struct batadv_orig_node *orig_node,
396 batadv_tt_global_size_mod(orig_node, vid, 1);
402 * @orig_node: the originator which global table size has to be decreased
405 static void batadv_tt_global_size_dec(struct batadv_orig_node *orig_node,
408 batadv_tt_global_size_mod(orig_node, vid, -1);
436 batadv_orig_node_put(orig_entry->orig_node);
772 orig_entry->orig_node);
830 * @orig_node: originator for which the TT data has to be prepared
845 batadv_tt_prepare_tvlv_global_data(struct batadv_orig_node *orig_node,
858 spin_lock_bh(&orig_node->vlan_list_lock);
859 hlist_for_each_entry(vlan, &orig_node->vlan_list, list) {
881 (*tt_data)->ttvn = atomic_read(&orig_node->last_ttvn);
885 hlist_for_each_entry(vlan, &orig_node->vlan_list, list) {
897 spin_unlock_bh(&orig_node->vlan_list_lock);
1519 * @orig_node: the originator for which the orig_list_entry has to be found
1521 * retrieve the orig_tt_list_entry belonging to orig_node from the
1528 const struct batadv_orig_node *orig_node)
1536 if (tmp_orig_entry->orig_node != orig_node)
1553 * @orig_node: the originator to search in the list
1555 * from @orig_node
1557 * find out if an orig_node is already in the list of a tt_global_entry.
1563 const struct batadv_orig_node *orig_node,
1569 orig_entry = batadv_tt_global_orig_entry_find(entry, orig_node);
1609 * @orig_node: the originator to add an orig entry for
1615 struct batadv_orig_node *orig_node, int ttvn,
1622 orig_entry = batadv_tt_global_orig_entry_find(tt_global, orig_node);
1637 kref_get(&orig_node->refcount);
1638 batadv_tt_global_size_inc(orig_node, tt_global->common.vid);
1639 orig_entry->orig_node = orig_node;
1661 * @orig_node: the originator announcing the client
1673 * The caller must hold the orig_node refcount.
1678 struct batadv_orig_node *orig_node,
1690 if (batadv_bla_is_backbone_gw_orig(bat_priv, orig_node->orig, vid))
1758 orig_node, NULL))
1797 batadv_tt_global_orig_entry_add(tt_global_entry, orig_node, ttvn,
1803 orig_node->orig);
1852 router = batadv_orig_router_get(orig_entry->orig_node,
1905 vlan = batadv_orig_node_vlan_get(best_entry->orig_node,
1911 best_entry->orig_node->orig);
1915 last_ttvn = atomic_read(&best_entry->orig_node->last_ttvn);
1920 best_entry->ttvn, best_entry->orig_node->orig,
1937 vlan = batadv_orig_node_vlan_get(orig_entry->orig_node,
1943 orig_entry->orig_node->orig);
1947 last_ttvn = atomic_read(&orig_entry->orig_node->last_ttvn);
1952 orig_entry->ttvn, orig_entry->orig_node->orig,
2034 vlan = batadv_orig_node_vlan_get(orig->orig_node,
2049 last_ttvn = atomic_read(&orig->orig_node->last_ttvn);
2053 orig->orig_node->orig) ||
2241 batadv_tt_global_size_dec(orig_entry->orig_node,
2267 * batadv_tt_global_del_orig_node() - remove orig_node from a global tt entry
2269 * @tt_global_entry: the global entry to remove the orig_node from
2270 * @orig_node: the originator announcing the client
2273 * Remove the given orig_node and its according orig_entry from the given
2279 struct batadv_orig_node *orig_node,
2290 if (orig_entry->orig_node == orig_node) {
2294 orig_node->orig,
2311 struct batadv_orig_node *orig_node,
2325 if (orig_entry->orig_node != orig_node) {
2341 orig_node, message);
2348 * @orig_node: an originator serving this client
2356 struct batadv_orig_node *orig_node,
2369 orig_node, message);
2401 orig_node, message);
2415 * @orig_node: the originator owning the entries to remove
2421 struct batadv_orig_node *orig_node,
2453 orig_node, message);
2467 clear_bit(BATADV_ORIG_CAPA_HAS_TT, &orig_node->capa_initialized);
2604 struct batadv_orig_node *orig_node = NULL;
2629 orig_node = best_entry->orig_node;
2630 if (orig_node && !kref_get_unless_zero(&orig_node->refcount))
2631 orig_node = NULL;
2640 return orig_node;
2645 * to the given orig_node
2647 * @orig_node: originator for which the CRC should be computed
2668 struct batadv_orig_node *orig_node,
2712 orig_node);
2837 struct batadv_orig_node *orig_node,
2844 spin_lock_bh(&orig_node->tt_buff_lock);
2846 kfree(orig_node->tt_buff);
2847 orig_node->tt_buff_len = 0;
2848 orig_node->tt_buff = kmalloc(tt_buff_len, GFP_ATOMIC);
2849 if (orig_node->tt_buff) {
2850 memcpy(orig_node->tt_buff, tt_buff, tt_buff_len);
2851 orig_node->tt_buff_len = tt_buff_len;
2854 spin_unlock_bh(&orig_node->tt_buff_lock);
2876 * @orig_node: orig node this request is being issued for
2879 * has already been issued for this orig_node, NULL otherwise.
2883 struct batadv_orig_node *orig_node)
2889 if (batadv_compare_eth(tt_req_node_tmp, orig_node) &&
2900 ether_addr_copy(tt_req_node->addr, orig_node->orig);
2939 * @data_ptr: an orig_node object (may be NULL)
2954 const struct batadv_orig_node *orig_node = data_ptr;
2964 return batadv_tt_global_entry_has_orig(tt_global_entry, orig_node,
3031 * @orig_node: originator for which the CRCs have to be checked
3038 static bool batadv_tt_global_check_crc(struct batadv_orig_node *orig_node,
3051 /* if orig_node is a backbone node for this VLAN, don't check
3054 if (batadv_bla_is_backbone_gw_orig(orig_node->bat_priv,
3055 orig_node->orig,
3059 vlan = batadv_orig_node_vlan_get(orig_node,
3076 hlist_for_each_entry_rcu(vlan, &orig_node->vlan_list, list)
3103 * batadv_tt_global_update_crc() - update all the global CRCs for this orig_node
3105 * @orig_node: the orig_node for which the CRCs have to be updated
3108 struct batadv_orig_node *orig_node)
3115 hlist_for_each_entry_rcu(vlan, &orig_node->vlan_list, list) {
3116 /* if orig_node is a backbone node for this VLAN, don't compute
3119 if (batadv_bla_is_backbone_gw_orig(bat_priv, orig_node->orig,
3123 crc = batadv_tt_global_crc(bat_priv, orig_node, vlan->vid);
3159 * reply from the same orig_node yet
3287 /* Copy the last orig_node's OGM buffer */
3367 struct batadv_orig_node *orig_node;
3383 orig_node = batadv_orig_hash_find(bat_priv, req_src);
3384 if (!orig_node)
3414 /* Copy the last orig_node's OGM buffer */
3446 orig_node->orig, full_table ? 'F' : '.', req_ttvn);
3460 if (orig_node)
3461 batadv_orig_node_put(orig_node);
3489 struct batadv_orig_node *orig_node,
3499 batadv_tt_global_del(bat_priv, orig_node,
3505 if (!batadv_tt_global_add(bat_priv, orig_node,
3518 set_bit(BATADV_ORIG_CAPA_HAS_TT, &orig_node->capa_initialized);
3526 struct batadv_orig_node *orig_node;
3528 orig_node = batadv_orig_hash_find(bat_priv, resp_src);
3529 if (!orig_node)
3533 batadv_tt_global_del_orig(bat_priv, orig_node, -1,
3536 _batadv_tt_update_changes(bat_priv, orig_node, tt_change, num_entries,
3539 spin_lock_bh(&orig_node->tt_buff_lock);
3540 kfree(orig_node->tt_buff);
3541 orig_node->tt_buff_len = 0;
3542 orig_node->tt_buff = NULL;
3543 spin_unlock_bh(&orig_node->tt_buff_lock);
3545 atomic_set(&orig_node->last_ttvn, ttvn);
3548 if (orig_node)
3549 batadv_orig_node_put(orig_node);
3553 struct batadv_orig_node *orig_node,
3557 _batadv_tt_update_changes(bat_priv, orig_node, tt_change,
3560 batadv_tt_save_orig_buffer(bat_priv, orig_node, tt_change,
3562 atomic_set(&orig_node->last_ttvn, ttvn);
3608 struct batadv_orig_node *orig_node = NULL;
3618 orig_node = batadv_orig_hash_find(bat_priv, resp_src);
3619 if (!orig_node)
3622 spin_lock_bh(&orig_node->tt_lock);
3634 batadv_tt_update_changes(bat_priv, orig_node, num_entries,
3638 /* Recalculate the CRC for this orig_node and store it */
3639 batadv_tt_global_update_crc(bat_priv, orig_node);
3641 spin_unlock_bh(&orig_node->tt_lock);
3654 if (orig_node)
3655 batadv_orig_node_put(orig_node);
3706 * reply from the same orig_node yet
3748 * @orig_node: message destination
3757 struct batadv_orig_node *orig_node)
3774 orig_node->orig, client, batadv_print_vid(vid));
3782 orig_node->orig, BATADV_TVLV_ROAM, 1,
4009 * @orig_node: the orig_node of the ogm
4017 struct batadv_orig_node *orig_node,
4022 u8 orig_ttvn = (u8)atomic_read(&orig_node->last_ttvn);
4029 &orig_node->capa_initialized);
4045 spin_lock_bh(&orig_node->tt_lock);
4047 batadv_tt_update_changes(bat_priv, orig_node, tt_num_changes,
4054 batadv_tt_global_update_crc(bat_priv, orig_node);
4056 spin_unlock_bh(&orig_node->tt_lock);
4067 if (!batadv_tt_global_check_crc(orig_node, tt_vlan,
4075 !batadv_tt_global_check_crc(orig_node, tt_vlan,
4080 orig_node->orig, ttvn, orig_ttvn,
4082 batadv_send_tt_request(bat_priv, orig_node, ttvn,
4145 * @orig_node: orig node which the temporary entry should be associated with
4152 struct batadv_orig_node *orig_node,
4162 if (!batadv_tt_global_add(bat_priv, orig_node, addr, vid,
4164 atomic_read(&orig_node->last_ttvn)))
4169 addr, batadv_print_vid(vid), orig_node->orig);
4218 * @orig: the orig_node of the ogm
4354 struct batadv_orig_node *orig_node = NULL;
4366 orig_node = batadv_orig_hash_find(bat_priv, src);
4367 if (!orig_node)
4377 batadv_tt_global_add(bat_priv, orig_node, roaming_adv->client,
4379 atomic_read(&orig_node->last_ttvn) + 1);
4382 if (orig_node)
4383 batadv_orig_node_put(orig_node);