static int rpcrouter_release(struct inode *inode, struct file *filp)
{
	struct msm_rpc_endpoint *ept;
	ept = (struct msm_rpc_endpoint *) filp->private_data;

	return msm_rpcrouter_destroy_local_endpoint(ept);
}
예제 #2
0
static int rpcrouter_release(struct inode *inode, struct file *filp)
{
	struct msm_rpc_endpoint *ept;
	static unsigned int rpcrouter_release_cnt;

	ept = (struct msm_rpc_endpoint *) filp->private_data;

	
	if (rpcrouter_release_cnt++ % 2)
		msleep(1);

	return msm_rpcrouter_destroy_local_endpoint(ept);
}
예제 #3
0
static int rpcrouter_release(struct inode *inode, struct file *filp)
{
	struct msm_rpc_endpoint *ept;
	static unsigned int rpcrouter_release_cnt;

	ept = (struct msm_rpc_endpoint *) filp->private_data;

	/* A user program with many files open when ends abruptly,
	 * will cause a flood of REMOVE_CLIENT messages to the
	 * remote processor.  This will cause remote processors
	 * internal queue to overflow. Inserting a sleep here
	 * regularly is the effecient option.
	 */
	if (rpcrouter_release_cnt++ % 2)
		msleep(1);

	return msm_rpcrouter_destroy_local_endpoint(ept);
}
예제 #4
0
static int rpcrouter_open(struct inode *inode, struct file *filp)
{
	int rc;
	void *pil;
	struct msm_rpc_endpoint *ept;
	struct rpcrouter_file_info *file_info;

	rc = nonseekable_open(inode, filp);
	if (rc < 0)
		return rc;

	file_info = kzalloc(sizeof(*file_info), GFP_KERNEL);
	if (!file_info)
		return -ENOMEM;

	ept = msm_rpcrouter_create_local_endpoint(inode->i_rdev);
	if (!ept) {
		kfree(file_info);
		return -ENOMEM;
	}
	file_info->ept = ept;

	/* if router device, load the modem */
	if (inode->i_rdev == msm_rpcrouter_devno) {
		pil = msm_rpcrouter_load_modem();
		if (IS_ERR(pil)) {
			kfree(file_info);
			msm_rpcrouter_destroy_local_endpoint(ept);
			return PTR_ERR(pil);
		}
		file_info->modem_pil = pil;
	}

	filp->private_data = file_info;
	return 0;
}
예제 #5
0
static int rpcrouter_release(struct inode *inode, struct file *filp)
{
	struct rpcrouter_file_info *file_info = filp->private_data;
	struct msm_rpc_endpoint *ept;
	static unsigned int rpcrouter_release_cnt;

	ept = (struct msm_rpc_endpoint *) file_info->ept;

	/* A user program with many files open when ends abruptly,
	 * will cause a flood of REMOVE_CLIENT messages to the
	 * remote processor.  This will cause remote processors
	 * internal queue to overflow. Inserting a sleep here
	 * regularly is the effecient option.
	 */
	if (rpcrouter_release_cnt++ % 2)
		msleep(1);

	/* if router device, unload the modem */
	if (inode->i_rdev == msm_rpcrouter_devno)
		msm_rpcrouter_unload_modem(file_info->modem_pil);

	kfree(file_info);
	return msm_rpcrouter_destroy_local_endpoint(ept);
}