Lines Matching refs:cmd_list

859 	hermon_cmdlist_t	*cmd_list;  in hermon_outstanding_cmd_alloc()  local
862 cmd_list = &state->hs_cmd_list; in hermon_outstanding_cmd_alloc()
863 mutex_enter(&cmd_list->cml_lock); in hermon_outstanding_cmd_alloc()
866 ASSERT(cmd_list->cml_num_alloc != 0); in hermon_outstanding_cmd_alloc()
873 while (cmd_list->cml_entries_free == 0) { in hermon_outstanding_cmd_alloc()
876 mutex_exit(&cmd_list->cml_lock); in hermon_outstanding_cmd_alloc()
890 cmd_list->cml_waiters++; in hermon_outstanding_cmd_alloc()
892 cv_wait(&cmd_list->cml_cv, &cmd_list->cml_lock); in hermon_outstanding_cmd_alloc()
897 head = cmd_list->cml_head_indx; in hermon_outstanding_cmd_alloc()
898 *cmd_ptr = &cmd_list->cml_cmd[head]; in hermon_outstanding_cmd_alloc()
905 cmd_list->cml_cmd[next].cmd_prev = prev; in hermon_outstanding_cmd_alloc()
906 cmd_list->cml_cmd[prev].cmd_next = next; in hermon_outstanding_cmd_alloc()
907 cmd_list->cml_head_indx = next; in hermon_outstanding_cmd_alloc()
910 cmd_list->cml_entries_free--; in hermon_outstanding_cmd_alloc()
912 mutex_exit(&cmd_list->cml_lock); in hermon_outstanding_cmd_alloc()
925 hermon_cmdlist_t *cmd_list; in hermon_outstanding_cmd_free() local
928 cmd_list = &state->hs_cmd_list; in hermon_outstanding_cmd_free()
929 mutex_enter(&cmd_list->cml_lock); in hermon_outstanding_cmd_free()
939 if (cmd_list->cml_entries_free++ != 0) { in hermon_outstanding_cmd_free()
941 (*cmd_ptr)->cmd_next = cmd_list->cml_head_indx; in hermon_outstanding_cmd_free()
942 (*cmd_ptr)->cmd_prev = cmd_list->cml_tail_indx; in hermon_outstanding_cmd_free()
945 cmd_list->cml_cmd[cmd_list->cml_head_indx].cmd_prev = cmd_indx; in hermon_outstanding_cmd_free()
946 cmd_list->cml_cmd[cmd_list->cml_tail_indx].cmd_next = cmd_indx; in hermon_outstanding_cmd_free()
949 cmd_list->cml_tail_indx = cmd_indx; in hermon_outstanding_cmd_free()
957 cmd_list->cml_head_indx = cmd_indx; in hermon_outstanding_cmd_free()
958 cmd_list->cml_tail_indx = cmd_indx; in hermon_outstanding_cmd_free()
962 if (cmd_list->cml_waiters > 0) { in hermon_outstanding_cmd_free()
963 cmd_list->cml_waiters--; in hermon_outstanding_cmd_free()
964 cv_signal(&cmd_list->cml_cv); in hermon_outstanding_cmd_free()
970 mutex_exit(&cmd_list->cml_lock); in hermon_outstanding_cmd_free()