diff options
author | Paul Gortmaker <paul.gortmaker@windriver.com> | 2015-04-27 01:25:36 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-05-08 09:24:13 +0200 |
commit | 5c2918a5ba83c3805f96490de07aee36c16a27b6 (patch) | |
tree | 6a19ccd22935511ace13a926a5565d43d471943b /drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c | |
parent | rtl8712: don't duplicate ieee80211 constants for status/reason (diff) | |
download | linux-dev-5c2918a5ba83c3805f96490de07aee36c16a27b6.tar.xz linux-dev-5c2918a5ba83c3805f96490de07aee36c16a27b6.zip |
rtl8192u: don't trample on <linux/ieee80211.h> struct namespace
In order to start reducing the duplicated code/constants/macros in this
driver, we need to include <linux/ieee80211.h> to provide the defacto
versions. However this driver has structs with the same name as the
ones in the main include, so namespace collision prevents us from doing
step #1.
Since the structs actually differ in their respective fields, we can't
simply delete the local ones without impacting the runtime; a conversion
to use the global ones can be considered at a later date if desired.
Rename the ones here with a vendor specific prefix so that we won't have
the namespace collision, and hence can continue on with the cleanup.
Automated conversion done with:
for i in `find . -name '*.[ch]'` ; do \
sed -i 's/struct ieee80211_hdr/struct rtl_80211_hdr/g' $i ; \
done
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c')
-rw-r--r-- | drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c index e815c81b45dc..1f80c52a49c4 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c @@ -306,7 +306,7 @@ static int ieee80211_tkip_encrypt(struct sk_buff *skb, int hdr_len, void *priv) struct ieee80211_tkip_data *tkey = priv; int len; u8 *pos; - struct ieee80211_hdr_4addr *hdr; + struct rtl_80211_hdr_4addr *hdr; cb_desc *tcb_desc = (cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE); struct blkcipher_desc desc = {.tfm = tkey->tx_tfm_arc4}; int ret = 0; @@ -318,7 +318,7 @@ static int ieee80211_tkip_encrypt(struct sk_buff *skb, int hdr_len, void *priv) skb->len < hdr_len) return -1; - hdr = (struct ieee80211_hdr_4addr *) skb->data; + hdr = (struct rtl_80211_hdr_4addr *) skb->data; if (!tcb_desc->bHwSec) { @@ -390,7 +390,7 @@ static int ieee80211_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv) u8 keyidx, *pos; u32 iv32; u16 iv16; - struct ieee80211_hdr_4addr *hdr; + struct rtl_80211_hdr_4addr *hdr; cb_desc *tcb_desc = (cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE); struct blkcipher_desc desc = {.tfm = tkey->rx_tfm_arc4}; u8 rc4key[16]; @@ -401,7 +401,7 @@ static int ieee80211_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv) if (skb->len < hdr_len + 8 + 4) return -1; - hdr = (struct ieee80211_hdr_4addr *) skb->data; + hdr = (struct rtl_80211_hdr_4addr *) skb->data; pos = skb->data + hdr_len; keyidx = pos[3]; if (!(keyidx & (1 << 5))) { @@ -523,9 +523,9 @@ static int michael_mic(struct crypto_hash *tfm_michael, u8 *key, u8 *hdr, static void michael_mic_hdr(struct sk_buff *skb, u8 *hdr) { - struct ieee80211_hdr_4addr *hdr11; + struct rtl_80211_hdr_4addr *hdr11; - hdr11 = (struct ieee80211_hdr_4addr *) skb->data; + hdr11 = (struct rtl_80211_hdr_4addr *) skb->data; switch (le16_to_cpu(hdr11->frame_ctl) & (IEEE80211_FCTL_FROMDS | IEEE80211_FCTL_TODS)) { case IEEE80211_FCTL_TODS: @@ -556,9 +556,9 @@ static int ieee80211_michael_mic_add(struct sk_buff *skb, int hdr_len, void *pri { struct ieee80211_tkip_data *tkey = priv; u8 *pos; - struct ieee80211_hdr_4addr *hdr; + struct rtl_80211_hdr_4addr *hdr; - hdr = (struct ieee80211_hdr_4addr *) skb->data; + hdr = (struct rtl_80211_hdr_4addr *) skb->data; if (skb_tailroom(skb) < 8 || skb->len < hdr_len) { printk(KERN_DEBUG "Invalid packet for Michael MIC add " @@ -585,7 +585,7 @@ static int ieee80211_michael_mic_add(struct sk_buff *skb, int hdr_len, void *pri } static void ieee80211_michael_mic_failure(struct net_device *dev, - struct ieee80211_hdr_4addr *hdr, + struct rtl_80211_hdr_4addr *hdr, int keyidx) { union iwreq_data wrqu; @@ -610,9 +610,9 @@ static int ieee80211_michael_mic_verify(struct sk_buff *skb, int keyidx, { struct ieee80211_tkip_data *tkey = priv; u8 mic[8]; - struct ieee80211_hdr_4addr *hdr; + struct rtl_80211_hdr_4addr *hdr; - hdr = (struct ieee80211_hdr_4addr *) skb->data; + hdr = (struct rtl_80211_hdr_4addr *) skb->data; if (!tkey->key_set) return -1; @@ -629,8 +629,8 @@ static int ieee80211_michael_mic_verify(struct sk_buff *skb, int keyidx, skb->data + hdr_len, skb->len - 8 - hdr_len, mic)) return -1; if (memcmp(mic, skb->data + skb->len - 8, 8) != 0) { - struct ieee80211_hdr_4addr *hdr; - hdr = (struct ieee80211_hdr_4addr *) skb->data; + struct rtl_80211_hdr_4addr *hdr; + hdr = (struct rtl_80211_hdr_4addr *) skb->data; printk(KERN_DEBUG "%s: Michael MIC verification failed for " "MSDU from %pM keyidx=%d\n", skb->dev ? skb->dev->name : "N/A", hdr->addr2, |