0001
0002
0003
0004
0005
0006
0007
0008
0009 #include <linux/interrupt.h>
0010
0011 #include "hvc_console.h"
0012
0013 static irqreturn_t hvc_handle_interrupt(int irq, void *dev_instance)
0014 {
0015
0016 if (hvc_poll(dev_instance))
0017 hvc_kick();
0018
0019
0020
0021
0022
0023 return IRQ_HANDLED;
0024 }
0025
0026
0027
0028
0029 int notifier_add_irq(struct hvc_struct *hp, int irq)
0030 {
0031 int rc;
0032
0033 if (!irq) {
0034 hp->irq_requested = 0;
0035 return 0;
0036 }
0037 rc = request_irq(irq, hvc_handle_interrupt, hp->flags,
0038 "hvc_console", hp);
0039 if (!rc)
0040 hp->irq_requested = 1;
0041 return rc;
0042 }
0043
0044 void notifier_del_irq(struct hvc_struct *hp, int irq)
0045 {
0046 if (!hp->irq_requested)
0047 return;
0048 free_irq(irq, hp);
0049 hp->irq_requested = 0;
0050 }
0051
0052 void notifier_hangup_irq(struct hvc_struct *hp, int irq)
0053 {
0054 notifier_del_irq(hp, irq);
0055 }