Exemplo n.º 1
0
int diagfwd_connect(void)
{
	int err;

	DIAGFWD_INFO("%s\n", __func__);
	if (!driver->usb_connected) {
		err = usb_diag_alloc_req(driver->legacy_ch, N_LEGACY_WRITE,
			N_LEGACY_READ);
		if (err)
			DIAGFWD_ERR("diag: unable to allocate USB requests");
	}

	driver->in_busy_1 = 0;
	driver->in_busy_2 = 0;
	driver->in_busy_qdsp_1 = 0;
	driver->in_busy_qdsp_2 = 0;
#if defined(CONFIG_MACH_MECHA)
	driver->in_busy_mdm_1 = 0;
	driver->in_busy_mdm_2 = 0;
#endif
	/* Poll SMD channels to check for data*/
	queue_work(driver->diag_wq, &(driver->diag_read_smd_work));
	queue_work(driver->diag_wq, &(driver->diag_read_smd_qdsp_work));

#if defined(CONFIG_ARCH_MSM8X60_LTE)
	driver->in_busy_sdio_1 = 0;
	driver->in_busy_sdio_2 = 0;
	if (diag_ch_sdio) {
		if (driver->legacy_ch && !IS_ERR(driver->legacy_ch))
			diagfwd_connect_sdio();
		else
			DIAGFWD_INFO("diag:No data from SDIO without  USB LEGACY ch");

	} else {
		if ((!driver->usb_connected) && driver->mdm_ch && !IS_ERR(driver->mdm_ch))
			diagfwd_connect_sdio();
		else
			DIAGFWD_INFO("diag:No data from SDIO without  USB MDM ch");

		queue_work(driver->diag_sdio_wq, &(driver->diag_read_mdm_work));
	}

#endif
	driver->usb_connected = 1;
	/* Poll USB channel to check for data*/
	queue_work(driver->diag_wq, &(driver->diag_read_work));

	return 0;
}
Exemplo n.º 2
0
int diagfwd_connect(void)
{
	int err;

	printk(KERN_DEBUG "diag: USB connected\n");
	err = usb_diag_alloc_req(driver->legacy_ch, N_LEGACY_WRITE,
			N_LEGACY_READ);
	if (err)
		printk(KERN_ERR "diag: unable to alloc USB req on legacy ch");

	driver->usb_connected = 1;
	driver->in_busy_1 = 0;
	driver->in_busy_2 = 0;
	driver->in_busy_qdsp_1 = 0;
	driver->in_busy_qdsp_2 = 0;

	/* Poll SMD channels to check for data*/
	queue_work(driver->diag_wq, &(driver->diag_read_smd_work));
	queue_work(driver->diag_wq, &(driver->diag_read_smd_qdsp_work));
	/* Poll USB channel to check for data*/
	queue_work(driver->diag_wq, &(driver->diag_read_work));
#ifdef CONFIG_DIAG_SDIO_PIPE
	if (machine_is_msm8x60_charm_surf() || machine_is_msm8x60_charm_ffa()) {
		if (driver->mdm_ch && !IS_ERR(driver->mdm_ch))
			diagfwd_connect_sdio();
		else
			printk(KERN_INFO "diag: No USB MDM ch");
	}
#endif
	return 0;
}
Exemplo n.º 3
0
int diagfwd_connect(void)
{
	int err;
	int i;

	printk(KERN_DEBUG "diag: USB connected\n");
	err = usb_diag_alloc_req(driver->legacy_ch, N_LEGACY_WRITE,
			N_LEGACY_READ);
	if (err)
		printk(KERN_ERR "diag: unable to alloc USB req on legacy ch");

	driver->usb_connected = 1;
	for (i = 0; i < NUM_SMD_DATA_CHANNELS; i++) {
		driver->smd_data[i].in_busy_1 = 0;
		driver->smd_data[i].in_busy_2 = 0;
		/* Poll SMD data channels to check for data */
		queue_work(driver->diag_wq,
			&(driver->smd_data[i].diag_read_smd_work));
		/* Poll SMD CNTL channels to check for data */
		diag_smd_notify(&(driver->smd_cntl[i]), SMD_EVENT_DATA);
	}

	/* Poll USB channel to check for data*/
	queue_work(driver->diag_wq, &(driver->diag_read_work));
#ifdef CONFIG_DIAG_SDIO_PIPE
	if (machine_is_msm8x60_fusion() || machine_is_msm8x60_fusn_ffa()) {
		if (driver->mdm_ch && !IS_ERR(driver->mdm_ch))
			diagfwd_connect_sdio();
		else
			printk(KERN_INFO "diag: No USB MDM ch");
	}
#endif
	return 0;
}
Exemplo n.º 4
0
int diagfwd_connect(void)
{
	int err;

	printk(KERN_DEBUG "diag: USB connected\n");
	err = usb_diag_alloc_req(driver->legacy_ch, N_LEGACY_WRITE,
			N_LEGACY_READ);
	if (err)
		printk(KERN_ERR "diag: unable to alloc USB req on legacy ch");

	driver->usb_connected = 1;
	driver->in_busy_1 = 0;
	driver->in_busy_2 = 0;
	driver->in_busy_qdsp_1 = 0;
	driver->in_busy_qdsp_2 = 0;
	driver->in_busy_wcnss = 0;

	/* Poll SMD channels to check for data*/
	queue_work(driver->diag_wq, &(driver->diag_read_smd_work));
	queue_work(driver->diag_wq, &(driver->diag_read_smd_qdsp_work));
	queue_work(driver->diag_wq, &(driver->diag_read_smd_wcnss_work));

	if (chk_config_get_id() == AO8960_TOOLS_ID) {
		/* Poll SMD CNTL channels to check for data */
		queue_work(driver->diag_wq, &(driver->diag_read_smd_cntl_work));
		queue_work(driver->diag_wq, &(driver->diag_read_smd_qdsp_cntl_work));
		queue_work(driver->diag_wq, &(driver->diag_read_smd_wcnss_cntl_work));
	}
	/* Poll USB channel to check for data*/
	queue_work(driver->diag_wq, &(driver->diag_read_work));
#ifdef CONFIG_DIAG_SDIO_PIPE
	if (diag_support_mdm9k) {
		if (driver->mdm_ch && !IS_ERR(driver->mdm_ch))
			diagfwd_connect_sdio();
		else
			printk(KERN_INFO "diag: No USB MDM ch");
	}
#endif
	return 0;
}