Lines Matching refs:dbq
489 struct doorbell_queue *dbq; in fsl_hv_queue_doorbell() local
495 list_for_each_entry(dbq, &db_list, list) { in fsl_hv_queue_doorbell()
496 if (dbq->head != nextp(dbq->tail)) { in fsl_hv_queue_doorbell()
497 dbq->q[dbq->tail] = doorbell; in fsl_hv_queue_doorbell()
503 dbq->tail = nextp(dbq->tail); in fsl_hv_queue_doorbell()
504 wake_up_interruptible(&dbq->wait); in fsl_hv_queue_doorbell()
570 struct doorbell_queue *dbq = filp->private_data; in fsl_hv_poll() local
574 spin_lock_irqsave(&dbq->lock, flags); in fsl_hv_poll()
576 poll_wait(filp, &dbq->wait, p); in fsl_hv_poll()
577 mask = (dbq->head == dbq->tail) ? 0 : (EPOLLIN | EPOLLRDNORM); in fsl_hv_poll()
579 spin_unlock_irqrestore(&dbq->lock, flags); in fsl_hv_poll()
594 struct doorbell_queue *dbq = filp->private_data; in fsl_hv_read() local
603 spin_lock_irqsave(&dbq->lock, flags); in fsl_hv_read()
610 if (dbq->head == dbq->tail) { in fsl_hv_read()
611 spin_unlock_irqrestore(&dbq->lock, flags); in fsl_hv_read()
616 if (wait_event_interruptible(dbq->wait, in fsl_hv_read()
617 dbq->head != dbq->tail)) in fsl_hv_read()
635 dbell = dbq->q[dbq->head]; in fsl_hv_read()
636 dbq->head = nextp(dbq->head); in fsl_hv_read()
638 spin_unlock_irqrestore(&dbq->lock, flags); in fsl_hv_read()
658 struct doorbell_queue *dbq; in fsl_hv_open() local
662 dbq = kzalloc(sizeof(struct doorbell_queue), GFP_KERNEL); in fsl_hv_open()
663 if (!dbq) { in fsl_hv_open()
668 spin_lock_init(&dbq->lock); in fsl_hv_open()
669 init_waitqueue_head(&dbq->wait); in fsl_hv_open()
672 list_add(&dbq->list, &db_list); in fsl_hv_open()
675 filp->private_data = dbq; in fsl_hv_open()
685 struct doorbell_queue *dbq = filp->private_data; in fsl_hv_close() local
691 list_del(&dbq->list); in fsl_hv_close()
694 kfree(dbq); in fsl_hv_close()