• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ diagfwd_connect函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中diagfwd_connect函数的典型用法代码示例。如果您正苦于以下问题:C++ diagfwd_connect函数的具体用法?C++ diagfwd_connect怎么用?C++ diagfwd_connect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了diagfwd_connect函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: diagchar_close

static int diagchar_close(struct inode *inode, struct file *file)
{
    int i = 0;
    struct diagchar_priv *diagpriv_data = file->private_data;

    if (!(file->private_data)) {
        pr_alert("diag: Invalid file pointer");
        return -ENOMEM;
    }

    /* clean up any DCI registrations for this client
    * This will specially help in case of ungraceful exit of any DCI client
    * This call will remove any pending registrations of such client
    */
    diagchar_ioctl(NULL, DIAG_IOCTL_DCI_DEINIT, 0);

    /* If the exiting process is the socket process */
    if (driver->socket_process &&
            (driver->socket_process->tgid == current->tgid)) {
        driver->socket_process = NULL;
    }

#ifdef CONFIG_DIAG_OVER_USB
    /* If the SD logging process exits, change logging to USB mode */
    if (driver->logging_process_id == current->tgid) {
        driver->logging_mode = USB_MODE;
        diagfwd_connect();
#ifdef CONFIG_DIAG_BRIDGE_CODE
        diag_clear_hsic_tbl();
        diagfwd_cancel_hsic();
        diagfwd_connect_bridge(0);
#endif
    }
#endif /* DIAG over USB */
    /* Delete the pkt response table entry for the exiting process */
    for (i = 0; i < diag_max_reg; i++)
        if (driver->table[i].process_id == current->tgid)
            driver->table[i].process_id = 0;

    if (driver) {
        mutex_lock(&driver->diagchar_mutex);
        driver->ref_count--;
        /* On Client exit, try to destroy all 3 pools */
        diagmem_exit(driver, POOL_TYPE_COPY);
        diagmem_exit(driver, POOL_TYPE_HDLC);
        diagmem_exit(driver, POOL_TYPE_WRITE_STRUCT);
        for (i = 0; i < driver->num_clients; i++) {
            if (NULL != diagpriv_data && diagpriv_data->pid ==
                    driver->client_map[i].pid) {
                driver->client_map[i].pid = 0;
                kfree(diagpriv_data);
                diagpriv_data = NULL;
                break;
            }
        }
        mutex_unlock(&driver->diagchar_mutex);
        return 0;
    }
    return -ENOMEM;
}
开发者ID:nsingh94,项目名称:msm7x30-caf,代码行数:60,代码来源:diagchar_core.c


示例2: diagchar_close

static int diagchar_close(struct inode *inode, struct file *file)
{
	int i = 0;
#ifdef CONFIG_DIAG_OVER_USB
	/* If the SD logging process exits, change logging to USB mode */
	if (driver->logging_process_id == current->tgid) {
		driver->logging_mode = USB_MODE;
		diagfwd_connect();
	}
#endif /* DIAG over USB */
	/* Delete the pkt response table entry for the exiting process */
	for (i = 0; i < diag_max_registration; i++)
			if (driver->table[i].process_id == current->tgid)
					driver->table[i].process_id = 0;

			if (driver) {
				mutex_lock(&driver->diagchar_mutex);
				driver->ref_count--;
				/* On Client exit, try to destroy all 3 pools */
				diagmem_exit(driver, POOL_TYPE_COPY);
				diagmem_exit(driver, POOL_TYPE_HDLC);
				diagmem_exit(driver, POOL_TYPE_WRITE_STRUCT);
				for (i = 0; i < driver->num_clients; i++)
					if (driver->client_map[i].pid ==
					     current->tgid) {
						driver->client_map[i].pid = 0;
						break;
					}
		mutex_unlock(&driver->diagchar_mutex);
		return 0;
	}
	return -ENOMEM;
}
开发者ID:victor2002,项目名称:a770k_kernel,代码行数:33,代码来源:diagchar_core.c


示例3: diagchar_close

static int diagchar_close(struct inode *inode, struct file *file)
{
	int i = 0;

	/* If the SD logging process exits, change logging to USB mode */
	if (driver->logging_process_id == current->tgid) {
		driver->logging_mode = USB_MODE;
		diagfwd_connect();
	}
	/* Delete the pkt response table entry for the exiting process */
	for (i = 0; i < diag_max_registration; i++)
			if (driver->table[i].process_id == current->tgid)
					driver->table[i].process_id = 0;

			if (driver) {
				mutex_lock(&driver->diagchar_mutex);
				driver->ref_count--;
				diagmem_exit(driver);
				for (i = 0; i < driver->num_clients; i++)
					if (driver->client_map[i].pid ==
					     current->tgid) {
						driver->client_map[i].pid = 0;
						break;
					}
		mutex_unlock(&driver->diagchar_mutex);
		return 0;
	}
	return -ENOMEM;
}
开发者ID:manuelnaranjo,项目名称:P500-2.6.32.x,代码行数:29,代码来源:diagchar_core.c


示例4: diagcharmdm_ioctl

static long diagcharmdm_ioctl(struct file *filp,
		unsigned int iocmd, unsigned long ioarg)
{
	int success = -1;

	if (iocmd == DIAG_IOCTL_SWITCH_LOGGING) {
		mutex_lock(&driver->diagcharmdm_mutex);
		driver->logging_mode = (int)ioarg;
		driver->logging_process_id = current->tgid;
		mutex_unlock(&driver->diagcharmdm_mutex);
		if (driver->logging_mode == MEMORY_DEVICE_MODE) {
			DIAG_INFO("diagcharmdm_ioctl enable\n");
			diagfwd_disconnect();
			driver->qxdm2sd_drop = 0;
			driver->in_busy_sdio_1 = 0;
			driver->in_busy_sdio_2 = 0;
			buf_9k = kzalloc(USB_MAX_OUT_BUF, GFP_KERNEL);
			if (driver->sdio_ch)
				queue_work(driver->diag_sdio_wq, &(driver->diag_read_sdio_work));

		} else if (driver->logging_mode == USB_MODE) {
			DIAG_INFO("diagcharmdm_ioctl disable\n");
			diagfwd_connect();
			driver->qxdm2sd_drop = 1;

			kfree(buf_9k);
		}
		success = 1;
	}
	return success;
}
开发者ID:Snuzzo,项目名称:htc8960-3.0,代码行数:31,代码来源:diagchar_core.c


示例5: diagcharmdm_ioctl

static int diagcharmdm_ioctl(struct inode *inode, struct file *filp,
			   unsigned int iocmd, unsigned long ioarg)
{
	int success = -1;

#if defined(CONFIG_MACH_MECHA)
	if (!sdio_diag_initialized) {
		DIAG_INFO("sdio diag isn't in embedded mode \n");
		return 0;
	}
#endif

	if (iocmd == DIAG_IOCTL_SWITCH_LOGGING) {
		mutex_lock(&driver->diagcharmdm_mutex);
		driver->logging_mode = (int)ioarg;
		driver->logging_process_id = current->tgid;
		mutex_unlock(&driver->diagcharmdm_mutex);
		if (driver->logging_mode == MEMORY_DEVICE_MODE) {
			DIAG_INFO("diagcharmdm_ioctl enable\n");
			diagfwd_disconnect();
			driver->qxdm2sd_drop = 0;
#if defined(CONFIG_MACH_MECHA)
			driver->in_busy_mdm_1 = 0;
			driver->in_busy_mdm_2 = 0;
			/* Poll SMD channels to check for data*/
			queue_work(driver->mdm_diag_workqueue, &(driver->diag_read_smd_mdm_work));
#endif
#if defined(CONFIG_ARCH_MSM8X60_LTE)
				driver->in_busy_sdio_1 = 0;
				driver->in_busy_sdio_2 = 0;
				buf_9k = kzalloc(USB_MAX_OUT_BUF, GFP_KERNEL);
				if (driver->sdio_ch)
					queue_work(driver->diag_sdio_wq, &(driver->diag_read_sdio_work));
#endif

		} else if (driver->logging_mode == USB_MODE) {
			DIAG_INFO("diagcharmdm_ioctl disable\n");
			diagfwd_connect();
			driver->qxdm2sd_drop = 1;
#if defined(CONFIG_MACH_MECHA)
			driver->in_busy_mdm_1 = 1;
			driver->in_busy_mdm_2 = 1;
#endif
#if defined(CONFIG_ARCH_MSM8X60_LTE)
			kfree(buf_9k);
#endif

				}
		success = 1;
	}

	return success;


	return 0;

}
开发者ID:LeeDroid-,项目名称:Flyer-2.6.35-HC-MR,代码行数:57,代码来源:diagchar_core.c


示例6: diag_sdio_probe

static int diag_sdio_probe(struct platform_device *pdev)
{
	int err;
	if (diag9k_debug_mask)
		DIAG_INFO("%s\n", __func__);

	err = sdio_open("SDIO_DIAG", &driver->sdio_ch, driver,
							 diag_sdio_notify);
	if (err)
		DIAG_ERR("DIAG could not open SDIO channel");
	else {
		DIAG_INFO("DIAG opened SDIO channel");

		if (!strcmp(DIAG_LEGACY, usb_ch_name)) {
			driver->legacy_ch = usb_diag_open(DIAG_LEGACY, driver,
				diag_usb_legacy_notifier);
			if (IS_ERR(driver->legacy_ch)) {
				DIAG_ERR("Unable to open USB diag legacy channel\n");
				goto err;
			}
			DIAG_INFO("open USB diag legacy channel\n");
		} else if (!strcmp(DIAG_MDM, usb_ch_name)) {
			driver->legacy_ch = usb_diag_open(DIAG_LEGACY, driver,
				diag_usb_legacy_notifier);
			if (IS_ERR(driver->legacy_ch)) {
				DIAG_ERR("Unable to open USB diag legacy channel\n");
				goto err;
			}
			DIAG_INFO("open USB diag legacy channel\n");

			driver->mdm_ch = usb_diag_open(DIAG_MDM, driver,
				diag_usb_legacy_notifier);
			if (IS_ERR(driver->mdm_ch)) {
				DIAG_ERR("Unable to open USB diag MDM channel\n");
				goto err;
			}
			DIAG_INFO("open USB diag MDM channel\n");
		}
/*		queue_work(driver->diag_sdio_wq, &(driver->diag_read_mdm_work));*/
	}
	if (diag_configured)
		diagfwd_connect();
	driver->in_busy_sdio_1 = 0;
	driver->in_busy_sdio_2 = 0;
	driver->qxdm2sd_drop = 0;
	sdio_diag_initialized = 1;
err:
	return err;
}
开发者ID:AmeriCanAndroid,项目名称:kernel-android-msm-2.6.35,代码行数:49,代码来源:diagfwd_sdio.c


示例7: diagchar_close

static int diagchar_close(struct inode *inode, struct file *file)
{
	int i = 0;
	struct diagchar_priv *diagpriv_data = file->private_data;

	if (!(file->private_data)) {
		pr_alert("diag: Invalid file pointer");
		return -ENOMEM;
	}

	if (!driver)
		return -ENOMEM;

#ifdef CONFIG_DIAG_OVER_USB
	/* If the SD logging process exits, change logging to USB mode */
	if (driver->logging_process_id == current->tgid) {
		driver->logging_mode = USB_MODE;
		diagfwd_connect();
	}
#endif /* DIAG over USB */
	/* Delete the pkt response table entry for the exiting process */
	for (i = 0; i < diag_max_registration; i++) {
		if (driver->table[i].process_id == current->tgid)
			driver->table[i].process_id = 0;
	}

	mutex_lock(&driver->diagchar_mutex);
	driver->ref_count--;
			/* On Client exit, try to destroy all 3 pools */
			diagmem_exit(driver, POOL_TYPE_COPY);
			diagmem_exit(driver, POOL_TYPE_HDLC);
			diagmem_exit(driver, POOL_TYPE_WRITE_STRUCT);
	for (i = 0; i < driver->num_clients; i++) {
		if (NULL != diagpriv_data && diagpriv_data->pid ==
			 driver->client_map[i].pid) {
			driver->client_map[i].pid = 0;
			kfree(diagpriv_data);
			diagpriv_data = NULL;
			break;
		}
	}
	mutex_unlock(&driver->diagchar_mutex);
	return 0;
}
开发者ID:LeeDroid-,项目名称:Flyer-2.6.35-HC-MR,代码行数:44,代码来源:diagchar_core.c


示例8: diagchar_ioctl

static int diagchar_ioctl(struct inode *inode, struct file *filp,
			   unsigned int iocmd, unsigned long ioarg)
{
	int i, j, count_entries = 0, temp;
	int success = -1;

	if (iocmd == DIAG_IOCTL_COMMAND_REG) {
		struct bindpkt_params_per_process *pkt_params =
			 (struct bindpkt_params_per_process *) ioarg;

		for (i = 0; i < diag_max_registration; i++) {
			if (driver->table[i].process_id == 0) {
				success = 1;
				driver->table[i].cmd_code =
					pkt_params->params->cmd_code;
				driver->table[i].subsys_id =
					pkt_params->params->subsys_id;
				driver->table[i].cmd_code_lo =
					pkt_params->params->cmd_code_hi;
				driver->table[i].cmd_code_hi =
					pkt_params->params->cmd_code_lo;
				driver->table[i].process_id = current->tgid;
				count_entries++;
				if (pkt_params->count > count_entries)
					pkt_params->params++;
				else
					return success;
			}
		}
		if (i < diag_threshold_registration) {
			/* Increase table size by amount required */
			diag_max_registration += pkt_params->count -
							 count_entries;
			/* Make sure size doesnt go beyond threshold */
			if (diag_max_registration > diag_threshold_registration)
				diag_max_registration =
						 diag_threshold_registration;
			driver->table = krealloc(driver->table,
					 diag_max_registration*sizeof(struct
					 diag_master_table), GFP_KERNEL);
			for (j = i; j < diag_max_registration; j++) {
				success = 1;
				driver->table[j].cmd_code = pkt_params->
							params->cmd_code;
				driver->table[j].subsys_id = pkt_params->
							params->subsys_id;
				driver->table[j].cmd_code_lo = pkt_params->
							params->cmd_code_hi;
				driver->table[j].cmd_code_hi = pkt_params->
							params->cmd_code_lo;
				driver->table[j].process_id = current->tgid;
				count_entries++;
				if (pkt_params->count > count_entries)
					pkt_params->params++;
				else
					return success;
			}
		} else
			pr_err("Max size reached, Pkt Registration failed for"
						" Process %d", current->tgid);

		success = 0;
	} else if (iocmd == DIAG_IOCTL_GET_DELAYED_RSP_ID) {
		struct diagpkt_delay_params *delay_params =
					(struct diagpkt_delay_params *) ioarg;

		if ((delay_params->rsp_ptr) &&
		 (delay_params->size == sizeof(delayed_rsp_id)) &&
				 (delay_params->num_bytes_ptr)) {
			*((uint16_t *)delay_params->rsp_ptr) =
				DIAGPKT_NEXT_DELAYED_RSP_ID(delayed_rsp_id);
			*(delay_params->num_bytes_ptr) = sizeof(delayed_rsp_id);
			success = 0;
		}
	} else if (iocmd == DIAG_IOCTL_LSM_DEINIT) {
		for (i = 0; i < driver->num_clients; i++)
			if (driver->client_map[i].pid == current->tgid)
				break;
		if (i == -1)
			return -EINVAL;
		driver->data_ready[i] |= DEINIT_TYPE;
		wake_up_interruptible(&driver->wait_q);
		success = 1;
	} else if (iocmd == DIAG_IOCTL_SWITCH_LOGGING) {
		mutex_lock(&driver->diagchar_mutex);
		temp = driver->logging_mode;
		driver->logging_mode = (int)ioarg;
		driver->logging_process_id = current->tgid;
		mutex_unlock(&driver->diagchar_mutex);
		if (temp == USB_MODE && driver->logging_mode == NO_LOGGING_MODE)
			diagfwd_disconnect();
		else if (temp == NO_LOGGING_MODE && driver->logging_mode
								== USB_MODE)
			diagfwd_connect();
		else if (temp == MEMORY_DEVICE_MODE && driver->logging_mode
							== NO_LOGGING_MODE) {
			driver->in_busy_1 = 1;
			driver->in_busy_2 = 1;
			driver->in_busy_qdsp = 1;
		} else if (temp == NO_LOGGING_MODE && driver->logging_mode
//.........这里部分代码省略.........
开发者ID:manuelnaranjo,项目名称:P500-2.6.32.x,代码行数:101,代码来源:diagchar_core.c


示例9: lge_dm_dev_tty_ioctl

static int lge_dm_dev_tty_ioctl(struct tty_struct *tty, unsigned int cmd, unsigned long arg)
{
//	int index=0;
	int index=MODEM_DATA;

	int i;
	#ifdef CONFIG_DIAGFWD_BRIDGE_CODE
	unsigned long spin_lock_flags;
	#endif
	struct dm_dev_tty *lge_dm_dev_tty_drv = NULL;
	
	lge_dm_dev_tty_drv = lge_dm_dev_tty;
	tty->driver_data = lge_dm_dev_tty_drv;
	lge_dm_dev_tty_drv->tty_str = tty;

	if (_IOC_TYPE(cmd) != DM_DEV_TTY_IOCTL_MAGIC)
	return -EINVAL;

	switch (cmd){

	case DM_DEV_TTY_MODEM_OPEN:

#ifdef CONFIG_DIAGFWD_BRIDGE_CODE
		if ((diag_bridge[index].usb_connected == 1) && (diag_hsic[index].count_hsic_pool == N_MDM_WRITE)) {
			spin_lock_irqsave(&diag_hsic[HSIC].hsic_spinlock,spin_lock_flags);
			diag_hsic[index].count_hsic_pool = 0;
			spin_unlock_irqrestore(&diag_hsic[HSIC].hsic_spinlock,spin_lock_flags);
		}

		diag_hsic[index].num_hsic_buf_tbl_entries = 0;
		for (i = 0; i < diag_hsic[index].poolsize_hsic_write; i++) {
			if (diag_hsic[index].hsic_buf_tbl[index].buf) {
				/* Return the buffer to the pool */
				diagmem_free(driver, (unsigned char *)
					(diag_hsic[index].hsic_buf_tbl[index].buf),
					POOL_TYPE_HSIC);
				diag_hsic[index].hsic_buf_tbl[index].buf = 0;
			}
			diag_hsic[index].hsic_buf_tbl[index].length = 0;
		}

		diagfwd_disconnect_bridge(1);
		diagfwd_cancel_hsic(REOPEN_HSIC); // QCT 161032 migration - NEED TO CHECK
		diagfwd_connect_bridge(0);
		#endif /* CONFIG_DIAGFWD_BRIDGE_CODE */

		/* change path to DM DEV */
		mutex_lock(&driver->diagchar_mutex);
		driver->logging_mode = DM_DEV_MODE;
		mutex_unlock(&driver->diagchar_mutex);

#ifdef CONFIG_DIAG_SDIO_PIPE
		driver->in_busy_sdio = 0;
		/* Poll SDIO channel to check for data */
		if (driver->sdio_ch)
			queue_work(driver->diag_sdio_wq,
				&(driver->diag_read_sdio_work));
#endif
#ifdef CONFIG_DIAGFWD_BRIDGE_CODE
		/* Read data from the hsic */
		if (diag_hsic[index].hsic_ch)
			queue_work(diag_bridge[index].wq,
				   &(diag_hsic[index].
					 diag_read_hsic_work));
#endif /* CONFIG_DIAGFWD_BRIDGE_CODE */


		break;
		
	case DM_DEV_TTY_MODEM_CLOSE:
        
		lge_dm_dev_tty->set_logging = 0;
		
		/* change path to USB driver */
		mutex_lock(&driver->diagchar_mutex);
		driver->logging_mode = USB_MODE;
		mutex_unlock(&driver->diagchar_mutex);
		
		if (driver->usb_connected == 0)
			diagfwd_disconnect();
		else
			diagfwd_connect();

#ifdef CONFIG_DIAGFWD_BRIDGE_CODE
		diag_hsic[index].num_hsic_buf_tbl_entries = 0;
		for (i = 0; i < diag_hsic[index].poolsize_hsic_write; i++) {
			if (diag_hsic[index].hsic_buf_tbl[index].buf) {
				/* Return the buffer to the pool */
				diagmem_free(driver, (unsigned char *)
					(diag_hsic[index].hsic_buf_tbl[index].buf),
					POOL_TYPE_HSIC);
				diag_hsic[index].hsic_buf_tbl[index].buf = 0;
			}
			diag_hsic[index].hsic_buf_tbl[index].length = 0;
		}

		diagfwd_cancel_hsic(REOPEN_HSIC); // QCT 161032 migration - NEED TO CHECK
		diagfwd_connect_bridge(0);
#endif

//.........这里部分代码省略.........
开发者ID:Loller79,项目名称:Solid_Kernel-STOCK-KK-CAF,代码行数:101,代码来源:lg_dm_dev_tty.c


示例10: lge_dm_tty_ioctl

static int lge_dm_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
	unsigned long arg)
{
	short result;
#ifdef CONFIG_DIAGFWD_BRIDGE_CODE
	short modem_number = Secondary_modem_chip;
#else
	short modem_number = Primary_modem_chip;
#endif /*CONFIG_DIAGFWD_BRIDGE_CODE*/	


	struct dm_tty *lge_dm_tty_drv = NULL;
	int status = 0; /*                                                 */
	int i;
	int index=MODEM_DATA;

#ifdef CONFIG_DIAGFWD_BRIDGE_CODE
	unsigned long spin_lock_flags;
#endif

	result = 0;
	lge_dm_tty_drv = lge_dm_tty;
	tty->driver_data = lge_dm_tty_drv;
	lge_dm_tty_drv->tty_str = tty;

	if (_IOC_TYPE(cmd) != DM_TTY_IOCTL_MAGIC)
		return -EINVAL;

	switch (cmd) {
	case DM_TTY_MODEM_OPEN_SDM:
		if(lge_dm_tty_drv->logging_mode == DM_APP_SDM)
		{
			pr_info(DM_TTY_MODULE_NAME ": %s: lge_dm_tty_ioctl "
			"already DM_TTY_MODEM_OPEN_SDM\n", __func__);

			result = TRUE;

			if (copy_to_user((void *)arg, (const void *)&result,
				sizeof(result)) == 0)
				pr_info(DM_TTY_MODULE_NAME ": %s: lge_dm_tty_ioctl "
					"already DM_TTY_MODEM_OPEN_SDM"
					"result = %d\n", __func__, result);

			break;
		}

		lge_dm_tty_drv->logging_mode = DM_APP_SDM;

		pr_info(DM_TTY_MODULE_NAME ": %s: lge_dm_tty_ioctl "
		"DM_TTY_MODEM_OPEN_SDM\n", __func__);


#ifdef CONFIG_DIAGFWD_BRIDGE_CODE
		if ((diag_bridge[index].usb_connected == 1) && (diag_hsic[index].count_hsic_pool == N_MDM_WRITE)) {
			spin_lock_irqsave(&diag_hsic[HSIC].hsic_spinlock,spin_lock_flags);
			diag_hsic[index].count_hsic_pool = 0;
			spin_unlock_irqrestore(&diag_hsic[HSIC].hsic_spinlock,spin_lock_flags);
		}

		diag_hsic[index].num_hsic_buf_tbl_entries = 0;
		for (i = 0; i < diag_hsic[index].poolsize_hsic_write; i++) {
			if (diag_hsic[index].hsic_buf_tbl[index].buf) {
				/* Return the buffer to the pool */
				diagmem_free(driver, (unsigned char *)
					(diag_hsic[index].hsic_buf_tbl[index].buf),
					POOL_TYPE_HSIC);
				diag_hsic[index].hsic_buf_tbl[index].buf = 0;
			}
			diag_hsic[index].hsic_buf_tbl[index].length = 0;
		}

		diagfwd_disconnect_bridge(1);
		diagfwd_cancel_hsic(REOPEN_HSIC); // QCT 161032 migration - NEED TO CHECK
		diagfwd_connect_bridge(0);
#endif /* CONFIG_DIAGFWD_BRIDGE_CODE */

		/* change path to DM APP */
		mutex_lock(&driver->diagchar_mutex);
		driver->logging_mode = DM_APP_MODE;
		mutex_unlock(&driver->diagchar_mutex);

		if (modem_number == Primary_modem_chip) {

			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 channels to check for data*/
				if (driver->smd_data[i].ch)
					queue_work(driver->diag_wq,
						&(driver->smd_data[i].
							diag_read_smd_work));
			}// end of for loop			
		} else if (modem_number == Secondary_modem_chip) {

#ifdef CONFIG_DIAGFWD_BRIDGE_CODE
					/* Read data from the hsic */
					if (diag_hsic[index].hsic_ch)
						queue_work(diag_bridge[index].wq,
							   &(diag_hsic[index].
								 diag_read_hsic_work));
//.........这里部分代码省略.........
开发者ID:TheTypoMaster,项目名称:android_kernel_lg_awifi,代码行数:101,代码来源:lg_dm_tty.c


示例11: diagchar_ioctl


//.........这里部分代码省略.........
#ifdef CONFIG_DIAG_SDIO_PIPE
			driver->in_busy_sdio = 1;
#endif
#ifdef CONFIG_DIAG_BRIDGE_CODE
			diagfwd_disconnect_bridge(0);
			diag_clear_hsic_tbl();
#endif
		} else if (temp == NO_LOGGING_MODE && driver->logging_mode
							== MEMORY_DEVICE_MODE) {
			driver->in_busy_1 = 0;
			driver->in_busy_2 = 0;
			driver->in_busy_lpass_1 = 0;
			driver->in_busy_lpass_2 = 0;
			driver->in_busy_wcnss_1 = 0;
			driver->in_busy_wcnss_2 = 0;
			/* Poll SMD channels to check for data*/
			if (driver->ch)
				queue_work(driver->diag_wq,
					&(driver->diag_read_smd_work));
			if (driver->chlpass)
				queue_work(driver->diag_wq,
					&(driver->diag_read_smd_lpass_work));
			if (driver->ch_wcnss)
				queue_work(driver->diag_wq,
					&(driver->diag_read_smd_wcnss_work));
#ifdef CONFIG_DIAG_SDIO_PIPE
			driver->in_busy_sdio = 0;
			/* Poll SDIO channel to check for data */
			if (driver->sdio_ch)
				queue_work(driver->diag_sdio_wq,
					&(driver->diag_read_sdio_work));
#endif
#ifdef CONFIG_DIAG_BRIDGE_CODE
			diagfwd_connect_bridge(0);
#endif
		}
#ifdef CONFIG_DIAG_OVER_USB
		else if (temp == USB_MODE && driver->logging_mode
							 == NO_LOGGING_MODE) {
			diagfwd_disconnect();
#ifdef CONFIG_DIAG_BRIDGE_CODE
			diagfwd_disconnect_bridge(0);
#endif
		} else if (temp == NO_LOGGING_MODE && driver->logging_mode
								== USB_MODE) {
			diagfwd_connect();
#ifdef CONFIG_DIAG_BRIDGE_CODE
			diagfwd_connect_bridge(0);
#endif
		} else if (temp == USB_MODE && driver->logging_mode
							== MEMORY_DEVICE_MODE) {
			diagfwd_disconnect();
			driver->in_busy_1 = 0;
			driver->in_busy_2 = 0;
			driver->in_busy_lpass_1 = 0;
			driver->in_busy_lpass_2 = 0;
			driver->in_busy_wcnss_1 = 0;
			driver->in_busy_wcnss_2 = 0;

			/* Poll SMD channels to check for data*/
			if (driver->ch)
				queue_work(driver->diag_wq,
					 &(driver->diag_read_smd_work));
			if (driver->chlpass)
				queue_work(driver->diag_wq,
					&(driver->diag_read_smd_lpass_work));
开发者ID:enesunal,项目名称:ANaconda-mining,代码行数:67,代码来源:diagchar_old.c


示例12: diagchar_ioctl


//.........这里部分代码省略.........
							== NO_LOGGING_MODE) {
			driver->in_busy_1 = 1;
			driver->in_busy_2 = 1;
			driver->in_busy_qdsp_1 = 1;
			driver->in_busy_qdsp_2 = 1;
			driver->in_busy_wcnss_1 = 1;
			driver->in_busy_wcnss_2 = 1;
#ifdef CONFIG_DIAG_SDIO_PIPE
			driver->in_busy_sdio = 1;
#endif
#ifdef CONFIG_DIAG_BRIDGE_CODE
			diagfwd_disconnect_bridge(0);
#endif
		} else if (temp == NO_LOGGING_MODE && driver->logging_mode
							== MEMORY_DEVICE_MODE) {
			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_1 = 0;
			driver->in_busy_wcnss_2 = 0;
			/* Poll SMD channels to check for data*/
			if (driver->ch)
				queue_work(driver->diag_wq,
					&(driver->diag_read_smd_work));
			if (driver->chqdsp)
				queue_work(driver->diag_wq,
					&(driver->diag_read_smd_qdsp_work));
			if (driver->ch_wcnss)
				queue_work(driver->diag_wq,
					&(driver->diag_read_smd_wcnss_work));
#ifdef CONFIG_DIAG_SDIO_PIPE
			driver->in_busy_sdio = 0;
			/* Poll SDIO channel to check for data */
			if (driver->sdio_ch)
				queue_work(driver->diag_sdio_wq,
					&(driver->diag_read_sdio_work));
#endif
#ifdef CONFIG_DIAG_BRIDGE_CODE
			diagfwd_connect_bridge(0);
#endif
		}
#ifdef CONFIG_DIAG_OVER_USB
		else if (temp == USB_MODE && driver->logging_mode
							 == NO_LOGGING_MODE) {
			diagfwd_disconnect();
#ifdef CONFIG_DIAG_BRIDGE_CODE
			diagfwd_disconnect_bridge(0);
#endif
		} else if (temp == NO_LOGGING_MODE && driver->logging_mode
								== USB_MODE) {
			diagfwd_connect();
#ifdef CONFIG_DIAG_BRIDGE_CODE
			diagfwd_connect_bridge(0);
#endif
		} else if (temp == USB_MODE && driver->logging_mode
							== MEMORY_DEVICE_MODE) {
			diagfwd_disconnect();
			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_1 = 0;
			driver->in_busy_wcnss_2 = 0;
			/* Poll SMD channels to check for data*/
			if (driver->ch)
				queue_work(driver->diag_wq,
					 &(driver->diag_read_smd_work));
			if (driver->chqdsp)
				queue_work(driver->diag_wq,
					&(driver->diag_read_smd_qdsp_work));
			if (driver->ch_wcnss)
				queue_work(driver->diag_wq,
					&(driver->diag_read_smd_wcnss_work));
#ifdef CONFIG_DIAG_SDIO_PIPE
			driver->in_busy_sdio = 0;
			/* Poll SDIO channel to check for data */
			if (driver->sdio_ch)
				queue_work(driver->diag_sdio_wq,
					&(driver->diag_read_sdio_work));
#endif
#ifdef CONFIG_DIAG_BRIDGE_CODE
			diagfwd_cancel_hsic();
			diagfwd_connect_bridge(0);
#endif
		} else if (temp == MEMORY_DEVICE_MODE &&
				 driver->logging_mode == USB_MODE) {
			diagfwd_connect();
#ifdef CONFIG_DIAG_BRIDGE_CODE
			diagfwd_cancel_hsic();
			diagfwd_connect_bridge(0);
#endif
		}

#endif /* DIAG over USB */
		success = 1;
	}

	return success;
}
开发者ID:TheTypoMaster,项目名称:kernel-msm8660,代码行数:101,代码来源:diagchar_core.c


示例13: diagchar_ioctl


//.........这里部分代码省略.........
			pr_err("Max size reached, Pkt Registration failed for"
						" Process %d", current->tgid);

		success = 0;
	} else if (iocmd == DIAG_IOCTL_GET_DELAYED_RSP_ID) {
		struct diagpkt_delay_params *delay_params =
					(struct diagpkt_delay_params *) ioarg;

		if ((delay_params->rsp_ptr) &&
		 (delay_params->size == sizeof(delayed_rsp_id)) &&
				 (delay_params->num_bytes_ptr)) {
			*((uint16_t *)delay_params->rsp_ptr) =
				DIAGPKT_NEXT_DELAYED_RSP_ID(delayed_rsp_id);
			*(delay_params->num_bytes_ptr) = sizeof(delayed_rsp_id);
			success = 0;
		}
	} else if (iocmd == DIAG_IOCTL_LSM_DEINIT) {
		for (i = 0; i < driver->num_clients; i++)
			if (driver->client_map[i].pid == current->tgid)
				break;
		if (i == -1)
			return -EINVAL;
		driver->data_ready[i] |= DEINIT_TYPE;
		wake_up_interruptible(&driver->wait_q);
		success = 1;
	} else if (iocmd == DIAG_IOCTL_SWITCH_LOGGING) {
		mutex_lock(&driver->diagchar_mutex);
		temp = driver->logging_mode;
		driver->logging_mode = (int)ioarg;
		driver->logging_process_id = current->tgid;
		mutex_unlock(&driver->diagchar_mutex);
		if (temp == MEMORY_DEVICE_MODE && driver->logging_mode
							== NO_LOGGING_MODE) {
			driver->in_busy_1 = 1;
			driver->in_busy_2 = 1;
			driver->in_busy_qdsp_1 = 1;
			driver->in_busy_qdsp_2 = 1;
		} else if (temp == NO_LOGGING_MODE && driver->logging_mode
							== MEMORY_DEVICE_MODE) {
			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*/
			if (driver->ch)
				queue_work(driver->diag_wq,
					&(driver->diag_read_smd_work));
			if (driver->chqdsp)
				queue_work(driver->diag_wq,
					&(driver->diag_read_smd_qdsp_work));
		}
#ifdef CONFIG_DIAG_OVER_USB
		else if (temp == USB_MODE && driver->logging_mode
							 == NO_LOGGING_MODE)
			diagfwd_disconnect();
		else if (temp == NO_LOGGING_MODE && driver->logging_mode
								== USB_MODE)
			diagfwd_connect();
		else if (temp == USB_MODE && driver->logging_mode
							== MEMORY_DEVICE_MODE) {
			if (driver->enable_sd_log)
				driver->enable_sd_log(1);
			DIAG_INFO("diag: USB disconnected\n");
			diagfwd_disconnect();
			DIAG_INFO("sdlogging enable\n");
#if 0 /* defined(CONFIG_ARCH_MSM8X60_LTE) */
			if (mdm_diag) {
				driver->in_busy_sdio = 0;
				buf_9k = kzalloc(USB_MAX_OUT_BUF, GFP_KERNEL);
				if (driver->sdio_ch)
					queue_work(driver->diag_sdio_wq, &(driver->diag_read_sdio_work));
			} else
#endif
			{
				driver->in_busy_1 = 0;
				driver->in_busy_2 = 0;
				driver->in_busy_qdsp_2 = 0;
				driver->in_busy_qdsp_2 = 0;
				/* Poll SMD channels to check for data*/
				if (driver->ch)
					queue_work(driver->diag_wq,
						 &(driver->diag_read_smd_work));
				if (driver->chqdsp)
					queue_work(driver->diag_wq,
						&(driver->diag_read_smd_qdsp_work));
			}
		} else if (temp == MEMORY_DEVICE_MODE && driver->logging_mode
								== USB_MODE) {
			DIAG_INFO("sdlogging disable\n");
			if (driver->enable_sd_log)
				driver->enable_sd_log(0);
			diagfwd_connect();

				}
#endif /* DIAG over USB */
		success = 1;
	}

	return success;
}
开发者ID:LeeDroid-,项目名称:Flyer-2.6.35-HC-MR,代码行数:101,代码来源:diagchar_core.c


示例14: diagchar_ioctl

static int diagchar_ioctl(struct inode *inode, struct file *filp,
			   unsigned int iocmd, unsigned long ioarg)
{
	int i, j, count_entries = 0, temp;
	int success = -1;

	if (iocmd == DIAG_IOCTL_COMMAND_REG) {
		struct bindpkt_params_per_process *pkt_params =
			 (struct bindpkt_params_per_process *) ioarg;

		for (i = 0; i < diag_max_registration; i++) {
			if (driver->table[i].process_id == 0) {
				success = 1;
				driver->table[i].cmd_code =
					pkt_params->params->cmd_code;
				driver->table[i].subsys_id =
					pkt_params->params->subsys_id;
				driver->table[i].cmd_code_lo =
					pkt_params->params->cmd_code_hi;
				driver->table[i].cmd_code_hi =
					pkt_params->params->cmd_code_lo;
				driver->table[i].process_id = current->tgid;
				count_entries++;
				if (pkt_params->count > count_entries)
					pkt_params->params++;
				else
					return success;
			}
		}
		if (i < diag_threshold_registration) {
			/* Increase table size by amount required */
			diag_max_registration += pkt_params->count -
							 count_entries;
			/* Make sure size doesnt go beyond threshold */
			if (diag_max_registration > diag_threshold_registration)
				diag_max_registration =
						 diag_threshold_registration;
			driver->table = krealloc(driver->table,
					 diag_max_registration*sizeof(struct
					 diag_master_table), GFP_KERNEL);
			for (j = i; j < diag_max_registration; j++) {
				success = 1;
				driver->table[j].cmd_code = pkt_params->
							params->cmd_code;
				driver->table[j].subsys_id = pkt_params->
							params->subsys_id;
				driver->table[j].cmd_code_lo = pkt_params->
							params->cmd_code_hi;
				driver->table[j].cmd_code_hi = pkt_params->
							params->cmd_code_lo;
				driver->table[j].process_id = current->tgid;
				count_entries++;
				if (pkt_params->count > count_entries)
					pkt_params->params++;
				else
					return success;
			}
		} else
			pr_err("Max size reached, Pkt Registration failed for"
						" Process %d", current->tgid);

		success = 0;
	} else if (iocmd == DIAG_IOCTL_GET_DELAYED_RSP_ID) {
		struct diagpkt_delay_params *delay_params =
					(struct diagpkt_delay_params *) ioarg;

		if ((delay_params->rsp_ptr) &&
		 (delay_params->size == sizeof(delayed_rsp_id)) &&
				 (delay_params->num_bytes_ptr)) {
			*((uint16_t *)delay_params->rsp_ptr) =
				DIAGPKT_NEXT_DELAYED_RSP_ID(delayed_rsp_id);
			*(delay_params->num_bytes_ptr) = sizeof(delayed_rsp_id);
			success = 0;
		}
	} else if (iocmd == DIAG_IOCTL_LSM_DEINIT) {
		for (i = 0; i < driver->num_clients; i++)
			if (driver->client_map[i] == current->tgid)
				break;
		if (i == -1)
			return -EINVAL;
		driver->data_ready[i] |= DEINIT_TYPE;
		wake_up_interruptible(&driver->wait_q);
		success = 1;
	} else if (iocmd == DIAG_IOCTL_SWITCH_LOGGING) {
		mutex_lock(&driver->diagchar_mutex);
		temp = driver->logging_mode;
		driver->logging_mode = (int)ioarg;
		driver->logging_process_id = current->tgid;
		mutex_unlock(&driver->diagchar_mutex);
		if (temp == USB_MODE && driver->logging_mode == NO_LOGGING_MODE)
			diagfwd_disconnect();
		else if (temp == NO_LOGGING_MODE && driver->logging_mode
								== USB_MODE)
			diagfwd_connect();
		else if (temp == MEMORY_DEVICE_MODE && driver->logging_mode
							== NO_LOGGING_MODE) {
			driver->in_busy = 1;
			driver->in_busy_qdsp = 1;
		} else if (temp == NO_LOGGING_MODE && driver->logging_mode
							== MEMORY_DEVICE_MODE) {
//.........这里部分代码省略.........
开发者ID:nunogilberto,项目名称:FIH-Kernel,代码行数:101,代码来源:diagchar_core.c


示例15: lge_dm_tty_ioctl

static int lge_dm_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
	unsigned long arg)
{
	short modem_number, result;
	struct dm_tty *lge_dm_tty_drv = NULL;
	int is_all_closed, i;
	int index=MODEM_DATA;

#ifdef CONFIG_DIAGFWD_BRIDGE_CODE
	unsigned long spin_lock_flags;
#endif

	result = 0;  // kyle00.choi, 20130625, WBT 485977
	lge_dm_tty_drv = lge_dm_tty;
	tty->driver_data = lge_dm_tty_drv;
	lge_dm_tty_drv->tty_str = tty;

	if (_IOC_TYPE(cmd) != DM_TTY_IOCTL_MAGIC)
		return -EINVAL;

	switch (cmd) {
	case DM_TTY_MODEM_OPEN:

		if (copy_from_user((void *)&modem_number, (const void *)arg,
			sizeof(modem_number)) == 0)
			pr_info(DM_TTY_MODULE_NAME ": %s: lge_dm_tty_ioctl "
				"DM_TTY_IOCTL_MODEM_OPEN modem_number = %d\n",
					__func__, modem_number);

		if (lge_dm_tty_drv->is_modem_open[modem_number] == FALSE)
			lge_dm_tty_drv->is_modem_open[modem_number] = TRUE;
		else
			pr_err(DM_TTY_MODULE_NAME ": %s: already open "
				"modem_number = %d", __func__, modem_number);


#ifdef CONFIG_DIAGFWD_BRIDGE_CODE
		if ((diag_bridge[index].usb_connected == 1) && (diag_hsic[index].count_hsic_pool == N_MDM_WRITE)) {
			spin_lock_irqsave(&diag_hsic[HSIC].hsic_spinlock,spin_lock_flags);
			diag_hsic[index].count_hsic_pool = 0;
			spin_unlock_irqrestore(&diag_hsic[HSIC].hsic_spinlock,spin_lock_flags);
		}

		diag_hsic[index].num_hsic_buf_tbl_entries = 0;
		for (i = 0; i < diag_hsic[index].poolsize_hsic_write; i++) {
			if (diag_hsic[index].hsic_buf_tbl[index].buf) {
				/* Return the buffer to the pool */
				diagmem_free(driver, (unsigned char *)
					(diag_hsic[index].hsic_buf_tbl[index].buf),
					POOL_TYPE_HSIC);
				diag_hsic[index].hsic_buf_tbl[index].buf = 0;
			}
			diag_hsic[index].hsic_buf_tbl[index].length = 0;
		}

		diagfwd_disconnect_bridge(1);
		diagfwd_cancel_hsic(REOPEN_HSIC); // QCT 161032 migration - NEED TO CHECK
		diagfwd_connect_bridge(0);
#endif /* CONFIG_DIAGFWD_BRIDGE_CODE */

		/* change path to DM APP */
		mutex_lock(&driver->diagchar_mutex);
		driver->logging_mode = DM_APP_MODE;
		mutex_unlock(&driver->diagchar_mutex);

		if (modem_number == Primary_modem_chip) {

			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 channels to check for data*/
				if (driver->smd_data[i].ch)
					queue_work(driver->diag_wq,
						&(driver->smd_data[i].
							diag_read_smd_work));
			}// end of for loop			
		} else if (modem_number == Secondary_modem_chip) {

#ifdef CONFIG_DIAGFWD_BRIDGE_CODE
					/* Read data from the hsic */
					if (diag_hsic[index].hsic_ch)
						queue_work(diag_bridge[index].wq,
							   &(diag_hsic[index].
								 diag_read_hsic_work));
#endif /* CONFIG_DIAGFWD_BRIDGE_CODE */


		} else {
			pr_info(DM_TTY_MODULE_NAME ": %s: lge_dm_tty_ioctl "
				"DM_TTY_IOCTL_MODEM_OPEN"
				"error modem_number = %d\n",
					__func__, modem_number);
		}

		result = lge_dm_tty_drv->is_modem_open[modem_number];

		if (copy_to_user((void *)arg, (const void *)&result,
			sizeof(result)) == 0)
			pr_info(DM_TTY_MODULE_NAME ": %s: lge_dm_tty_ioctl "
				"DM_TTY_IOCTL_MODEM_OPEN"
//.........这里部分代码省略.........
开发者ID:Fechinator,项目名称:FechdaKernel_V500,代码行数:101,代码来源:lg_dm_tty.c


示例16: diagchar_ioctl


//.........这里部分代码省略.........

				success = 0;
		}
	} else if (iocmd == DIAG_IOCTL_LSM_DEINIT) {
		for (i = 0; i < driver->num_clients; i++)
			if (driver->client_map[i].pid == current->tgid)
				break;
		if (i == -1)
			return -EINVAL;
		driver->data_ready[i] |= DEINIT_TYPE;
		wake_up_interruptible(&driver->wait_q);
		success = 1;
	} else if (iocmd == DIAG_IOCTL_SWITCH_LOGGING) {
		mutex_lock(&driver->diagchar_mutex);
		temp = driver->logging_mode;
		driver->logging_mode = (int)ioarg;
		if (driver->logging_mode == MEMORY_DEVICE_MODE)
			driver->mask_check = 1;
		if (driver->logging_mode == UART_MODE) {
			driver->mask_check = 0;
			driver->logging_mode = MEMORY_DEVICE_MODE;
		}
		driver->logging_process_id = current->tgid;
		mutex_unlock(&driver->diagchar_mutex);
		if (temp == MEMORY_DEVICE_MODE && driver->logging_mode
							== NO_LOGGING_MODE) {
			driver->in_busy_1 = 1;
			driver->in_busy_2 = 1;
			driver->in_busy_qdsp_1 = 1;
			driver->in_busy_qdsp_2 = 1;
			driver->in_busy_wcnss = 1;
#ifdef CONFIG_DIAG_SDIO_PIPE
			driver->in_busy_sdio = 1;
#endif
		} else if (temp == NO_LOGGING_MODE && driver->logging_mode
							== MEMORY_DEVICE_MODE) {
			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*/
			if (driver->ch)
				queue_work(driver->diag_wq,
					&(driver->diag_read_smd_work));
			if (driver->chqdsp)
				queue_work(driver->diag_wq,
					&(driver->diag_read_smd_qdsp_work));
			if (driver->ch_wcnss)
				queue_work(driver->diag_wq,
					&(driver->diag_read_smd_wcnss_work));
#ifdef CONFIG_DIAG_SDIO_PIPE
			driver->in_busy_sdio = 0;
			/* Poll SDIO channel to check for data */
			if (driver->sdio_ch)
				queue_work(driver->diag_sdio_wq,
					&(driver->diag_read_sdio_work));
#endif
		}
#ifdef CONFIG_DIAG_OVER_USB
		else if (temp == USB_MODE && driver->logging_mode
							 == NO_LOGGING_MODE)
			diagfwd_disconnect();
		else if (temp == NO_LOGGING_MODE && driver->logging_mode
								== USB_MODE)
			diagfwd_connect();
		else if (temp == USB_MODE && driver->logging_mode
							== MEMORY_DEVICE_MODE) {
			diagfwd_disconnect();
			driver->in_busy_1 = 0;
			driver->in_busy_2 = 0;
			driver->in_busy_qdsp_2 = 0;
			driver->in_busy_qdsp_2 = 0;
			driver->in_busy_wcnss = 0;
			/* Poll SMD channels to check for data*/
			if (driver->ch)
				queue_work(driver->diag_wq,
					 &(driver->diag_read_smd_work));
			if (driver->chqdsp)
				queue_work(driver->diag_wq,
					&(driver->diag_read_smd_qdsp_work));
			if (driver->ch_wcnss)
				queue_work(driver->diag_wq,
					&(driver->diag_read_smd_wcnss_work));
#ifdef CONFIG_DIAG_SDIO_PIPE
			driver->in_busy_sdio = 0;
			/* Poll SDIO channel to check for data */
			if (driver->sdio_ch)
				queue_work(driver->diag_sdio_wq,
					&(driver->diag_read_sdio_work));
#endif
			} else if (temp == MEMORY_DEVICE_MODE &&
					 driver->logging_mode == USB_MODE)
				diagfwd_connect();
#endif /* DIAG over USB */
		success = 1;
	}

	return success;
}
开发者ID:carlos4,项目名称:android_kernel_samsung_d2spr,代码行数:101,代码来源:diagchar_core.c


示例17: lge_dm_tty_ioctl


//.........这里部分代码省略.........

		} else {
			pr_info(DM_TTY_MODULE_NAME ": %s: lge_dm_tty_ioctl "
				"DM_TTY_MODEM_OPEN_SDM"
				"error modem_number = %d\n",
					__func__, modem_number);
		}

		result = TRUE;

		if (copy_to_user((void *)arg, (const void *)&result,
			sizeof(result)) == 0)
			pr_info(DM_TTY_MODULE_NAME ": %s: lge_dm_tty_ioctl "
				"DM_TTY_MODEM_OPEN_SDM"
				"result = %d\n", __func__, result);

		break;

	case DM_TTY_MODEM_CLOSE_SDM:
		lge_dm_tty_drv->logging_mode = DM_APP_ODM;
		pr_info(DM_TTY_MODULE_NAME ": %s: lge_dm_tty_ioctl "
		"DM_TTY_MODEM_CLOSE_SDM\n", __func__);
				
		lge_dm_tty_drv->set_logging = 0;
		
		/* change path to USB driver */
		mutex_lock(&driver->diagchar_mutex);
		driver->logging_mode = USB_MODE;
		mutex_unlock(&driver->diagchar_mutex);
		
		if (driver->usb_connected == 0)
			diagfwd_disconnect();
		else
			diagfwd_connect();
		
        diag_ws_reset();

		result = TRUE;

		if (copy_to_user((void *)arg, (const void *)&result,
			sizeof(result)) == 0)
			pr_info(DM_TTY_MODULE_NAME ": %s: lge_dm_tty_ioctl "
				"DM_TTY_MODEM_CLOSE_SDM"
				"result = %d\n", __func__, result);

		break;
	case DM_TTY_MODEM_OPEN_ODM:
		lge_dm_tty_drv->logging_mode = DM_APP_ODM;
		pr_info(DM_TTY_MODULE_NAME ": %s: lge_dm_tty_ioctl "
		"DM_TTY_MODEM_OPEN_ODM\n", __func__);
		
		/* change path to DM DEV */
		mutex_lock(&driver->diagchar_mutex);
		driver->logging_mode = DM_APP_MODE;
		mutex_unlock(&driver->diagchar_mutex);

		for (i = 0; i < NUM_SMD_DATA_CHANNELS; i++) {
            spin_lock_irqsave(&driver->smd_data[i].in_busy_lock, flags);
			driver->smd_data[i].in_busy_1 = 0;
			driver->smd_data[i].in_busy_2 = 0;
            spin_unlock_irqrestore(&driver->smd_data[i].in_busy_lock, flags);
			/* Poll SMD channels to check for data*/
			if (driver->smd_data[i].ch)
				queue_work(driver->diag_wq,
					&(driver-& 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ diagmem_free函数代码示例发布时间:2022-05-30
下一篇:
C++ diag_printf函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap