static ssize_t store_ipcloopback(struct device *dev,
		struct device_attribute *attr, const char *buf, size_t count)
{
	struct miscdevice *miscdev = dev_get_drvdata(dev);
	struct modem_shared *msd =
		container_of(miscdev, struct io_device, miscdev)->msd;
	struct io_device *lb_iod = get_iod_with_channel(msd, SIPC5_CH_ID_FMT_9);
	struct io_device *ipc_iod =
				get_iod_with_channel(msd, SIPC5_CH_ID_FMT_0);

	if (*buf == '0') {
		msd->ipcloopback_enable = 0;

		lb_iod->ops.header_create = sipc5_hdr_create_ipcloopback;
		ipc_iod->ops.recv_demux = sipc5_recv_demux;

		mif_info("ipc loobpack disable: %d\n", msd->ipcloopback_enable);
	} else {
		msd->ipcloopback_enable = 1;

		lb_iod->ops.header_create = sipc5_hdr_create_ipcloopback;
		ipc_iod->ops.recv_demux = sipc5_recv_demux_ipcloopback;

		mif_info("ipc loobpack enable: %d\n", msd->ipcloopback_enable);
	}

	return count;
}
Ejemplo n.º 2
0
static int xmm7260_boot_on(struct modem_ctl *mc)
{
	struct io_device *iod;
	struct link_device *ld;

	/* As of now, fmt0 always use LLI link */
	iod = get_iod_with_channel(mc->msd, SIPC5_CH_ID_FMT_0);

	if (!iod) {
		mif_err("There's no boot_on handler\n");
		return -ENXIO;
	}

	ld = get_current_link(iod);

	if (ld && ld->boot_on) {
		ld->boot_on(ld, NULL);
	} else {
		mif_err("There's no boot_on handler\n");
		return -ENXIO;
	}

	return 0;
}