nl80211: Use defines for cipher suite selectors
authorZhu Yi <yi.zhu@intel.com>
Thu, 3 Sep 2009 17:21:18 +0000 (20:21 +0300)
committerJouni Malinen <j@w1.fi>
Thu, 3 Sep 2009 17:21:18 +0000 (20:21 +0300)
src/common/ieee802_11_defs.h
src/drivers/driver_nl80211.c

index b4c804e..1a8701b 100644 (file)
@@ -679,4 +679,17 @@ enum {
 
 #define VENDOR_HT_CAPAB_OUI_TYPE 0x33 /* 00-90-4c:0x33 */
 
+/* cipher suite selectors */
+#define WLAN_CIPHER_SUITE_USE_GROUP    0x000FAC00
+#define WLAN_CIPHER_SUITE_WEP40                0x000FAC01
+#define WLAN_CIPHER_SUITE_TKIP         0x000FAC02
+/* reserved:                           0x000FAC03 */
+#define WLAN_CIPHER_SUITE_CCMP         0x000FAC04
+#define WLAN_CIPHER_SUITE_WEP104       0x000FAC05
+#define WLAN_CIPHER_SUITE_AES_CMAC     0x000FAC06
+
+/* AKM suite selectors */
+#define WLAN_AKM_SUITE_8021X           0x000FAC01
+#define WLAN_AKM_SUITE_PSK             0x000FAC02
+
 #endif /* IEEE802_11_DEFS_H */
index 77cee65..0382640 100644 (file)
@@ -1690,19 +1690,22 @@ static int nl_set_encr(int ifindex, struct wpa_driver_nl80211_data *drv,
                case WPA_ALG_WEP:
                        if (key_len == 5)
                                NLA_PUT_U32(msg, NL80211_ATTR_KEY_CIPHER,
-                                           0x000FAC01);
+                                           WLAN_CIPHER_SUITE_WEP40);
                        else
                                NLA_PUT_U32(msg, NL80211_ATTR_KEY_CIPHER,
-                                           0x000FAC05);
+                                           WLAN_CIPHER_SUITE_WEP104);
                        break;
                case WPA_ALG_TKIP:
-                       NLA_PUT_U32(msg, NL80211_ATTR_KEY_CIPHER, 0x000FAC02);
+                       NLA_PUT_U32(msg, NL80211_ATTR_KEY_CIPHER,
+                                   WLAN_CIPHER_SUITE_TKIP);
                        break;
                case WPA_ALG_CCMP:
-                       NLA_PUT_U32(msg, NL80211_ATTR_KEY_CIPHER, 0x000FAC04);
+                       NLA_PUT_U32(msg, NL80211_ATTR_KEY_CIPHER,
+                                   WLAN_CIPHER_SUITE_CCMP);
                        break;
                case WPA_ALG_IGTK:
-                       NLA_PUT_U32(msg, NL80211_ATTR_KEY_CIPHER, 0x000FAC06);
+                       NLA_PUT_U32(msg, NL80211_ATTR_KEY_CIPHER,
+                                   WLAN_CIPHER_SUITE_AES_CMAC);
                        break;
                default:
                        wpa_printf(MSG_ERROR, "%s: Unsupported encryption "