spin_lock_irqsave(&priv->lock, flags);
iwl_disable_interrupts(priv);
spin_unlock_irqrestore(&priv->lock, flags);
- iwl_synchronize_irq(priv);
+ trans_sync_irq(priv);
/* device going down, Stop using ICT table */
iwl_disable_ict(priv);
iwl_disable_interrupts(priv);
spin_unlock_irqrestore(&priv->lock, flags);
- iwl_synchronize_irq(priv);
+ trans_sync_irq(priv);
iwl_dealloc_ucode(priv);
void iwl_free_isr_ict(struct iwl_priv *priv);
irqreturn_t iwl_isr_ict(int irq, void *data);
-/* call this function to flush any scheduled tasklet */
-static inline void iwl_synchronize_irq(struct iwl_priv *priv)
-{
- /* wait to make sure we flush pending tasklet*/
- synchronize_irq(priv->bus.irq);
- tasklet_kill(&priv->irq_tasklet);
-}
-
static inline void iwl_set_calib_hdr(struct iwl_calib_hdr *hdr, u8 cmd)
{
hdr->op_code = cmd;
* @tx_free: frees the tx memory
* @send_cmd:send a host command
* @send_cmd_pdu:send a host command: flags can be CMD_*
+ * @sync_irq: the upper layer will typically disable interrupt and call this
+ * handler. After this handler returns, it is guaranteed that all
+ * the ISR / tasklet etc... have finished running and the transport
+ * layer shall not pass any Rx.
* @free: release all the ressource for the transport layer itself such as
* irq, tasklet etc...
*/
struct iwl_tx_cmd *tx_cmd, int txq_id, __le16 fc, bool ampdu,
struct iwl_rxon_context *ctx);
+ void (*sync_irq)(struct iwl_priv *priv);
void (*free)(struct iwl_priv *priv);
};
return 0;
}
+static void iwl_trans_sync_irq(struct iwl_priv *priv)
+{
+ /* wait to make sure we flush pending tasklet*/
+ synchronize_irq(priv->bus.irq);
+ tasklet_kill(&priv->irq_tasklet);
+}
+
static void iwl_trans_free(struct iwl_priv *priv)
{
free_irq(priv->bus.irq, priv);
.get_tx_cmd = iwl_trans_get_tx_cmd,
.tx = iwl_trans_tx,
+ .sync_irq = iwl_trans_sync_irq,
.free = iwl_trans_free,
};
return priv->trans.ops->tx(priv, skb, tx_cmd, txq_id, fc, ampdu, ctx);
}
+static inline void trans_sync_irq(struct iwl_priv *priv)
+{
+ priv->trans.ops->sync_irq(priv);
+}
+
static inline void trans_free(struct iwl_priv *priv)
{
priv->trans.ops->free(priv);