1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23#ifndef IEEE80211_CRYPT_H
24#define IEEE80211_CRYPT_H
25
26#include <linux/types.h>
27#include <linux/list.h>
28#include <net/ieee80211.h>
29#include <asm/atomic.h>
30
31enum {
32 IEEE80211_CRYPTO_TKIP_COUNTERMEASURES = (1 << 0),
33};
34
35struct sk_buff;
36struct module;
37
38struct ieee80211_crypto_ops {
39 const char *name;
40 struct list_head list;
41
42
43
44
45 void *(*init) (int keyidx);
46
47
48 void (*deinit) (void *priv);
49
50 int (*build_iv) (struct sk_buff * skb, int hdr_len,
51 u8 *key, int keylen, void *priv);
52
53
54
55
56
57
58
59 int (*encrypt_mpdu) (struct sk_buff * skb, int hdr_len, void *priv);
60 int (*decrypt_mpdu) (struct sk_buff * skb, int hdr_len, void *priv);
61
62
63
64 int (*encrypt_msdu) (struct sk_buff * skb, int hdr_len, void *priv);
65 int (*decrypt_msdu) (struct sk_buff * skb, int keyidx, int hdr_len,
66 void *priv);
67
68 int (*set_key) (void *key, int len, u8 * seq, void *priv);
69 int (*get_key) (void *key, int len, u8 * seq, void *priv);
70
71
72
73 char *(*print_stats) (char *p, void *priv);
74
75
76 unsigned long (*get_flags) (void *priv);
77 unsigned long (*set_flags) (unsigned long flags, void *priv);
78
79
80
81
82
83
84 int extra_mpdu_prefix_len, extra_mpdu_postfix_len;
85 int extra_msdu_prefix_len, extra_msdu_postfix_len;
86
87 struct module *owner;
88};
89
90struct ieee80211_crypt_data {
91 struct list_head list;
92 struct ieee80211_crypto_ops *ops;
93 void *priv;
94 atomic_t refcnt;
95};
96
97struct ieee80211_device;
98
99int ieee80211_register_crypto_ops(struct ieee80211_crypto_ops *ops);
100int ieee80211_unregister_crypto_ops(struct ieee80211_crypto_ops *ops);
101struct ieee80211_crypto_ops *ieee80211_get_crypto_ops(const char *name);
102void ieee80211_crypt_deinit_entries(struct ieee80211_device *, int);
103void ieee80211_crypt_deinit_handler(unsigned long);
104void ieee80211_crypt_delayed_deinit(struct ieee80211_device *ieee,
105 struct ieee80211_crypt_data **crypt);
106void ieee80211_crypt_quiescing(struct ieee80211_device *ieee);
107
108#endif
109