コード例 #1
0
void diagfwd_bridge_exit(void)
{
	pr_debug("diag: in %s\n", __func__);

	if (driver->hsic_device_enabled) {
		diag_hsic_close();
		driver->hsic_device_enabled = 0;
		diagmem_exit(driver, POOL_TYPE_ALL);
	}
	if (driver->diag_smux_enabled) {
		driver->lcid = LCID_INVALID;
		kfree(driver->buf_in_smux);
		driver->diag_smux_enabled = 0;
	}
	platform_driver_unregister(&msm_hsic_ch_driver);
	platform_driver_unregister(&msm_diagfwd_smux_driver);
	
#ifdef CONFIG_DIAG_OVER_USB
	if (driver->usb_mdm_connected)
		usb_diag_free_req(driver->mdm_ch);
	usb_diag_close(driver->mdm_ch);
#endif
	kfree(driver->usb_buf_mdm_out);
	kfree(driver->hsic_buf_tbl);
	kfree(driver->write_ptr_mdm);
	kfree(driver->usb_read_mdm_ptr);
	destroy_workqueue(driver->diag_bridge_wq);
}
コード例 #2
0
/*
 * diagfwd_disconnect_bridge is called when the USB mdm channel
 * is disconnected
 */
int diagfwd_disconnect_bridge(int process_cable)
{
    pr_debug("DIAG in %s\n", __func__);

    /* If the usb cable is being disconnected */
    if (process_cable) {
        driver->usb_mdm_connected = 0;
        usb_diag_free_req(driver->mdm_ch);
    }

    if (driver->logging_mode != MEMORY_DEVICE_MODE) {
        if (driver->hsic_device_enabled) {
            driver->in_busy_hsic_write_on_device = 1;
            driver->in_busy_hsic_read_on_device = 1;
            driver->in_busy_hsic_write = 1;
            driver->in_busy_hsic_read = 1;
            /* Turn off communication over usb mdm and hsic */
            return diag_hsic_close();
        } else if (driver->diag_smux_enabled) {
            driver->in_busy_smux = 1;
            driver->lcid = LCID_INVALID;
            /* Turn off communication over usb mdm and smux */
            msm_smux_close(LCID_VALID);
        }
    }
    return 0;
}
コード例 #3
0
int diagfwd_disconnect_bridge(int process_cable)
{
	DIAGFWD_INFO("diag: In %s, process_cable: %d\n", __func__, process_cable);

	
	if (process_cable) {
		driver->usb_mdm_connected = 0;
		driver->qxdmusb_drop = 1;
		usb_diag_free_req(driver->mdm_ch);
	}

	if (driver->hsic_device_enabled &&
			driver->logging_mode != MEMORY_DEVICE_MODE) {
#if 0
		driver->in_busy_hsic_read_on_device = 1;
		driver->in_busy_hsic_write = 1;
		
		return diag_hsic_close();
#endif
	} else if (driver->diag_smux_enabled &&
			driver->logging_mode == USB_MODE) {
		driver->in_busy_smux = 1;
		driver->lcid = LCID_INVALID;
#if 0
		driver->smux_connected = 0;
#endif
		
		msm_smux_close(LCID_VALID);
	}
	return 0;
}
コード例 #4
0
static int diag_hsic_remove(struct platform_device *pdev)
{
	pr_debug("diag: %s called\n", __func__);
	mutex_lock(&diag_bridge[HSIC].bridge_mutex);
	diag_hsic_close();
	driver->hsic_device_enabled = 0;
	mutex_unlock(&diag_bridge[HSIC].bridge_mutex);

	return 0;
}
コード例 #5
0
static int diag_hsic_remove(struct platform_device *pdev)
{
	pr_debug("diag: %s called\n", __func__);
	if (diag_hsic[pdev->id].hsic_device_enabled) {
		mutex_lock(&diag_bridge[pdev->id].bridge_mutex);
		diag_hsic_close(pdev->id);
		diag_hsic[pdev->id].hsic_device_enabled = 0;
		mutex_unlock(&diag_bridge[pdev->id].bridge_mutex);
	}

	return 0;
}
コード例 #6
0
ファイル: diagfwd_hsic.c プロジェクト: NooNameR/k3_bravo
/*
 * diagfwd_disconnect_hsic is called when the USB mdm channel
 * is disconnected
 */
static int diagfwd_disconnect_hsic(void)
{
	pr_debug("DIAG in %s\n", __func__);

	driver->usb_mdm_connected = 0;
	usb_diag_free_req(driver->mdm_ch);
	driver->in_busy_hsic_write_on_mdm = 1;
	driver->in_busy_hsic_read_on_mdm = 1;
	driver->in_busy_hsic_write = 1;
	driver->in_busy_hsic_read = 1;

	/* Turn off communication over usb mdm and hsic */
	return diag_hsic_close();
}
コード例 #7
0
/*
 * diagfwd_disconnect_bridge is called when the USB mdm channel
 * is disconnected. So disconnect should happen for all bridges
 */
int diagfwd_disconnect_bridge(int process_cable)
{
	int i;
	pr_debug("diag: In %s, process_cable: %d\n", __func__, process_cable);

	for (i = 0; i < MAX_BRIDGES; i++) {
		if (diag_bridge[i].enabled) {
			mutex_lock(&diag_bridge[i].bridge_mutex);
			/* If the usb cable is being disconnected */
			if (process_cable) {
				diag_bridge[i].usb_connected = 0;
				usb_diag_free_req(diag_bridge[i].ch);
				driver->qxdmusb_drop = 1;
			}

			if (i == SMUX) {
				if (driver->diag_smux_enabled &&
					driver->logging_mode == USB_MODE) {
					driver->in_busy_smux = 1;
					driver->lcid = LCID_INVALID;
					driver->smux_connected = 0;
					/*
					 * Turn off communication over usb
					 * and smux
					 */
					msm_smux_close(LCID_VALID);
				}
			}  else {
				if (diag_hsic[i].hsic_device_enabled &&
				     (driver->logging_mode != MEMORY_DEVICE_MODE
				     || !diag_hsic[i].hsic_data_requested)) {
#if !DIAG_XPST
					diag_hsic[i].
						in_busy_hsic_read_on_device = 1;
					diag_hsic[i].in_busy_hsic_write = 1;
					/* Turn off communication over usb
					 * and HSIC */
					diag_hsic_close(i);
#endif
				}
			}
			mutex_unlock(&diag_bridge[i].bridge_mutex);
		}
	}
	return 0;
}
コード例 #8
0
/*
 * diagfwd_disconnect_hsic is called when the USB mdm channel
 * is disconnected
 */
int diagfwd_disconnect_hsic(int process_cable)
{
	pr_debug("diag: In %s, process_cable: %d\n", __func__, process_cable);

	/* If the usb cable is being disconnected */
	if (process_cable) {
		driver->usb_mdm_connected = 0;
		usb_diag_free_req(driver->mdm_ch);
	}

	if (driver->logging_mode != MEMORY_DEVICE_MODE) {
		if (driver->hsic_device_enabled) {
			driver->in_busy_hsic_read_on_device = 1;
			driver->in_busy_hsic_write = 1;
			/* Turn off communication over usb mdm and hsic */
			return diag_hsic_close();
		}
	}
	return 0;
}
コード例 #9
0
void diagfwd_bridge_exit(void)
{
	int i;
	pr_debug("diag: in %s\n", __func__);

	for (i = 0; i < MAX_HSIC_CH; i++) {
		if (diag_hsic[i].hsic_device_enabled) {
			diag_hsic_close(i);
			diag_hsic[i].hsic_device_enabled = 0;
			diag_bridge[i].enabled = 0;
		}
		diag_hsic[i].hsic_inited = 0;
		kfree(diag_hsic[i].hsic_buf_tbl);
	}
	diagmem_exit(driver, POOL_TYPE_ALL);
	if (driver->diag_smux_enabled) {
		driver->lcid = LCID_INVALID;
		kfree(driver->buf_in_smux);
		driver->diag_smux_enabled = 0;
		diag_bridge[SMUX].enabled = 0;
	}
	platform_driver_unregister(&msm_hsic_ch_driver);
	platform_driver_unregister(&msm_diagfwd_smux_driver);
	/* destroy USB MDM specific variables */
	for (i = 0; i < MAX_BRIDGES; i++) {
		if (diag_bridge[i].enabled) {
#ifdef CONFIG_DIAG_OVER_USB
			if (diag_bridge[i].usb_connected)
				usb_diag_free_req(diag_bridge[i].ch);
			usb_diag_close(diag_bridge[i].ch);
#endif
			kfree(diag_bridge[i].usb_buf_out);
			kfree(diag_bridge[i].usb_read_ptr);
			destroy_workqueue(diag_bridge[i].wq);
			diag_bridge[i].enabled = 0;
		}
	}
	kfree(driver->write_ptr_mdm);
}
コード例 #10
0
ファイル: diagfwd_hsic.c プロジェクト: NooNameR/k3_bravo
void __exit diagfwd_hsic_exit(void)
{
	pr_debug("DIAG in %s\n", __func__);

	if (driver->hsic_initialized)
		diag_hsic_close();

#ifdef CONFIG_DIAG_OVER_USB
	if (driver->usb_mdm_connected)
		usb_diag_free_req(driver->mdm_ch);
#endif
	platform_driver_unregister(&msm_hsic_ch_driver);
#ifdef CONFIG_DIAG_OVER_USB
	usb_diag_close(driver->mdm_ch);
#endif
	kfree(driver->buf_in_hsic);
	kfree(driver->usb_buf_mdm_out);
	kfree(driver->write_ptr_mdm);
	kfree(driver->usb_read_mdm_ptr);
	destroy_workqueue(driver->diag_hsic_wq);

	driver->hsic_device_enabled = 0;
}
コード例 #11
0
void diagfwd_hsic_exit(void)
{
	pr_debug("diag: in %s\n", __func__);

	if (driver->hsic_initialized)
		diag_hsic_close();
	diagmem_exit(driver, POOL_TYPE_ALL);
	/* destroy USB MDM specific variables */
#ifdef CONFIG_DIAG_OVER_USB
	if (driver->usb_mdm_connected)
		usb_diag_free_req(driver->mdm_ch);
#endif
	platform_driver_unregister(&msm_hsic_ch_driver);
#ifdef CONFIG_DIAG_OVER_USB
	usb_diag_close(driver->mdm_ch);
#endif
	kfree(driver->usb_buf_mdm_out);
	kfree(driver->hsic_buf_tbl);
	kfree(driver->usb_read_mdm_ptr);
	destroy_workqueue(driver->diag_hsic_wq);

	driver->hsic_device_enabled = 0;
}
コード例 #12
0
static int diag_hsic_remove(struct platform_device *pdev)
{
	int index = hsic_map[pdev->id].struct_idx;

	pr_debug("diag: %s called, pdev_id %d\n", __func__, pdev->id);

	if (hsic_map[pdev->id].type == HSIC_DATA_TYPE) {
		if (diag_hsic[index].hsic_device_enabled) {
			mutex_lock(&diag_bridge[index].bridge_mutex);
			diag_hsic_close(index);
			diag_hsic[index].hsic_device_enabled = 0;
			mutex_unlock(&diag_bridge[index].bridge_mutex);
		}
	} else {
		if (diag_hsic_dci[index].hsic_device_enabled) {
			mutex_lock(&diag_bridge_dci[index].bridge_mutex);
			diag_hsic_dci_close(index);
			diag_hsic_dci[index].hsic_device_enabled = 0;
			mutex_unlock(&diag_bridge_dci[index].bridge_mutex);
		}
	}

	return 0;
}
コード例 #13
0
int diagfwd_disconnect_bridge(int process_cable)
{
	int i;
	pr_debug("diag: In %s, process_cable: %d\n", __func__, process_cable);

	for (i = 0; i < MAX_BRIDGES; i++) {
		if (diag_bridge[i].enabled) {
			mutex_lock(&diag_bridge[i].bridge_mutex);
			
			if (process_cable) {
				diag_bridge[i].usb_connected = 0;
				usb_diag_free_req(diag_bridge[i].ch);
				driver->qxdmusb_drop = 1;
			}

			if (i == HSIC && driver->hsic_device_enabled &&
				 driver->logging_mode != MEMORY_DEVICE_MODE) {
#if !DIAG_XPST
				driver->in_busy_hsic_read_on_device = 1;
				driver->in_busy_hsic_write = 1;
				
				diag_hsic_close();
#endif
			} else if (i == SMUX && driver->diag_smux_enabled &&
					driver->logging_mode == USB_MODE) {
				driver->in_busy_smux = 1;
				driver->lcid = LCID_INVALID;
				driver->smux_connected = 0;
				
				msm_smux_close(LCID_VALID);
			}
			mutex_unlock(&diag_bridge[i].bridge_mutex);
		}
	}
	return 0;
}
コード例 #14
0
ファイル: diagfwd_hsic.c プロジェクト: NooNameR/k3_bravo
static int diag_hsic_remove(struct platform_device *pdev)
{
	pr_debug("DIAG: %s called\n", __func__);
	diag_hsic_close();
	return 0;
}