summaryrefslogtreecommitdiff
path: root/net/mac80211/ieee80211.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2007-07-27 17:43:23 +0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-11 03:47:34 +0400
commit1f5a7e47ae58cc23c623c09f1c9d97b7a8cf6344 (patch)
treebccb233ff41737569c0dd397d80405f5402aafa5 /net/mac80211/ieee80211.c
parent75c35aa4e2931b22e8e95fa2d6380eebac229f30 (diff)
downloadlinux-1f5a7e47ae58cc23c623c09f1c9d97b7a8cf6344.tar.xz
[MAC80211]: split out some key functions from ieee80211.c
into a new file key.c which doesn't have much code right now but it makes ieee80211.c easier to read. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Jiri Benc <jbenc@suse.cz> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/ieee80211.c')
-rw-r--r--net/mac80211/ieee80211.c56
1 files changed, 0 insertions, 56 deletions
diff --git a/net/mac80211/ieee80211.c b/net/mac80211/ieee80211.c
index 02fb00ec2ed3..f20e647552ec 100644
--- a/net/mac80211/ieee80211.c
+++ b/net/mac80211/ieee80211.c
@@ -33,7 +33,6 @@
#include "ieee80211_cfg.h"
#include "debugfs.h"
#include "debugfs_netdev.h"
-#include "debugfs_key.h"
/* privid for wiphys to determine whether they belong to us or not */
void *mac80211_wiphy_privid = &mac80211_wiphy_privid;
@@ -63,61 +62,6 @@ struct ieee80211_tx_status_rtap_hdr {
} __attribute__ ((packed));
-struct ieee80211_key_conf *
-ieee80211_key_data2conf(struct ieee80211_local *local,
- const struct ieee80211_key *data)
-{
- struct ieee80211_key_conf *conf;
-
- conf = kmalloc(sizeof(*conf) + data->keylen, GFP_ATOMIC);
- if (!conf)
- return NULL;
-
- conf->hw_key_idx = data->hw_key_idx;
- conf->alg = data->alg;
- conf->keylen = data->keylen;
- conf->flags = 0;
- if (data->force_sw_encrypt)
- conf->flags |= IEEE80211_KEY_FORCE_SW_ENCRYPT;
- conf->keyidx = data->keyidx;
- if (data->default_tx_key)
- conf->flags |= IEEE80211_KEY_DEFAULT_TX_KEY;
- if (local->default_wep_only)
- conf->flags |= IEEE80211_KEY_DEFAULT_WEP_ONLY;
- memcpy(conf->key, data->key, data->keylen);
-
- return conf;
-}
-
-struct ieee80211_key *ieee80211_key_alloc(struct ieee80211_sub_if_data *sdata,
- int idx, size_t key_len, gfp_t flags)
-{
- struct ieee80211_key *key;
-
- key = kzalloc(sizeof(struct ieee80211_key) + key_len, flags);
- if (!key)
- return NULL;
- kref_init(&key->kref);
- return key;
-}
-
-static void ieee80211_key_release(struct kref *kref)
-{
- struct ieee80211_key *key;
-
- key = container_of(kref, struct ieee80211_key, kref);
- if (key->alg == ALG_CCMP)
- ieee80211_aes_key_free(key->u.ccmp.tfm);
- ieee80211_debugfs_key_remove(key);
- kfree(key);
-}
-
-void ieee80211_key_free(struct ieee80211_key *key)
-{
- if (key)
- kref_put(&key->kref, ieee80211_key_release);
-}
-
static int rate_list_match(const int *rate_list, int rate)
{
int i;