Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
nu11secur1ty
GitHub Repository: nu11secur1ty/Kali-Linux
Path: blob/master/ALFA-W1F1/RTL8814AU/os_dep/linux/rtw_rhashtable.h
1307 views
1
/******************************************************************************
2
*
3
* Copyright(c) 2007 - 2017 Realtek Corporation.
4
*
5
* This program is free software; you can redistribute it and/or modify it
6
* under the terms of version 2 of the GNU General Public License as
7
* published by the Free Software Foundation.
8
*
9
* This program is distributed in the hope that it will be useful, but WITHOUT
10
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12
* more details.
13
*
14
*****************************************************************************/
15
#ifndef __RTW_RHASHTABLE_H__
16
#define __RTW_RHASHTABLE_H__
17
18
#ifdef CONFIG_RTW_MESH /* for now, only promised for kernel versions we support mesh */
19
20
/* directly reference rhashtable in kernel */
21
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0))
22
#include <linux/rhashtable.h>
23
#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0)) */
24
25
/* Use rhashtable from kernel 4.4 */
26
#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0))
27
#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 0, 0))
28
#define NULLS_MARKER(value) (1UL | (((long)value) << 1))
29
#endif
30
#include "rhashtable.h"
31
#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0)) */
32
33
typedef struct rhashtable rtw_rhashtable;
34
typedef struct rhash_head rtw_rhash_head;
35
typedef struct rhashtable_params rtw_rhashtable_params;
36
37
#define rtw_rhashtable_init(ht, params) rhashtable_init(ht, params)
38
39
typedef struct rhashtable_iter rtw_rhashtable_iter;
40
41
int rtw_rhashtable_walk_enter(rtw_rhashtable *ht, rtw_rhashtable_iter *iter);
42
#define rtw_rhashtable_walk_exit(iter) rhashtable_walk_exit(iter)
43
#define rtw_rhashtable_walk_start(iter) rhashtable_walk_start(iter)
44
#define rtw_rhashtable_walk_next(iter) rhashtable_walk_next(iter)
45
#define rtw_rhashtable_walk_stop(iter) rhashtable_walk_stop(iter)
46
47
#define rtw_rhashtable_free_and_destroy(ht, free_fn, arg) rhashtable_free_and_destroy((ht), (free_fn), (arg))
48
#define rtw_rhashtable_lookup_fast(ht, key, params) rhashtable_lookup_fast((ht), (key), (params))
49
#define rtw_rhashtable_lookup_insert_fast(ht, obj, params) rhashtable_lookup_insert_fast((ht), (obj), (params))
50
#define rtw_rhashtable_remove_fast(ht, obj, params) rhashtable_remove_fast((ht), (obj), (params))
51
52
#endif /* CONFIG_RTW_MESH */
53
54
#endif /* __RTW_RHASHTABLE_H__ */
55
56
57