Lines Matching refs:context

89 	struct hns_roce_cmd_context *context =  in hns_roce_cmd_event()  local
90 &hr_dev->cmd.context[token % hr_dev->cmd.max_cmds]; in hns_roce_cmd_event()
92 if (unlikely(token != context->token)) { in hns_roce_cmd_event()
95 token, context->token); in hns_roce_cmd_event()
99 context->result = (status == HNS_ROCE_CMD_SUCCESS) ? 0 : (-EIO); in hns_roce_cmd_event()
100 context->out_param = out_param; in hns_roce_cmd_event()
101 complete(&context->done); in hns_roce_cmd_event()
110 struct hns_roce_cmd_context *context; in __hns_roce_cmd_mbox_wait() local
117 context = &cmd->context[cmd->free_head]; in __hns_roce_cmd_mbox_wait()
118 cmd->free_head = context->next; in __hns_roce_cmd_mbox_wait()
119 } while (context->busy); in __hns_roce_cmd_mbox_wait()
121 context->busy = 1; in __hns_roce_cmd_mbox_wait()
122 context->token += cmd->max_cmds; in __hns_roce_cmd_mbox_wait()
126 reinit_completion(&context->done); in __hns_roce_cmd_mbox_wait()
130 context->token, 1); in __hns_roce_cmd_mbox_wait()
138 if (!wait_for_completion_timeout(&context->done, in __hns_roce_cmd_mbox_wait()
141 context->token, op); in __hns_roce_cmd_mbox_wait()
146 ret = context->result; in __hns_roce_cmd_mbox_wait()
149 context->token, op, ret); in __hns_roce_cmd_mbox_wait()
152 context->busy = 0; in __hns_roce_cmd_mbox_wait()
214 hr_cmd->context = in hns_roce_cmd_use_events()
215 kcalloc(hr_cmd->max_cmds, sizeof(*hr_cmd->context), GFP_KERNEL); in hns_roce_cmd_use_events()
216 if (!hr_cmd->context) { in hns_roce_cmd_use_events()
222 hr_cmd->context[i].token = i; in hns_roce_cmd_use_events()
223 hr_cmd->context[i].next = i + 1; in hns_roce_cmd_use_events()
224 init_completion(&hr_cmd->context[i].done); in hns_roce_cmd_use_events()
226 hr_cmd->context[hr_cmd->max_cmds - 1].next = 0; in hns_roce_cmd_use_events()
241 kfree(hr_cmd->context); in hns_roce_cmd_use_polling()