本文整理汇总了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;
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}