aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/rx.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/rx.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/rx.c')
-rw-r--r--net/mac80211/rx.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index f24a0a1cff1..ad2427021b2 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -961,7 +961,8 @@ ieee80211_rx_h_decrypt(struct ieee80211_rx_data *rx)
961 * pairwise or station-to-station keys, but for WEP we allow 961 * pairwise or station-to-station keys, but for WEP we allow
962 * using a key index as well. 962 * using a key index as well.
963 */ 963 */
964 if (rx->key && rx->key->conf.alg != ALG_WEP && 964 if (rx->key && rx->key->conf.cipher != WLAN_CIPHER_SUITE_WEP40 &&
965 rx->key->conf.cipher != WLAN_CIPHER_SUITE_WEP104 &&
965 !is_multicast_ether_addr(hdr->addr1)) 966 !is_multicast_ether_addr(hdr->addr1))
966 rx->key = NULL; 967 rx->key = NULL;
967 } 968 }
@@ -977,8 +978,9 @@ ieee80211_rx_h_decrypt(struct ieee80211_rx_data *rx)
977 return RX_DROP_UNUSABLE; 978 return RX_DROP_UNUSABLE;
978 /* the hdr variable is invalid now! */ 979 /* the hdr variable is invalid now! */
979 980
980 switch (rx->key->conf.alg) { 981 switch (rx->key->conf.cipher) {
981 case ALG_WEP: 982 case WLAN_CIPHER_SUITE_WEP40:
983 case WLAN_CIPHER_SUITE_WEP104:
982 /* Check for weak IVs if possible */ 984 /* Check for weak IVs if possible */
983 if (rx->sta && ieee80211_is_data(fc) && 985 if (rx->sta && ieee80211_is_data(fc) &&
984 (!(status->flag & RX_FLAG_IV_STRIPPED) || 986 (!(status->flag & RX_FLAG_IV_STRIPPED) ||
@@ -988,13 +990,13 @@ ieee80211_rx_h_decrypt(struct ieee80211_rx_data *rx)
988 990
989 result = ieee80211_crypto_wep_decrypt(rx); 991 result = ieee80211_crypto_wep_decrypt(rx);
990 break; 992 break;
991 case ALG_TKIP: 993 case WLAN_CIPHER_SUITE_TKIP:
992 result = ieee80211_crypto_tkip_decrypt(rx); 994 result = ieee80211_crypto_tkip_decrypt(rx);
993 break; 995 break;
994 case ALG_CCMP: 996 case WLAN_CIPHER_SUITE_CCMP:
995 result = ieee80211_crypto_ccmp_decrypt(rx); 997 result = ieee80211_crypto_ccmp_decrypt(rx);
996 break; 998 break;
997 case ALG_AES_CMAC: 999 case WLAN_CIPHER_SUITE_AES_CMAC:
998 result = ieee80211_crypto_aes_cmac_decrypt(rx); 1000 result = ieee80211_crypto_aes_cmac_decrypt(rx);
999 break; 1001 break;
1000 } 1002 }
@@ -1291,7 +1293,7 @@ ieee80211_rx_h_defragment(struct ieee80211_rx_data *rx)
1291 /* This is the first fragment of a new frame. */ 1293 /* This is the first fragment of a new frame. */
1292 entry = ieee80211_reassemble_add(rx->sdata, frag, seq, 1294 entry = ieee80211_reassemble_add(rx->sdata, frag, seq,
1293 rx->queue, &(rx->skb)); 1295 rx->queue, &(rx->skb));
1294 if (rx->key && rx->key->conf.alg == ALG_CCMP && 1296 if (rx->key && rx->key->conf.cipher == WLAN_CIPHER_SUITE_CCMP &&
1295 ieee80211_has_protected(fc)) { 1297 ieee80211_has_protected(fc)) {
1296 int queue = ieee80211_is_mgmt(fc) ? 1298 int queue = ieee80211_is_mgmt(fc) ?
1297 NUM_RX_DATA_QUEUES : rx->queue; 1299 NUM_RX_DATA_QUEUES : rx->queue;
@@ -1320,7 +1322,7 @@ ieee80211_rx_h_defragment(struct ieee80211_rx_data *rx)
1320 int i; 1322 int i;
1321 u8 pn[CCMP_PN_LEN], *rpn; 1323 u8 pn[CCMP_PN_LEN], *rpn;
1322 int queue; 1324 int queue;
1323 if (!rx->key || rx->key->conf.alg != ALG_CCMP) 1325 if (!rx->key || rx->key->conf.cipher != WLAN_CIPHER_SUITE_CCMP)
1324 return RX_DROP_UNUSABLE; 1326 return RX_DROP_UNUSABLE;
1325 memcpy(pn, entry->last_pn, CCMP_PN_LEN); 1327 memcpy(pn, entry->last_pn, CCMP_PN_LEN);
1326 for (i = CCMP_PN_LEN - 1; i >= 0; i--) { 1328 for (i = CCMP_PN_LEN - 1; i >= 0; i--) {