diff options
author | Jitendra Kalsaria <jitendra.kalsaria@qlogic.com> | 2013-02-09 13:29:50 +0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-02-11 11:04:13 +0400 |
commit | 483202d590cd76fc794f3aa11a342b718a804a28 (patch) | |
tree | ddb70fdd56c0ab137c916d88bc335f18a19f3e36 /drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c | |
parent | 3d73b5fda45a4288856020527f1dbf4efd8c9a7a (diff) | |
download | linux-483202d590cd76fc794f3aa11a342b718a804a28.tar.xz |
qlcnic: helper routine to handle async events
Create a helper routine to handle async events, as it is being called
from multiple places
Signed-off-by: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c')
-rw-r--r-- | drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c index bb4311e9aea9..bc38eaf89a93 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c @@ -1553,6 +1553,24 @@ skip: return count; } +static void qlcnic_83xx_poll_process_aen(struct qlcnic_adapter *adapter) +{ + unsigned long flags; + u32 mask, resp, event; + + spin_lock_irqsave(&adapter->ahw->mbx_lock, flags); + resp = QLCRDX(adapter->ahw, QLCNIC_FW_MBX_CTRL); + if (!(resp & QLCNIC_SET_OWNER)) + goto out; + event = readl(QLCNIC_MBX_FW(adapter->ahw, 0)); + if (event & QLCNIC_MBX_ASYNC_EVENT) + qlcnic_83xx_process_aen(adapter); +out: + mask = QLCRDX(adapter->ahw, QLCNIC_DEF_INT_MASK); + writel(0, adapter->ahw->pci_base0 + mask); + spin_unlock_irqrestore(&adapter->ahw->mbx_lock, flags); +} + static int qlcnic_83xx_poll(struct napi_struct *napi, int budget) { int tx_complete; @@ -1567,7 +1585,7 @@ static int qlcnic_83xx_poll(struct napi_struct *napi, int budget) tx_ring = adapter->tx_ring; if (!(adapter->flags & QLCNIC_MSIX_ENABLED)) - qlcnic_83xx_process_aen(adapter); + qlcnic_83xx_poll_process_aen(adapter); tx_complete = qlcnic_process_cmd_ring(adapter, tx_ring, budget); work_done = qlcnic_83xx_process_rcv_ring(sds_ring, budget); |