Lines Matching refs:dev
52 static inline int pvrdma_cmd_recv(struct pvrdma_dev *dev, in pvrdma_cmd_recv() argument
58 dev_dbg(&dev->pdev->dev, "receive response from device\n"); in pvrdma_cmd_recv()
60 err = wait_for_completion_interruptible_timeout(&dev->cmd_done, in pvrdma_cmd_recv()
63 dev_warn(&dev->pdev->dev, in pvrdma_cmd_recv()
68 spin_lock(&dev->cmd_lock); in pvrdma_cmd_recv()
69 memcpy(resp, dev->resp_slot, sizeof(*resp)); in pvrdma_cmd_recv()
70 spin_unlock(&dev->cmd_lock); in pvrdma_cmd_recv()
73 dev_warn(&dev->pdev->dev, in pvrdma_cmd_recv()
83 pvrdma_cmd_post(struct pvrdma_dev *dev, union pvrdma_cmd_req *req, in pvrdma_cmd_post() argument
88 dev_dbg(&dev->pdev->dev, "post request to device\n"); in pvrdma_cmd_post()
91 down(&dev->cmd_sema); in pvrdma_cmd_post()
96 spin_lock(&dev->cmd_lock); in pvrdma_cmd_post()
97 memcpy(dev->cmd_slot, req, sizeof(*req)); in pvrdma_cmd_post()
98 spin_unlock(&dev->cmd_lock); in pvrdma_cmd_post()
100 init_completion(&dev->cmd_done); in pvrdma_cmd_post()
101 pvrdma_write_reg(dev, PVRDMA_REG_REQUEST, 0); in pvrdma_cmd_post()
106 err = pvrdma_read_reg(dev, PVRDMA_REG_ERR); in pvrdma_cmd_post()
109 err = pvrdma_cmd_recv(dev, resp, resp_code); in pvrdma_cmd_post()
111 dev_warn(&dev->pdev->dev, in pvrdma_cmd_post()
116 up(&dev->cmd_sema); in pvrdma_cmd_post()