static int bam_rmnet_rev_probe(struct platform_device *pdev)
{
	int i;
	char name[BAM_DMUX_CH_NAME_MAX_LEN];
	struct rmnet_private *p;

	for (i = 0; i < RMNET_REV_DEVICE_COUNT; ++i) {
		scnprintf(name, BAM_DMUX_CH_NAME_MAX_LEN, "bam_dmux_ch_%d",
					(i+BAM_DMUX_DATA_REV_RMNET_0));
		if (!strncmp(pdev->name, name, BAM_DMUX_CH_NAME_MAX_LEN))
			break;
	}

	if (i >= RMNET_REV_DEVICE_COUNT) {
		pr_err("%s: wrong netdev %s\n", __func__, pdev->name);
		return 0;
	}

	p = netdev_priv(netdevs_rev[i]);
	if (p->in_reset) {
		p->in_reset = 0;
		msm_bam_dmux_open(p->ch_id, netdevs_rev[i], bam_notify);
		netif_carrier_on(netdevs_rev[i]);
		netif_start_queue(netdevs_rev[i]);
	}

	return 0;
}
Esempio n. 2
0
static int bam_rmnet_probe(struct platform_device *pdev)
{
	int i;
	char name[BAM_DMUX_CH_NAME_MAX_LEN];
	struct rmnet_private *p;

	DBG0("[%s] bam_rmnet_probe()\n", pdev->name);

	for (i = 0; i < RMNET_DEVICE_COUNT; ++i) {
		scnprintf(name, BAM_DMUX_CH_NAME_MAX_LEN, "bam_dmux_ch_%d", i);
		if (!strncmp(pdev->name, name, BAM_DMUX_CH_NAME_MAX_LEN))
			break;
	}

	p = netdev_priv(netdevs[i]);
	if (p->in_reset) {
		DBG0("[%s] is reset\n", pdev->name);
		p->in_reset = 0;
		msm_bam_dmux_open(p->ch_id, netdevs[i], bam_notify);
		netif_carrier_on(netdevs[i]);
		netif_start_queue(netdevs[i]);
	}

	return 0;
}
static int __rmnet_open(struct net_device *dev)
{
	int r;
	struct rmnet_private *p = netdev_priv(dev);

	DBG0("[%s] __rmnet_open()\n", dev->name);

	if (p->device_up == DEVICE_UNINITIALIZED) {
		r = msm_bam_dmux_open(p->ch_id, dev, bam_notify);

		if (r < 0) {
			DBG0("%s: ch=%d failed with rc %d\n",
					__func__, p->ch_id, r);
			return -ENODEV;
		}

		r = platform_driver_register(p->bam_pdev);
		if (r) {
			pr_err("%s: bam pdev registration failed n=%d rc=%d\n",
					__func__, p->ch_id, r);
			msm_bam_dmux_close(p->ch_id);
			return r;
		}
	}

	p->device_up = DEVICE_ACTIVE;
	return 0;
}
Esempio n. 4
0
static int __rmnet_open(struct net_device *dev)
{
    int r;
    struct rmnet_private *p = netdev_priv(dev);

    DBG0("[%s] __rmnet_open()\n", dev->name);

    if (!p->device_up) {
        r = msm_bam_dmux_open(p->ch_id, dev,
                              bam_recv_notify, bam_write_done);

        if (r < 0)
            return -ENODEV;
    }

    p->device_up = DEVICE_ACTIVE;
    return 0;
}
static int __rmnet_open(struct net_device *dev)
{
	int r;
	struct rmnet_private *p = netdev_priv(dev);

	DBG0("[%s] __rmnet_open()\n", dev->name);

	if (p->device_up == DEVICE_UNINITIALIZED) {
		r = msm_bam_dmux_open(p->ch_id, dev, bam_notify);
		if (r < 0) {
			DBG0("%s: ch=%d failed with rc %d\n",
					__func__, p->ch_id, r);
			return -ENODEV;
		}
	}

	p->device_up = DEVICE_ACTIVE;
	return 0;
}