aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/tx.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2010-08-10 03:46:38 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-08-16 16:45:11 -0400
commit97359d1235eaf634fe706c9faa6e40181cc95fb8 (patch)
tree5799455c94622eaa6a4fb065bd3b5c350bb705e0 /net/mac80211/tx.c
parent915a824e30c503157c38115eb6a85f60bb653738 (diff)
mac80211: use cipher suite selectors
Currently, mac80211 translates the cfg80211 cipher suite selectors into ALG_* values. That isn't all too useful, and some drivers benefit from the distinction between WEP40 and WEP104 as well. Therefore, convert it all to use the cipher suite selectors. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Acked-by: Gertjan van Wingerde <gwingerde@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/tx.c')
-rw-r--r--net/mac80211/tx.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index c54db966926b..bc4fefc91663 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -543,15 +543,16 @@ ieee80211_tx_h_select_key(struct ieee80211_tx_data *tx)
543 tx->key->tx_rx_count++; 543 tx->key->tx_rx_count++;
544 /* TODO: add threshold stuff again */ 544 /* TODO: add threshold stuff again */
545 545
546 switch (tx->key->conf.alg) { 546 switch (tx->key->conf.cipher) {
547 case ALG_WEP: 547 case WLAN_CIPHER_SUITE_WEP40:
548 case WLAN_CIPHER_SUITE_WEP104:
548 if (ieee80211_is_auth(hdr->frame_control)) 549 if (ieee80211_is_auth(hdr->frame_control))
549 break; 550 break;
550 case ALG_TKIP: 551 case WLAN_CIPHER_SUITE_TKIP:
551 if (!ieee80211_is_data_present(hdr->frame_control)) 552 if (!ieee80211_is_data_present(hdr->frame_control))
552 tx->key = NULL; 553 tx->key = NULL;
553 break; 554 break;
554 case ALG_CCMP: 555 case WLAN_CIPHER_SUITE_CCMP:
555 if (!ieee80211_is_data_present(hdr->frame_control) && 556 if (!ieee80211_is_data_present(hdr->frame_control) &&
556 !ieee80211_use_mfp(hdr->frame_control, tx->sta, 557 !ieee80211_use_mfp(hdr->frame_control, tx->sta,
557 tx->skb)) 558 tx->skb))
@@ -561,7 +562,7 @@ ieee80211_tx_h_select_key(struct ieee80211_tx_data *tx)
561 IEEE80211_KEY_FLAG_SW_MGMT) && 562 IEEE80211_KEY_FLAG_SW_MGMT) &&
562 ieee80211_is_mgmt(hdr->frame_control); 563 ieee80211_is_mgmt(hdr->frame_control);
563 break; 564 break;
564 case ALG_AES_CMAC: 565 case WLAN_CIPHER_SUITE_AES_CMAC:
565 if (!ieee80211_is_mgmt(hdr->frame_control)) 566 if (!ieee80211_is_mgmt(hdr->frame_control))
566 tx->key = NULL; 567 tx->key = NULL;
567 break; 568 break;
@@ -949,14 +950,15 @@ ieee80211_tx_h_encrypt(struct ieee80211_tx_data *tx)
949 if (!tx->key) 950 if (!tx->key)
950 return TX_CONTINUE; 951 return TX_CONTINUE;
951 952
952 switch (tx->key->conf.alg) { 953 switch (tx->key->conf.cipher) {
953 case ALG_WEP: 954 case WLAN_CIPHER_SUITE_WEP40:
955 case WLAN_CIPHER_SUITE_WEP104:
954 return ieee80211_crypto_wep_encrypt(tx); 956 return ieee80211_crypto_wep_encrypt(tx);
955 case ALG_TKIP: 957 case WLAN_CIPHER_SUITE_TKIP:
956 return ieee80211_crypto_tkip_encrypt(tx); 958 return ieee80211_crypto_tkip_encrypt(tx);
957 case ALG_CCMP: 959 case WLAN_CIPHER_SUITE_CCMP:
958 return ieee80211_crypto_ccmp_encrypt(tx); 960 return ieee80211_crypto_ccmp_encrypt(tx);
959 case ALG_AES_CMAC: 961 case WLAN_CIPHER_SUITE_AES_CMAC:
960 return ieee80211_crypto_aes_cmac_encrypt(tx); 962 return ieee80211_crypto_aes_cmac_encrypt(tx);
961 } 963 }
962 964