Commit 74fda971 authored by Don Fry's avatar Don Fry Committed by Wey-Yi Guy

iwlwifi: move HCMD_ACTIVE to trans

The HCMD_ACTIVE bit is only used in trans.
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 8a8bbdb4
...@@ -1887,7 +1887,7 @@ static void iwl_dump_nic_error_log(struct iwl_priv *priv) ...@@ -1887,7 +1887,7 @@ static void iwl_dump_nic_error_log(struct iwl_priv *priv)
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");
IWL_ERR(trans, "Status: 0x%08lX, count: %d\n", IWL_ERR(trans, "Status: 0x%08lX, count: %d\n",
priv->shrd->status, table.valid); priv->status, table.valid);
} }
trace_iwlwifi_dev_ucode_error(trans->dev, table.error_id, table.tsf_low, trace_iwlwifi_dev_ucode_error(trans->dev, table.error_id, table.tsf_low,
...@@ -2177,9 +2177,6 @@ static void iwlagn_fw_error(struct iwl_priv *priv, bool ondemand) ...@@ -2177,9 +2177,6 @@ static void iwlagn_fw_error(struct iwl_priv *priv, bool ondemand)
/* Set the FW error flag -- cleared on iwl_down */ /* Set the FW error flag -- cleared on iwl_down */
set_bit(STATUS_FW_ERROR, &priv->status); set_bit(STATUS_FW_ERROR, &priv->status);
/* Cancel currently queued command. */
clear_bit(STATUS_HCMD_ACTIVE, &priv->shrd->status);
iwl_abort_notification_waits(&priv->notif_wait); iwl_abort_notification_waits(&priv->notif_wait);
/* Keep the restart process from trying to send host /* Keep the restart process from trying to send host
......
...@@ -526,8 +526,6 @@ static ssize_t iwl_dbgfs_status_read(struct file *file, ...@@ -526,8 +526,6 @@ static ssize_t iwl_dbgfs_status_read(struct file *file,
int pos = 0; int pos = 0;
const size_t bufsz = sizeof(buf); const size_t bufsz = sizeof(buf);
pos += scnprintf(buf + pos, bufsz - pos, "STATUS_HCMD_ACTIVE:\t %d\n",
test_bit(STATUS_HCMD_ACTIVE, &priv->shrd->status));
pos += scnprintf(buf + pos, bufsz - pos, "STATUS_RF_KILL_HW:\t %d\n", pos += scnprintf(buf + pos, bufsz - pos, "STATUS_RF_KILL_HW:\t %d\n",
test_bit(STATUS_RF_KILL_HW, &priv->status)); test_bit(STATUS_RF_KILL_HW, &priv->status));
pos += scnprintf(buf + pos, bufsz - pos, "STATUS_CT_KILL:\t\t %d\n", pos += scnprintf(buf + pos, bufsz - pos, "STATUS_CT_KILL:\t\t %d\n",
......
...@@ -150,7 +150,6 @@ struct iwl_mod_params { ...@@ -150,7 +150,6 @@ struct iwl_mod_params {
/** /**
* struct iwl_shared - shared fields for all the layers of the driver * struct iwl_shared - shared fields for all the layers of the driver
* *
* @status: STATUS_*
* @wowlan: are we running wowlan uCode * @wowlan: are we running wowlan uCode
* @bus: pointer to the bus layer data * @bus: pointer to the bus layer data
* @cfg: see struct iwl_cfg * @cfg: see struct iwl_cfg
...@@ -161,8 +160,6 @@ struct iwl_mod_params { ...@@ -161,8 +160,6 @@ struct iwl_mod_params {
* @eeprom: pointer to the eeprom/OTP image * @eeprom: pointer to the eeprom/OTP image
*/ */
struct iwl_shared { struct iwl_shared {
unsigned long status;
const struct iwl_cfg *cfg; const struct iwl_cfg *cfg;
struct iwl_trans *trans; struct iwl_trans *trans;
void *drv; void *drv;
......
...@@ -547,7 +547,10 @@ static void iwl_irq_handle_error(struct iwl_trans *trans) ...@@ -547,7 +547,10 @@ static void iwl_irq_handle_error(struct iwl_trans *trans)
APMS_CLK_VAL_MRB_FUNC_MODE) || APMS_CLK_VAL_MRB_FUNC_MODE) ||
(iwl_read_prph(trans, APMG_PS_CTRL_REG) & (iwl_read_prph(trans, APMG_PS_CTRL_REG) &
APMG_PS_CTRL_VAL_RESET_REQ))) { APMG_PS_CTRL_VAL_RESET_REQ))) {
clear_bit(STATUS_HCMD_ACTIVE, &trans->shrd->status); struct iwl_trans_pcie *trans_pcie;
trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
clear_bit(STATUS_HCMD_ACTIVE, &trans_pcie->status);
iwl_op_mode_wimax_active(trans->op_mode); iwl_op_mode_wimax_active(trans->op_mode);
wake_up(&trans->wait_command_queue); wake_up(&trans->wait_command_queue);
return; return;
......
...@@ -792,12 +792,12 @@ void iwl_tx_cmd_complete(struct iwl_trans *trans, struct iwl_rx_cmd_buffer *rxb, ...@@ -792,12 +792,12 @@ void iwl_tx_cmd_complete(struct iwl_trans *trans, struct iwl_rx_cmd_buffer *rxb,
iwl_hcmd_queue_reclaim(trans, txq_id, index); iwl_hcmd_queue_reclaim(trans, txq_id, index);
if (!(meta->flags & CMD_ASYNC)) { if (!(meta->flags & CMD_ASYNC)) {
if (!test_bit(STATUS_HCMD_ACTIVE, &trans->shrd->status)) { if (!test_bit(STATUS_HCMD_ACTIVE, &trans_pcie->status)) {
IWL_WARN(trans, IWL_WARN(trans,
"HCMD_ACTIVE already clear for command %s\n", "HCMD_ACTIVE already clear for command %s\n",
get_cmd_string(cmd->hdr.cmd)); get_cmd_string(cmd->hdr.cmd));
} }
clear_bit(STATUS_HCMD_ACTIVE, &trans->shrd->status); clear_bit(STATUS_HCMD_ACTIVE, &trans_pcie->status);
IWL_DEBUG_INFO(trans, "Clearing HCMD_ACTIVE for command %s\n", IWL_DEBUG_INFO(trans, "Clearing HCMD_ACTIVE for command %s\n",
get_cmd_string(cmd->hdr.cmd)); get_cmd_string(cmd->hdr.cmd));
wake_up(&trans->wait_command_queue); wake_up(&trans->wait_command_queue);
...@@ -839,7 +839,7 @@ static int iwl_send_cmd_sync(struct iwl_trans *trans, struct iwl_host_cmd *cmd) ...@@ -839,7 +839,7 @@ static int iwl_send_cmd_sync(struct iwl_trans *trans, struct iwl_host_cmd *cmd)
get_cmd_string(cmd->id)); get_cmd_string(cmd->id));
if (WARN_ON(test_and_set_bit(STATUS_HCMD_ACTIVE, if (WARN_ON(test_and_set_bit(STATUS_HCMD_ACTIVE,
&trans->shrd->status))) { &trans_pcie->status))) {
IWL_ERR(trans, "Command %s: a command is already active!\n", IWL_ERR(trans, "Command %s: a command is already active!\n",
get_cmd_string(cmd->id)); get_cmd_string(cmd->id));
return -EIO; return -EIO;
...@@ -851,7 +851,7 @@ static int iwl_send_cmd_sync(struct iwl_trans *trans, struct iwl_host_cmd *cmd) ...@@ -851,7 +851,7 @@ static int iwl_send_cmd_sync(struct iwl_trans *trans, struct iwl_host_cmd *cmd)
cmd_idx = iwl_enqueue_hcmd(trans, cmd); cmd_idx = iwl_enqueue_hcmd(trans, cmd);
if (cmd_idx < 0) { if (cmd_idx < 0) {
ret = cmd_idx; ret = cmd_idx;
clear_bit(STATUS_HCMD_ACTIVE, &trans->shrd->status); clear_bit(STATUS_HCMD_ACTIVE, &trans_pcie->status);
IWL_ERR(trans, IWL_ERR(trans,
"Error sending %s: enqueue_hcmd failed: %d\n", "Error sending %s: enqueue_hcmd failed: %d\n",
get_cmd_string(cmd->id), ret); get_cmd_string(cmd->id), ret);
...@@ -859,10 +859,10 @@ static int iwl_send_cmd_sync(struct iwl_trans *trans, struct iwl_host_cmd *cmd) ...@@ -859,10 +859,10 @@ static int iwl_send_cmd_sync(struct iwl_trans *trans, struct iwl_host_cmd *cmd)
} }
ret = wait_event_timeout(trans->wait_command_queue, ret = wait_event_timeout(trans->wait_command_queue,
!test_bit(STATUS_HCMD_ACTIVE, &trans->shrd->status), !test_bit(STATUS_HCMD_ACTIVE, &trans_pcie->status),
HOST_COMPLETE_TIMEOUT); HOST_COMPLETE_TIMEOUT);
if (!ret) { if (!ret) {
if (test_bit(STATUS_HCMD_ACTIVE, &trans->shrd->status)) { if (test_bit(STATUS_HCMD_ACTIVE, &trans_pcie->status)) {
struct iwl_tx_queue *txq = struct iwl_tx_queue *txq =
&trans_pcie->txq[trans_pcie->cmd_queue]; &trans_pcie->txq[trans_pcie->cmd_queue];
struct iwl_queue *q = &txq->q; struct iwl_queue *q = &txq->q;
...@@ -876,7 +876,7 @@ static int iwl_send_cmd_sync(struct iwl_trans *trans, struct iwl_host_cmd *cmd) ...@@ -876,7 +876,7 @@ static int iwl_send_cmd_sync(struct iwl_trans *trans, struct iwl_host_cmd *cmd)
"Current CMD queue read_ptr %d write_ptr %d\n", "Current CMD queue read_ptr %d write_ptr %d\n",
q->read_ptr, q->write_ptr); q->read_ptr, q->write_ptr);
clear_bit(STATUS_HCMD_ACTIVE, &trans->shrd->status); clear_bit(STATUS_HCMD_ACTIVE, &trans_pcie->status);
IWL_DEBUG_INFO(trans, "Clearing HCMD_ACTIVE for command" IWL_DEBUG_INFO(trans, "Clearing HCMD_ACTIVE for command"
"%s\n", get_cmd_string(cmd->id)); "%s\n", get_cmd_string(cmd->id));
ret = -ETIMEDOUT; ret = -ETIMEDOUT;
......
...@@ -1248,6 +1248,12 @@ static void iwl_trans_pcie_stop_device(struct iwl_trans *trans) ...@@ -1248,6 +1248,12 @@ static void iwl_trans_pcie_stop_device(struct iwl_trans *trans)
/* stop and reset the on-board processor */ /* stop and reset the on-board processor */
iwl_write32(trans, CSR_RESET, CSR_RESET_REG_FLAG_NEVO_RESET); iwl_write32(trans, CSR_RESET, CSR_RESET_REG_FLAG_NEVO_RESET);
/* clear all status bits */
clear_bit(STATUS_HCMD_ACTIVE, &trans_pcie->status);
clear_bit(STATUS_INT_ENABLED, &trans_pcie->status);
clear_bit(STATUS_DEVICE_ENABLED, &trans_pcie->status);
clear_bit(STATUS_POWER_PMI, &trans_pcie->status);
} }
static void iwl_trans_pcie_wowlan_suspend(struct iwl_trans *trans) static void iwl_trans_pcie_wowlan_suspend(struct iwl_trans *trans)
......
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