static void rpcrouter_smd_remote_qdsp_notify(void *_dev, unsigned event)
{
	switch (event) {
	case SMD_EVENT_DATA:
		msm_rpcrouter_xprt_notify(&smd_remote_qdsp_xprt.xprt,
			RPCROUTER_XPRT_EVENT_DATA);
		break;

	case SMD_EVENT_OPEN:
		/* Print log info */
		pr_debug("%s: smd opened\n", __func__);

		msm_rpcrouter_xprt_notify(&smd_remote_qdsp_xprt.xprt,
			RPCROUTER_XPRT_EVENT_OPEN);
		break;

	case SMD_EVENT_CLOSE:
		/* Print log info */
		pr_debug("%s: smd closed\n", __func__);

		msm_rpcrouter_xprt_notify(&smd_remote_qdsp_xprt.xprt,
				RPCROUTER_XPRT_EVENT_CLOSE);
		break;
	}
}
static int rpcrouter_smd_remote_probe(struct platform_device *pdev)
{
    int rc;

    smd_remote_xprt.xprt.name = "rpcrotuer_smd_xprt";
    smd_remote_xprt.xprt.read_avail = rpcrouter_smd_remote_read_avail;
    smd_remote_xprt.xprt.read = rpcrouter_smd_remote_read;
    smd_remote_xprt.xprt.write_avail = rpcrouter_smd_remote_write_avail;
    smd_remote_xprt.xprt.write = rpcrouter_smd_remote_write;
    smd_remote_xprt.xprt.close = rpcrouter_smd_remote_close;
    smd_remote_xprt.xprt.priv = NULL;

    /* Open up SMD channel */
    rc = smd_open("RPCCALL", &smd_remote_xprt.channel, NULL,
                  rpcrouter_smd_remote_notify);
    if (rc < 0)
        return rc;

    smd_disable_read_intr(smd_remote_xprt.channel);

    msm_rpcrouter_xprt_notify(&smd_remote_xprt.xprt,
                              RPCROUTER_XPRT_EVENT_OPEN);

    smsm_change_state(SMSM_APPS_STATE, 0, SMSM_RPCINIT);

    return 0;
}
static int rpcrouter_smd_loopback_probe(struct platform_device *pdev)
{
    int rc;

    smd_loopback_xprt.xprt.name = "rpcrouter_loopback_xprt";
    smd_loopback_xprt.xprt.read_avail = rpcrouter_smd_loopback_read_avail;
    smd_loopback_xprt.xprt.read = rpcrouter_smd_loopback_read;
    smd_loopback_xprt.xprt.write_avail = rpcrouter_smd_loopback_write_avail;
    smd_loopback_xprt.xprt.write = rpcrouter_smd_loopback_write;
    smd_loopback_xprt.xprt.close = rpcrouter_smd_loopback_close;
    smd_loopback_xprt.xprt.priv = NULL;

    /* Open up SMD LOOPBACK channel */
    rc = smd_named_open_on_edge("local_loopback", SMD_LOOPBACK_TYPE,
                                &smd_loopback_xprt.channel, NULL,
                                rpcrouter_smd_loopback_notify);
    if (rc < 0)
        return rc;

    smd_disable_read_intr(smd_remote_xprt.channel);

    msm_rpcrouter_xprt_notify(&smd_loopback_xprt.xprt,
                              RPCROUTER_XPRT_EVENT_OPEN);
    return 0;
}
Exemplo n.º 4
0
/* Q6 SMD XPORT probe */
static int rpcrouter_smd_remote_qdsp_probe(struct platform_device *pdev)
{
	int rc;

	smd_remote_qdsp_xprt.xprt.name = "rpcrotuer_smd_q6_xprt";
	smd_remote_qdsp_xprt.xprt.read_avail =
		rpcrouter_smd_remote_qdsp_read_avail;
	smd_remote_qdsp_xprt.xprt.read = rpcrouter_smd_remote_qdsp_read;
	smd_remote_qdsp_xprt.xprt.write_avail =
		rpcrouter_smd_remote_qdsp_write_avail;
	smd_remote_qdsp_xprt.xprt.write = rpcrouter_smd_remote_qdsp_write;
	smd_remote_qdsp_xprt.xprt.close = rpcrouter_smd_remote_qdsp_close;
	smd_remote_qdsp_xprt.xprt.priv = NULL;

	/* Open up SMD channel */
	rc = smd_named_open_on_edge("RPCCALL_QDSP", SMD_APPS_QDSP,
			&smd_remote_qdsp_xprt.channel, NULL,
			rpcrouter_smd_remote_qdsp_notify);
	if (rc < 0)
		return rc;

	msm_rpcrouter_xprt_notify(&smd_remote_qdsp_xprt.xprt,
	RPCROUTER_XPRT_EVENT_OPEN);

	/* TBD QDSP SMSM may not be IN LINUX yet
	smsm_change_state(SMSM_APPS_STATE, 0, SMSM_RPCINIT); */

	return 0;
}
static void rpcrouter_smd_remote_notify(void *_dev, unsigned event)
{
	switch (event) {
	case SMD_EVENT_DATA:
		msm_rpcrouter_xprt_notify(&smd_remote_xprt.xprt,
					  RPCROUTER_XPRT_EVENT_DATA);
		break;

	case SMD_EVENT_OPEN:
		pr_info("%s: smd opened 0x%p\n", __func__, _dev);

		msm_rpcrouter_xprt_notify(&smd_remote_xprt.xprt,
			RPCROUTER_XPRT_EVENT_OPEN);
		break;

	case SMD_EVENT_CLOSE:
		pr_info("%s: smd closed 0x%p\n", __func__, _dev);

		msm_rpcrouter_xprt_notify(&smd_remote_xprt.xprt,
				RPCROUTER_XPRT_EVENT_CLOSE);
		break;
    }
}
static void rpcrouter_smd_loopback_notify(void *_dev, unsigned event)
{
    if (event == SMD_EVENT_DATA)
        msm_rpcrouter_xprt_notify(&smd_loopback_xprt.xprt,
                                  RPCROUTER_XPRT_EVENT_DATA);
}