Lines Matching refs:dbq
492 struct doorbell_queue *dbq; in fsl_hv_queue_doorbell() local
498 list_for_each_entry(dbq, &db_list, list) { in fsl_hv_queue_doorbell()
499 if (dbq->head != nextp(dbq->tail)) { in fsl_hv_queue_doorbell()
500 dbq->q[dbq->tail] = doorbell; in fsl_hv_queue_doorbell()
506 dbq->tail = nextp(dbq->tail); in fsl_hv_queue_doorbell()
507 wake_up_interruptible(&dbq->wait); in fsl_hv_queue_doorbell()
573 struct doorbell_queue *dbq = filp->private_data; in fsl_hv_poll() local
577 spin_lock_irqsave(&dbq->lock, flags); in fsl_hv_poll()
579 poll_wait(filp, &dbq->wait, p); in fsl_hv_poll()
580 mask = (dbq->head == dbq->tail) ? 0 : (EPOLLIN | EPOLLRDNORM); in fsl_hv_poll()
582 spin_unlock_irqrestore(&dbq->lock, flags); in fsl_hv_poll()
597 struct doorbell_queue *dbq = filp->private_data; in fsl_hv_read() local
606 spin_lock_irqsave(&dbq->lock, flags); in fsl_hv_read()
613 if (dbq->head == dbq->tail) { in fsl_hv_read()
614 spin_unlock_irqrestore(&dbq->lock, flags); in fsl_hv_read()
619 if (wait_event_interruptible(dbq->wait, in fsl_hv_read()
620 dbq->head != dbq->tail)) in fsl_hv_read()
638 dbell = dbq->q[dbq->head]; in fsl_hv_read()
639 dbq->head = nextp(dbq->head); in fsl_hv_read()
641 spin_unlock_irqrestore(&dbq->lock, flags); in fsl_hv_read()
661 struct doorbell_queue *dbq; in fsl_hv_open() local
665 dbq = kzalloc(sizeof(struct doorbell_queue), GFP_KERNEL); in fsl_hv_open()
666 if (!dbq) { in fsl_hv_open()
671 spin_lock_init(&dbq->lock); in fsl_hv_open()
672 init_waitqueue_head(&dbq->wait); in fsl_hv_open()
675 list_add(&dbq->list, &db_list); in fsl_hv_open()
678 filp->private_data = dbq; in fsl_hv_open()
688 struct doorbell_queue *dbq = filp->private_data; in fsl_hv_close() local
694 list_del(&dbq->list); in fsl_hv_close()
697 kfree(dbq); in fsl_hv_close()