aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/ieee80211.c
diff options
context:
space:
mode:
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 @@
33#include "ieee80211_cfg.h" 33#include "ieee80211_cfg.h"
34#include "debugfs.h" 34#include "debugfs.h"
35#include "debugfs_netdev.h" 35#include "debugfs_netdev.h"
36#include "debugfs_key.h"
37 36
38/* privid for wiphys to determine whether they belong to us or not */ 37/* privid for wiphys to determine whether they belong to us or not */
39void *mac80211_wiphy_privid = &mac80211_wiphy_privid; 38void *mac80211_wiphy_privid = &mac80211_wiphy_privid;
@@ -63,61 +62,6 @@ struct ieee80211_tx_status_rtap_hdr {
63} __attribute__ ((packed)); 62} __attribute__ ((packed));
64 63
65 64
66struct ieee80211_key_conf *
67ieee80211_key_data2conf(struct ieee80211_local *local,
68 const struct ieee80211_key *data)
69{
70 struct ieee80211_key_conf *conf;
71
72 conf = kmalloc(sizeof(*conf) + data->keylen, GFP_ATOMIC);
73 if (!conf)
74 return NULL;
75
76 conf->hw_key_idx = data->hw_key_idx;
77 conf->alg = data->alg;
78 conf->keylen = data->keylen;
79 conf->flags = 0;
80 if (data->force_sw_encrypt)
81 conf->flags |= IEEE80211_KEY_FORCE_SW_ENCRYPT;
82 conf->keyidx = data->keyidx;
83 if (data->default_tx_key)
84 conf->flags |= IEEE80211_KEY_DEFAULT_TX_KEY;
85 if (local->default_wep_only)
86 conf->flags |= IEEE80211_KEY_DEFAULT_WEP_ONLY;
87 memcpy(conf->key, data->key, data->keylen);
88
89 return conf;
90}
91
92struct ieee80211_key *ieee80211_key_alloc(struct ieee80211_sub_if_data *sdata,
93 int idx, size_t key_len, gfp_t flags)
94{
95 struct ieee80211_key *key;
96
97 key = kzalloc(sizeof(struct ieee80211_key) + key_len, flags);
98 if (!key)
99 return NULL;
100 kref_init(&key->kref);
101 return key;
102}
103
104static void ieee80211_key_release(struct kref *kref)
105{
106 struct ieee80211_key *key;
107
108 key = container_of(kref, struct ieee80211_key, kref);
109 if (key->alg == ALG_CCMP)
110 ieee80211_aes_key_free(key->u.ccmp.tfm);
111 ieee80211_debugfs_key_remove(key);
112 kfree(key);
113}
114
115void ieee80211_key_free(struct ieee80211_key *key)
116{
117 if (key)
118 kref_put(&key->kref, ieee80211_key_release);
119}
120
121static int rate_list_match(const int *rate_list, int rate) 65static int rate_list_match(const int *rate_list, int rate)
122{ 66{
123 int i; 67 int i;