Lines Matching refs:cmd

57 				    mbox_msg->cmd, ret);  in __hns_roce_cmd_mbox_poll()
69 down(&hr_dev->cmd.poll_sem); in hns_roce_cmd_mbox_poll()
71 up(&hr_dev->cmd.poll_sem); in hns_roce_cmd_mbox_poll()
80 &hr_dev->cmd.context[token % hr_dev->cmd.max_cmds]; in hns_roce_cmd_event()
97 struct hns_roce_cmdq *cmd = &hr_dev->cmd; in __hns_roce_cmd_mbox_wait() local
102 spin_lock(&cmd->context_lock); in __hns_roce_cmd_mbox_wait()
105 context = &cmd->context[cmd->free_head]; in __hns_roce_cmd_mbox_wait()
106 cmd->free_head = context->next; in __hns_roce_cmd_mbox_wait()
110 context->token += cmd->max_cmds; in __hns_roce_cmd_mbox_wait()
112 spin_unlock(&cmd->context_lock); in __hns_roce_cmd_mbox_wait()
121 mbox_msg->cmd, ret); in __hns_roce_cmd_mbox_wait()
128 context->token, mbox_msg->cmd); in __hns_roce_cmd_mbox_wait()
136 context->token, mbox_msg->cmd, ret); in __hns_roce_cmd_mbox_wait()
148 down(&hr_dev->cmd.event_sem); in hns_roce_cmd_mbox_wait()
150 up(&hr_dev->cmd.event_sem); in hns_roce_cmd_mbox_wait()
156 u8 cmd, unsigned long tag) in hns_roce_cmd_mbox() argument
167 mbox_msg.cmd = cmd; in hns_roce_cmd_mbox()
170 if (hr_dev->cmd.use_events) { in hns_roce_cmd_mbox()
184 sema_init(&hr_dev->cmd.poll_sem, 1); in hns_roce_cmd_init()
185 hr_dev->cmd.use_events = 0; in hns_roce_cmd_init()
186 hr_dev->cmd.max_cmds = CMD_MAX_NUM; in hns_roce_cmd_init()
187 hr_dev->cmd.pool = dma_pool_create("hns_roce_cmd", hr_dev->dev, in hns_roce_cmd_init()
190 if (!hr_dev->cmd.pool) in hns_roce_cmd_init()
198 dma_pool_destroy(hr_dev->cmd.pool); in hns_roce_cmd_cleanup()
203 struct hns_roce_cmdq *hr_cmd = &hr_dev->cmd; in hns_roce_cmd_use_events()
231 struct hns_roce_cmdq *hr_cmd = &hr_dev->cmd; in hns_roce_cmd_use_polling()
247 dma_pool_alloc(hr_dev->cmd.pool, GFP_KERNEL, &mailbox->dma); in hns_roce_alloc_cmd_mailbox()
262 dma_pool_free(hr_dev->cmd.pool, mailbox->buf, mailbox->dma); in hns_roce_free_cmd_mailbox()
268 u8 cmd, unsigned long idx) in hns_roce_create_hw_ctx() argument
270 return hns_roce_cmd_mbox(dev, mailbox->dma, 0, cmd, idx); in hns_roce_create_hw_ctx()
273 int hns_roce_destroy_hw_ctx(struct hns_roce_dev *dev, u8 cmd, unsigned long idx) in hns_roce_destroy_hw_ctx() argument
275 return hns_roce_cmd_mbox(dev, 0, 0, cmd, idx); in hns_roce_destroy_hw_ctx()