mwifiex: pcie: unify MSI-X / non-MSI-X interrupt process

After removing the interrupt loop in commit 5d5ddb5e0d ("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>
This commit is contained in:
Brian Norris 2017-07-24 18:13:31 -07:00 committed by Kalle Valo
parent 605db27f74
commit 87a602126a
1 changed files with 3 additions and 65 deletions

View File

@ -2430,7 +2430,7 @@ exit:
* In case of Rx packets received, the packets are uploaded from card to * In case of Rx packets received, the packets are uploaded from card to
* host and processed accordingly. * 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; int ret;
u32 pcie_ireg = 0; u32 pcie_ireg = 0;
@ -2505,75 +2505,13 @@ static int mwifiex_process_pcie_int(struct mwifiex_adapter *adapter)
mwifiex_dbg(adapter, INTR, mwifiex_dbg(adapter, INTR,
"info: cmd_sent=%d data_sent=%d\n", "info: cmd_sent=%d data_sent=%d\n",
adapter->cmd_sent, adapter->data_sent); 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); mwifiex_pcie_enable_host_int(adapter);
return 0; 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. * This function downloads data from driver to card.
* *