aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-agn.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index a67b04b309e0..837406e53b3f 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -165,7 +165,7 @@ int iwl_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx)
165 } 165 }
166 iwl_clear_ucode_stations(priv, ctx); 166 iwl_clear_ucode_stations(priv, ctx);
167 iwl_restore_stations(priv, ctx); 167 iwl_restore_stations(priv, ctx);
168 ret = iwl_restore_default_wep_keys(priv); 168 ret = iwl_restore_default_wep_keys(priv, ctx);
169 if (ret) { 169 if (ret) {
170 IWL_ERR(priv, "Failed to restore WEP keys (%d)\n", ret); 170 IWL_ERR(priv, "Failed to restore WEP keys (%d)\n", ret);
171 return ret; 171 return ret;
@@ -197,7 +197,7 @@ int iwl_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx)
197 memcpy(active_rxon, &ctx->staging, sizeof(*active_rxon)); 197 memcpy(active_rxon, &ctx->staging, sizeof(*active_rxon));
198 iwl_clear_ucode_stations(priv, ctx); 198 iwl_clear_ucode_stations(priv, ctx);
199 iwl_restore_stations(priv, ctx); 199 iwl_restore_stations(priv, ctx);
200 ret = iwl_restore_default_wep_keys(priv); 200 ret = iwl_restore_default_wep_keys(priv, ctx);
201 if (ret) { 201 if (ret) {
202 IWL_ERR(priv, "Failed to restore WEP keys (%d)\n", ret); 202 IWL_ERR(priv, "Failed to restore WEP keys (%d)\n", ret);
203 return ret; 203 return ret;
@@ -2222,6 +2222,11 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
2222 priv->_agn.inst_evtlog_size = priv->cfg->max_event_log_size; 2222 priv->_agn.inst_evtlog_size = priv->cfg->max_event_log_size;
2223 priv->_agn.inst_errlog_ptr = pieces.inst_errlog_ptr; 2223 priv->_agn.inst_errlog_ptr = pieces.inst_errlog_ptr;
2224 2224
2225 if (priv->valid_contexts == BIT(IWL_RXON_CTX_BSS))
2226 priv->sta_key_max_num = STA_KEY_MAX_NUM;
2227 else
2228 priv->sta_key_max_num = STA_KEY_MAX_NUM_PAN;
2229
2225 /* Copy images into buffers for card's bus-master reads ... */ 2230 /* Copy images into buffers for card's bus-master reads ... */
2226 2231
2227 /* Runtime instructions (first block of data in file) */ 2232 /* Runtime instructions (first block of data in file) */
@@ -3548,6 +3553,7 @@ static int iwl_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
3548{ 3553{
3549 struct iwl_priv *priv = hw->priv; 3554 struct iwl_priv *priv = hw->priv;
3550 struct iwl_vif_priv *vif_priv = (void *)vif->drv_priv; 3555 struct iwl_vif_priv *vif_priv = (void *)vif->drv_priv;
3556 struct iwl_rxon_context *ctx = vif_priv->ctx;
3551 int ret; 3557 int ret;
3552 u8 sta_id; 3558 u8 sta_id;
3553 bool is_default_wep_key = false; 3559 bool is_default_wep_key = false;
@@ -3576,7 +3582,7 @@ static int iwl_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
3576 key->cipher == WLAN_CIPHER_SUITE_WEP104) && 3582 key->cipher == WLAN_CIPHER_SUITE_WEP104) &&
3577 !sta) { 3583 !sta) {
3578 if (cmd == SET_KEY) 3584 if (cmd == SET_KEY)
3579 is_default_wep_key = !priv->key_mapping_key; 3585 is_default_wep_key = !ctx->key_mapping_keys;
3580 else 3586 else
3581 is_default_wep_key = 3587 is_default_wep_key =
3582 (key->hw_key_idx == HW_KEY_DEFAULT); 3588 (key->hw_key_idx == HW_KEY_DEFAULT);
@@ -3594,9 +3600,9 @@ static int iwl_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
3594 break; 3600 break;
3595 case DISABLE_KEY: 3601 case DISABLE_KEY:
3596 if (is_default_wep_key) 3602 if (is_default_wep_key)
3597 ret = iwl_remove_default_wep_key(priv, key); 3603 ret = iwl_remove_default_wep_key(priv, ctx, key);
3598 else 3604 else
3599 ret = iwl_remove_dynamic_key(priv, key, sta_id); 3605 ret = iwl_remove_dynamic_key(priv, ctx, key, sta_id);
3600 3606
3601 IWL_DEBUG_MAC80211(priv, "disable hwcrypto key\n"); 3607 IWL_DEBUG_MAC80211(priv, "disable hwcrypto key\n");
3602 break; 3608 break;
@@ -4209,6 +4215,7 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
4209 priv->contexts[IWL_RXON_CTX_BSS].rxon_assoc_cmd = REPLY_RXON_ASSOC; 4215 priv->contexts[IWL_RXON_CTX_BSS].rxon_assoc_cmd = REPLY_RXON_ASSOC;
4210 priv->contexts[IWL_RXON_CTX_BSS].qos_cmd = REPLY_QOS_PARAM; 4216 priv->contexts[IWL_RXON_CTX_BSS].qos_cmd = REPLY_QOS_PARAM;
4211 priv->contexts[IWL_RXON_CTX_BSS].ap_sta_id = IWL_AP_ID; 4217 priv->contexts[IWL_RXON_CTX_BSS].ap_sta_id = IWL_AP_ID;
4218 priv->contexts[IWL_RXON_CTX_BSS].wep_key_cmd = REPLY_WEPKEY;
4212 BUILD_BUG_ON(NUM_IWL_RXON_CTX != 1); 4219 BUILD_BUG_ON(NUM_IWL_RXON_CTX != 1);
4213 4220
4214 SET_IEEE80211_DEV(hw, &pdev->dev); 4221 SET_IEEE80211_DEV(hw, &pdev->dev);