Changeset View
Changeset View
Standalone View
Standalone View
sys/compat/linuxkpi/common/include/linux/interrupt.h
Show First 20 Lines • Show All 94 Lines • ▼ Show 20 Lines | request_irq(unsigned int irq, irq_handler_t handler, unsigned long flags, | ||||
if (res == NULL) | if (res == NULL) | ||||
return (-ENXIO); | return (-ENXIO); | ||||
irqe = kmalloc(sizeof(*irqe), GFP_KERNEL); | irqe = kmalloc(sizeof(*irqe), GFP_KERNEL); | ||||
irqe->dev = dev; | irqe->dev = dev; | ||||
irqe->res = res; | irqe->res = res; | ||||
irqe->arg = arg; | irqe->arg = arg; | ||||
irqe->handler = handler; | irqe->handler = handler; | ||||
irqe->irq = irq; | irqe->irq = irq; | ||||
error = bus_setup_intr(dev->bsddev, res, INTR_TYPE_NET | INTR_MPSAFE, | error = bus_setup_intr(dev->bsddev, res, | ||||
NULL, linux_irq_handler, irqe, &irqe->tag); | INTR_TYPE_LKPI | INTR_MPSAFE, NULL, | ||||
linux_irq_handler, irqe, &irqe->tag); | |||||
if (error) { | if (error) { | ||||
bus_release_resource(dev->bsddev, SYS_RES_IRQ, rid, irqe->res); | bus_release_resource(dev->bsddev, SYS_RES_IRQ, rid, irqe->res); | ||||
kfree(irqe); | kfree(irqe); | ||||
return (-error); | return (-error); | ||||
} | } | ||||
list_add(&irqe->links, &dev->irqents); | list_add(&irqe->links, &dev->irqents); | ||||
return 0; | return 0; | ||||
} | } | ||||
static inline int | static inline int | ||||
enable_irq(unsigned int irq) | enable_irq(unsigned int irq) | ||||
{ | { | ||||
struct irq_ent *irqe; | struct irq_ent *irqe; | ||||
struct device *dev; | struct device *dev; | ||||
dev = linux_pci_find_irq_dev(irq); | dev = linux_pci_find_irq_dev(irq); | ||||
if (dev == NULL) | if (dev == NULL) | ||||
return -EINVAL; | return -EINVAL; | ||||
irqe = linux_irq_ent(dev, irq); | irqe = linux_irq_ent(dev, irq); | ||||
if (irqe == NULL || irqe->tag != NULL) | if (irqe == NULL || irqe->tag != NULL) | ||||
return -EINVAL; | return -EINVAL; | ||||
return -bus_setup_intr(dev->bsddev, irqe->res, INTR_TYPE_NET | INTR_MPSAFE, | return -bus_setup_intr(dev->bsddev, irqe->res, | ||||
NULL, linux_irq_handler, irqe, &irqe->tag); | INTR_TYPE_LKPI | INTR_MPSAFE, NULL, | ||||
linux_irq_handler, irqe, &irqe->tag); | |||||
} | } | ||||
static inline void | static inline void | ||||
disable_irq(unsigned int irq) | disable_irq(unsigned int irq) | ||||
{ | { | ||||
struct irq_ent *irqe; | struct irq_ent *irqe; | ||||
struct device *dev; | struct device *dev; | ||||
▲ Show 20 Lines • Show All 79 Lines • Show Last 20 Lines |