diff options
author | Winkler, Tomas <tomas.winkler@intel.com> | 2009-01-19 18:30:22 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-01-29 16:00:54 -0500 |
commit | 42986796409a6293351207150edb7b4689b6013d (patch) | |
tree | 5c920d2dac0a90a179dff34301ce5c6f59a49a45 /drivers/net/wireless/iwlwifi/iwl3945-base.c | |
parent | 5cd19c5f15f4bd3354cc7f8f8b1125018a84a25c (diff) |
iwlwifi: fix iwl_mac_set_key and iwl3945_mac_set_key
This patch fix iwl_mac_set_key function changed in patch
"mac80211: clean up set_key callback"
1. removing 'static' const u8 *addr' that can possible cause
conflict when two or more NICs are present in the system.
2. simplifying functions
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl3945-base.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl3945-base.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index b916f00b61bf..010df19d01ef 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -6500,10 +6500,8 @@ static int iwl3945_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, | |||
6500 | { | 6500 | { |
6501 | struct iwl_priv *priv = hw->priv; | 6501 | struct iwl_priv *priv = hw->priv; |
6502 | const u8 *addr; | 6502 | const u8 *addr; |
6503 | int rc = 0; | 6503 | int ret; |
6504 | u8 sta_id; | 6504 | u8 sta_id; |
6505 | static const u8 bcast_addr[ETH_ALEN] = | ||
6506 | { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; | ||
6507 | 6505 | ||
6508 | IWL_DEBUG_MAC80211("enter\n"); | 6506 | IWL_DEBUG_MAC80211("enter\n"); |
6509 | 6507 | ||
@@ -6512,8 +6510,7 @@ static int iwl3945_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, | |||
6512 | return -EOPNOTSUPP; | 6510 | return -EOPNOTSUPP; |
6513 | } | 6511 | } |
6514 | 6512 | ||
6515 | addr = sta ? sta->addr : bcast_addr; | 6513 | addr = sta ? sta->addr : iwl_bcast_addr; |
6516 | |||
6517 | sta_id = iwl3945_hw_find_station(priv, addr); | 6514 | sta_id = iwl3945_hw_find_station(priv, addr); |
6518 | if (sta_id == IWL_INVALID_STATION) { | 6515 | if (sta_id == IWL_INVALID_STATION) { |
6519 | IWL_DEBUG_MAC80211("leave - %pM not in station map.\n", | 6516 | IWL_DEBUG_MAC80211("leave - %pM not in station map.\n", |
@@ -6527,8 +6524,8 @@ static int iwl3945_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, | |||
6527 | 6524 | ||
6528 | switch (cmd) { | 6525 | switch (cmd) { |
6529 | case SET_KEY: | 6526 | case SET_KEY: |
6530 | rc = iwl3945_update_sta_key_info(priv, key, sta_id); | 6527 | ret = iwl3945_update_sta_key_info(priv, key, sta_id); |
6531 | if (!rc) { | 6528 | if (!ret) { |
6532 | iwl3945_set_rxon_hwcrypto(priv, 1); | 6529 | iwl3945_set_rxon_hwcrypto(priv, 1); |
6533 | iwl3945_commit_rxon(priv); | 6530 | iwl3945_commit_rxon(priv); |
6534 | key->hw_key_idx = sta_id; | 6531 | key->hw_key_idx = sta_id; |
@@ -6537,21 +6534,21 @@ static int iwl3945_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, | |||
6537 | } | 6534 | } |
6538 | break; | 6535 | break; |
6539 | case DISABLE_KEY: | 6536 | case DISABLE_KEY: |
6540 | rc = iwl3945_clear_sta_key_info(priv, sta_id); | 6537 | ret = iwl3945_clear_sta_key_info(priv, sta_id); |
6541 | if (!rc) { | 6538 | if (!ret) { |
6542 | iwl3945_set_rxon_hwcrypto(priv, 0); | 6539 | iwl3945_set_rxon_hwcrypto(priv, 0); |
6543 | iwl3945_commit_rxon(priv); | 6540 | iwl3945_commit_rxon(priv); |
6544 | IWL_DEBUG_MAC80211("disable hwcrypto key\n"); | 6541 | IWL_DEBUG_MAC80211("disable hwcrypto key\n"); |
6545 | } | 6542 | } |
6546 | break; | 6543 | break; |
6547 | default: | 6544 | default: |
6548 | rc = -EINVAL; | 6545 | ret = -EINVAL; |
6549 | } | 6546 | } |
6550 | 6547 | ||
6551 | IWL_DEBUG_MAC80211("leave\n"); | 6548 | IWL_DEBUG_MAC80211("leave\n"); |
6552 | mutex_unlock(&priv->mutex); | 6549 | mutex_unlock(&priv->mutex); |
6553 | 6550 | ||
6554 | return rc; | 6551 | return ret; |
6555 | } | 6552 | } |
6556 | 6553 | ||
6557 | static int iwl3945_mac_conf_tx(struct ieee80211_hw *hw, u16 queue, | 6554 | static int iwl3945_mac_conf_tx(struct ieee80211_hw *hw, u16 queue, |