int insert_ed_to_ready_q(ed_t *insert_ed, bool f_isfirst) { if(insert_ed->ed_desc.endpoint_type == BULK_TRANSFER|| insert_ed->ed_desc.endpoint_type == CONTROL_TRANSFER) { if(f_isfirst) { otg_list_push_next(&insert_ed->trans_ready_q_list_entry,&nonperiodic_trans_ready_q.trans_ready_q_list_head); } else { otg_list_push_prev(&insert_ed->trans_ready_q_list_entry,&nonperiodic_trans_ready_q.trans_ready_q_list_head); } nonperiodic_trans_ready_q.trans_ready_entry_num++; } else { if(f_isfirst) { otg_list_push_next(&insert_ed->trans_ready_q_list_entry,&periodic_trans_ready_q.trans_ready_q_list_head); } else { otg_list_push_prev(&insert_ed->trans_ready_q_list_entry,&periodic_trans_ready_q.trans_ready_q_list_head); } periodic_trans_ready_q.trans_ready_entry_num++; } return USB_ERR_SUCCESS; }
static int insert_ed_to_ready_q(struct ed *insert_ed, bool is_first) { otg_dbg(OTG_DBG_SCHEDULE_ED, "ed_id %d, td_id %d, %d\n", insert_ed->ed_id, insert_ed->num_td, is_first); if (insert_ed->ed_desc.endpoint_type == BULK_TRANSFER || insert_ed->ed_desc.endpoint_type == CONTROL_TRANSFER) { if (is_first) { otg_list_push_next(&insert_ed->readyq_list, &nonperiodic_trans_ready_q.entity_list); } else { otg_list_push_prev(&insert_ed->readyq_list, &nonperiodic_trans_ready_q.entity_list); } nonperiodic_trans_ready_q.entity_num++; } else { if (is_first) { otg_list_push_next(&insert_ed->readyq_list, &periodic_trans_ready_q.entity_list); } else { otg_list_push_prev(&insert_ed->readyq_list, &periodic_trans_ready_q.entity_list); } periodic_trans_ready_q.entity_num++; } return USB_ERR_SUCCESS; }