static void enable_clients(struct mhi_device_ctxt *mhi_dev_ctxt, enum MHI_EXEC_ENV exec_env) { struct mhi_client_handle *client_handle = NULL; struct mhi_cb_info cb_info; int i; struct mhi_chan_info chan_info; int r; cb_info.cb_reason = MHI_CB_MHI_ENABLED; mhi_log(MHI_MSG_INFO, "Enabling Clients, exec env %d.\n", exec_env); for (i = 0; i < MHI_MAX_CHANNELS; ++i) { if (!VALID_CHAN_NR(i)) continue; client_handle = mhi_dev_ctxt->client_handle_list[i]; r = get_chan_props(mhi_dev_ctxt, i, &chan_info); if (!r && client_handle && exec_env == GET_CHAN_PROPS(CHAN_BRINGUP_STAGE, chan_info.flags)) mhi_notify_client(client_handle, MHI_CB_MHI_ENABLED); } if (exec_env == MHI_EXEC_ENV_AMSS) mhi_deassert_device_wake(mhi_dev_ctxt); mhi_log(MHI_MSG_INFO, "Done.\n"); }
void mhi_notify_clients(struct mhi_device_ctxt *mhi_dev_ctxt, enum MHI_CB_REASON reason) { int i; struct mhi_client_handle *client_handle = NULL; for (i = 0; i < MHI_MAX_CHANNELS; ++i) { if (VALID_CHAN_NR(i)) { client_handle = mhi_dev_ctxt->client_handle_list[i]; mhi_notify_client(client_handle, reason); } } }