|
@@ -611,6 +611,46 @@ static int iwl_trans_tx_stop(struct iwl_priv *priv)
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
+static void iwl_trans_stop_device(struct iwl_priv *priv)
|
|
|
+{
|
|
|
+ unsigned long flags;
|
|
|
+
|
|
|
+ /* stop and reset the on-board processor */
|
|
|
+ iwl_write32(priv, CSR_RESET, CSR_RESET_REG_FLAG_NEVO_RESET);
|
|
|
+
|
|
|
+ /* tell the device to stop sending interrupts */
|
|
|
+ spin_lock_irqsave(&priv->lock, flags);
|
|
|
+ iwl_disable_interrupts(priv);
|
|
|
+ spin_unlock_irqrestore(&priv->lock, flags);
|
|
|
+ trans_sync_irq(priv);
|
|
|
+
|
|
|
+ /* device going down, Stop using ICT table */
|
|
|
+ iwl_disable_ict(priv);
|
|
|
+
|
|
|
+ /*
|
|
|
+ * If a HW restart happens during firmware loading,
|
|
|
+ * then the firmware loading might call this function
|
|
|
+ * and later it might be called again due to the
|
|
|
+ * restart. So don't process again if the device is
|
|
|
+ * already dead.
|
|
|
+ */
|
|
|
+ if (test_bit(STATUS_DEVICE_ENABLED, &priv->status)) {
|
|
|
+ iwl_trans_tx_stop(priv);
|
|
|
+ iwl_trans_rx_stop(priv);
|
|
|
+
|
|
|
+ /* Power-down device's busmaster DMA clocks */
|
|
|
+ iwl_write_prph(priv, APMG_CLK_DIS_REG,
|
|
|
+ APMG_CLK_VAL_DMA_CLK_RQT);
|
|
|
+ udelay(5);
|
|
|
+ }
|
|
|
+
|
|
|
+ /* Make sure (redundant) we've released our request to stay awake */
|
|
|
+ iwl_clear_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ);
|
|
|
+
|
|
|
+ /* Stop the device, and put it in low power state */
|
|
|
+ iwl_apm_stop(priv);
|
|
|
+}
|
|
|
+
|
|
|
static struct iwl_tx_cmd *iwl_trans_get_tx_cmd(struct iwl_priv *priv,
|
|
|
int txq_id)
|
|
|
{
|
|
@@ -779,13 +819,13 @@ static void iwl_trans_free(struct iwl_priv *priv)
|
|
|
|
|
|
static const struct iwl_trans_ops trans_ops = {
|
|
|
.rx_init = iwl_trans_rx_init,
|
|
|
- .rx_stop = iwl_trans_rx_stop,
|
|
|
.rx_free = iwl_trans_rx_free,
|
|
|
|
|
|
.tx_init = iwl_trans_tx_init,
|
|
|
- .tx_stop = iwl_trans_tx_stop,
|
|
|
.tx_free = iwl_trans_tx_free,
|
|
|
|
|
|
+ .stop_device = iwl_trans_stop_device,
|
|
|
+
|
|
|
.send_cmd = iwl_send_cmd,
|
|
|
.send_cmd_pdu = iwl_send_cmd_pdu,
|
|
|
|