aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/p54/txrx.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/p54/txrx.c')
-rw-r--r--drivers/net/wireless/p54/txrx.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/net/wireless/p54/txrx.c b/drivers/net/wireless/p54/txrx.c
index 173aec3d6e7e..34447d1ad80d 100644
--- a/drivers/net/wireless/p54/txrx.c
+++ b/drivers/net/wireless/p54/txrx.c
@@ -683,14 +683,15 @@ static void p54_tx_80211_header(struct p54_common *priv, struct sk_buff *skb,
683 } 683 }
684} 684}
685 685
686static u8 p54_convert_algo(enum ieee80211_key_alg alg) 686static u8 p54_convert_algo(u32 cipher)
687{ 687{
688 switch (alg) { 688 switch (cipher) {
689 case ALG_WEP: 689 case WLAN_CIPHER_SUITE_WEP40:
690 case WLAN_CIPHER_SUITE_WEP104:
690 return P54_CRYPTO_WEP; 691 return P54_CRYPTO_WEP;
691 case ALG_TKIP: 692 case WLAN_CIPHER_SUITE_TKIP:
692 return P54_CRYPTO_TKIPMICHAEL; 693 return P54_CRYPTO_TKIPMICHAEL;
693 case ALG_CCMP: 694 case WLAN_CIPHER_SUITE_CCMP:
694 return P54_CRYPTO_AESCCMP; 695 return P54_CRYPTO_AESCCMP;
695 default: 696 default:
696 return 0; 697 return 0;
@@ -731,7 +732,7 @@ int p54_tx_80211(struct ieee80211_hw *dev, struct sk_buff *skb)
731 732
732 if (info->control.hw_key) { 733 if (info->control.hw_key) {
733 crypt_offset = ieee80211_get_hdrlen_from_skb(skb); 734 crypt_offset = ieee80211_get_hdrlen_from_skb(skb);
734 if (info->control.hw_key->alg == ALG_TKIP) { 735 if (info->control.hw_key->cipher == WLAN_CIPHER_SUITE_TKIP) {
735 u8 *iv = (u8 *)(skb->data + crypt_offset); 736 u8 *iv = (u8 *)(skb->data + crypt_offset);
736 /* 737 /*
737 * The firmware excepts that the IV has to have 738 * The firmware excepts that the IV has to have
@@ -827,10 +828,10 @@ int p54_tx_80211(struct ieee80211_hw *dev, struct sk_buff *skb)
827 hdr->tries = ridx; 828 hdr->tries = ridx;
828 txhdr->rts_rate_idx = 0; 829 txhdr->rts_rate_idx = 0;
829 if (info->control.hw_key) { 830 if (info->control.hw_key) {
830 txhdr->key_type = p54_convert_algo(info->control.hw_key->alg); 831 txhdr->key_type = p54_convert_algo(info->control.hw_key->cipher);
831 txhdr->key_len = min((u8)16, info->control.hw_key->keylen); 832 txhdr->key_len = min((u8)16, info->control.hw_key->keylen);
832 memcpy(txhdr->key, info->control.hw_key->key, txhdr->key_len); 833 memcpy(txhdr->key, info->control.hw_key->key, txhdr->key_len);
833 if (info->control.hw_key->alg == ALG_TKIP) { 834 if (info->control.hw_key->cipher == WLAN_CIPHER_SUITE_TKIP) {
834 /* reserve space for the MIC key */ 835 /* reserve space for the MIC key */
835 len += 8; 836 len += 8;
836 memcpy(skb_put(skb, 8), &(info->control.hw_key->key 837 memcpy(skb_put(skb, 8), &(info->control.hw_key->key