Commit 628a140b authored by Johannes Berg's avatar Johannes Berg Committed by David S. Miller

[MAC80211]: remove ALG_NONE

This "algorithm" is used only internally and is not useful.
Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
Cc: Michael Buesch <mb@bu3sch.de>
Acked-by: default avatarZhu Yi <yi.zhu@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 640845a5
...@@ -2827,9 +2827,6 @@ static int b43_dev_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, ...@@ -2827,9 +2827,6 @@ static int b43_dev_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
if (!dev) if (!dev)
return -ENODEV; return -ENODEV;
switch (key->alg) { switch (key->alg) {
case ALG_NONE:
algorithm = B43_SEC_ALGO_NONE;
break;
case ALG_WEP: case ALG_WEP:
if (key->keylen == 5) if (key->keylen == 5)
algorithm = B43_SEC_ALGO_WEP40; algorithm = B43_SEC_ALGO_WEP40;
......
...@@ -2579,10 +2579,6 @@ static void iwl_build_tx_cmd_hwcrypto(struct iwl_priv *priv, ...@@ -2579,10 +2579,6 @@ static void iwl_build_tx_cmd_hwcrypto(struct iwl_priv *priv,
"with key %d\n", ctl->key_idx); "with key %d\n", ctl->key_idx);
break; break;
case ALG_NONE:
IWL_DEBUG_TX("Tx packet in the clear (encrypt requested).\n");
break;
default: default:
printk(KERN_ERR "Unknown encode alg %d\n", keyinfo->alg); printk(KERN_ERR "Unknown encode alg %d\n", keyinfo->alg);
break; break;
......
...@@ -2663,10 +2663,6 @@ static void iwl_build_tx_cmd_hwcrypto(struct iwl_priv *priv, ...@@ -2663,10 +2663,6 @@ static void iwl_build_tx_cmd_hwcrypto(struct iwl_priv *priv,
"with key %d\n", ctl->key_idx); "with key %d\n", ctl->key_idx);
break; break;
case ALG_NONE:
IWL_DEBUG_TX("Tx packet in the clear (encrypt requested).\n");
break;
default: default:
printk(KERN_ERR "Unknown encode alg %d\n", keyinfo->alg); printk(KERN_ERR "Unknown encode alg %d\n", keyinfo->alg);
break; break;
......
...@@ -541,13 +541,11 @@ struct ieee80211_if_conf { ...@@ -541,13 +541,11 @@ struct ieee80211_if_conf {
/** /**
* enum ieee80211_key_alg - key algorithm * enum ieee80211_key_alg - key algorithm
* @ALG_NONE: Unset key algorithm, will never be passed to the driver
* @ALG_WEP: WEP40 or WEP104 * @ALG_WEP: WEP40 or WEP104
* @ALG_TKIP: TKIP * @ALG_TKIP: TKIP
* @ALG_CCMP: CCMP (AES) * @ALG_CCMP: CCMP (AES)
*/ */
enum ieee80211_key_alg { enum ieee80211_key_alg {
ALG_NONE,
ALG_WEP, ALG_WEP,
ALG_TKIP, ALG_TKIP,
ALG_CCMP, ALG_CCMP,
......
...@@ -27,8 +27,9 @@ ...@@ -27,8 +27,9 @@
static int ieee80211_set_encryption(struct net_device *dev, u8 *sta_addr, static int ieee80211_set_encryption(struct net_device *dev, u8 *sta_addr,
int idx, int alg, int set_tx_key, int idx, int alg, int remove,
const u8 *_key, size_t key_len) int set_tx_key, const u8 *_key,
size_t key_len)
{ {
struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
int ret = 0; int ret = 0;
...@@ -75,7 +76,7 @@ static int ieee80211_set_encryption(struct net_device *dev, u8 *sta_addr, ...@@ -75,7 +76,7 @@ static int ieee80211_set_encryption(struct net_device *dev, u8 *sta_addr,
key = sta->key; key = sta->key;
} }
if (alg == ALG_NONE) { if (remove) {
ieee80211_key_free(key); ieee80211_key_free(key);
key = NULL; key = NULL;
} else { } else {
...@@ -827,6 +828,7 @@ static int ieee80211_ioctl_siwencode(struct net_device *dev, ...@@ -827,6 +828,7 @@ static int ieee80211_ioctl_siwencode(struct net_device *dev,
struct ieee80211_sub_if_data *sdata; struct ieee80211_sub_if_data *sdata;
int idx, i, alg = ALG_WEP; int idx, i, alg = ALG_WEP;
u8 bcaddr[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; u8 bcaddr[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
int remove = 0;
sdata = IEEE80211_DEV_TO_SUB_IF(dev); sdata = IEEE80211_DEV_TO_SUB_IF(dev);
...@@ -845,7 +847,7 @@ static int ieee80211_ioctl_siwencode(struct net_device *dev, ...@@ -845,7 +847,7 @@ static int ieee80211_ioctl_siwencode(struct net_device *dev,
idx--; idx--;
if (erq->flags & IW_ENCODE_DISABLED) if (erq->flags & IW_ENCODE_DISABLED)
alg = ALG_NONE; remove = 1;
else if (erq->length == 0) { else if (erq->length == 0) {
/* No key data - just set the default TX key index */ /* No key data - just set the default TX key index */
ieee80211_set_default_key(sdata, idx); ieee80211_set_default_key(sdata, idx);
...@@ -854,7 +856,7 @@ static int ieee80211_ioctl_siwencode(struct net_device *dev, ...@@ -854,7 +856,7 @@ static int ieee80211_ioctl_siwencode(struct net_device *dev,
return ieee80211_set_encryption( return ieee80211_set_encryption(
dev, bcaddr, dev, bcaddr,
idx, alg, idx, alg, remove,
!sdata->default_key, !sdata->default_key,
keybuf, erq->length); keybuf, erq->length);
} }
...@@ -1005,11 +1007,11 @@ static int ieee80211_ioctl_siwencodeext(struct net_device *dev, ...@@ -1005,11 +1007,11 @@ static int ieee80211_ioctl_siwencodeext(struct net_device *dev,
{ {
struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
struct iw_encode_ext *ext = (struct iw_encode_ext *) extra; struct iw_encode_ext *ext = (struct iw_encode_ext *) extra;
int alg, idx, i; int uninitialized_var(alg), idx, i, remove = 0;
switch (ext->alg) { switch (ext->alg) {
case IW_ENCODE_ALG_NONE: case IW_ENCODE_ALG_NONE:
alg = ALG_NONE; remove = 1;
break; break;
case IW_ENCODE_ALG_WEP: case IW_ENCODE_ALG_WEP:
alg = ALG_WEP; alg = ALG_WEP;
...@@ -1025,7 +1027,7 @@ static int ieee80211_ioctl_siwencodeext(struct net_device *dev, ...@@ -1025,7 +1027,7 @@ static int ieee80211_ioctl_siwencodeext(struct net_device *dev,
} }
if (erq->flags & IW_ENCODE_DISABLED) if (erq->flags & IW_ENCODE_DISABLED)
alg = ALG_NONE; remove = 1;
idx = erq->flags & IW_ENCODE_INDEX; idx = erq->flags & IW_ENCODE_INDEX;
if (idx < 1 || idx > 4) { if (idx < 1 || idx > 4) {
...@@ -1044,6 +1046,7 @@ static int ieee80211_ioctl_siwencodeext(struct net_device *dev, ...@@ -1044,6 +1046,7 @@ static int ieee80211_ioctl_siwencodeext(struct net_device *dev,
idx--; idx--;
return ieee80211_set_encryption(dev, ext->addr.sa_data, idx, alg, return ieee80211_set_encryption(dev, ext->addr.sa_data, idx, alg,
remove,
ext->ext_flags & ext->ext_flags &
IW_ENCODE_EXT_SET_TX_KEY, IW_ENCODE_EXT_SET_TX_KEY,
ext->key, ext->key_len); ext->key, ext->key_len);
......
...@@ -121,7 +121,6 @@ struct ieee80211_key *ieee80211_key_alloc(struct ieee80211_sub_if_data *sdata, ...@@ -121,7 +121,6 @@ struct ieee80211_key *ieee80211_key_alloc(struct ieee80211_sub_if_data *sdata,
struct ieee80211_key *key; struct ieee80211_key *key;
BUG_ON(idx < 0 || idx >= NUM_DEFAULT_KEYS); BUG_ON(idx < 0 || idx >= NUM_DEFAULT_KEYS);
BUG_ON(alg == ALG_NONE);
key = kzalloc(sizeof(struct ieee80211_key) + key_len, GFP_KERNEL); key = kzalloc(sizeof(struct ieee80211_key) + key_len, GFP_KERNEL);
if (!key) if (!key)
......
...@@ -532,9 +532,6 @@ ieee80211_rx_h_decrypt(struct ieee80211_txrx_data *rx) ...@@ -532,9 +532,6 @@ ieee80211_rx_h_decrypt(struct ieee80211_txrx_data *rx)
return ieee80211_crypto_tkip_decrypt(rx); return ieee80211_crypto_tkip_decrypt(rx);
case ALG_CCMP: case ALG_CCMP:
return ieee80211_crypto_ccmp_decrypt(rx); return ieee80211_crypto_ccmp_decrypt(rx);
case ALG_NONE:
WARN_ON(1);
return TXRX_CONTINUE;
} }
/* not reached */ /* not reached */
......
...@@ -554,8 +554,6 @@ ieee80211_tx_h_encrypt(struct ieee80211_txrx_data *tx) ...@@ -554,8 +554,6 @@ ieee80211_tx_h_encrypt(struct ieee80211_txrx_data *tx)
return ieee80211_crypto_tkip_encrypt(tx); return ieee80211_crypto_tkip_encrypt(tx);
case ALG_CCMP: case ALG_CCMP:
return ieee80211_crypto_ccmp_encrypt(tx); return ieee80211_crypto_ccmp_encrypt(tx);
case ALG_NONE:
return TXRX_CONTINUE;
} }
/* not reached */ /* not reached */
......
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