Exemplo n.º 1
0
static void smd_open_work_fn(struct work_struct *work)
{
	struct diag_smd_info *smd_info = container_of(work,
						      struct diag_smd_info,
						      open_work);
	if (!smd_info->inited)
		return;

	diagfwd_channel_open(smd_info->fwd_ctxt);
	diagfwd_late_open(smd_info->fwd_ctxt);
	DIAG_LOG(DIAG_DEBUG_PERIPHERALS, "%s exiting\n",
		 smd_info->name);
}
static void smd_late_init(struct diag_smd_info *smd_info)
{
    struct diagfwd_info *fwd_info = NULL;
    if (!smd_info)
        return;

    DIAG_LOG(DIAG_DEBUG_PERIPHERALS, "%s entering\n",
             smd_info->name);

    diagfwd_register(TRANSPORT_SMD, smd_info->peripheral, smd_info->type,
                     (void *)smd_info, &smd_ops, &smd_info->fwd_ctxt);
    fwd_info = smd_info->fwd_ctxt;
    smd_info->inited = 1;
    if (atomic_read(&smd_info->opened))
        diagfwd_channel_open(smd_info->fwd_ctxt);

    DIAG_LOG(DIAG_DEBUG_PERIPHERALS, "%s exiting\n",
             smd_info->name);
}
Exemplo n.º 3
0
static void __socket_open_channel(struct diag_socket_info *info)
{
	if (!info)
		return;

	if (!info->inited) {
		pr_debug("diag: In %s, socket %s is not initialized\n",
			 __func__, info->name);
		return;
	}

	if (atomic_read(&info->opened)) {
		pr_debug("diag: In %s, socket %s already opened\n",
			 __func__, info->name);
		return;
	}

	atomic_set(&info->opened, 1);
	diagfwd_channel_open(info->fwd_ctxt);
}
Exemplo n.º 4
0
static void smd_late_init(struct diag_smd_info *smd_info)
{
	struct diagfwd_info *fwd_info = NULL;
	if (!smd_info)
		return;

	DIAG_LOG(DIAG_DEBUG_PERIPHERALS, "%s entering\n",
		 smd_info->name);

	diagfwd_register(TRANSPORT_SMD, smd_info->peripheral, smd_info->type,
			 (void *)smd_info, &smd_ops, &smd_info->fwd_ctxt);
	fwd_info = smd_info->fwd_ctxt;
	smd_info->inited = 1;
	/*
	 * The channel is already open by the probe call as a result of other
	 * peripheral. Inform the diag fwd layer that the channel is open.
	 */
	if (atomic_read(&smd_info->opened))
		diagfwd_channel_open(smd_info->fwd_ctxt);

	DIAG_LOG(DIAG_DEBUG_PERIPHERALS, "%s exiting\n",
		 smd_info->name);
}