Lines Matching refs:hr_cmd
203 struct hns_roce_cmdq *hr_cmd = &hr_dev->cmd; in hns_roce_cmd_use_events() local
206 hr_cmd->context = in hns_roce_cmd_use_events()
207 kcalloc(hr_cmd->max_cmds, sizeof(*hr_cmd->context), GFP_KERNEL); in hns_roce_cmd_use_events()
208 if (!hr_cmd->context) { in hns_roce_cmd_use_events()
213 for (i = 0; i < hr_cmd->max_cmds; ++i) { in hns_roce_cmd_use_events()
214 hr_cmd->context[i].token = i; in hns_roce_cmd_use_events()
215 hr_cmd->context[i].next = i + 1; in hns_roce_cmd_use_events()
216 init_completion(&hr_cmd->context[i].done); in hns_roce_cmd_use_events()
218 hr_cmd->context[hr_cmd->max_cmds - 1].next = 0; in hns_roce_cmd_use_events()
219 hr_cmd->free_head = 0; in hns_roce_cmd_use_events()
221 sema_init(&hr_cmd->event_sem, hr_cmd->max_cmds); in hns_roce_cmd_use_events()
222 spin_lock_init(&hr_cmd->context_lock); in hns_roce_cmd_use_events()
224 hr_cmd->use_events = 1; in hns_roce_cmd_use_events()
231 struct hns_roce_cmdq *hr_cmd = &hr_dev->cmd; in hns_roce_cmd_use_polling() local
233 kfree(hr_cmd->context); in hns_roce_cmd_use_polling()
234 hr_cmd->use_events = 0; in hns_roce_cmd_use_polling()