aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/ieee80211_crypt.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/ieee80211_crypt.h')
-rw-r--r--include/net/ieee80211_crypt.h38
1 files changed, 25 insertions, 13 deletions
diff --git a/include/net/ieee80211_crypt.h b/include/net/ieee80211_crypt.h
index b58a3bcc0dc0..0a1c2d82ca4b 100644
--- a/include/net/ieee80211_crypt.h
+++ b/include/net/ieee80211_crypt.h
@@ -25,16 +25,22 @@
25 25
26#include <linux/skbuff.h> 26#include <linux/skbuff.h>
27 27
28enum {
29 IEEE80211_CRYPTO_TKIP_COUNTERMEASURES = (1 << 0),
30};
31
28struct ieee80211_crypto_ops { 32struct ieee80211_crypto_ops {
29 const char *name; 33 const char *name;
30 34
31 /* init new crypto context (e.g., allocate private data space, 35 /* init new crypto context (e.g., allocate private data space,
32 * select IV, etc.); returns NULL on failure or pointer to allocated 36 * select IV, etc.); returns NULL on failure or pointer to allocated
33 * private data on success */ 37 * private data on success */
34 void * (*init)(int keyidx); 38 void *(*init) (int keyidx);
35 39
36 /* deinitialize crypto context and free allocated private data */ 40 /* deinitialize crypto context and free allocated private data */
37 void (*deinit)(void *priv); 41 void (*deinit) (void *priv);
42
43 int (*build_iv) (struct sk_buff * skb, int hdr_len, void *priv);
38 44
39 /* encrypt/decrypt return < 0 on error or >= 0 on success. The return 45 /* encrypt/decrypt return < 0 on error or >= 0 on success. The return
40 * value from decrypt_mpdu is passed as the keyidx value for 46 * value from decrypt_mpdu is passed as the keyidx value for
@@ -42,34 +48,39 @@ struct ieee80211_crypto_ops {
42 * encryption; if not, error will be returned; these functions are 48 * encryption; if not, error will be returned; these functions are
43 * called for all MPDUs (i.e., fragments). 49 * called for all MPDUs (i.e., fragments).
44 */ 50 */
45 int (*encrypt_mpdu)(struct sk_buff *skb, int hdr_len, void *priv); 51 int (*encrypt_mpdu) (struct sk_buff * skb, int hdr_len, void *priv);
46 int (*decrypt_mpdu)(struct sk_buff *skb, int hdr_len, void *priv); 52 int (*decrypt_mpdu) (struct sk_buff * skb, int hdr_len, void *priv);
47 53
48 /* These functions are called for full MSDUs, i.e. full frames. 54 /* These functions are called for full MSDUs, i.e. full frames.
49 * These can be NULL if full MSDU operations are not needed. */ 55 * These can be NULL if full MSDU operations are not needed. */
50 int (*encrypt_msdu)(struct sk_buff *skb, int hdr_len, void *priv); 56 int (*encrypt_msdu) (struct sk_buff * skb, int hdr_len, void *priv);
51 int (*decrypt_msdu)(struct sk_buff *skb, int keyidx, int hdr_len, 57 int (*decrypt_msdu) (struct sk_buff * skb, int keyidx, int hdr_len,
52 void *priv); 58 void *priv);
53 59
54 int (*set_key)(void *key, int len, u8 *seq, void *priv); 60 int (*set_key) (void *key, int len, u8 * seq, void *priv);
55 int (*get_key)(void *key, int len, u8 *seq, void *priv); 61 int (*get_key) (void *key, int len, u8 * seq, void *priv);
56 62
57 /* procfs handler for printing out key information and possible 63 /* procfs handler for printing out key information and possible
58 * statistics */ 64 * statistics */
59 char * (*print_stats)(char *p, void *priv); 65 char *(*print_stats) (char *p, void *priv);
66
67 /* Crypto specific flag get/set for configuration settings */
68 unsigned long (*get_flags) (void *priv);
69 unsigned long (*set_flags) (unsigned long flags, void *priv);
60 70
61 /* maximum number of bytes added by encryption; encrypt buf is 71 /* maximum number of bytes added by encryption; encrypt buf is
62 * allocated with extra_prefix_len bytes, copy of in_buf, and 72 * allocated with extra_prefix_len bytes, copy of in_buf, and
63 * extra_postfix_len; encrypt need not use all this space, but 73 * extra_postfix_len; encrypt need not use all this space, but
64 * the result must start at the beginning of the buffer and correct 74 * the result must start at the beginning of the buffer and correct
65 * length must be returned */ 75 * length must be returned */
66 int extra_prefix_len, extra_postfix_len; 76 int extra_mpdu_prefix_len, extra_mpdu_postfix_len;
77 int extra_msdu_prefix_len, extra_msdu_postfix_len;
67 78
68 struct module *owner; 79 struct module *owner;
69}; 80};
70 81
71struct ieee80211_crypt_data { 82struct ieee80211_crypt_data {
72 struct list_head list; /* delayed deletion list */ 83 struct list_head list; /* delayed deletion list */
73 struct ieee80211_crypto_ops *ops; 84 struct ieee80211_crypto_ops *ops;
74 void *priv; 85 void *priv;
75 atomic_t refcnt; 86 atomic_t refcnt;
@@ -77,10 +88,11 @@ struct ieee80211_crypt_data {
77 88
78int ieee80211_register_crypto_ops(struct ieee80211_crypto_ops *ops); 89int ieee80211_register_crypto_ops(struct ieee80211_crypto_ops *ops);
79int ieee80211_unregister_crypto_ops(struct ieee80211_crypto_ops *ops); 90int ieee80211_unregister_crypto_ops(struct ieee80211_crypto_ops *ops);
80struct ieee80211_crypto_ops * ieee80211_get_crypto_ops(const char *name); 91struct ieee80211_crypto_ops *ieee80211_get_crypto_ops(const char *name);
81void ieee80211_crypt_deinit_entries(struct ieee80211_device *, int); 92void ieee80211_crypt_deinit_entries(struct ieee80211_device *, int);
82void ieee80211_crypt_deinit_handler(unsigned long); 93void ieee80211_crypt_deinit_handler(unsigned long);
83void ieee80211_crypt_delayed_deinit(struct ieee80211_device *ieee, 94void ieee80211_crypt_delayed_deinit(struct ieee80211_device *ieee,
84 struct ieee80211_crypt_data **crypt); 95 struct ieee80211_crypt_data **crypt);
96void ieee80211_crypt_quiescing(struct ieee80211_device *ieee);
85 97
86#endif 98#endif