Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 66889
b: refs/heads/master
c: 628a140
h: refs/heads/master
i:
  66887: 0db1b6c
v: v3
  • Loading branch information
Johannes Berg authored and David S. Miller committed Oct 10, 2007
1 parent 57a7de2 commit 954f09c
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 28 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 640845a5632390eaa9357cd818646c8f0ee3d47e
refs/heads/master: 628a140ba033ef201706a8c7e767c8a0c0f8326c
3 changes: 0 additions & 3 deletions trunk/drivers/net/wireless/b43/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 0 additions & 4 deletions trunk/drivers/net/wireless/iwlwifi/iwl3945-base.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 0 additions & 4 deletions trunk/drivers/net/wireless/iwlwifi/iwl4965-base.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 0 additions & 2 deletions trunk/include/net/mac80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
19 changes: 11 additions & 8 deletions trunk/net/mac80211/ieee80211_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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);

Expand All @@ -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);
Expand All @@ -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);
}
Expand Down Expand Up @@ -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;
Expand All @@ -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) {
Expand All @@ -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);
Expand Down
1 change: 0 additions & 1 deletion trunk/net/mac80211/key.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 0 additions & 3 deletions trunk/net/mac80211/rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 0 additions & 2 deletions trunk/net/mac80211/tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 954f09c

Please sign in to comment.