Commit 206a443f authored by Arend van Spriel's avatar Arend van Spriel Committed by Greg Kroah-Hartman

staging: brcm80211: rename key endian conversion functions

The key endian conversion functions in wl_cfg80211.c have been
renamed as the old names were misleasing.
Reported-by: default avatarJohannes Berg <johannes@sipsolutions.net>
Reviewed-by: default avatarFranky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: default avatarRoland Vossen <rvossen@broadcom.com>
Signed-off-by: default avatarRoland Vossen <rvossen@broadcom.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent f66a27de
...@@ -215,8 +215,8 @@ static s32 brcmf_add_keyext(struct wiphy *wiphy, struct net_device *dev, ...@@ -215,8 +215,8 @@ static s32 brcmf_add_keyext(struct wiphy *wiphy, struct net_device *dev,
/* /*
** key indianess swap utilities ** key indianess swap utilities
*/ */
static void swap_key_from_BE(struct brcmf_wsec_key *key); static void convert_key_from_CPU(struct brcmf_wsec_key *key);
static void swap_key_to_BE(struct brcmf_wsec_key *key); static void convert_key_to_CPU(struct brcmf_wsec_key *key);
/* /*
** brcmf_cfg80211_priv memory init/deinit utilities ** brcmf_cfg80211_priv memory init/deinit utilities
...@@ -509,7 +509,7 @@ static const u32 __wl_cipher_suites[] = { ...@@ -509,7 +509,7 @@ static const u32 __wl_cipher_suites[] = {
WLAN_CIPHER_SUITE_AES_CMAC, WLAN_CIPHER_SUITE_AES_CMAC,
}; };
static void swap_key_from_BE(struct brcmf_wsec_key *key) static void convert_key_from_CPU(struct brcmf_wsec_key *key)
{ {
key->index = cpu_to_le32(key->index); key->index = cpu_to_le32(key->index);
key->len = cpu_to_le32(key->len); key->len = cpu_to_le32(key->len);
...@@ -520,7 +520,7 @@ static void swap_key_from_BE(struct brcmf_wsec_key *key) ...@@ -520,7 +520,7 @@ static void swap_key_from_BE(struct brcmf_wsec_key *key)
key->iv_initialized = cpu_to_le32(key->iv_initialized); key->iv_initialized = cpu_to_le32(key->iv_initialized);
} }
static void swap_key_to_BE(struct brcmf_wsec_key *key) static void convert_key_to_CPU(struct brcmf_wsec_key *key)
{ {
key->index = le32_to_cpu(key->index); key->index = le32_to_cpu(key->index);
key->len = le32_to_cpu(key->len); key->len = le32_to_cpu(key->len);
...@@ -1344,7 +1344,7 @@ brcmf_set_set_sharedkey(struct net_device *dev, ...@@ -1344,7 +1344,7 @@ brcmf_set_set_sharedkey(struct net_device *dev,
WL_CONN("key length (%d) key index (%d) algo (%d)\n", WL_CONN("key length (%d) key index (%d) algo (%d)\n",
key.len, key.index, key.algo); key.len, key.index, key.algo);
WL_CONN("key \"%s\"\n", key.data); WL_CONN("key \"%s\"\n", key.data);
swap_key_from_BE(&key); convert_key_from_CPU(&key);
err = brcmf_dev_ioctl(dev, BRCMF_C_SET_KEY, &key, err = brcmf_dev_ioctl(dev, BRCMF_C_SET_KEY, &key,
sizeof(key)); sizeof(key));
if (unlikely(err)) { if (unlikely(err)) {
...@@ -1612,7 +1612,7 @@ brcmf_add_keyext(struct wiphy *wiphy, struct net_device *dev, ...@@ -1612,7 +1612,7 @@ brcmf_add_keyext(struct wiphy *wiphy, struct net_device *dev,
/* check for key index change */ /* check for key index change */
if (key.len == 0) { if (key.len == 0) {
/* key delete */ /* key delete */
swap_key_from_BE(&key); convert_key_from_CPU(&key);
err = brcmf_dev_ioctl(dev, BRCMF_C_SET_KEY, &key, sizeof(key)); err = brcmf_dev_ioctl(dev, BRCMF_C_SET_KEY, &key, sizeof(key));
if (unlikely(err)) { if (unlikely(err)) {
WL_ERR("key delete error (%d)\n", err); WL_ERR("key delete error (%d)\n", err);
...@@ -1670,7 +1670,7 @@ brcmf_add_keyext(struct wiphy *wiphy, struct net_device *dev, ...@@ -1670,7 +1670,7 @@ brcmf_add_keyext(struct wiphy *wiphy, struct net_device *dev,
WL_ERR("Invalid cipher (0x%x)\n", params->cipher); WL_ERR("Invalid cipher (0x%x)\n", params->cipher);
return -EINVAL; return -EINVAL;
} }
swap_key_from_BE(&key); convert_key_from_CPU(&key);
brcmf_netdev_wait_pend8021x(dev); brcmf_netdev_wait_pend8021x(dev);
err = brcmf_dev_ioctl(dev, BRCMF_C_SET_KEY, &key, sizeof(key)); err = brcmf_dev_ioctl(dev, BRCMF_C_SET_KEY, &key, sizeof(key));
...@@ -1745,7 +1745,7 @@ brcmf_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev, ...@@ -1745,7 +1745,7 @@ brcmf_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev,
} }
/* Set the new key/index */ /* Set the new key/index */
swap_key_from_BE(&key); convert_key_from_CPU(&key);
err = brcmf_dev_ioctl(dev, BRCMF_C_SET_KEY, &key, sizeof(key)); err = brcmf_dev_ioctl(dev, BRCMF_C_SET_KEY, &key, sizeof(key));
if (unlikely(err)) { if (unlikely(err)) {
WL_ERR("WLC_SET_KEY error (%d)\n", err); WL_ERR("WLC_SET_KEY error (%d)\n", err);
...@@ -1795,7 +1795,7 @@ brcmf_cfg80211_del_key(struct wiphy *wiphy, struct net_device *dev, ...@@ -1795,7 +1795,7 @@ brcmf_cfg80211_del_key(struct wiphy *wiphy, struct net_device *dev,
WL_CONN("key index (%d)\n", key_idx); WL_CONN("key index (%d)\n", key_idx);
/* Set the new key/index */ /* Set the new key/index */
swap_key_from_BE(&key); convert_key_from_CPU(&key);
err = brcmf_dev_ioctl(dev, BRCMF_C_SET_KEY, &key, sizeof(key)); err = brcmf_dev_ioctl(dev, BRCMF_C_SET_KEY, &key, sizeof(key));
if (unlikely(err)) { if (unlikely(err)) {
if (err == -EINVAL) { if (err == -EINVAL) {
...@@ -1859,7 +1859,7 @@ brcmf_cfg80211_get_key(struct wiphy *wiphy, struct net_device *dev, ...@@ -1859,7 +1859,7 @@ brcmf_cfg80211_get_key(struct wiphy *wiphy, struct net_device *dev,
memset(&key, 0, sizeof(key)); memset(&key, 0, sizeof(key));
key.index = key_idx; key.index = key_idx;
swap_key_to_BE(&key); convert_key_to_CPU(&key);
memset(&params, 0, sizeof(params)); memset(&params, 0, sizeof(params));
params.key_len = (u8) min_t(u8, WLAN_MAX_KEY_LEN, key.len); params.key_len = (u8) min_t(u8, WLAN_MAX_KEY_LEN, key.len);
memcpy(params.key, key.data, params.key_len); memcpy(params.key, key.data, params.key_len);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment