aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/emulex/benet/be_main.c
diff options
context:
space:
mode:
authorSomnath Kotur <somnath.kotur@emulex.com>2013-03-14 02:42:07 +0000
committerDavid S. Miller <davem@davemloft.net>2013-03-15 08:56:58 -0400
commit68c45a2da34cb44962c6a48f8e474ec6b7853641 (patch)
treee98dcd8cc1df30d79a3fd9af0159513f600e6985 /drivers/net/ethernet/emulex/benet/be_main.c
parentbe2net: enable interrupts in be_probe() (RoCE and other ULPs need them) (diff)
downloadlinux-dev-68c45a2da34cb44962c6a48f8e474ec6b7853641.tar.xz
linux-dev-68c45a2da34cb44962c6a48f8e474ec6b7853641.zip
be2net: Use new F/W mailbox cmd to manipulate interrupts.
This is needed as the earlier method of manipulating this register via PCI Config space is disallowed by certain Hypervisors. Signed-off-by: Somnath Kotur <somnath.kotur@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/emulex/benet/be_main.c')
-rw-r--r--drivers/net/ethernet/emulex/benet/be_main.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index dae7172c2404..c71b180f4678 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -153,17 +153,10 @@ static int be_queue_alloc(struct be_adapter *adapter, struct be_queue_info *q,
return 0;
}
-static void be_intr_set(struct be_adapter *adapter, bool enable)
+static void be_reg_intr_set(struct be_adapter *adapter, bool enable)
{
u32 reg, enabled;
- /* On lancer interrupts can't be controlled via this register */
- if (lancer_chip(adapter))
- return;
-
- if (adapter->eeh_error)
- return;
-
pci_read_config_dword(adapter->pdev, PCICFG_MEMBAR_CTRL_INT_CTRL_OFFSET,
&reg);
enabled = reg & MEMBAR_CTRL_INT_CTRL_HOSTINTR_MASK;
@@ -179,6 +172,22 @@ static void be_intr_set(struct be_adapter *adapter, bool enable)
PCICFG_MEMBAR_CTRL_INT_CTRL_OFFSET, reg);
}
+static void be_intr_set(struct be_adapter *adapter, bool enable)
+{
+ int status = 0;
+
+ /* On lancer interrupts can't be controlled via this register */
+ if (lancer_chip(adapter))
+ return;
+
+ if (adapter->eeh_error)
+ return;
+
+ status = be_cmd_intr_set(adapter, enable);
+ if (status)
+ be_reg_intr_set(adapter, enable);
+}
+
static void be_rxq_notify(struct be_adapter *adapter, u16 qid, u16 posted)
{
u32 val = 0;