aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/et131x/et131x_isr.c
diff options
context:
space:
mode:
authorAlan Cox <alan@linux.intel.com>2009-08-27 11:02:25 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2009-09-15 12:02:29 -0700
commitb8c4cc46541d864b37497d0047b81b62a5d4e073 (patch)
tree7709393cc60976d97baa2e3b1d2c8aac5b01cd95 /drivers/staging/et131x/et131x_isr.c
parentStaging: et131x: kill the interrupt magic define and types (diff)
downloadlinux-dev-b8c4cc46541d864b37497d0047b81b62a5d4e073.tar.xz
linux-dev-b8c4cc46541d864b37497d0047b81b62a5d4e073.zip
Staging: et131x: put the jagcore routines in with their users
We have two trivial IRQ routines, a single statement and a real function - relocate them. While we are at it kill the trivial to sort out soft reset and slv bits in the same areas of code. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/et131x/et131x_isr.c')
-rw-r--r--drivers/staging/et131x/et131x_isr.c43
1 files changed, 41 insertions, 2 deletions
diff --git a/drivers/staging/et131x/et131x_isr.c b/drivers/staging/et131x/et131x_isr.c
index 656df12acf72..878fd205e415 100644
--- a/drivers/staging/et131x/et131x_isr.c
+++ b/drivers/staging/et131x/et131x_isr.c
@@ -97,12 +97,53 @@ extern dbg_info_t *et131x_dbginfo;
#endif /* CONFIG_ET131X_DEBUG */
/**
+ * et131x_enable_interrupts - enable interrupt
+ * @adapter: et131x device
+ *
+ * Enable the appropriate interrupts on the ET131x according to our
+ * configuration
+ */
+
+void et131x_enable_interrupts(struct et131x_adapter *adapter)
+{
+ u32 mask;
+
+ /* Enable all global interrupts */
+ if (adapter->FlowControl == TxOnly || adapter->FlowControl == Both)
+ mask = INT_MASK_ENABLE;
+ else
+ mask = INT_MASK_ENABLE_NO_FLOW;
+
+ if (adapter->DriverNoPhyAccess)
+ mask |= ET_INTR_PHY;
+
+ adapter->CachedMaskValue = mask;
+ writel(mask, &adapter->regs->global.int_mask);
+}
+
+/**
+ * et131x_disable_interrupts - interrupt disable
+ * @adapter: et131x device
+ *
+ * Block all interrupts from the et131x device at the device itself
+ */
+
+void et131x_disable_interrupts(struct et131x_adapter *adapter)
+{
+ /* Disable all global interrupts */
+ adapter->CachedMaskValue = INT_MASK_DISABLE;
+ writel(INT_MASK_DISABLE, &adapter->regs->global.int_mask);
+}
+
+
+/**
* et131x_isr - The Interrupt Service Routine for the driver.
* @irq: the IRQ on which the interrupt was received.
* @dev_id: device-specific info (here a pointer to a net_device struct)
*
* Returns a value indicating if the interrupt was handled.
*/
+
irqreturn_t et131x_isr(int irq, void *dev_id)
{
bool handled = true;
@@ -197,7 +238,6 @@ irqreturn_t et131x_isr(int irq, void *dev_id)
* execution
*/
schedule_work(&adapter->task);
-
out:
return IRQ_RETVAL(handled);
}
@@ -476,6 +516,5 @@ void et131x_isr_handler(struct work_struct *work)
DBG_VERBOSE(et131x_dbginfo, "SLV_TIMEOUT interrupt\n");
}
}
-
et131x_enable_interrupts(etdev);
}