aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-agn.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2011-04-05 12:42:04 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-04-07 15:51:38 -0400
commitd7d5783c6668b54111cc77005755799e94261497 (patch)
treef65b3ee1b9d1c49088ccabc18638fc99b5e053d1 /drivers/net/wireless/iwlwifi/iwl-agn.c
parent3d09cdff233b5a37ce9993c533e8da1403e2da30 (diff)
iwlagn: clean up alive handling
Devices newer than 4965 don't actually send two different versions of the ALIVE command, so we always had a bug here since before this patch we copy more data than we got. Remove the iwl_init_alive_resp struct and don't use it. Since we also really don't need to track all the data received in ALIVE as we only use the error and log event tables later, we can also save space by just keeping those and not more data around in memory. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 30b8b9e1bc2e..b3b1e84c9311 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -590,10 +590,7 @@ static void iwl_continuous_event_trace(struct iwl_priv *priv)
590 u32 num_wraps; /* # times uCode wrapped to top of log */ 590 u32 num_wraps; /* # times uCode wrapped to top of log */
591 u32 next_entry; /* index of next entry to be written by uCode */ 591 u32 next_entry; /* index of next entry to be written by uCode */
592 592
593 if (priv->ucode_type == UCODE_INIT) 593 base = priv->device_pointers.error_event_table;
594 base = le32_to_cpu(priv->card_alive_init.error_event_table_ptr);
595 else
596 base = le32_to_cpu(priv->card_alive.log_event_table_ptr);
597 if (priv->cfg->ops->lib->is_valid_rtc_data_addr(base)) { 594 if (priv->cfg->ops->lib->is_valid_rtc_data_addr(base)) {
598 capacity = iwl_read_targ_mem(priv, base); 595 capacity = iwl_read_targ_mem(priv, base);
599 num_wraps = iwl_read_targ_mem(priv, base + (2 * sizeof(u32))); 596 num_wraps = iwl_read_targ_mem(priv, base + (2 * sizeof(u32)));
@@ -1871,12 +1868,11 @@ void iwl_dump_nic_error_log(struct iwl_priv *priv)
1871 u32 blink1, blink2, ilink1, ilink2; 1868 u32 blink1, blink2, ilink1, ilink2;
1872 u32 pc, hcmd; 1869 u32 pc, hcmd;
1873 1870
1871 base = priv->device_pointers.error_event_table;
1874 if (priv->ucode_type == UCODE_INIT) { 1872 if (priv->ucode_type == UCODE_INIT) {
1875 base = le32_to_cpu(priv->card_alive_init.error_event_table_ptr);
1876 if (!base) 1873 if (!base)
1877 base = priv->_agn.init_errlog_ptr; 1874 base = priv->_agn.init_errlog_ptr;
1878 } else { 1875 } else {
1879 base = le32_to_cpu(priv->card_alive.error_event_table_ptr);
1880 if (!base) 1876 if (!base)
1881 base = priv->_agn.inst_errlog_ptr; 1877 base = priv->_agn.inst_errlog_ptr;
1882 } 1878 }
@@ -1941,12 +1937,11 @@ static int iwl_print_event_log(struct iwl_priv *priv, u32 start_idx,
1941 if (num_events == 0) 1937 if (num_events == 0)
1942 return pos; 1938 return pos;
1943 1939
1940 base = priv->device_pointers.log_event_table;
1944 if (priv->ucode_type == UCODE_INIT) { 1941 if (priv->ucode_type == UCODE_INIT) {
1945 base = le32_to_cpu(priv->card_alive_init.log_event_table_ptr);
1946 if (!base) 1942 if (!base)
1947 base = priv->_agn.init_evtlog_ptr; 1943 base = priv->_agn.init_evtlog_ptr;
1948 } else { 1944 } else {
1949 base = le32_to_cpu(priv->card_alive.log_event_table_ptr);
1950 if (!base) 1945 if (!base)
1951 base = priv->_agn.inst_evtlog_ptr; 1946 base = priv->_agn.inst_evtlog_ptr;
1952 } 1947 }
@@ -2055,13 +2050,12 @@ int iwl_dump_nic_event_log(struct iwl_priv *priv, bool full_log,
2055 int pos = 0; 2050 int pos = 0;
2056 size_t bufsz = 0; 2051 size_t bufsz = 0;
2057 2052
2053 base = priv->device_pointers.log_event_table;
2058 if (priv->ucode_type == UCODE_INIT) { 2054 if (priv->ucode_type == UCODE_INIT) {
2059 base = le32_to_cpu(priv->card_alive_init.log_event_table_ptr);
2060 logsize = priv->_agn.init_evtlog_size; 2055 logsize = priv->_agn.init_evtlog_size;
2061 if (!base) 2056 if (!base)
2062 base = priv->_agn.init_evtlog_ptr; 2057 base = priv->_agn.init_evtlog_ptr;
2063 } else { 2058 } else {
2064 base = le32_to_cpu(priv->card_alive.log_event_table_ptr);
2065 logsize = priv->_agn.inst_evtlog_size; 2059 logsize = priv->_agn.inst_evtlog_size;
2066 if (!base) 2060 if (!base)
2067 base = priv->_agn.inst_evtlog_ptr; 2061 base = priv->_agn.inst_evtlog_ptr;
@@ -2415,8 +2409,6 @@ static void __iwl_down(struct iwl_priv *priv)
2415 iwl_apm_stop(priv); 2409 iwl_apm_stop(priv);
2416 2410
2417 exit: 2411 exit:
2418 memset(&priv->card_alive, 0, sizeof(struct iwl_alive_resp));
2419
2420 dev_kfree_skb(priv->beacon_skb); 2412 dev_kfree_skb(priv->beacon_skb);
2421 priv->beacon_skb = NULL; 2413 priv->beacon_skb = NULL;
2422 2414