summaryrefslogtreecommitdiff
path: root/pcnet32/irq.c
diff options
context:
space:
mode:
authorZheng Da <zhengda1936@gmail.com>2009-11-14 00:15:08 +0100
committerZheng Da <zhengda1936@gmail.com>2009-11-14 00:15:08 +0100
commit6c25f97b8e9171eb399d56549cded82d29d05924 (patch)
treed4870807926dcba2a27fb55f705f8af1424d77b1 /pcnet32/irq.c
parentea13a76596f0a980fad58b83a6b50917d65b67c0 (diff)
A working user-level pcnet32 driver.user-level_pcnet32
Diffstat (limited to 'pcnet32/irq.c')
-rw-r--r--pcnet32/irq.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/pcnet32/irq.c b/pcnet32/irq.c
new file mode 100644
index 000000000..f82e8b11c
--- /dev/null
+++ b/pcnet32/irq.c
@@ -0,0 +1,34 @@
+#include <error.h>
+
+#include <mach.h>
+#include <hurd.h>
+
+#include "netdevice.h"
+#include "device_U.h"
+#include "irq.h"
+
+extern mach_port_t master_device;
+
+/*
+ * Install the irq in the kernel.
+ */
+int
+request_irq (struct linux_device *dev,
+ void (*handler) (int), unsigned long flags)
+{
+ return device_intr_notify (master_device, dev->irq, dev->dev_id,
+ ports_get_right (dev), MACH_MSG_TYPE_MAKE_SEND);
+}
+
+/*
+ * Deallocate an irq.
+ */
+void
+free_irq (struct linux_device *dev)
+{
+ error_t err;
+ err = device_intr_notify (master_device, dev->irq, dev->dev_id,
+ MACH_PORT_NULL, MACH_MSG_TYPE_MAKE_SEND);
+ if (err)
+ error (0, err, "device_intr_notify");
+}