示例#1
0
static void vcd_clnt_cb_in_eos
    (struct vcd_clnt_ctxt *cctxt,
     u32 event,
     u32 status,
     void *payload, size_t sz, u32 *ddl_handle, void *const client_data) {
	struct vcd_dev_ctxt *dev_ctxt = cctxt->dev_ctxt;
	struct vcd_transc *transc = NULL;
	u32 frm_trans_end = false, rc = VCD_S_SUCCESS;

	if (cctxt->ddl_handle != ddl_handle) {
		VCD_MSG_ERROR("ddl_handle mismatch");

		return;
	}

	switch (event) {
	case VCD_EVT_RESP_INPUT_DONE:
		{
			rc = vcd_handle_input_done_in_eos(cctxt, payload,
						     status);

			break;
		}

	case VCD_EVT_RESP_OUTPUT_DONE:
		{
			rc = vcd_handle_frame_done_in_eos(cctxt, payload,
						     status);

			break;
		}
	case VCD_EVT_RESP_OUTPUT_REQ:
		{
			rc = vcd_handle_output_required(cctxt, payload,
					status);
			break;
		}
	case VCD_EVT_RESP_EOS_DONE:
		{
			transc = (struct vcd_transc *)client_data;
			vcd_handle_eos_done(cctxt, transc, status);
			vcd_mark_frame_channel(cctxt->dev_ctxt);
			break;
		}
	case VCD_EVT_IND_OUTPUT_RECONFIG:
		{
			rc = vcd_handle_ind_output_reconfig(cctxt,
				payload, status);
			if (!VCD_FAILED(rc)) {
				frm_trans_end = true;
				payload = NULL;
				vcd_do_client_state_transition(cctxt,
					VCD_CLIENT_STATE_RUN,
					CLIENT_STATE_EVENT_NUMBER
					(clnt_cb));
				VCD_MSG_LOW
					("RECONFIGinEOS:Suspending Client");
				rc = vcd_sched_suspend_resume_clnt(cctxt,
						false);
				if (VCD_FAILED(rc)) {
					VCD_MSG_ERROR
					("Failed: suspend_resume_clnt. rc=0x%x",
						rc);
				}
			}
			break;
		}
	case VCD_EVT_IND_HWERRFATAL:
		{
			vcd_handle_ind_hw_err_fatal(cctxt,
				VCD_EVT_IND_HWERRFATAL,	status);
			break;
		}
	case VCD_EVT_IND_INFO_OUTPUT_RECONFIG:
		{
			vcd_handle_ind_info_output_reconfig(cctxt, status);
			break;
		}
	default:
		{
			VCD_MSG_ERROR
			    ("Unexpected callback event=%d status=%d from DDL",
			     event, status);

			dev_ctxt->command_continue = false;

			break;
		}

	}
	if (!VCD_FAILED(rc) &&
		(event == VCD_EVT_RESP_INPUT_DONE ||
		event == VCD_EVT_RESP_OUTPUT_DONE ||
		event == VCD_EVT_RESP_OUTPUT_REQ ||
		event == VCD_EVT_IND_OUTPUT_RECONFIG)) {
		if (payload && ((struct ddl_frame_data_tag *)
			payload)->frm_trans_end) {
			vcd_mark_frame_channel(cctxt->dev_ctxt);
			frm_trans_end = true;
		}
		if (frm_trans_end && !cctxt->status.frame_submitted)
			vcd_handle_eos_trans_end(cctxt);
	}
}
示例#2
0
static void vcd_clnt_cb_in_eos
    (struct vcd_clnt_ctxt_type_t *p_cctxt,
     u32 event,
     u32 status,
     void *p_payload, u32 n_size, u32 *ddl_handle, void *const p_client_data) {
	struct vcd_dev_ctxt_type *p_dev_ctxt = p_cctxt->p_dev_ctxt;
	struct vcd_transc_type *p_transc = NULL;
	u32 b_frm_trans_end = FALSE;

	if (p_cctxt->ddl_handle != ddl_handle) {
		VCD_MSG_ERROR("ddl_handle mismatch");

		return;
	}

	switch (event) {
	case VCD_EVT_RESP_INPUT_DONE:
		{
			vcd_handle_input_done_in_eos(p_cctxt, p_payload,
						     status);

			break;
		}

	case VCD_EVT_RESP_OUTPUT_DONE:
		{
			vcd_handle_frame_done_in_eos(p_cctxt, p_payload,
						     status);

			break;
		}
	case VCD_EVT_RESP_OUTPUT_REQ:
		{
			(void)vcd_handle_output_required(p_cctxt, p_payload,
					status);
			break;
		}
	case VCD_EVT_RESP_EOS_DONE:
		{
			p_transc = (struct vcd_transc_type *)p_client_data;

			vcd_handle_eos_done(p_cctxt, p_transc, status);
			break;
		}
	case VCD_EVT_IND_OUTPUT_RECONFIG:
		{
			(void) vcd_handle_ind_output_reconfig(p_cctxt,
				p_payload, status);

			b_frm_trans_end = TRUE;
			p_payload = NULL;
			break;
		}
	case VCD_EVT_IND_HWERRFATAL:
		{
			vcd_handle_ind_hw_err_fatal(p_cctxt,
				VCD_EVT_IND_HWERRFATAL,	status);
			break;
		}
	default:
		{
			VCD_MSG_ERROR
			    ("Unexpected callback event=%d status=%d from DDL",
			     event, status);

			p_dev_ctxt->b_continue = FALSE;

			break;
		}

	}
	if (event == VCD_EVT_RESP_INPUT_DONE ||
		event == VCD_EVT_RESP_OUTPUT_DONE ||
		event == VCD_EVT_RESP_OUTPUT_REQ ||
		event == VCD_EVT_IND_OUTPUT_RECONFIG) {
		if (p_payload && ((struct ddl_frame_data_type_tag *)
			p_payload)->b_frm_trans_end) {
			vcd_mark_frame_channel(p_cctxt->p_dev_ctxt);
			b_frm_trans_end = TRUE;
		}
		if (b_frm_trans_end && !p_cctxt->status.n_frame_submitted)
			vcd_handle_eos_trans_end(p_cctxt);
	}
}