aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/enic/vnic_intr.h
diff options
context:
space:
mode:
authorScott Feldman <scofeldm@cisco.com>2009-02-09 23:23:50 -0800
committerDavid S. Miller <davem@davemloft.net>2009-02-09 23:23:50 -0800
commited8af6b288c0643dfe0ad91f1bfc8c56c0d307cc (patch)
tree6c15a77bec04fe3b5616c4ec5c0b6b2dd1502285 /drivers/net/enic/vnic_intr.h
parent0ecc103aec454288cbaa5a33d8960ab3467e8a11 (diff)
enic: bug fix: return notify intr credits
Return notify intr credits after notify intr from firmware. This is especially important for legacy PCI intr mode, where not returning credits would cause PBA to remain asserted which would get us right back into the ISR. Signed-off-by: Scott Feldman <scofeldm@cisco.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/enic/vnic_intr.h')
-rw-r--r--drivers/net/enic/vnic_intr.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/net/enic/vnic_intr.h b/drivers/net/enic/vnic_intr.h
index ce633a5a7e3..9a53604edce 100644
--- a/drivers/net/enic/vnic_intr.h
+++ b/drivers/net/enic/vnic_intr.h
@@ -76,6 +76,20 @@ static inline void vnic_intr_return_credits(struct vnic_intr *intr,
iowrite32(int_credit_return, &intr->ctrl->int_credit_return);
}
+static inline unsigned int vnic_intr_credits(struct vnic_intr *intr)
+{
+ return ioread32(&intr->ctrl->int_credits);
+}
+
+static inline void vnic_intr_return_all_credits(struct vnic_intr *intr)
+{
+ unsigned int credits = vnic_intr_credits(intr);
+ int unmask = 1;
+ int reset_timer = 1;
+
+ vnic_intr_return_credits(intr, credits, unmask, reset_timer);
+}
+
static inline u32 vnic_intr_legacy_pba(u32 __iomem *legacy_pba)
{
/* read PBA without clearing */