* pairings are not supported.
*/
+struct irq_bypass_consumer;
+
/**
* struct irq_bypass_producer - IRQ bypass producer definition
* @node: IRQ bypass manager private list management
* @eventfd: eventfd context used to match producers and consumers
+ * @consumer: The connected consumer (NULL if no connection)
* @irq: Linux IRQ number for the producer device
* @add_consumer: Connect the IRQ producer to an IRQ consumer (optional)
* @del_consumer: Disconnect the IRQ producer from an IRQ consumer (optional)
struct irq_bypass_producer {
struct list_head node;
struct eventfd_ctx *eventfd;
+ struct irq_bypass_consumer *consumer;
int irq;
int (*add_consumer)(struct irq_bypass_producer *,
struct irq_bypass_consumer *);
* struct irq_bypass_consumer - IRQ bypass consumer definition
* @node: IRQ bypass manager private list management
* @eventfd: eventfd context used to match producers and consumers
+ * @producer: The connected producer (NULL if no connection)
* @add_producer: Connect the IRQ consumer to an IRQ producer
* @del_producer: Disconnect the IRQ consumer from an IRQ producer
* @stop: Perform any quiesce operations necessary prior to add/del (optional)
struct irq_bypass_consumer {
struct list_head node;
struct eventfd_ctx *eventfd;
+ struct irq_bypass_producer *producer;
+
int (*add_producer)(struct irq_bypass_consumer *,
struct irq_bypass_producer *);
void (*del_producer)(struct irq_bypass_consumer *,
if (prod->start)
prod->start(prod);
+ if (!ret) {
+ prod->consumer = cons;
+ cons->producer = prod;
+ }
return ret;
}
cons->start(cons);
if (prod->start)
prod->start(prod);
+
+ prod->consumer = NULL;
+ cons->producer = NULL;
}
/**
list_for_each_entry(consumer, &consumers, node) {
if (consumer->eventfd == producer->eventfd) {
+ WARN_ON_ONCE(producer->consumer != consumer);
__disconnect(producer, consumer);
break;
}
list_for_each_entry(producer, &producers, node) {
if (producer->eventfd == consumer->eventfd) {
+ WARN_ON_ONCE(consumer->producer != producer);
__disconnect(producer, consumer);
break;
}