Implement enable_irq() and disable_irq() in the LinuxKPI.
MFC after: 1 week Submitted by: Johannes Lundberg <johalun0@gmail.com> Sponsored by: Mellanox Technologies
This commit is contained in:
parent
5e016ca4a6
commit
94a13a99f3
@ -111,6 +111,38 @@ request_irq(unsigned int irq, irq_handler_t handler, unsigned long flags,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int
|
||||
enable_irq(unsigned int irq)
|
||||
{
|
||||
struct irq_ent *irqe;
|
||||
struct device *dev;
|
||||
|
||||
dev = linux_pci_find_irq_dev(irq);
|
||||
if (dev == NULL)
|
||||
return -EINVAL;
|
||||
irqe = linux_irq_ent(dev, irq);
|
||||
if (irqe == NULL)
|
||||
return -EINVAL;
|
||||
return -bus_setup_intr(dev->bsddev, irqe->res, INTR_TYPE_NET | INTR_MPSAFE,
|
||||
NULL, linux_irq_handler, irqe, &irqe->tag);
|
||||
}
|
||||
|
||||
static inline void
|
||||
disable_irq(unsigned int irq)
|
||||
{
|
||||
struct irq_ent *irqe;
|
||||
struct device *dev;
|
||||
|
||||
dev = linux_pci_find_irq_dev(irq);
|
||||
if (dev == NULL)
|
||||
return;
|
||||
irqe = linux_irq_ent(dev, irq);
|
||||
if (irqe == NULL)
|
||||
return;
|
||||
bus_teardown_intr(dev->bsddev, irqe->res, irqe->tag);
|
||||
irqe->tag = NULL;
|
||||
}
|
||||
|
||||
static inline int
|
||||
bind_irq_to_cpu(unsigned int irq, int cpu_id)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user