Commit 8655112d authored by Don Fry's avatar Don Fry Committed by Wey-Yi Guy

iwlwifi: move event and err pointers to iwl_nic

Move the ucode offset pointers to the iwl_nic as they are nic related.
Signed-off-by: default avatarDon Fry <donald.h.fry@intel.com>
Signed-off-by: default avatarWey-Yi Guy <wey-yi.w.guy@intel.com>
parent 60396183
...@@ -863,9 +863,6 @@ struct iwl_priv { ...@@ -863,9 +863,6 @@ struct iwl_priv {
struct iwl_rx_phy_res last_phy_res; struct iwl_rx_phy_res last_phy_res;
bool last_phy_res_valid; bool last_phy_res_valid;
u32 init_evtlog_ptr, init_evtlog_size, init_errlog_ptr;
u32 inst_evtlog_ptr, inst_evtlog_size, inst_errlog_ptr;
/* /*
* chain noise reset and gain commands are the * chain noise reset and gain commands are the
* two extra calibration commands follows the standard * two extra calibration commands follows the standard
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include "iwl-core.h" #include "iwl-core.h"
#include "iwl-io.h" #include "iwl-io.h"
#include "iwl-trans-pcie-int.h" #include "iwl-trans-pcie-int.h"
#include "iwl-wifi.h"
#ifdef CONFIG_IWLWIFI_IDI #ifdef CONFIG_IWLWIFI_IDI
#include "iwl-amfh.h" #include "iwl-amfh.h"
...@@ -589,17 +590,17 @@ static void iwl_dump_nic_error_log(struct iwl_trans *trans) ...@@ -589,17 +590,17 @@ static void iwl_dump_nic_error_log(struct iwl_trans *trans)
{ {
u32 base; u32 base;
struct iwl_error_event_table table; struct iwl_error_event_table table;
struct iwl_priv *priv = priv(trans); struct iwl_nic *nic = nic(trans);
struct iwl_trans_pcie *trans_pcie = struct iwl_trans_pcie *trans_pcie =
IWL_TRANS_GET_PCIE_TRANS(trans); IWL_TRANS_GET_PCIE_TRANS(trans);
base = trans->shrd->device_pointers.error_event_table; base = trans->shrd->device_pointers.error_event_table;
if (trans->shrd->ucode_type == IWL_UCODE_INIT) { if (trans->shrd->ucode_type == IWL_UCODE_INIT) {
if (!base) if (!base)
base = priv->init_errlog_ptr; base = nic->init_errlog_ptr;
} else { } else {
if (!base) if (!base)
base = priv->inst_errlog_ptr; base = nic->inst_errlog_ptr;
} }
if (!iwlagn_hw_valid_rtc_data_addr(base)) { if (!iwlagn_hw_valid_rtc_data_addr(base)) {
...@@ -611,7 +612,7 @@ static void iwl_dump_nic_error_log(struct iwl_trans *trans) ...@@ -611,7 +612,7 @@ static void iwl_dump_nic_error_log(struct iwl_trans *trans)
return; return;
} }
iwl_read_targ_mem_words(trans(priv), base, &table, sizeof(table)); iwl_read_targ_mem_words(trans, base, &table, sizeof(table));
if (ERROR_START_OFFSET <= table.valid * ERROR_ELEM_SIZE) { if (ERROR_START_OFFSET <= table.valid * ERROR_ELEM_SIZE) {
IWL_ERR(trans, "Start IWL Error Log Dump:\n"); IWL_ERR(trans, "Start IWL Error Log Dump:\n");
...@@ -621,7 +622,7 @@ static void iwl_dump_nic_error_log(struct iwl_trans *trans) ...@@ -621,7 +622,7 @@ static void iwl_dump_nic_error_log(struct iwl_trans *trans)
trans_pcie->isr_stats.err_code = table.error_id; trans_pcie->isr_stats.err_code = table.error_id;
trace_iwlwifi_dev_ucode_error(priv, table.error_id, table.tsf_low, trace_iwlwifi_dev_ucode_error(priv(nic), table.error_id, table.tsf_low,
table.data1, table.data2, table.line, table.data1, table.data2, table.line,
table.blink1, table.blink2, table.ilink1, table.blink1, table.blink2, table.ilink1,
table.ilink2, table.bcon_time, table.gp1, table.ilink2, table.bcon_time, table.gp1,
...@@ -718,7 +719,7 @@ static int iwl_print_event_log(struct iwl_trans *trans, u32 start_idx, ...@@ -718,7 +719,7 @@ static int iwl_print_event_log(struct iwl_trans *trans, u32 start_idx,
u32 ptr; /* SRAM byte address of log data */ u32 ptr; /* SRAM byte address of log data */
u32 ev, time, data; /* event log data */ u32 ev, time, data; /* event log data */
unsigned long reg_flags; unsigned long reg_flags;
struct iwl_priv *priv = priv(trans); struct iwl_nic *nic = nic(trans);
if (num_events == 0) if (num_events == 0)
return pos; return pos;
...@@ -726,10 +727,10 @@ static int iwl_print_event_log(struct iwl_trans *trans, u32 start_idx, ...@@ -726,10 +727,10 @@ static int iwl_print_event_log(struct iwl_trans *trans, u32 start_idx,
base = trans->shrd->device_pointers.log_event_table; base = trans->shrd->device_pointers.log_event_table;
if (trans->shrd->ucode_type == IWL_UCODE_INIT) { if (trans->shrd->ucode_type == IWL_UCODE_INIT) {
if (!base) if (!base)
base = priv->init_evtlog_ptr; base = nic->init_evtlog_ptr;
} else { } else {
if (!base) if (!base)
base = priv->inst_evtlog_ptr; base = nic->inst_evtlog_ptr;
} }
if (mode == 0) if (mode == 0)
...@@ -759,7 +760,7 @@ static int iwl_print_event_log(struct iwl_trans *trans, u32 start_idx, ...@@ -759,7 +760,7 @@ static int iwl_print_event_log(struct iwl_trans *trans, u32 start_idx,
"EVT_LOG:0x%08x:%04u\n", "EVT_LOG:0x%08x:%04u\n",
time, ev); time, ev);
} else { } else {
trace_iwlwifi_dev_ucode_event(priv, 0, trace_iwlwifi_dev_ucode_event(priv(trans), 0,
time, ev); time, ev);
IWL_ERR(trans, "EVT_LOG:0x%08x:%04u\n", IWL_ERR(trans, "EVT_LOG:0x%08x:%04u\n",
time, ev); time, ev);
...@@ -773,7 +774,7 @@ static int iwl_print_event_log(struct iwl_trans *trans, u32 start_idx, ...@@ -773,7 +774,7 @@ static int iwl_print_event_log(struct iwl_trans *trans, u32 start_idx,
} else { } else {
IWL_ERR(trans, "EVT_LOGT:%010u:0x%08x:%04u\n", IWL_ERR(trans, "EVT_LOGT:%010u:0x%08x:%04u\n",
time, data, ev); time, data, ev);
trace_iwlwifi_dev_ucode_event(priv, time, trace_iwlwifi_dev_ucode_event(priv(trans), time,
data, ev); data, ev);
} }
} }
...@@ -835,17 +836,17 @@ int iwl_dump_nic_event_log(struct iwl_trans *trans, bool full_log, ...@@ -835,17 +836,17 @@ int iwl_dump_nic_event_log(struct iwl_trans *trans, bool full_log,
u32 logsize; u32 logsize;
int pos = 0; int pos = 0;
size_t bufsz = 0; size_t bufsz = 0;
struct iwl_priv *priv = priv(trans); struct iwl_nic *nic = nic(trans);
base = trans->shrd->device_pointers.log_event_table; base = trans->shrd->device_pointers.log_event_table;
if (trans->shrd->ucode_type == IWL_UCODE_INIT) { if (trans->shrd->ucode_type == IWL_UCODE_INIT) {
logsize = priv->init_evtlog_size; logsize = nic->init_evtlog_size;
if (!base) if (!base)
base = priv->init_evtlog_ptr; base = nic->init_evtlog_ptr;
} else { } else {
logsize = priv->inst_evtlog_size; logsize = nic->inst_evtlog_size;
if (!base) if (!base)
base = priv->inst_evtlog_ptr; base = nic->inst_evtlog_ptr;
} }
if (!iwlagn_hw_valid_rtc_data_addr(base)) { if (!iwlagn_hw_valid_rtc_data_addr(base)) {
......
...@@ -1205,20 +1205,20 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context) ...@@ -1205,20 +1205,20 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
* for each event, which is of mode 1 (including timestamp) for all * for each event, which is of mode 1 (including timestamp) for all
* new microcodes that include this information. * new microcodes that include this information.
*/ */
priv->init_evtlog_ptr = pieces.init_evtlog_ptr; nic->init_evtlog_ptr = pieces.init_evtlog_ptr;
if (pieces.init_evtlog_size) if (pieces.init_evtlog_size)
priv->init_evtlog_size = (pieces.init_evtlog_size - 16)/12; nic->init_evtlog_size = (pieces.init_evtlog_size - 16)/12;
else else
priv->init_evtlog_size = nic->init_evtlog_size =
cfg(priv)->base_params->max_event_log_size; cfg(priv)->base_params->max_event_log_size;
priv->init_errlog_ptr = pieces.init_errlog_ptr; nic->init_errlog_ptr = pieces.init_errlog_ptr;
priv->inst_evtlog_ptr = pieces.inst_evtlog_ptr; nic->inst_evtlog_ptr = pieces.inst_evtlog_ptr;
if (pieces.inst_evtlog_size) if (pieces.inst_evtlog_size)
priv->inst_evtlog_size = (pieces.inst_evtlog_size - 16)/12; nic->inst_evtlog_size = (pieces.inst_evtlog_size - 16)/12;
else else
priv->inst_evtlog_size = nic->inst_evtlog_size =
cfg(priv)->base_params->max_event_log_size; cfg(priv)->base_params->max_event_log_size;
priv->inst_errlog_ptr = pieces.inst_errlog_ptr; nic->inst_errlog_ptr = pieces.inst_errlog_ptr;
#ifndef CONFIG_IWLWIFI_P2P #ifndef CONFIG_IWLWIFI_P2P
ucode_capa.flags &= ~IWL_UCODE_TLV_FLAGS_PAN; ucode_capa.flags &= ~IWL_UCODE_TLV_FLAGS_PAN;
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment