From a042e39acf004a17c02b4bd47ed676aea58cb928 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sat, 28 Jan 2017 14:04:44 +0200 Subject: [PATCH] nl80211: Use RSN_CIPHER_SUITE_* instead of WLAN_CIPHER_SUITE_* This is a step towards getting rid of the unnecessary duplication of definitions. Signed-off-by: Jouni Malinen --- src/drivers/driver_nl80211.c | 60 +++++++++++++++---------------- src/drivers/driver_nl80211_capa.c | 26 +++++++------- 2 files changed, 43 insertions(+), 43 deletions(-) diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 27b4d71ac..37066410e 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -2633,30 +2633,30 @@ static u32 wpa_alg_to_cipher_suite(enum wpa_alg alg, size_t key_len) switch (alg) { case WPA_ALG_WEP: if (key_len == 5) - return WLAN_CIPHER_SUITE_WEP40; - return WLAN_CIPHER_SUITE_WEP104; + return RSN_CIPHER_SUITE_WEP40; + return RSN_CIPHER_SUITE_WEP104; case WPA_ALG_TKIP: - return WLAN_CIPHER_SUITE_TKIP; + return RSN_CIPHER_SUITE_TKIP; case WPA_ALG_CCMP: - return WLAN_CIPHER_SUITE_CCMP; + return RSN_CIPHER_SUITE_CCMP; case WPA_ALG_GCMP: - return WLAN_CIPHER_SUITE_GCMP; + return RSN_CIPHER_SUITE_GCMP; case WPA_ALG_CCMP_256: - return WLAN_CIPHER_SUITE_CCMP_256; + return RSN_CIPHER_SUITE_CCMP_256; case WPA_ALG_GCMP_256: - return WLAN_CIPHER_SUITE_GCMP_256; + return RSN_CIPHER_SUITE_GCMP_256; case WPA_ALG_IGTK: - return WLAN_CIPHER_SUITE_AES_CMAC; + return RSN_CIPHER_SUITE_AES_128_CMAC; case WPA_ALG_BIP_GMAC_128: - return WLAN_CIPHER_SUITE_BIP_GMAC_128; + return RSN_CIPHER_SUITE_BIP_GMAC_128; case WPA_ALG_BIP_GMAC_256: - return WLAN_CIPHER_SUITE_BIP_GMAC_256; + return RSN_CIPHER_SUITE_BIP_GMAC_256; case WPA_ALG_BIP_CMAC_256: - return WLAN_CIPHER_SUITE_BIP_CMAC_256; + return RSN_CIPHER_SUITE_BIP_CMAC_256; case WPA_ALG_SMS4: - return WLAN_CIPHER_SUITE_SMS4; + return RSN_CIPHER_SUITE_SMS4; case WPA_ALG_KRK: - return WLAN_CIPHER_SUITE_KRK; + return RSN_CIPHER_SUITE_KRK; case WPA_ALG_NONE: case WPA_ALG_PMK: wpa_printf(MSG_ERROR, "nl80211: Unexpected encryption algorithm %d", @@ -2674,21 +2674,21 @@ static u32 wpa_cipher_to_cipher_suite(unsigned int cipher) { switch (cipher) { case WPA_CIPHER_CCMP_256: - return WLAN_CIPHER_SUITE_CCMP_256; + return RSN_CIPHER_SUITE_CCMP_256; case WPA_CIPHER_GCMP_256: - return WLAN_CIPHER_SUITE_GCMP_256; + return RSN_CIPHER_SUITE_GCMP_256; case WPA_CIPHER_CCMP: - return WLAN_CIPHER_SUITE_CCMP; + return RSN_CIPHER_SUITE_CCMP; case WPA_CIPHER_GCMP: - return WLAN_CIPHER_SUITE_GCMP; + return RSN_CIPHER_SUITE_GCMP; case WPA_CIPHER_TKIP: - return WLAN_CIPHER_SUITE_TKIP; + return RSN_CIPHER_SUITE_TKIP; case WPA_CIPHER_WEP104: - return WLAN_CIPHER_SUITE_WEP104; + return RSN_CIPHER_SUITE_WEP104; case WPA_CIPHER_WEP40: - return WLAN_CIPHER_SUITE_WEP40; + return RSN_CIPHER_SUITE_WEP40; case WPA_CIPHER_GTK_NOT_USED: - return WLAN_CIPHER_SUITE_NO_GROUP_ADDR; + return RSN_CIPHER_SUITE_NO_GROUP_ADDRESSED; } return 0; @@ -2701,19 +2701,19 @@ static int wpa_cipher_to_cipher_suites(unsigned int ciphers, u32 suites[], int num_suites = 0; if (num_suites < max_suites && ciphers & WPA_CIPHER_CCMP_256) - suites[num_suites++] = WLAN_CIPHER_SUITE_CCMP_256; + suites[num_suites++] = RSN_CIPHER_SUITE_CCMP_256; if (num_suites < max_suites && ciphers & WPA_CIPHER_GCMP_256) - suites[num_suites++] = WLAN_CIPHER_SUITE_GCMP_256; + suites[num_suites++] = RSN_CIPHER_SUITE_GCMP_256; if (num_suites < max_suites && ciphers & WPA_CIPHER_CCMP) - suites[num_suites++] = WLAN_CIPHER_SUITE_CCMP; + suites[num_suites++] = RSN_CIPHER_SUITE_CCMP; if (num_suites < max_suites && ciphers & WPA_CIPHER_GCMP) - suites[num_suites++] = WLAN_CIPHER_SUITE_GCMP; + suites[num_suites++] = RSN_CIPHER_SUITE_GCMP; if (num_suites < max_suites && ciphers & WPA_CIPHER_TKIP) - suites[num_suites++] = WLAN_CIPHER_SUITE_TKIP; + suites[num_suites++] = RSN_CIPHER_SUITE_TKIP; if (num_suites < max_suites && ciphers & WPA_CIPHER_WEP104) - suites[num_suites++] = WLAN_CIPHER_SUITE_WEP104; + suites[num_suites++] = RSN_CIPHER_SUITE_WEP104; if (num_suites < max_suites && ciphers & WPA_CIPHER_WEP40) - suites[num_suites++] = WLAN_CIPHER_SUITE_WEP40; + suites[num_suites++] = RSN_CIPHER_SUITE_WEP40; return num_suites; } @@ -2971,8 +2971,8 @@ static int nl80211_set_conn_keys(struct wpa_driver_associate_params *params, params->wep_key[i]) || nla_put_u32(msg, NL80211_KEY_CIPHER, params->wep_key_len[i] == 5 ? - WLAN_CIPHER_SUITE_WEP40 : - WLAN_CIPHER_SUITE_WEP104) || + RSN_CIPHER_SUITE_WEP40 : + RSN_CIPHER_SUITE_WEP104) || nla_put_u8(msg, NL80211_KEY_IDX, i) || (i == params->wep_tx_keyidx && nla_put_flag(msg, NL80211_KEY_DEFAULT))) diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c index cad397046..3d8531684 100644 --- a/src/drivers/driver_nl80211_capa.c +++ b/src/drivers/driver_nl80211_capa.c @@ -12,8 +12,8 @@ #include #include "utils/common.h" -#include "common/ieee802_11_defs.h" #include "common/ieee802_11_common.h" +#include "common/wpa_common.h" #include "common/qca-vendor.h" #include "common/qca-vendor-attr.h" #include "driver_nl80211.h" @@ -266,40 +266,40 @@ static void wiphy_info_cipher_suites(struct wiphy_info_data *info, c >> 24, (c >> 16) & 0xff, (c >> 8) & 0xff, c & 0xff); switch (c) { - case WLAN_CIPHER_SUITE_CCMP_256: + case RSN_CIPHER_SUITE_CCMP_256: info->capa->enc |= WPA_DRIVER_CAPA_ENC_CCMP_256; break; - case WLAN_CIPHER_SUITE_GCMP_256: + case RSN_CIPHER_SUITE_GCMP_256: info->capa->enc |= WPA_DRIVER_CAPA_ENC_GCMP_256; break; - case WLAN_CIPHER_SUITE_CCMP: + case RSN_CIPHER_SUITE_CCMP: info->capa->enc |= WPA_DRIVER_CAPA_ENC_CCMP; break; - case WLAN_CIPHER_SUITE_GCMP: + case RSN_CIPHER_SUITE_GCMP: info->capa->enc |= WPA_DRIVER_CAPA_ENC_GCMP; break; - case WLAN_CIPHER_SUITE_TKIP: + case RSN_CIPHER_SUITE_TKIP: info->capa->enc |= WPA_DRIVER_CAPA_ENC_TKIP; break; - case WLAN_CIPHER_SUITE_WEP104: + case RSN_CIPHER_SUITE_WEP104: info->capa->enc |= WPA_DRIVER_CAPA_ENC_WEP104; break; - case WLAN_CIPHER_SUITE_WEP40: + case RSN_CIPHER_SUITE_WEP40: info->capa->enc |= WPA_DRIVER_CAPA_ENC_WEP40; break; - case WLAN_CIPHER_SUITE_AES_CMAC: + case RSN_CIPHER_SUITE_AES_128_CMAC: info->capa->enc |= WPA_DRIVER_CAPA_ENC_BIP; break; - case WLAN_CIPHER_SUITE_BIP_GMAC_128: + case RSN_CIPHER_SUITE_BIP_GMAC_128: info->capa->enc |= WPA_DRIVER_CAPA_ENC_BIP_GMAC_128; break; - case WLAN_CIPHER_SUITE_BIP_GMAC_256: + case RSN_CIPHER_SUITE_BIP_GMAC_256: info->capa->enc |= WPA_DRIVER_CAPA_ENC_BIP_GMAC_256; break; - case WLAN_CIPHER_SUITE_BIP_CMAC_256: + case RSN_CIPHER_SUITE_BIP_CMAC_256: info->capa->enc |= WPA_DRIVER_CAPA_ENC_BIP_CMAC_256; break; - case WLAN_CIPHER_SUITE_NO_GROUP_ADDR: + case RSN_CIPHER_SUITE_NO_GROUP_ADDRESSED: info->capa->enc |= WPA_DRIVER_CAPA_ENC_GTK_NOT_USED; break; }