aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-trans.c
diff options
context:
space:
mode:
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>2011-07-04 01:58:19 -0400
committerWey-Yi Guy <wey-yi.w.guy@intel.com>2011-07-16 10:36:49 -0400
commit34c1b7ba127d1815b3dd1cb81cc4338ce0e712b7 (patch)
tree753b883841eb6772eef0f7e444f6b7ec3719b87c /drivers/net/wireless/iwlwifi/iwl-trans.c
parent47c1b496015e41e1068878814596af9a45d4fa84 (diff)
iwlagn: move the tasklet / irq to the transport layer
PCIe doesn't provide any ISR registration API, whereas other buses do. Hence, we need to move the tasklet and irq to the transport layer to allow this flexibility. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-trans.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-trans.c29
1 files changed, 27 insertions, 2 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans.c b/drivers/net/wireless/iwlwifi/iwl-trans.c
index acd2a5feec93..ecdda6d57b16 100644
--- a/drivers/net/wireless/iwlwifi/iwl-trans.c
+++ b/drivers/net/wireless/iwlwifi/iwl-trans.c
@@ -705,6 +705,12 @@ static int iwl_trans_tx(struct iwl_priv *priv, struct sk_buff *skb,
705 return 0; 705 return 0;
706} 706}
707 707
708static void iwl_trans_free(struct iwl_priv *priv)
709{
710 free_irq(priv->bus.irq, priv);
711 iwl_free_isr_ict(priv);
712}
713
708static const struct iwl_trans_ops trans_ops = { 714static const struct iwl_trans_ops trans_ops = {
709 .rx_init = iwl_trans_rx_init, 715 .rx_init = iwl_trans_rx_init,
710 .rx_stop = iwl_trans_rx_stop, 716 .rx_stop = iwl_trans_rx_stop,
@@ -719,9 +725,28 @@ static const struct iwl_trans_ops trans_ops = {
719 725
720 .get_tx_cmd = iwl_trans_get_tx_cmd, 726 .get_tx_cmd = iwl_trans_get_tx_cmd,
721 .tx = iwl_trans_tx, 727 .tx = iwl_trans_tx,
728
729 .free = iwl_trans_free,
722}; 730};
723 731
724void iwl_trans_register(struct iwl_trans *trans) 732int iwl_trans_register(struct iwl_priv *priv)
725{ 733{
726 trans->ops = &trans_ops; 734 int err;
735
736 priv->trans.ops = &trans_ops;
737
738 iwl_alloc_isr_ict(priv);
739
740 err = request_irq(priv->bus.irq, iwl_isr_ict, IRQF_SHARED,
741 DRV_NAME, priv);
742 if (err) {
743 IWL_ERR(priv, "Error allocating IRQ %d\n", priv->bus.irq);
744 iwl_free_isr_ict(priv);
745 return err;
746 }
747
748 tasklet_init(&priv->irq_tasklet, (void (*)(unsigned long))
749 iwl_irq_tasklet, (unsigned long)priv);
750
751 return 0;
727} 752}