Lines Matching refs:hash
40 #include "hash.h"
130 * batadv_nc_mesh_init() - initialise coding hash table and start housekeeping
390 * batadv_nc_purge_orig_hash() - traverse entire originator hash to check if
396 struct batadv_hashtable *hash = bat_priv->orig_hash;
401 if (!hash)
405 for (i = 0; i < hash->size; i++) {
406 head = &hash->table[i];
417 * batadv_nc_purge_paths() - traverse all nc paths part of the hash and remove
420 * @hash: hash table containing the nc paths to check
427 struct batadv_hashtable *hash,
434 spinlock_t *lock; /* Protects lists in hash */
437 for (i = 0; i < hash->size; i++) {
438 head = &hash->table[i];
439 lock = &hash->list_locks[i];
476 * batadv_nc_hash_key_gen() - computes the nc_path hash key
477 * @key: buffer to hold the final hash key
478 * @src: source ethernet mac address going into the hash key
479 * @dst: destination ethernet mac address going into the hash key
489 * batadv_nc_hash_choose() - compute the hash value for an nc path
490 * @data: data to hash
491 * @size: size of the hash table
493 * Return: the selected index in the hash table for the given data.
498 u32 hash = 0;
500 hash = jhash(&nc_path->prev_hop, sizeof(nc_path->prev_hop), hash);
501 hash = jhash(&nc_path->next_hop, sizeof(nc_path->next_hop), hash);
503 return hash % size;
507 * batadv_nc_hash_compare() - comparing function used in the network coding hash
534 * @hash: hash table containing the nc path
540 batadv_nc_hash_find(struct batadv_hashtable *hash,
547 if (!hash)
550 index = batadv_nc_hash_choose(data, hash->size);
551 head = &hash->table[index];
661 * @hash: to be processed hash table
668 struct batadv_hashtable *hash,
679 if (!hash)
682 /* Loop hash table bins */
683 for (i = 0; i < hash->size; i++) {
684 head = &hash->table[i];
944 * @hash: hash table containing the nc path
952 struct batadv_hashtable *hash,
962 nc_path = batadv_nc_hash_find(hash, (void *)&nc_path_key);
988 /* Add nc_path to hash table */
990 hash_added = batadv_hash_add(hash, batadv_nc_hash_compare,
1266 struct batadv_hashtable *hash = bat_priv->nc.coding_hash;
1269 if (!hash)
1275 idx = batadv_nc_hash_choose(&nc_path_key, hash->size);
1279 hlist_for_each_entry_rcu(nc_path, &hash->table[idx], hash_entry) {
1733 struct batadv_hashtable *hash = bat_priv->nc.decoding_hash;
1740 if (!hash)
1754 index = batadv_nc_hash_choose(&nc_path_key, hash->size);
1758 hlist_for_each_entry_rcu(nc_path, &hash->table[index], hash_entry) {