Lines Matching refs:token
370 struct bnxt_hwrm_wait_token *token; in __hwrm_acquire_token() local
372 token = kzalloc(sizeof(*token), GFP_KERNEL); in __hwrm_acquire_token()
373 if (!token) in __hwrm_acquire_token()
378 token->dst = dst; in __hwrm_acquire_token()
379 token->state = BNXT_HWRM_PENDING; in __hwrm_acquire_token()
381 token->seq_id = bp->hwrm_cmd_seq++; in __hwrm_acquire_token()
382 hlist_add_head_rcu(&token->node, &bp->hwrm_pending_list); in __hwrm_acquire_token()
384 token->seq_id = bp->hwrm_cmd_kong_seq++; in __hwrm_acquire_token()
387 return token; in __hwrm_acquire_token()
391 __hwrm_release_token(struct bnxt *bp, struct bnxt_hwrm_wait_token *token) in __hwrm_release_token() argument
393 if (token->dst == BNXT_HWRM_CHNL_CHIMP) { in __hwrm_release_token()
394 hlist_del_rcu(&token->node); in __hwrm_release_token()
395 kfree_rcu(token, rcu); in __hwrm_release_token()
397 kfree(token); in __hwrm_release_token()
405 struct bnxt_hwrm_wait_token *token; in hwrm_update_token() local
408 hlist_for_each_entry_rcu(token, &bp->hwrm_pending_list, node) { in hwrm_update_token()
409 if (token->seq_id == seq_id) { in hwrm_update_token()
410 WRITE_ONCE(token->state, state); in hwrm_update_token()
424 struct bnxt_hwrm_wait_token *token = NULL; in __hwrm_send() local
460 token = __hwrm_acquire_token(bp, dst); in __hwrm_send()
461 if (!token) { in __hwrm_send()
465 ctx->req->seq_id = cpu_to_le16(token->seq_id); in __hwrm_send()
514 while (READ_ONCE(token->state) < BNXT_HWRM_COMPLETE && in __hwrm_send()
533 if (READ_ONCE(token->state) != BNXT_HWRM_COMPLETE) { in __hwrm_send()
553 if (token && in __hwrm_send()
554 READ_ONCE(token->state) == BNXT_HWRM_DEFERRED) { in __hwrm_send()
555 __hwrm_release_token(bp, token); in __hwrm_send()
556 token = NULL; in __hwrm_send()
636 if (token) in __hwrm_send()
637 __hwrm_release_token(bp, token); in __hwrm_send()