aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
Diffstat (limited to 'include/net')
-rw-r--r--include/net/ieee80211.h9
-rw-r--r--include/net/ieee80211_crypt.h86
2 files changed, 89 insertions, 6 deletions
diff --git a/include/net/ieee80211.h b/include/net/ieee80211.h
index db09580ad14b..51a20b5f3b5d 100644
--- a/include/net/ieee80211.h
+++ b/include/net/ieee80211.h
@@ -20,9 +20,9 @@
20 */ 20 */
21#ifndef IEEE80211_H 21#ifndef IEEE80211_H
22#define IEEE80211_H 22#define IEEE80211_H
23
24#include <linux/if_ether.h> /* ETH_ALEN */ 23#include <linux/if_ether.h> /* ETH_ALEN */
25#include <linux/kernel.h> /* ARRAY_SIZE */ 24#include <linux/kernel.h> /* ARRAY_SIZE */
25#include <linux/wireless.h>
26 26
27#if WIRELESS_EXT < 17 27#if WIRELESS_EXT < 17
28#define IW_QUAL_QUAL_INVALID 0x10 28#define IW_QUAL_QUAL_INVALID 0x10
@@ -104,7 +104,7 @@ struct eapol {
104#define MAX_FRAG_THRESHOLD 2346U 104#define MAX_FRAG_THRESHOLD 2346U
105 105
106/* Frame control field constants */ 106/* Frame control field constants */
107#define IEEE80211_FCTL_VERS 0x0002 107#define IEEE80211_FCTL_VERS 0x0003
108#define IEEE80211_FCTL_FTYPE 0x000c 108#define IEEE80211_FCTL_FTYPE 0x000c
109#define IEEE80211_FCTL_STYPE 0x00f0 109#define IEEE80211_FCTL_STYPE 0x00f0
110#define IEEE80211_FCTL_TODS 0x0100 110#define IEEE80211_FCTL_TODS 0x0100
@@ -264,7 +264,7 @@ struct ieee80211_snap_hdr {
264 264
265#define WLAN_AUTH_CHALLENGE_LEN 128 265#define WLAN_AUTH_CHALLENGE_LEN 128
266 266
267#define WLAN_CAPABILITY_BSS (1<<0) 267#define WLAN_CAPABILITY_ESS (1<<0)
268#define WLAN_CAPABILITY_IBSS (1<<1) 268#define WLAN_CAPABILITY_IBSS (1<<1)
269#define WLAN_CAPABILITY_CF_POLLABLE (1<<2) 269#define WLAN_CAPABILITY_CF_POLLABLE (1<<2)
270#define WLAN_CAPABILITY_CF_POLL_REQUEST (1<<3) 270#define WLAN_CAPABILITY_CF_POLL_REQUEST (1<<3)
@@ -426,9 +426,7 @@ struct ieee80211_stats {
426 426
427struct ieee80211_device; 427struct ieee80211_device;
428 428
429#if 0 /* for later */
430#include "ieee80211_crypt.h" 429#include "ieee80211_crypt.h"
431#endif
432 430
433#define SEC_KEY_1 (1<<0) 431#define SEC_KEY_1 (1<<0)
434#define SEC_KEY_2 (1<<1) 432#define SEC_KEY_2 (1<<1)
@@ -852,5 +850,4 @@ static inline const char *escape_essid(const char *essid, u8 essid_len) {
852 *d = '\0'; 850 *d = '\0';
853 return escaped; 851 return escaped;
854} 852}
855
856#endif /* IEEE80211_H */ 853#endif /* IEEE80211_H */
diff --git a/include/net/ieee80211_crypt.h b/include/net/ieee80211_crypt.h
new file mode 100644
index 000000000000..b58a3bcc0dc0
--- /dev/null
+++ b/include/net/ieee80211_crypt.h
@@ -0,0 +1,86 @@
1/*
2 * Original code based on Host AP (software wireless LAN access point) driver
3 * for Intersil Prism2/2.5/3.
4 *
5 * Copyright (c) 2001-2002, SSH Communications Security Corp and Jouni Malinen
6 * <jkmaline@cc.hut.fi>
7 * Copyright (c) 2002-2003, Jouni Malinen <jkmaline@cc.hut.fi>
8 *
9 * Adaption to a generic IEEE 802.11 stack by James Ketrenos
10 * <jketreno@linux.intel.com>
11 *
12 * Copyright (c) 2004, Intel Corporation
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License version 2 as
16 * published by the Free Software Foundation. See README and COPYING for
17 * more details.
18 */
19
20/*
21 * This file defines the interface to the ieee80211 crypto module.
22 */
23#ifndef IEEE80211_CRYPT_H
24#define IEEE80211_CRYPT_H
25
26#include <linux/skbuff.h>
27
28struct ieee80211_crypto_ops {
29 const char *name;
30
31 /* init new crypto context (e.g., allocate private data space,
32 * select IV, etc.); returns NULL on failure or pointer to allocated
33 * private data on success */
34 void * (*init)(int keyidx);
35
36 /* deinitialize crypto context and free allocated private data */
37 void (*deinit)(void *priv);
38
39 /* encrypt/decrypt return < 0 on error or >= 0 on success. The return
40 * value from decrypt_mpdu is passed as the keyidx value for
41 * decrypt_msdu. skb must have enough head and tail room for the
42 * encryption; if not, error will be returned; these functions are
43 * called for all MPDUs (i.e., fragments).
44 */
45 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);
47
48 /* These functions are called for full MSDUs, i.e. full frames.
49 * These can be NULL if full MSDU operations are not needed. */
50 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,
52 void *priv);
53
54 int (*set_key)(void *key, int len, u8 *seq, void *priv);
55 int (*get_key)(void *key, int len, u8 *seq, void *priv);
56
57 /* procfs handler for printing out key information and possible
58 * statistics */
59 char * (*print_stats)(char *p, void *priv);
60
61 /* maximum number of bytes added by encryption; encrypt buf is
62 * allocated with extra_prefix_len bytes, copy of in_buf, and
63 * extra_postfix_len; encrypt need not use all this space, but
64 * the result must start at the beginning of the buffer and correct
65 * length must be returned */
66 int extra_prefix_len, extra_postfix_len;
67
68 struct module *owner;
69};
70
71struct ieee80211_crypt_data {
72 struct list_head list; /* delayed deletion list */
73 struct ieee80211_crypto_ops *ops;
74 void *priv;
75 atomic_t refcnt;
76};
77
78int ieee80211_register_crypto_ops(struct ieee80211_crypto_ops *ops);
79int ieee80211_unregister_crypto_ops(struct ieee80211_crypto_ops *ops);
80struct ieee80211_crypto_ops * ieee80211_get_crypto_ops(const char *name);
81void ieee80211_crypt_deinit_entries(struct ieee80211_device *, int);
82void ieee80211_crypt_deinit_handler(unsigned long);
83void ieee80211_crypt_delayed_deinit(struct ieee80211_device *ieee,
84 struct ieee80211_crypt_data **crypt);
85
86#endif