当前位置: 首页>>代码示例>>C++>>正文


C++ smd_open函数代码示例

本文整理汇总了C++中smd_open函数的典型用法代码示例。如果您正苦于以下问题:C++ smd_open函数的具体用法?C++ smd_open怎么用?C++ smd_open使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了smd_open函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: diag_smd_probe

static int diag_smd_probe(struct platform_device *pdev)
{
	int r = 0;

	if (pdev->id == SMD_APPS_MODEM) {
		r = smd_open(SMDDIAG_NAME, &driver->ch, driver, diag_smd_notify);
		wmb();
		ch_temp = driver->ch;
		DIAGFWD_INFO("%s: smd_open(%s):%d, ch_temp:%p, driver->ch:%p, &driver->ch:%p\n",
			__func__, SMDDIAG_NAME, r, ch_temp, driver->ch, &driver->ch);
	}
#if defined(CONFIG_MSM_N_WAY_SMD)
	if (pdev->id == SMD_APPS_QDSP) {
#if defined(CONFIG_MACH_MECHA) || defined(CONFIG_ARCH_MSM8X60_LTE)	\
	|| defined(CONFIG_ARCH_MSM8X60) || defined(CONFIG_ARCH_MSM8960)
		r = smd_named_open_on_edge("DIAG", SMD_APPS_QDSP
			, &driver->chqdsp, driver, diag_smd_qdsp_notify);
#else
		r = smd_open("DSP_DIAG", &driver->chqdsp, driver, diag_smd_qdsp_notify);
#endif
	}
#endif
	if (pdev->id == SMD_APPS_WCNSS)
		r = smd_named_open_on_edge("APPS_RIVA_DATA", SMD_APPS_WCNSS
			, &driver->ch_wcnss, driver, diag_smd_wcnss_notify);
	pm_runtime_set_active(&pdev->dev);
	pm_runtime_enable(&pdev->dev);
	pr_debug("diag: open SMD port, Id = %d, r = %d\n", pdev->id, r);
	smd_diag_initialized = 1;

	return 0;
}
开发者ID:dic1911,项目名称:android_kernel_htc_gtou,代码行数:32,代码来源:diagfwd.c

示例2: grmnet_ctrl_smd_connect_w

static void grmnet_ctrl_smd_connect_w(struct work_struct *w)
{
	struct rmnet_ctrl_port *port =
			container_of(w, struct rmnet_ctrl_port, connect_w.work);
	struct smd_ch_info *c = &port->ctrl_ch;
	unsigned long flags;
	int ret;

	pr_debug("%s:\n", __func__);

	if (!test_bit(CH_READY, &c->flags))
		return;

	ret = smd_open(c->name, &c->ch, port, grmnet_ctrl_smd_notify);
	if (ret) {
		if (ret == -EAGAIN) {
			/* port not ready  - retry */
			pr_debug("%s: SMD port not ready - rescheduling:%s err:%d\n",
					__func__, c->name, ret);
			queue_delayed_work(grmnet_ctrl_wq, &port->connect_w,
				msecs_to_jiffies(250));
		} else {
			pr_err("%s: unable to open smd port:%s err:%d\n",
					__func__, c->name, ret);
		}
		return;
	}

	spin_lock_irqsave(&port->port_lock, flags);
	if (port->port_usb)
		smd_tiocmset(c->ch, c->cbits_tomodem, ~c->cbits_tomodem);
	spin_unlock_irqrestore(&port->port_lock, flags);
}
开发者ID:ColonelSaumon,项目名称:android_kernel_nokia_msm8x25,代码行数:33,代码来源:u_rmnet_ctrl_smd.c

示例3: __rmnet_open

static int __rmnet_open(struct net_device *dev)
{
	int r;
	void *pil;
	struct rmnet_private *p = netdev_priv(dev);

	mutex_lock(&p->pil_lock);
	if (!p->pil) {
		pil = msm_rmnet_load_modem(dev);
		if (IS_ERR(pil)) {
			mutex_unlock(&p->pil_lock);
			return PTR_ERR(pil);
		}
		p->pil = pil;
	}
	mutex_unlock(&p->pil_lock);

	if (!p->ch) {
		r = smd_open(p->chname, &p->ch, dev, smd_net_notify);

		if (r < 0)
			return -ENODEV;
	}

	smd_disable_read_intr(p->ch);
	return 0;
}
开发者ID:FPChaim,项目名称:android_kernel_lge_msm7x27-3.0.x,代码行数:27,代码来源:msm_rmnet.c

示例4: smd_vt_open

static int smd_vt_open(struct inode *ip, struct file *fp)
{
    int r = 0;
    int try_count =0;
    
    printk(KERN_INFO "smd_vt_open\n");

    mutex_lock(&smd_vt_ch_lock);
    if ((smd_vt_devp->ch == 0) || (smd_vt_devp->open_count == 0)) {
        r = smd_open("DATA11", &smd_vt_devp->ch,0, smd_vt_notify);
        while((r == 0) && (smd_vt_devp->open_flag ==0)){
            if(100 < try_count++){
                r = -ENODEV;
                break;
            }
            msleep(10);
        }
    }

    if( r ==  0){    // opened success or already opened.
        smd_vt_devp->open_count++;
    }
    mutex_unlock(&smd_vt_ch_lock);
    return r;
}
开发者ID:airk000,项目名称:kernel_pantech_msm8660,代码行数:25,代码来源:smd_vt.c

示例5: __rmnet_open

static int __rmnet_open(struct net_device *dev)
{
	int r;
	void *pil;
	struct rmnet_private *p = netdev_priv(dev);

	/* printk("%s() ++\n", __func__); */

	mutex_lock(&p->pil_lock);
	if (!p->pil) {
		pil = msm_rmnet_load_modem(dev);
		if (IS_ERR(pil)) {
			mutex_unlock(&p->pil_lock);
			return PTR_ERR(pil);
		}
		p->pil = pil;
	}
	mutex_unlock(&p->pil_lock);

	if (!p->ch) {
		r = smd_open(p->chname, &p->ch, dev, smd_net_notify);

		if (r < 0)
			return -ENODEV;
	}

	/* printk("%s() --\n", __func__); */
	return 0;
}
开发者ID:vinylfreak89,项目名称:leanKernel-tbolt-aosp,代码行数:29,代码来源:msm_rmnet.c

示例6: diag_smd_probe

static int diag_smd_probe(struct platform_device *pdev)
{
	int r = 0;

	if (pdev->id == SMD_APPS_MODEM) {
		r = smd_open("DIAG", &driver->ch, driver, diag_smd_notify);
		ch_temp = driver->ch;
	}
#if defined(CONFIG_MSM_N_WAY_SMD)
	if (pdev->id == SMD_APPS_QDSP)
		r = smd_named_open_on_edge("DIAG", SMD_APPS_QDSP
			, &driver->chqdsp, driver, diag_smd_qdsp_notify);
#endif
	if (pdev->id == SMD_APPS_WCNSS)
		r = smd_named_open_on_edge("APPS_RIVA_DATA", SMD_APPS_WCNSS
			, &driver->ch_wcnss, driver, diag_smd_wcnss_notify);
	pm_runtime_set_active(&pdev->dev);
	pm_runtime_enable(&pdev->dev);
	pr_debug("diag: open SMD port, Id = %d, r = %d\n", pdev->id, r);

	#ifdef CONFIG_HUAWEI_FEATURE_PHUDIAG
	phudriver->ch = driver->ch;
	#endif
	return 0;
}
开发者ID:desalesouche,项目名称:kernel_huawei,代码行数:25,代码来源:diagfwd.c

示例7: grmnet_ctrl_smd_connect_w

static void grmnet_ctrl_smd_connect_w(struct work_struct *w)
{
	struct rmnet_ctrl_port *port =
			container_of(w, struct rmnet_ctrl_port, connect_w);
	struct smd_ch_info *c = &port->ctrl_ch;
	unsigned long flags;
	int ret;

	pr_debug("%s:\n", __func__);

	if (!test_bit(CH_READY, &c->flags))
		return;

	ret = smd_open(c->name, &c->ch, port, grmnet_ctrl_smd_notify);
	if (ret) {
		pr_err("%s: Unable to open smd ch:%s err:%d\n",
				__func__, c->name, ret);
		return;
	}

	spin_lock_irqsave(&port->port_lock, flags);
	if (port->port_usb)
		smd_tiocmset(c->ch, c->cbits_tomodem, ~c->cbits_tomodem);
	spin_unlock_irqrestore(&port->port_lock, flags);
}
开发者ID:dimax754,项目名称:msm_2.6.38,代码行数:25,代码来源:u_rmnet_ctrl_smd.c

示例8: diag_smd_probe

static int diag_smd_probe(struct platform_device *pdev)
{
	int r = 0;

	if (pdev->id == 0) {
		if (driver->usb_buf_in == NULL &&
			(driver->usb_buf_in =
			kzalloc(USB_MAX_IN_BUF, GFP_KERNEL)) == NULL)

			goto err;
		else

		r = smd_open("DIAG", &driver->ch, driver, diag_smd_notify);
	}
#if defined(CONFIG_MSM_N_WAY_SMD)
	if (pdev->id == 1) {
		if (driver->usb_buf_in_qdsp == NULL &&
			(driver->usb_buf_in_qdsp =
			kzalloc(USB_MAX_IN_BUF, GFP_KERNEL)) == NULL)

			goto err;
		else

		r = smd_named_open_on_edge("DIAG", SMD_APPS_QDSP,
			&driver->chqdsp, driver, diag_smd_qdsp_notify);

	}
#endif
	printk(KERN_INFO "diag opened SMD port ; r = %d\n", r);

err:
	return 0;
}
开发者ID:AntonioPT,项目名称:u8150-kernel-pulse-port,代码行数:33,代码来源:diagfwd.c

示例9: rpcrouter_smd_remote_probe

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;
}
开发者ID:underdarkonsole,项目名称:huawei_vision_kernel_JB,代码行数:27,代码来源:rpcrouter_smd_xprt.c

示例10: msm_diag_smd_open

static int msm_diag_smd_open(void)
{
	struct diag_context *ctxt = &_context;
	int r = 0;

    if ( !ctxt->ch ) {
	    r = smd_open("SMD_DIAG", &ctxt->ch, ctxt, smd_diag_notify);
    }
	return r;
}
开发者ID:astarasikov,项目名称:android_kernel_htc_kovsky,代码行数:10,代码来源:smd_diag.c

示例11: nmea_open

static int nmea_open(struct inode *ip, struct file *fp)
{
	int r = 0;

	mutex_lock(&nmea_ch_lock);
	if (nmea_devp->ch == 0)
		r = smd_open("GPSNMEA", &nmea_devp->ch, nmea_devp, nmea_notify);
	mutex_unlock(&nmea_ch_lock);

	return r;
}
开发者ID:404992361,项目名称:mi1_kernel,代码行数:11,代码来源:smd_nmea.c

示例12: nmea_open

static int nmea_open(struct inode *ip, struct file *fp)
{
	int r = 0;

	mutex_lock(&nmea_ch_lock);
	if (nmea_devp->ch == 0)
		r = smd_open("SMD_GPSNMEA", &nmea_devp->ch, nmea_devp, nmea_notify);	/* Modified by Andy for HTC SMD upper layer drivers */
	mutex_unlock(&nmea_ch_lock);

	return r;
}
开发者ID:12rafael,项目名称:jellytimekernel,代码行数:11,代码来源:smd_nmea.c

示例13: smd_tty_open

static int smd_tty_open(struct tty_struct *tty, struct file *f)
{
	int res = 0;
	int n = tty->index;
	struct smd_tty_info *info;
	const char *name;

	if (n == 0)
		name = "SMD_DS";
//	else if (n == 7)
//		name = "DATA1";
//	else if (n == 21)
//		name = "DATA21";
	else if (n == 27)
		name = "SMD_GPSNMEA";
//	else if (n == 36)
//		name = "LOOPBACK";
	else
		return -ENODEV;

	info = smd_tty + n;

	mutex_lock(&smd_tty_lock);
	tty->driver_data = info;

	if (info->open_count++ == 0) {
		info->tty = tty;
		tasklet_init(&info->tty_tsklt, smd_tty_read,
			     (unsigned long)info);
		wake_lock_init(&info->wake_lock, WAKE_LOCK_SUSPEND, name);
		if (!info->ch) {
#if 0
			if (n == 36) {
				/* set smsm state to SMSM_SMD_LOOPBACK state
				** and wait allowing enough time for Modem side
				** to open the loopback port (Currently, this is
				** this is effecient than polling).
				*/
				smsm_change_state(SMSM_APPS_STATE,
						  0, SMSM_SMD_LOOPBACK);
				msleep(100);
			}
#endif
			res = smd_open(name, &info->ch, info,
				       smd_tty_notify);
		}
	}
	mutex_unlock(&smd_tty_lock);

	return res;
}
开发者ID:klothius,项目名称:htc_magic_kernel_2635,代码行数:51,代码来源:smd_tty.c

示例14: diag_dci_probe

static int diag_dci_probe(struct platform_device *pdev)
{
	int err = 0;

	if (pdev->id == SMD_APPS_MODEM) {
		err = smd_open("DIAG_2", &driver->ch_dci, driver,
					    diag_smd_dci_notify);
		if (err)
			pr_err("diag: cannot open DCI port, Id = %d, err ="
				" %d\n", pdev->id, err);
		else
			diag_dci_notify_client(DIAG_CON_MPSS);
	}
	return err;
}
开发者ID:KonstaT,项目名称:sailfishos_kernel_jolla_msm8930,代码行数:15,代码来源:diag_dci.c

示例15: rmnet_open

static int rmnet_open(struct net_device *dev)
{
	int r;
	struct rmnet_private *p = netdev_priv(dev);

	pr_info("rmnet_open()\n");
	if (!p->ch) {
		r = smd_open(p->chname, &p->ch, dev, smd_net_notify);

		if (r < 0)
			return -ENODEV;
	}

	netif_start_queue(dev);
	return 0;
}
开发者ID:AKToronto,项目名称:htc-kernel-msm7227,代码行数:16,代码来源:msm_rmnet.c


注:本文中的smd_open函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。