|
@@ -158,6 +158,11 @@ int iwl_commit_rxon(struct iwl_priv *priv)
|
|
}
|
|
}
|
|
iwl_clear_ucode_stations(priv, false);
|
|
iwl_clear_ucode_stations(priv, false);
|
|
iwl_restore_stations(priv);
|
|
iwl_restore_stations(priv);
|
|
|
|
+ ret = iwl_restore_default_wep_keys(priv);
|
|
|
|
+ if (ret) {
|
|
|
|
+ IWL_ERR(priv, "Failed to restore WEP keys (%d)\n", ret);
|
|
|
|
+ return ret;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
IWL_DEBUG_INFO(priv, "Sending RXON\n"
|
|
IWL_DEBUG_INFO(priv, "Sending RXON\n"
|
|
@@ -185,6 +190,11 @@ int iwl_commit_rxon(struct iwl_priv *priv)
|
|
memcpy(active_rxon, &priv->staging_rxon, sizeof(*active_rxon));
|
|
memcpy(active_rxon, &priv->staging_rxon, sizeof(*active_rxon));
|
|
iwl_clear_ucode_stations(priv, false);
|
|
iwl_clear_ucode_stations(priv, false);
|
|
iwl_restore_stations(priv);
|
|
iwl_restore_stations(priv);
|
|
|
|
+ ret = iwl_restore_default_wep_keys(priv);
|
|
|
|
+ if (ret) {
|
|
|
|
+ IWL_ERR(priv, "Failed to restore WEP keys (%d)\n", ret);
|
|
|
|
+ return ret;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
priv->start_calib = 0;
|
|
priv->start_calib = 0;
|
|
@@ -1833,6 +1843,7 @@ void iwl_dump_nic_error_log(struct iwl_priv *priv)
|
|
u32 data2, line;
|
|
u32 data2, line;
|
|
u32 desc, time, count, base, data1;
|
|
u32 desc, time, count, base, data1;
|
|
u32 blink1, blink2, ilink1, ilink2;
|
|
u32 blink1, blink2, ilink1, ilink2;
|
|
|
|
+ u32 pc, hcmd;
|
|
|
|
|
|
if (priv->ucode_type == UCODE_INIT)
|
|
if (priv->ucode_type == UCODE_INIT)
|
|
base = le32_to_cpu(priv->card_alive_init.error_event_table_ptr);
|
|
base = le32_to_cpu(priv->card_alive_init.error_event_table_ptr);
|
|
@@ -1855,6 +1866,7 @@ void iwl_dump_nic_error_log(struct iwl_priv *priv)
|
|
}
|
|
}
|
|
|
|
|
|
desc = iwl_read_targ_mem(priv, base + 1 * sizeof(u32));
|
|
desc = iwl_read_targ_mem(priv, base + 1 * sizeof(u32));
|
|
|
|
+ pc = iwl_read_targ_mem(priv, base + 2 * sizeof(u32));
|
|
blink1 = iwl_read_targ_mem(priv, base + 3 * sizeof(u32));
|
|
blink1 = iwl_read_targ_mem(priv, base + 3 * sizeof(u32));
|
|
blink2 = iwl_read_targ_mem(priv, base + 4 * sizeof(u32));
|
|
blink2 = iwl_read_targ_mem(priv, base + 4 * sizeof(u32));
|
|
ilink1 = iwl_read_targ_mem(priv, base + 5 * sizeof(u32));
|
|
ilink1 = iwl_read_targ_mem(priv, base + 5 * sizeof(u32));
|
|
@@ -1863,6 +1875,7 @@ void iwl_dump_nic_error_log(struct iwl_priv *priv)
|
|
data2 = iwl_read_targ_mem(priv, base + 8 * sizeof(u32));
|
|
data2 = iwl_read_targ_mem(priv, base + 8 * sizeof(u32));
|
|
line = iwl_read_targ_mem(priv, base + 9 * sizeof(u32));
|
|
line = iwl_read_targ_mem(priv, base + 9 * sizeof(u32));
|
|
time = iwl_read_targ_mem(priv, base + 11 * sizeof(u32));
|
|
time = iwl_read_targ_mem(priv, base + 11 * sizeof(u32));
|
|
|
|
+ hcmd = iwl_read_targ_mem(priv, base + 22 * sizeof(u32));
|
|
|
|
|
|
trace_iwlwifi_dev_ucode_error(priv, desc, time, data1, data2, line,
|
|
trace_iwlwifi_dev_ucode_error(priv, desc, time, data1, data2, line,
|
|
blink1, blink2, ilink1, ilink2);
|
|
blink1, blink2, ilink1, ilink2);
|
|
@@ -1871,10 +1884,9 @@ void iwl_dump_nic_error_log(struct iwl_priv *priv)
|
|
"data1 data2 line\n");
|
|
"data1 data2 line\n");
|
|
IWL_ERR(priv, "%-28s (#%02d) %010u 0x%08X 0x%08X %u\n",
|
|
IWL_ERR(priv, "%-28s (#%02d) %010u 0x%08X 0x%08X %u\n",
|
|
desc_lookup(desc), desc, time, data1, data2, line);
|
|
desc_lookup(desc), desc, time, data1, data2, line);
|
|
- IWL_ERR(priv, "blink1 blink2 ilink1 ilink2\n");
|
|
|
|
- IWL_ERR(priv, "0x%05X 0x%05X 0x%05X 0x%05X\n", blink1, blink2,
|
|
|
|
- ilink1, ilink2);
|
|
|
|
-
|
|
|
|
|
|
+ IWL_ERR(priv, "pc blink1 blink2 ilink1 ilink2 hcmd\n");
|
|
|
|
+ IWL_ERR(priv, "0x%05X 0x%05X 0x%05X 0x%05X 0x%05X 0x%05X\n",
|
|
|
|
+ pc, blink1, blink2, ilink1, ilink2, hcmd);
|
|
}
|
|
}
|
|
|
|
|
|
#define EVENT_START_OFFSET (4 * sizeof(u32))
|
|
#define EVENT_START_OFFSET (4 * sizeof(u32))
|
|
@@ -1990,9 +2002,6 @@ static int iwl_print_last_event_logs(struct iwl_priv *priv, u32 capacity,
|
|
return pos;
|
|
return pos;
|
|
}
|
|
}
|
|
|
|
|
|
-/* For sanity check only. Actual size is determined by uCode, typ. 512 */
|
|
|
|
-#define MAX_EVENT_LOG_SIZE (512)
|
|
|
|
-
|
|
|
|
#define DEFAULT_DUMP_EVENT_LOG_ENTRIES (20)
|
|
#define DEFAULT_DUMP_EVENT_LOG_ENTRIES (20)
|
|
|
|
|
|
int iwl_dump_nic_event_log(struct iwl_priv *priv, bool full_log,
|
|
int iwl_dump_nic_event_log(struct iwl_priv *priv, bool full_log,
|
|
@@ -2025,16 +2034,16 @@ int iwl_dump_nic_event_log(struct iwl_priv *priv, bool full_log,
|
|
num_wraps = iwl_read_targ_mem(priv, base + (2 * sizeof(u32)));
|
|
num_wraps = iwl_read_targ_mem(priv, base + (2 * sizeof(u32)));
|
|
next_entry = iwl_read_targ_mem(priv, base + (3 * sizeof(u32)));
|
|
next_entry = iwl_read_targ_mem(priv, base + (3 * sizeof(u32)));
|
|
|
|
|
|
- if (capacity > MAX_EVENT_LOG_SIZE) {
|
|
|
|
|
|
+ if (capacity > priv->cfg->max_event_log_size) {
|
|
IWL_ERR(priv, "Log capacity %d is bogus, limit to %d entries\n",
|
|
IWL_ERR(priv, "Log capacity %d is bogus, limit to %d entries\n",
|
|
- capacity, MAX_EVENT_LOG_SIZE);
|
|
|
|
- capacity = MAX_EVENT_LOG_SIZE;
|
|
|
|
|
|
+ capacity, priv->cfg->max_event_log_size);
|
|
|
|
+ capacity = priv->cfg->max_event_log_size;
|
|
}
|
|
}
|
|
|
|
|
|
- if (next_entry > MAX_EVENT_LOG_SIZE) {
|
|
|
|
|
|
+ if (next_entry > priv->cfg->max_event_log_size) {
|
|
IWL_ERR(priv, "Log write index %d is bogus, limit to %d\n",
|
|
IWL_ERR(priv, "Log write index %d is bogus, limit to %d\n",
|
|
- next_entry, MAX_EVENT_LOG_SIZE);
|
|
|
|
- next_entry = MAX_EVENT_LOG_SIZE;
|
|
|
|
|
|
+ next_entry, priv->cfg->max_event_log_size);
|
|
|
|
+ next_entry = priv->cfg->max_event_log_size;
|
|
}
|
|
}
|
|
|
|
|
|
size = num_wraps ? capacity : next_entry;
|
|
size = num_wraps ? capacity : next_entry;
|
|
@@ -2894,12 +2903,13 @@ static int iwl_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
|
|
mutex_lock(&priv->mutex);
|
|
mutex_lock(&priv->mutex);
|
|
iwl_scan_cancel_timeout(priv, 100);
|
|
iwl_scan_cancel_timeout(priv, 100);
|
|
|
|
|
|
- /* If we are getting WEP group key and we didn't receive any key mapping
|
|
|
|
|
|
+ /*
|
|
|
|
+ * If we are getting WEP group key and we didn't receive any key mapping
|
|
* so far, we are in legacy wep mode (group key only), otherwise we are
|
|
* so far, we are in legacy wep mode (group key only), otherwise we are
|
|
* in 1X mode.
|
|
* in 1X mode.
|
|
- * In legacy wep mode, we use another host command to the uCode */
|
|
|
|
- if (key->alg == ALG_WEP && sta_id == priv->hw_params.bcast_sta_id &&
|
|
|
|
- priv->iw_mode != NL80211_IFTYPE_AP) {
|
|
|
|
|
|
+ * In legacy wep mode, we use another host command to the uCode.
|
|
|
|
+ */
|
|
|
|
+ if (key->alg == ALG_WEP && !sta && vif->type != NL80211_IFTYPE_AP) {
|
|
if (cmd == SET_KEY)
|
|
if (cmd == SET_KEY)
|
|
is_default_wep_key = !priv->key_mapping_key;
|
|
is_default_wep_key = !priv->key_mapping_key;
|
|
else
|
|
else
|
|
@@ -3033,19 +3043,6 @@ static void iwl_mac_sta_notify(struct ieee80211_hw *hw,
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-/**
|
|
|
|
- * iwl_restore_wepkeys - Restore WEP keys to device
|
|
|
|
- */
|
|
|
|
-static void iwl_restore_wepkeys(struct iwl_priv *priv)
|
|
|
|
-{
|
|
|
|
- mutex_lock(&priv->mutex);
|
|
|
|
- if (priv->iw_mode == NL80211_IFTYPE_STATION &&
|
|
|
|
- priv->default_wep_key &&
|
|
|
|
- iwl_send_static_wepkey_cmd(priv, 0))
|
|
|
|
- IWL_ERR(priv, "Could not send WEP static key\n");
|
|
|
|
- mutex_unlock(&priv->mutex);
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
static int iwlagn_mac_sta_add(struct ieee80211_hw *hw,
|
|
static int iwlagn_mac_sta_add(struct ieee80211_hw *hw,
|
|
struct ieee80211_vif *vif,
|
|
struct ieee80211_vif *vif,
|
|
struct ieee80211_sta *sta)
|
|
struct ieee80211_sta *sta)
|
|
@@ -3072,8 +3069,6 @@ static int iwlagn_mac_sta_add(struct ieee80211_hw *hw,
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
|
|
- iwl_restore_wepkeys(priv);
|
|
|
|
-
|
|
|
|
/* Initialize rate scaling */
|
|
/* Initialize rate scaling */
|
|
IWL_DEBUG_INFO(priv, "Initializing rate scaling for station %pM\n",
|
|
IWL_DEBUG_INFO(priv, "Initializing rate scaling for station %pM\n",
|
|
sta->addr);
|
|
sta->addr);
|