[MAC80211]: remove ALG_NONE
authorJohannes Berg <johannes@sipsolutions.net>
Wed, 26 Sep 2007 15:53:17 +0000 (17:53 +0200)
committerDavid S. Miller <davem@sunset.davemloft.net>
Wed, 10 Oct 2007 23:54:18 +0000 (16:54 -0700)
This "algorithm" is used only internally and is not useful.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Cc: Michael Buesch <mb@bu3sch.de>
Acked-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/wireless/b43/main.c
drivers/net/wireless/iwlwifi/iwl3945-base.c
drivers/net/wireless/iwlwifi/iwl4965-base.c
include/net/mac80211.h
net/mac80211/ieee80211_ioctl.c
net/mac80211/key.c
net/mac80211/rx.c
net/mac80211/tx.c

index 6c80f2e2f4eec68796503909d13a2918b9f9827f..c141a264ac45bfb16e323ee8b1bbb2b08a727666 100644 (file)
@@ -2827,9 +2827,6 @@ static int b43_dev_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
        if (!dev)
                return -ENODEV;
        switch (key->alg) {
-       case ALG_NONE:
-               algorithm = B43_SEC_ALGO_NONE;
-               break;
        case ALG_WEP:
                if (key->keylen == 5)
                        algorithm = B43_SEC_ALGO_WEP40;
index 2cd7caa69e466043a46843fea4dc9d97f23fbb81..75e3b5c3f1558bce3ffc32cc99e172f6d2fa7bc4 100644 (file)
@@ -2579,10 +2579,6 @@ static void iwl_build_tx_cmd_hwcrypto(struct iwl_priv *priv,
                             "with key %d\n", ctl->key_idx);
                break;
 
-       case ALG_NONE:
-               IWL_DEBUG_TX("Tx packet in the clear (encrypt requested).\n");
-               break;
-
        default:
                printk(KERN_ERR "Unknown encode alg %d\n", keyinfo->alg);
                break;
index 5a8342664af193994ce3a34b3e15c1e5f510d3d2..b1a6e39f7821d9cd5888d905737d168856ada18a 100644 (file)
@@ -2663,10 +2663,6 @@ static void iwl_build_tx_cmd_hwcrypto(struct iwl_priv *priv,
                             "with key %d\n", ctl->key_idx);
                break;
 
-       case ALG_NONE:
-               IWL_DEBUG_TX("Tx packet in the clear (encrypt requested).\n");
-               break;
-
        default:
                printk(KERN_ERR "Unknown encode alg %d\n", keyinfo->alg);
                break;
index c143ac8965dbce6726b0b329f3a258144567c380..1a2114b8d221628ff21f0f682c00c8648908e02f 100644 (file)
@@ -541,13 +541,11 @@ struct ieee80211_if_conf {
 
 /**
  * enum ieee80211_key_alg - key algorithm
- * @ALG_NONE: Unset key algorithm, will never be passed to the driver
  * @ALG_WEP: WEP40 or WEP104
  * @ALG_TKIP: TKIP
  * @ALG_CCMP: CCMP (AES)
  */
 enum ieee80211_key_alg {
-       ALG_NONE,
        ALG_WEP,
        ALG_TKIP,
        ALG_CCMP,
index 48e68434b38a54bfb2612be71c9a44fee4826176..6c8e73e0d29d3516fe58c29ab245d3ad34d35333 100644 (file)
@@ -27,8 +27,9 @@
 
 
 static int ieee80211_set_encryption(struct net_device *dev, u8 *sta_addr,
-                                   int idx, int alg, int set_tx_key,
-                                   const u8 *_key, size_t key_len)
+                                   int idx, int alg, int remove,
+                                   int set_tx_key, const u8 *_key,
+                                   size_t key_len)
 {
        struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
        int ret = 0;
@@ -75,7 +76,7 @@ static int ieee80211_set_encryption(struct net_device *dev, u8 *sta_addr,
                key = sta->key;
        }
 
-       if (alg == ALG_NONE) {
+       if (remove) {
                ieee80211_key_free(key);
                key = NULL;
        } else {
@@ -827,6 +828,7 @@ static int ieee80211_ioctl_siwencode(struct net_device *dev,
        struct ieee80211_sub_if_data *sdata;
        int idx, i, alg = ALG_WEP;
        u8 bcaddr[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
+       int remove = 0;
 
        sdata = IEEE80211_DEV_TO_SUB_IF(dev);
 
@@ -845,7 +847,7 @@ static int ieee80211_ioctl_siwencode(struct net_device *dev,
                idx--;
 
        if (erq->flags & IW_ENCODE_DISABLED)
-               alg = ALG_NONE;
+               remove = 1;
        else if (erq->length == 0) {
                /* No key data - just set the default TX key index */
                ieee80211_set_default_key(sdata, idx);
@@ -854,7 +856,7 @@ static int ieee80211_ioctl_siwencode(struct net_device *dev,
 
        return ieee80211_set_encryption(
                dev, bcaddr,
-               idx, alg,
+               idx, alg, remove,
                !sdata->default_key,
                keybuf, erq->length);
 }
@@ -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 iw_encode_ext *ext = (struct iw_encode_ext *) extra;
-       int alg, idx, i;
+       int uninitialized_var(alg), idx, i, remove = 0;
 
        switch (ext->alg) {
        case IW_ENCODE_ALG_NONE:
-               alg = ALG_NONE;
+               remove = 1;
                break;
        case IW_ENCODE_ALG_WEP:
                alg = ALG_WEP;
@@ -1025,7 +1027,7 @@ static int ieee80211_ioctl_siwencodeext(struct net_device *dev,
        }
 
        if (erq->flags & IW_ENCODE_DISABLED)
-               alg = ALG_NONE;
+               remove = 1;
 
        idx = erq->flags & IW_ENCODE_INDEX;
        if (idx < 1 || idx > 4) {
@@ -1044,6 +1046,7 @@ static int ieee80211_ioctl_siwencodeext(struct net_device *dev,
                idx--;
 
        return ieee80211_set_encryption(dev, ext->addr.sa_data, idx, alg,
+                                       remove,
                                        ext->ext_flags &
                                        IW_ENCODE_EXT_SET_TX_KEY,
                                        ext->key, ext->key_len);
index f13d46b2c13c57310d8c80327ece465e51ddaa2b..0b2328f7d67cdb7b3bc90990f50e0450461d309c 100644 (file)
@@ -121,7 +121,6 @@ struct ieee80211_key *ieee80211_key_alloc(struct ieee80211_sub_if_data *sdata,
        struct ieee80211_key *key;
 
        BUG_ON(idx < 0 || idx >= NUM_DEFAULT_KEYS);
-       BUG_ON(alg == ALG_NONE);
 
        key = kzalloc(sizeof(struct ieee80211_key) + key_len, GFP_KERNEL);
        if (!key)
index f5caa1a016ee28186c3451afa3e8278df3ea46b0..8c16574ec39c6251c565d60dad45b4ae31f714f8 100644 (file)
@@ -532,9 +532,6 @@ ieee80211_rx_h_decrypt(struct ieee80211_txrx_data *rx)
                return ieee80211_crypto_tkip_decrypt(rx);
        case ALG_CCMP:
                return ieee80211_crypto_ccmp_decrypt(rx);
-       case ALG_NONE:
-               WARN_ON(1);
-               return TXRX_CONTINUE;
        }
 
        /* not reached */
index 8f0007a925a21189c0e0a4bfa99f1ba287c78dcc..47416b0645db9512daf0702d72f8e5396ee6eb9d 100644 (file)
@@ -554,8 +554,6 @@ ieee80211_tx_h_encrypt(struct ieee80211_txrx_data *tx)
                return ieee80211_crypto_tkip_encrypt(tx);
        case ALG_CCMP:
                return ieee80211_crypto_ccmp_encrypt(tx);
-       case ALG_NONE:
-               return TXRX_CONTINUE;
        }
 
        /* not reached */