Lines Matching refs:dbq
491 struct doorbell_queue *dbq; in fsl_hv_queue_doorbell() local
497 list_for_each_entry(dbq, &db_list, list) { in fsl_hv_queue_doorbell()
498 if (dbq->head != nextp(dbq->tail)) { in fsl_hv_queue_doorbell()
499 dbq->q[dbq->tail] = doorbell; in fsl_hv_queue_doorbell()
505 dbq->tail = nextp(dbq->tail); in fsl_hv_queue_doorbell()
506 wake_up_interruptible(&dbq->wait); in fsl_hv_queue_doorbell()
572 struct doorbell_queue *dbq = filp->private_data; in fsl_hv_poll() local
576 spin_lock_irqsave(&dbq->lock, flags); in fsl_hv_poll()
578 poll_wait(filp, &dbq->wait, p); in fsl_hv_poll()
579 mask = (dbq->head == dbq->tail) ? 0 : (EPOLLIN | EPOLLRDNORM); in fsl_hv_poll()
581 spin_unlock_irqrestore(&dbq->lock, flags); in fsl_hv_poll()
596 struct doorbell_queue *dbq = filp->private_data; in fsl_hv_read() local
605 spin_lock_irqsave(&dbq->lock, flags); in fsl_hv_read()
612 if (dbq->head == dbq->tail) { in fsl_hv_read()
613 spin_unlock_irqrestore(&dbq->lock, flags); in fsl_hv_read()
618 if (wait_event_interruptible(dbq->wait, in fsl_hv_read()
619 dbq->head != dbq->tail)) in fsl_hv_read()
637 dbell = dbq->q[dbq->head]; in fsl_hv_read()
638 dbq->head = nextp(dbq->head); in fsl_hv_read()
640 spin_unlock_irqrestore(&dbq->lock, flags); in fsl_hv_read()
660 struct doorbell_queue *dbq; in fsl_hv_open() local
663 dbq = kzalloc(sizeof(struct doorbell_queue), GFP_KERNEL); in fsl_hv_open()
664 if (!dbq) { in fsl_hv_open()
669 spin_lock_init(&dbq->lock); in fsl_hv_open()
670 init_waitqueue_head(&dbq->wait); in fsl_hv_open()
673 list_add(&dbq->list, &db_list); in fsl_hv_open()
676 filp->private_data = dbq; in fsl_hv_open()
686 struct doorbell_queue *dbq = filp->private_data; in fsl_hv_close() local
690 list_del(&dbq->list); in fsl_hv_close()
693 kfree(dbq); in fsl_hv_close()