當前位置: 首頁>>代碼示例>>C++>>正文


C++ DEVICE_STATE_EVENT_NUMBER函數代碼示例

本文整理匯總了C++中DEVICE_STATE_EVENT_NUMBER函數的典型用法代碼示例。如果您正苦於以下問題:C++ DEVICE_STATE_EVENT_NUMBER函數的具體用法?C++ DEVICE_STATE_EVENT_NUMBER怎麽用?C++ DEVICE_STATE_EVENT_NUMBER使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了DEVICE_STATE_EVENT_NUMBER函數的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: VCD_MSG_LOW

static u32 vcd_init_in_null
(struct vcd_drv_ctxt_type_t *p_drv_ctxt,
 struct vcd_init_config_type *p_config, s32 *p_driver_handle) {
    u32 rc = VCD_S_SUCCESS;
    struct vcd_dev_ctxt_type *p_dev_ctxt = &p_drv_ctxt->dev_ctxt;
    u32 b_done_create_timer = FALSE;
    VCD_MSG_LOW("vcd_init_in_dev_null:");


    p_dev_ctxt->config = *p_config;

    p_dev_ctxt->p_device_base_addr =
        (u8 *)p_config->pf_map_dev_base_addr(
            p_dev_ctxt->config.p_device_name);

    if (!p_dev_ctxt->p_device_base_addr) {
        VCD_MSG_ERROR("NULL Device_base_addr");

        return VCD_ERR_FAIL;
    }

    if (p_config->pf_register_isr) {
        p_config->pf_register_isr(p_dev_ctxt->config.
                                  p_device_name);
    }

    if (p_config->pf_timer_create) {
        if (p_config->pf_timer_create(vcd_hw_timeout_handler,
                                      NULL, &p_dev_ctxt->p_hw_timer_handle))
            b_done_create_timer = TRUE;
        else {
            VCD_MSG_ERROR("timercreate failed");
            return VCD_ERR_FAIL;
        }
    }


    rc = vcd_init_cmn(p_drv_ctxt, p_config, p_driver_handle);

    if (!VCD_FAILED(rc)) {
        vcd_do_device_state_transition(p_drv_ctxt,
                                       VCD_DEVICE_STATE_NOT_INIT,
                                       DEVICE_STATE_EVENT_NUMBER
                                       (pf_init));
    } else {
        if (p_dev_ctxt->config.pf_un_map_dev_base_addr)
            p_dev_ctxt->config.pf_un_map_dev_base_addr();

        if (p_dev_ctxt->config.pf_deregister_isr)
            p_dev_ctxt->config.pf_deregister_isr();

        if (b_done_create_timer && p_dev_ctxt->config.pf_timer_release)
            p_dev_ctxt->config.pf_timer_release(p_dev_ctxt->
                                                p_hw_timer_handle);

    }

    return rc;

}
開發者ID:lehmanju,項目名稱:android_kernel_huawei_u8500,代碼行數:60,代碼來源:vcd_device_sm.c

示例2: vcd_term_driver_context

void vcd_term_driver_context(struct vcd_drv_ctxt_type_t *p_drv_ctxt)
{
    struct vcd_dev_ctxt_type *p_dev_ctxt = &p_drv_ctxt->dev_ctxt;

    VCD_MSG_HIGH("All driver instances terminated");

    if (p_dev_ctxt->config.pf_deregister_isr)
        p_dev_ctxt->config.pf_deregister_isr();

    if (p_dev_ctxt->config.pf_un_map_dev_base_addr)
        p_dev_ctxt->config.pf_un_map_dev_base_addr();

    if (p_dev_ctxt->config.pf_timer_release)
        p_dev_ctxt->config.pf_timer_release(
            p_dev_ctxt->p_hw_timer_handle);

    vcd_free(p_dev_ctxt->a_trans_tbl);

    memset(p_dev_ctxt, 0, sizeof(struct vcd_dev_ctxt_type));

    vcd_do_device_state_transition(p_drv_ctxt,
                                   VCD_DEVICE_STATE_NULL,
                                   DEVICE_STATE_EVENT_NUMBER(pf_term));

}
開發者ID:lehmanju,項目名稱:android_kernel_huawei_u8500,代碼行數:25,代碼來源:vcd_device_sm.c

示例3: vcd_handle_device_init_failed

void vcd_handle_device_init_failed(struct vcd_drv_ctxt_type_t *p_drv_ctxt,
                                   u32 status)
{
    struct vcd_clnt_ctxt_type_t *p_client;
    struct vcd_clnt_ctxt_type_t *p_tmp_client;

    VCD_MSG_ERROR("Device init failed. status = %d", status);

    p_client = p_drv_ctxt->dev_ctxt.p_cctxt_list_head;
    while (p_client) {
        p_client->callback(VCD_EVT_RESP_OPEN,
                           status, NULL, 0, 0, p_client->p_client_data);

        p_tmp_client = p_client;
        p_client = p_client->p_next;

        vcd_destroy_client_context(p_tmp_client);
    }
    if (ddl_device_release(NULL))
        VCD_MSG_ERROR("Failed: ddl_device_release");

    (void)sched_destroy(p_drv_ctxt->dev_ctxt.sched_hdl);
    p_drv_ctxt->dev_ctxt.sched_hdl = NULL;

    if (vcd_power_event(&p_drv_ctxt->dev_ctxt,
                        NULL, VCD_EVT_PWR_DEV_INIT_FAIL))
        VCD_MSG_ERROR("VCD_EVT_PWR_DEV_INIT_FAIL failed");

    vcd_do_device_state_transition(p_drv_ctxt,
                                   VCD_DEVICE_STATE_NOT_INIT,
                                   DEVICE_STATE_EVENT_NUMBER(pf_dev_cb));
}
開發者ID:lehmanju,項目名稱:android_kernel_huawei_u8500,代碼行數:32,代碼來源:vcd_device_sm.c

示例4: vcd_handle_device_err_fatal

void vcd_handle_device_err_fatal(struct vcd_dev_ctxt_type *p_dev_ctxt,
                                 struct vcd_clnt_ctxt_type_t *p_trig_clnt)
{
    struct vcd_clnt_ctxt_type_t *p_cctxt = p_dev_ctxt->p_cctxt_list_head;
    struct vcd_clnt_ctxt_type_t *p_tmp_clnt = NULL;
    VCD_MSG_LOW("vcd_handle_device_err_fatal:");
    while (p_cctxt) {
        p_tmp_clnt = p_cctxt;
        p_cctxt = p_cctxt->p_next;
        if (p_tmp_clnt != p_trig_clnt)
            vcd_clnt_handle_device_err_fatal(p_tmp_clnt,
                                             VCD_EVT_IND_HWERRFATAL);
    }
    p_dev_ctxt->e_pending_cmd = VCD_CMD_DEVICE_RESET;
    if (!p_dev_ctxt->p_cctxt_list_head)
        vcd_do_device_state_transition(vcd_get_drv_context(),
                                       VCD_DEVICE_STATE_NOT_INIT,
                                       DEVICE_STATE_EVENT_NUMBER(pf_timeout));
    else
        vcd_do_device_state_transition(vcd_get_drv_context(),
                                       VCD_DEVICE_STATE_INVALID,
                                       DEVICE_STATE_EVENT_NUMBER(pf_dev_cb));
}
開發者ID:lehmanju,項目名稱:android_kernel_huawei_u8500,代碼行數:23,代碼來源:vcd_device_sm.c

示例5: vcd_continue

void vcd_continue(void)
{
    struct vcd_drv_ctxt_type_t *p_drv_ctxt;
    struct vcd_dev_ctxt_type *p_dev_ctxt;
    u32 b_continue;
    struct vcd_transc_type *p_transc;
    u32 rc;
    VCD_MSG_LOW("vcd_continue:");

    p_drv_ctxt = vcd_get_drv_context();
    p_dev_ctxt = &p_drv_ctxt->dev_ctxt;

    p_dev_ctxt->b_continue = FALSE;

    if (p_dev_ctxt->e_pending_cmd == VCD_CMD_DEVICE_INIT) {
        VCD_MSG_HIGH("VCD_CMD_DEVICE_INIT is pending");

        p_dev_ctxt->e_pending_cmd = VCD_CMD_NONE;

        (void)vcd_init_device_context(p_drv_ctxt,
                                      DEVICE_STATE_EVENT_NUMBER(pf_open));
    } else if (p_dev_ctxt->e_pending_cmd == VCD_CMD_DEVICE_TERM) {
        VCD_MSG_HIGH("VCD_CMD_DEVICE_TERM is pending");

        p_dev_ctxt->e_pending_cmd = VCD_CMD_NONE;

        (void)vcd_deinit_device_context(p_drv_ctxt,
                                        DEVICE_STATE_EVENT_NUMBER(pf_close));
    } else if (p_dev_ctxt->e_pending_cmd == VCD_CMD_DEVICE_RESET) {
        VCD_MSG_HIGH("VCD_CMD_DEVICE_RESET is pending");
        p_dev_ctxt->e_pending_cmd = VCD_CMD_NONE;
        (void)vcd_reset_device_context(p_drv_ctxt,
                                       DEVICE_STATE_EVENT_NUMBER(pf_dev_cb));
    } else {
        if (p_dev_ctxt->b_set_perf_lvl_pending) {
            rc = vcd_power_event(p_dev_ctxt, NULL,
                                 VCD_EVT_PWR_DEV_SET_PERFLVL);

            if (VCD_FAILED(rc)) {
                VCD_MSG_ERROR
                ("VCD_EVT_PWR_CLNT_SET_PERFLVL failed");
                VCD_MSG_HIGH
                ("Not running at desired perf level."
                 "curr=%d, reqd=%d",
                 p_dev_ctxt->n_curr_perf_lvl,
                 p_dev_ctxt->n_reqd_perf_lvl);
            } else {
                p_dev_ctxt->b_set_perf_lvl_pending = FALSE;
            }
        }

        do {
            b_continue = FALSE;

            if (vcd_get_command_channel_in_loop
                    (p_dev_ctxt, &p_transc)) {
                if (vcd_submit_command_in_continue(p_dev_ctxt,
                                                   p_transc))
                    b_continue = TRUE;
                else {
                    VCD_MSG_MED
                    ("No more commands to submit");

                    vcd_release_command_channel(p_dev_ctxt,
                                                p_transc);

                    vcd_release_interim_command_channels
                    (p_dev_ctxt);
                }
            }
        } while (b_continue);

        do {
            b_continue = FALSE;

            if (vcd_get_frame_channel_in_loop
                    (p_dev_ctxt, &p_transc)) {
                if (vcd_try_submit_frame_in_continue(p_dev_ctxt,
                                                     p_transc)) {
                    b_continue = TRUE;
                } else {
                    VCD_MSG_MED("No more frames to submit");

                    vcd_release_frame_channel(p_dev_ctxt,
                                              p_transc);

                    vcd_release_interim_frame_channels
                    (p_dev_ctxt);
                }
            }

        } while (b_continue);

        if (!vcd_core_is_busy(p_dev_ctxt)) {
            rc = vcd_power_event(p_dev_ctxt, NULL,
                                 VCD_EVT_PWR_CLNT_CMD_END);

            if (VCD_FAILED(rc))
                VCD_MSG_ERROR("Failed:"
                              "VCD_EVT_PWR_CLNT_CMD_END");
//.........這裏部分代碼省略.........
開發者ID:lehmanju,項目名稱:android_kernel_huawei_u8500,代碼行數:101,代碼來源:vcd_device_sm.c


注:本文中的DEVICE_STATE_EVENT_NUMBER函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。