KEY_TYPE_ID_AES,
KEY_TYPE_ID_WAPI,
};
-
-enum KEY_INFO_WEP {
- KEY_INFO_WEP_MCAST = 0x01,
- KEY_INFO_WEP_UNICAST = 0x02,
- KEY_INFO_WEP_ENABLED = 0x04
-};
-
-enum KEY_INFO_TKIP {
- KEY_INFO_TKIP_MCAST = 0x01,
- KEY_INFO_TKIP_UNICAST = 0x02,
- KEY_INFO_TKIP_ENABLED = 0x04
-};
-
-enum KEY_INFO_AES {
- KEY_INFO_AES_MCAST = 0x01,
- KEY_INFO_AES_UNICAST = 0x02,
- KEY_INFO_AES_ENABLED = 0x04
-};
+#define KEY_MCAST BIT(0)
+#define KEY_UNICAST BIT(1)
+#define KEY_ENABLED BIT(2)
#define WAPI_KEY_LEN 50
-enum KEY_INFO_WAPI {
- KEY_INFO_WAPI_MCAST = 0x01,
- KEY_INFO_WAPI_UNICAST = 0x02,
- KEY_INFO_WAPI_ENABLED = 0x04
-};
-
#define MAX_POLL_TRIES 100
#define MAX_MULTI_INTERFACE_POLL_TRIES 1000
key_param_set->key_type_id =
cpu_to_le16(KEY_TYPE_ID_WEP);
key_param_set->key_info =
- cpu_to_le16(KEY_INFO_WEP_ENABLED |
- KEY_INFO_WEP_UNICAST |
- KEY_INFO_WEP_MCAST);
+ cpu_to_le16(KEY_ENABLED | KEY_UNICAST |
+ KEY_MCAST);
key_param_set->key_len =
cpu_to_le16(priv->wep_key[i].key_length);
/* Set WEP key index */
cpu_to_le16(KEY_TYPE_ID_WAPI);
if (cmd_oid == KEY_INFO_ENABLED)
key_material->key_param_set.key_info =
- cpu_to_le16(KEY_INFO_WAPI_ENABLED);
+ cpu_to_le16(KEY_ENABLED);
else
key_material->key_param_set.key_info =
- cpu_to_le16(!KEY_INFO_WAPI_ENABLED);
+ cpu_to_le16(!KEY_ENABLED);
key_material->key_param_set.key[0] = enc_key->key_index;
if (!priv->sec_info.wapi_key_on)
if (0 != memcmp(enc_key->mac_addr, bc_mac, sizeof(bc_mac))) {
/* WAPI pairwise key: unicast */
key_material->key_param_set.key_info |=
- cpu_to_le16(KEY_INFO_WAPI_UNICAST);
+ cpu_to_le16(KEY_UNICAST);
} else { /* WAPI group key: multicast */
key_material->key_param_set.key_info |=
- cpu_to_le16(KEY_INFO_WAPI_MCAST);
+ cpu_to_le16(KEY_MCAST);
priv->sec_info.wapi_key_on = true;
}
cpu_to_le16(KEY_TYPE_ID_AES);
if (cmd_oid == KEY_INFO_ENABLED)
key_material->key_param_set.key_info =
- cpu_to_le16(KEY_INFO_AES_ENABLED);
+ cpu_to_le16(KEY_ENABLED);
else
key_material->key_param_set.key_info =
- cpu_to_le16(!KEY_INFO_AES_ENABLED);
+ cpu_to_le16(!KEY_ENABLED);
if (enc_key->key_index & MWIFIEX_KEY_INDEX_UNICAST)
/* AES pairwise key: unicast */
key_material->key_param_set.key_info |=
- cpu_to_le16(KEY_INFO_AES_UNICAST);
+ cpu_to_le16(KEY_UNICAST);
else /* AES group key: multicast */
key_material->key_param_set.key_info |=
- cpu_to_le16(KEY_INFO_AES_MCAST);
+ cpu_to_le16(KEY_MCAST);
} else if (enc_key->key_len == WLAN_KEY_LEN_TKIP) {
dev_dbg(priv->adapter->dev, "cmd: WPA_TKIP\n");
key_material->key_param_set.key_type_id =
cpu_to_le16(KEY_TYPE_ID_TKIP);
key_material->key_param_set.key_info =
- cpu_to_le16(KEY_INFO_TKIP_ENABLED);
+ cpu_to_le16(KEY_ENABLED);
if (enc_key->key_index & MWIFIEX_KEY_INDEX_UNICAST)
/* TKIP pairwise key: unicast */
key_material->key_param_set.key_info |=
- cpu_to_le16(KEY_INFO_TKIP_UNICAST);
+ cpu_to_le16(KEY_UNICAST);
else /* TKIP group key: multicast */
key_material->key_param_set.key_info |=
- cpu_to_le16(KEY_INFO_TKIP_MCAST);
+ cpu_to_le16(KEY_MCAST);
}
if (key_material->key_param_set.key_type_id) {