Commit 69a10b29 authored by Meenakshi Venkataraman's avatar Meenakshi Venkataraman Committed by John W. Linville

iwlwifi: move wait_command_queue from shared to trans

This wait queue really belongs to the transport
layer, as it is used for sending synchronous
commands to the HW.

However, only op_mode knows about errors and
exceptional conditions, so make this queue
accessible by the op_mode.
Signed-off-by: default avatarMeenakshi Venkataraman <meenakshi.venkataraman@intel.com>
Signed-off-by: default avatarWey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent f0d120af
...@@ -671,7 +671,7 @@ static int iwlagn_rx_card_state_notif(struct iwl_priv *priv, ...@@ -671,7 +671,7 @@ static int iwlagn_rx_card_state_notif(struct iwl_priv *priv,
wiphy_rfkill_set_hw_state(priv->hw->wiphy, wiphy_rfkill_set_hw_state(priv->hw->wiphy,
test_bit(STATUS_RF_KILL_HW, &priv->status)); test_bit(STATUS_RF_KILL_HW, &priv->status));
else else
wake_up(&priv->shrd->wait_command_queue); wake_up(&trans(priv)->wait_command_queue);
return 0; return 0;
} }
......
...@@ -962,8 +962,6 @@ static void iwl_setup_deferred_work(struct iwl_priv *priv) ...@@ -962,8 +962,6 @@ static void iwl_setup_deferred_work(struct iwl_priv *priv)
{ {
priv->workqueue = create_singlethread_workqueue(DRV_NAME); priv->workqueue = create_singlethread_workqueue(DRV_NAME);
init_waitqueue_head(&priv->shrd->wait_command_queue);
INIT_WORK(&priv->restart, iwl_bg_restart); INIT_WORK(&priv->restart, iwl_bg_restart);
INIT_WORK(&priv->beacon_update, iwl_bg_beacon_update); INIT_WORK(&priv->beacon_update, iwl_bg_beacon_update);
INIT_WORK(&priv->run_time_calib_work, iwl_bg_run_time_calib_work); INIT_WORK(&priv->run_time_calib_work, iwl_bg_run_time_calib_work);
......
...@@ -850,7 +850,7 @@ static void iwlagn_fw_error(struct iwl_priv *priv, bool ondemand) ...@@ -850,7 +850,7 @@ static void iwlagn_fw_error(struct iwl_priv *priv, bool ondemand)
* commands by clearing the ready bit */ * commands by clearing the ready bit */
clear_bit(STATUS_READY, &priv->status); clear_bit(STATUS_READY, &priv->status);
wake_up(&priv->shrd->wait_command_queue); wake_up(&trans(priv)->wait_command_queue);
if (!ondemand) { if (!ondemand) {
/* /*
......
...@@ -376,7 +376,6 @@ struct iwl_cfg { ...@@ -376,7 +376,6 @@ struct iwl_cfg {
* @nic: pointer to the nic data * @nic: pointer to the nic data
* @hw_params: see struct iwl_hw_params * @hw_params: see struct iwl_hw_params
* @lock: protect general shared data * @lock: protect general shared data
* @wait_command_queue: the wait_queue for SYNC host commands
* @eeprom: pointer to the eeprom/OTP image * @eeprom: pointer to the eeprom/OTP image
* @ucode_type: indicator of loaded ucode image * @ucode_type: indicator of loaded ucode image
* @device_pointers: pointers to ucode event tables * @device_pointers: pointers to ucode event tables
...@@ -391,8 +390,6 @@ struct iwl_shared { ...@@ -391,8 +390,6 @@ struct iwl_shared {
struct iwl_hw_params hw_params; struct iwl_hw_params hw_params;
const struct iwl_fw *fw; const struct iwl_fw *fw;
wait_queue_head_t wait_command_queue;
/* eeprom -- this is in the card's little endian byte order */ /* eeprom -- this is in the card's little endian byte order */
u8 *eeprom; u8 *eeprom;
......
...@@ -684,7 +684,7 @@ static void iwl_irq_handle_error(struct iwl_trans *trans) ...@@ -684,7 +684,7 @@ static void iwl_irq_handle_error(struct iwl_trans *trans)
*/ */
clear_bit(STATUS_READY, &trans->shrd->status); clear_bit(STATUS_READY, &trans->shrd->status);
clear_bit(STATUS_HCMD_ACTIVE, &trans->shrd->status); clear_bit(STATUS_HCMD_ACTIVE, &trans->shrd->status);
wake_up(&trans->shrd->wait_command_queue); wake_up(&trans->wait_command_queue);
IWL_ERR(trans, "RF is used by WiMAX\n"); IWL_ERR(trans, "RF is used by WiMAX\n");
return; return;
} }
......
...@@ -928,7 +928,7 @@ void iwl_tx_cmd_complete(struct iwl_trans *trans, struct iwl_rx_cmd_buffer *rxb, ...@@ -928,7 +928,7 @@ void iwl_tx_cmd_complete(struct iwl_trans *trans, struct iwl_rx_cmd_buffer *rxb,
clear_bit(STATUS_HCMD_ACTIVE, &trans->shrd->status); clear_bit(STATUS_HCMD_ACTIVE, &trans->shrd->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->shrd->wait_command_queue); wake_up(&trans->wait_command_queue);
} }
meta->flags = 0; meta->flags = 0;
...@@ -992,7 +992,7 @@ static int iwl_send_cmd_sync(struct iwl_trans *trans, struct iwl_host_cmd *cmd) ...@@ -992,7 +992,7 @@ static int iwl_send_cmd_sync(struct iwl_trans *trans, struct iwl_host_cmd *cmd)
return ret; return ret;
} }
ret = wait_event_timeout(trans->shrd->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->shrd->status),
HOST_COMPLETE_TIMEOUT); HOST_COMPLETE_TIMEOUT);
if (!ret) { if (!ret) {
......
...@@ -2327,6 +2327,9 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct iwl_shared *shrd, ...@@ -2327,6 +2327,9 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct iwl_shared *shrd,
pci_write_config_word(pdev, PCI_COMMAND, pci_cmd); pci_write_config_word(pdev, PCI_COMMAND, pci_cmd);
} }
/* Initialize the wait queue for commands */
init_waitqueue_head(&trans->wait_command_queue);
return trans; return trans;
out_pci_release_regions: out_pci_release_regions:
......
...@@ -413,6 +413,7 @@ enum iwl_trans_state { ...@@ -413,6 +413,7 @@ enum iwl_trans_state {
* @hw_id_str: a string with info about HW ID. Set during transport allocation. * @hw_id_str: a string with info about HW ID. Set during transport allocation.
* @nvm_device_type: indicates OTP or eeprom * @nvm_device_type: indicates OTP or eeprom
* @pm_support: set to true in start_hw if link pm is supported * @pm_support: set to true in start_hw if link pm is supported
* @wait_command_queue: the wait_queue for SYNC host commands
*/ */
struct iwl_trans { struct iwl_trans {
const struct iwl_trans_ops *ops; const struct iwl_trans_ops *ops;
...@@ -429,6 +430,8 @@ struct iwl_trans { ...@@ -429,6 +430,8 @@ struct iwl_trans {
int nvm_device_type; int nvm_device_type;
bool pm_support; bool pm_support;
wait_queue_head_t wait_command_queue;
/* pointer to trans specific struct */ /* pointer to trans specific struct */
/*Ensure that this pointer will always be aligned to sizeof pointer */ /*Ensure that this pointer will always be aligned to sizeof pointer */
char trans_specific[0] __aligned(sizeof(void *)); char trans_specific[0] __aligned(sizeof(void *));
......
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