Lines Matching refs:dbq
493 struct doorbell_queue *dbq; in fsl_hv_queue_doorbell() local
499 list_for_each_entry(dbq, &db_list, list) { in fsl_hv_queue_doorbell()
500 if (dbq->head != nextp(dbq->tail)) { in fsl_hv_queue_doorbell()
501 dbq->q[dbq->tail] = doorbell; in fsl_hv_queue_doorbell()
507 dbq->tail = nextp(dbq->tail); in fsl_hv_queue_doorbell()
508 wake_up_interruptible(&dbq->wait); in fsl_hv_queue_doorbell()
574 struct doorbell_queue *dbq = filp->private_data; in fsl_hv_poll() local
578 spin_lock_irqsave(&dbq->lock, flags); in fsl_hv_poll()
580 poll_wait(filp, &dbq->wait, p); in fsl_hv_poll()
581 mask = (dbq->head == dbq->tail) ? 0 : (POLLIN | POLLRDNORM); in fsl_hv_poll()
583 spin_unlock_irqrestore(&dbq->lock, flags); in fsl_hv_poll()
598 struct doorbell_queue *dbq = filp->private_data; in fsl_hv_read() local
607 spin_lock_irqsave(&dbq->lock, flags); in fsl_hv_read()
614 if (dbq->head == dbq->tail) { in fsl_hv_read()
615 spin_unlock_irqrestore(&dbq->lock, flags); in fsl_hv_read()
620 if (wait_event_interruptible(dbq->wait, in fsl_hv_read()
621 dbq->head != dbq->tail)) in fsl_hv_read()
639 dbell = dbq->q[dbq->head]; in fsl_hv_read()
640 dbq->head = nextp(dbq->head); in fsl_hv_read()
642 spin_unlock_irqrestore(&dbq->lock, flags); in fsl_hv_read()
662 struct doorbell_queue *dbq; in fsl_hv_open() local
666 dbq = kzalloc(sizeof(struct doorbell_queue), GFP_KERNEL); in fsl_hv_open()
667 if (!dbq) { in fsl_hv_open()
672 spin_lock_init(&dbq->lock); in fsl_hv_open()
673 init_waitqueue_head(&dbq->wait); in fsl_hv_open()
676 list_add(&dbq->list, &db_list); in fsl_hv_open()
679 filp->private_data = dbq; in fsl_hv_open()
689 struct doorbell_queue *dbq = filp->private_data; in fsl_hv_close() local
695 list_del(&dbq->list); in fsl_hv_close()
698 kfree(dbq); in fsl_hv_close()