Lines Matching full:token

44 	int i, token = -EBUSY;  in __opal_async_get_token()  local
51 token = i; in __opal_async_get_token()
57 return token; in __opal_async_get_token()
61 * Note: If the returned token is used in an opal call and opal returns
68 int token; in opal_async_get_token_interruptible() local
70 /* Wait until a token is available */ in opal_async_get_token_interruptible()
74 token = __opal_async_get_token(); in opal_async_get_token_interruptible()
75 if (token < 0) in opal_async_get_token_interruptible()
78 return token; in opal_async_get_token_interruptible()
82 static int __opal_async_release_token(int token) in __opal_async_release_token() argument
87 if (token < 0 || token >= opal_max_async_tokens) { in __opal_async_release_token()
88 pr_err("%s: Passed token is out of range, token %d\n", in __opal_async_release_token()
89 __func__, token); in __opal_async_release_token()
94 switch (opal_async_tokens[token].state) { in __opal_async_release_token()
97 opal_async_tokens[token].state = ASYNC_TOKEN_UNALLOCATED; in __opal_async_release_token()
102 * Mark a DISPATCHED token as ABANDONED so that the response handling in __opal_async_release_token()
106 opal_async_tokens[token].state = ASYNC_TOKEN_ABANDONED; in __opal_async_release_token()
116 int opal_async_release_token(int token) in opal_async_release_token() argument
120 ret = __opal_async_release_token(token); in opal_async_release_token()
128 int opal_async_wait_response(uint64_t token, struct opal_msg *msg) in opal_async_wait_response() argument
130 if (token >= opal_max_async_tokens) { in opal_async_wait_response()
131 pr_err("%s: Invalid token passed\n", __func__); in opal_async_wait_response()
141 * There is no need to mark the token as dispatched, wait_event() in opal_async_wait_response()
142 * will block until the token completes. in opal_async_wait_response()
149 wait_event(opal_async_wait, opal_async_tokens[token].state in opal_async_wait_response()
151 memcpy(msg, &opal_async_tokens[token].response, sizeof(*msg)); in opal_async_wait_response()
157 int opal_async_wait_response_interruptible(uint64_t token, struct opal_msg *msg) in opal_async_wait_response_interruptible() argument
162 if (token >= opal_max_async_tokens) { in opal_async_wait_response_interruptible()
163 pr_err("%s: Invalid token passed\n", __func__); in opal_async_wait_response_interruptible()
173 * The first time this gets called we mark the token as DISPATCHED in opal_async_wait_response_interruptible()
175 * caller frees the token, we know not to actually free the token in opal_async_wait_response_interruptible()
178 * Only change if the token is ALLOCATED - it may have been in opal_async_wait_response_interruptible()
182 * There is also a dirty great comment at the token allocation in opal_async_wait_response_interruptible()
186 * token. in opal_async_wait_response_interruptible()
188 if (opal_async_tokens[token].state == ASYNC_TOKEN_ALLOCATED) { in opal_async_wait_response_interruptible()
190 if (opal_async_tokens[token].state == ASYNC_TOKEN_ALLOCATED) in opal_async_wait_response_interruptible()
191 opal_async_tokens[token].state = ASYNC_TOKEN_DISPATCHED; in opal_async_wait_response_interruptible()
202 opal_async_tokens[token].state == in opal_async_wait_response_interruptible()
205 memcpy(msg, &opal_async_tokens[token].response, sizeof(*msg)); in opal_async_wait_response_interruptible()
218 uint64_t token; in opal_async_comp_event() local
223 token = be64_to_cpu(comp_msg->params[0]); in opal_async_comp_event()
225 state = opal_async_tokens[token].state; in opal_async_comp_event()
226 opal_async_tokens[token].state = ASYNC_TOKEN_COMPLETED; in opal_async_comp_event()
230 /* Free the token, no one else will */ in opal_async_comp_event()
231 opal_async_release_token(token); in opal_async_comp_event()
234 memcpy(&opal_async_tokens[token].response, comp_msg, sizeof(*comp_msg)); in opal_async_comp_event()