summaryrefslogtreecommitdiffstats
path: root/sys/net80211/ieee80211_crypto_tkip.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/net80211/ieee80211_crypto_tkip.c')
-rw-r--r--sys/net80211/ieee80211_crypto_tkip.c38
1 files changed, 5 insertions, 33 deletions
diff --git a/sys/net80211/ieee80211_crypto_tkip.c b/sys/net80211/ieee80211_crypto_tkip.c
index 05c1532..327306a 100644
--- a/sys/net80211/ieee80211_crypto_tkip.c
+++ b/sys/net80211/ieee80211_crypto_tkip.c
@@ -52,7 +52,7 @@ __FBSDID("$FreeBSD$");
static void *tkip_attach(struct ieee80211com *, struct ieee80211_key *);
static void tkip_detach(struct ieee80211_key *);
static int tkip_setkey(struct ieee80211_key *);
-static int tkip_encap(struct ieee80211_key *, struct mbuf *m, u_int8_t keyid);
+static int tkip_encap(struct ieee80211_key *, struct mbuf *m, uint8_t keyid);
static int tkip_enmic(struct ieee80211_key *, struct mbuf *, int);
static int tkip_decap(struct ieee80211_key *, struct mbuf *, int);
static int tkip_demic(struct ieee80211_key *, struct mbuf *, int);
@@ -150,11 +150,11 @@ tkip_setkey(struct ieee80211_key *k)
* Add privacy headers and do any s/w encryption required.
*/
static int
-tkip_encap(struct ieee80211_key *k, struct mbuf *m, u_int8_t keyid)
+tkip_encap(struct ieee80211_key *k, struct mbuf *m, uint8_t keyid)
{
struct tkip_ctx *ctx = k->wk_private;
struct ieee80211com *ic = ctx->tc_ic;
- u_int8_t *ivp;
+ uint8_t *ivp;
int hdrlen;
/*
@@ -179,7 +179,7 @@ tkip_encap(struct ieee80211_key *k, struct mbuf *m, u_int8_t keyid)
M_PREPEND(m, tkip.ic_header, M_NOWAIT);
if (m == NULL)
return 0;
- ivp = mtod(m, u_int8_t *);
+ ivp = mtod(m, uint8_t *);
memmove(ivp, ivp + tkip.ic_header, hdrlen);
ivp += hdrlen;
@@ -970,32 +970,4 @@ tkip_decrypt(struct tkip_ctx *ctx, struct ieee80211_key *key,
/*
* Module glue.
*/
-static int
-tkip_modevent(module_t mod, int type, void *unused)
-{
- switch (type) {
- case MOD_LOAD:
- ieee80211_crypto_register(&tkip);
- return 0;
- case MOD_UNLOAD:
- case MOD_QUIESCE:
- if (nrefs) {
- printf("wlan_tkip: still in use (%u dynamic refs)\n",
- nrefs);
- return EBUSY;
- }
- if (type == MOD_UNLOAD)
- ieee80211_crypto_unregister(&tkip);
- return 0;
- }
- return EINVAL;
-}
-
-static moduledata_t tkip_mod = {
- "wlan_tkip",
- tkip_modevent,
- 0
-};
-DECLARE_MODULE(wlan_tkip, tkip_mod, SI_SUB_DRIVERS, SI_ORDER_FIRST);
-MODULE_VERSION(wlan_tkip, 1);
-MODULE_DEPEND(wlan_tkip, wlan, 1, 1, 1);
+IEEE80211_CRYPTO_MODULE(tkip, 1);
OpenPOWER on IntegriCloud