]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
mwifiex: pcie: unify MSI-X / non-MSI-X interrupt process
authorBrian Norris <briannorris@chromium.org>
Tue, 25 Jul 2017 01:13:31 +0000 (18:13 -0700)
committerKalle Valo <kvalo@codeaurora.org>
Fri, 28 Jul 2017 14:47:53 +0000 (17:47 +0300)
After removing the interrupt loop in commit 5d5ddb5e0d9b ("mwifiex:
pcie: don't loop/retry interrupt status checks"), there is practically
zero difference between mwifiex_process_pcie_int() (which handled legacy
PCI interrupts and MSI interrupts) and mwifiex_process_msix_int() (which
handled MSI-X interrupts). Let's add the one relevant line to
mwifiex_process_pcie_int() and kill the copy-and-paste.

Signed-off-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/marvell/mwifiex/pcie.c

index 13722961def25ebd1c54a49f43bdfc740a7f50d1..bffe46a2928747cbf253f2b857ee0cf792fb7bfb 100644 (file)
@@ -2430,7 +2430,7 @@ exit:
  * In case of Rx packets received, the packets are uploaded from card to
  * host and processed accordingly.
  */
-static int mwifiex_process_pcie_int(struct mwifiex_adapter *adapter)
+static int mwifiex_process_int_status(struct mwifiex_adapter *adapter)
 {
        int ret;
        u32 pcie_ireg = 0;
@@ -2505,75 +2505,13 @@ static int mwifiex_process_pcie_int(struct mwifiex_adapter *adapter)
        mwifiex_dbg(adapter, INTR,
                    "info: cmd_sent=%d data_sent=%d\n",
                    adapter->cmd_sent, adapter->data_sent);
-       if (!card->msi_enable && adapter->ps_state != PS_STATE_SLEEP)
+       if (!card->msi_enable && !card->msix_enable &&
+                                adapter->ps_state != PS_STATE_SLEEP)
                mwifiex_pcie_enable_host_int(adapter);
 
        return 0;
 }
 
-static int mwifiex_process_msix_int(struct mwifiex_adapter *adapter)
-{
-       int ret;
-       u32 pcie_ireg;
-       unsigned long flags;
-
-       spin_lock_irqsave(&adapter->int_lock, flags);
-       /* Clear out unused interrupts */
-       pcie_ireg = adapter->int_status;
-       adapter->int_status = 0;
-       spin_unlock_irqrestore(&adapter->int_lock, flags);
-
-       if (pcie_ireg & HOST_INTR_DNLD_DONE) {
-               mwifiex_dbg(adapter, INTR,
-                           "info: TX DNLD Done\n");
-               ret = mwifiex_pcie_send_data_complete(adapter);
-               if (ret)
-                       return ret;
-       }
-       if (pcie_ireg & HOST_INTR_UPLD_RDY) {
-               mwifiex_dbg(adapter, INTR,
-                           "info: Rx DATA\n");
-               ret = mwifiex_pcie_process_recv_data(adapter);
-               if (ret)
-                       return ret;
-       }
-       if (pcie_ireg & HOST_INTR_EVENT_RDY) {
-               mwifiex_dbg(adapter, INTR,
-                           "info: Rx EVENT\n");
-               ret = mwifiex_pcie_process_event_ready(adapter);
-               if (ret)
-                       return ret;
-       }
-
-       if (pcie_ireg & HOST_INTR_CMD_DONE) {
-               if (adapter->cmd_sent) {
-                       mwifiex_dbg(adapter, INTR,
-                                   "info: CMD sent Interrupt\n");
-                       adapter->cmd_sent = false;
-               }
-               /* Handle command response */
-               ret = mwifiex_pcie_process_cmd_complete(adapter);
-               if (ret)
-                       return ret;
-       }
-
-       mwifiex_dbg(adapter, INTR,
-                   "info: cmd_sent=%d data_sent=%d\n",
-                   adapter->cmd_sent, adapter->data_sent);
-
-       return 0;
-}
-
-static int mwifiex_process_int_status(struct mwifiex_adapter *adapter)
-{
-       struct pcie_service_card *card = adapter->card;
-
-       if (card->msix_enable)
-               return mwifiex_process_msix_int(adapter);
-       else
-               return mwifiex_process_pcie_int(adapter);
-}
-
 /*
  * This function downloads data from driver to card.
  *