diff options
Diffstat (limited to 'drivers/staging/rtl8192e/rtllib_crypt_tkip.c')
-rw-r--r-- | drivers/staging/rtl8192e/rtllib_crypt_tkip.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/drivers/staging/rtl8192e/rtllib_crypt_tkip.c b/drivers/staging/rtl8192e/rtllib_crypt_tkip.c index 9fdfcc017e..0244b524a7 100644 --- a/drivers/staging/rtl8192e/rtllib_crypt_tkip.c +++ b/drivers/staging/rtl8192e/rtllib_crypt_tkip.c @@ -255,7 +255,7 @@ static int rtllib_tkip_encrypt(struct sk_buff *skb, int hdr_len, void *priv) struct rtllib_tkip_data *tkey = priv; int len; u8 *pos; - struct rtllib_hdr_4addr *hdr; + struct ieee80211_hdr *hdr; struct cb_desc *tcb_desc = (struct cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE); int ret = 0; @@ -266,7 +266,7 @@ static int rtllib_tkip_encrypt(struct sk_buff *skb, int hdr_len, void *priv) skb->len < hdr_len) return -1; - hdr = (struct rtllib_hdr_4addr *)skb->data; + hdr = (struct ieee80211_hdr *)skb->data; if (!tcb_desc->bHwSec) { if (!tkey->tx_phase1_done) { @@ -330,7 +330,7 @@ static int rtllib_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv) u8 keyidx, *pos; u32 iv32; u16 iv16; - struct rtllib_hdr_4addr *hdr; + struct ieee80211_hdr *hdr; struct cb_desc *tcb_desc = (struct cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE); u8 rc4key[16]; @@ -341,7 +341,7 @@ static int rtllib_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv) if (skb->len < hdr_len + 8 + 4) return -1; - hdr = (struct rtllib_hdr_4addr *)skb->data; + hdr = (struct ieee80211_hdr *)skb->data; pos = skb->data + hdr_len; keyidx = pos[3]; if (!(keyidx & (1 << 5))) { @@ -465,20 +465,20 @@ out: static void michael_mic_hdr(struct sk_buff *skb, u8 *hdr) { - struct rtllib_hdr_4addr *hdr11; + struct ieee80211_hdr *hdr11; - hdr11 = (struct rtllib_hdr_4addr *)skb->data; - switch (le16_to_cpu(hdr11->frame_ctl) & - (RTLLIB_FCTL_FROMDS | RTLLIB_FCTL_TODS)) { - case RTLLIB_FCTL_TODS: + hdr11 = (struct ieee80211_hdr *)skb->data; + switch (le16_to_cpu(hdr11->frame_control) & + (IEEE80211_FCTL_FROMDS | IEEE80211_FCTL_TODS)) { + case IEEE80211_FCTL_TODS: ether_addr_copy(hdr, hdr11->addr3); /* DA */ ether_addr_copy(hdr + ETH_ALEN, hdr11->addr2); /* SA */ break; - case RTLLIB_FCTL_FROMDS: + case IEEE80211_FCTL_FROMDS: ether_addr_copy(hdr, hdr11->addr1); /* DA */ ether_addr_copy(hdr + ETH_ALEN, hdr11->addr3); /* SA */ break; - case RTLLIB_FCTL_FROMDS | RTLLIB_FCTL_TODS: + case IEEE80211_FCTL_FROMDS | IEEE80211_FCTL_TODS: ether_addr_copy(hdr, hdr11->addr3); /* DA */ ether_addr_copy(hdr + ETH_ALEN, hdr11->addr4); /* SA */ break; @@ -501,9 +501,9 @@ static int rtllib_michael_mic_add(struct sk_buff *skb, int hdr_len, void *priv) { struct rtllib_tkip_data *tkey = priv; u8 *pos; - struct rtllib_hdr_4addr *hdr; + struct ieee80211_hdr *hdr; - hdr = (struct rtllib_hdr_4addr *)skb->data; + hdr = (struct ieee80211_hdr *)skb->data; if (skb_tailroom(skb) < 8 || skb->len < hdr_len) { netdev_dbg(skb->dev, @@ -514,7 +514,7 @@ static int rtllib_michael_mic_add(struct sk_buff *skb, int hdr_len, void *priv) michael_mic_hdr(skb, tkey->tx_hdr); - if (RTLLIB_QOS_HAS_SEQ(le16_to_cpu(hdr->frame_ctl))) + if (RTLLIB_QOS_HAS_SEQ(le16_to_cpu(hdr->frame_control))) tkey->tx_hdr[12] = *(skb->data + hdr_len - 2) & 0x07; pos = skb_put(skb, 8); if (michael_mic(tkey->tx_tfm_michael, &tkey->key[16], tkey->tx_hdr, @@ -525,7 +525,7 @@ static int rtllib_michael_mic_add(struct sk_buff *skb, int hdr_len, void *priv) } static void rtllib_michael_mic_failure(struct net_device *dev, - struct rtllib_hdr_4addr *hdr, + struct ieee80211_hdr *hdr, int keyidx) { union iwreq_data wrqu; @@ -550,15 +550,15 @@ static int rtllib_michael_mic_verify(struct sk_buff *skb, int keyidx, { struct rtllib_tkip_data *tkey = priv; u8 mic[8]; - struct rtllib_hdr_4addr *hdr; + struct ieee80211_hdr *hdr; - hdr = (struct rtllib_hdr_4addr *)skb->data; + hdr = (struct ieee80211_hdr *)skb->data; if (!tkey->key_set) return -1; michael_mic_hdr(skb, tkey->rx_hdr); - if (RTLLIB_QOS_HAS_SEQ(le16_to_cpu(hdr->frame_ctl))) + if (RTLLIB_QOS_HAS_SEQ(le16_to_cpu(hdr->frame_control))) tkey->rx_hdr[12] = *(skb->data + hdr_len - 2) & 0x07; if (michael_mic(tkey->rx_tfm_michael, &tkey->key[24], tkey->rx_hdr, @@ -566,9 +566,9 @@ static int rtllib_michael_mic_verify(struct sk_buff *skb, int keyidx, return -1; if (memcmp(mic, skb->data + skb->len - 8, 8) != 0) { - struct rtllib_hdr_4addr *hdr; + struct ieee80211_hdr *hdr; - hdr = (struct rtllib_hdr_4addr *)skb->data; + hdr = (struct ieee80211_hdr *)skb->data; netdev_dbg(skb->dev, "Michael MIC verification failed for MSDU from %pM keyidx=%d\n", hdr->addr2, keyidx); |