int npa_remote_create_sync_client(const char *resource_name,
		const char *client_name,
		enum npa_remote_client_type client_type,
		void **handle)
{
	int err = 0;
	struct npa_remote_create_sync_client_arg arg;
	struct npa_remote_create_sync_client_ret ret;

	arg.resource_name = resource_name;
	arg.client_name = client_name;
	arg.client_type = client_type;
	arg.handle_is_valid = handle != NULL;

	err = msm_rpc_client_req2(npa_rpc_client,
			NPA_REMOTE_CREATE_SYNC_CLIENT_PROC,
			npa_remote_create_sync_client_arg_fn, &arg,
			npa_remote_create_sync_client_ret_fn, &ret, -1);
	if (err) {
		pr_err("NPA Remote func %s returned error %d\n", __func__, err);
		BUG();
	}

	if (ret.handle_is_valid)
		*handle = (void *)ret.handle;

	return ret.result;
}
int npa_remote_issue_required_request(void *handle, unsigned int state,
		unsigned int *new_state)
{
	int err = 0;
	struct npa_remote_issue_required_request_arg arg;
	struct npa_remote_issue_required_request_ret ret;

	arg.handle = (uint32_t)handle;
	arg.state = state;
	arg.new_state_valid = new_state != NULL;

	err = msm_rpc_client_req2(npa_rpc_client,
			NPA_REMOTE_ISSUE_REQUIRED_REQUEST_PROC,
			npa_remote_issue_required_request_arg_fn, &arg,
			npa_remote_issue_required_request_ret_fn, &ret, -1);
	if (err) {
		pr_err("NPA Remote func %s returned error %d\n", __func__, err);
		BUG();
	}

	if (ret.new_state_is_valid)
		*new_state = ret.new_state;

	return ret.result;
}
Example #3
0
static int dog_keepalive_register_func(struct msm_rpc_client *client,
				       struct dog_keepalive_register_arg *arg,
				       struct dog_keepalive_register_ret *ret)
{
	return msm_rpc_client_req2(client,
				   DOG_KEEPALIVE_REGISTER_PROC,
				   dog_keepalive_register_arg_func, arg,
				   dog_keepalive_register_ret_func, ret, -1);
}
static int ping_mdm_unregister(
	struct msm_rpc_client *client,
	struct ping_mdm_unregister_arg *arg,
	struct ping_mdm_unregister_ret *ret)
{
	return msm_rpc_client_req2(client,
				   PING_MDM_UNREGISTER_PROC,
				   ping_mdm_unregister_arg, arg,
				   ping_mdm_register_ret, ret, -1);
}
static int ping_mdm_register_data_cb(
	struct msm_rpc_client *client,
	struct ping_mdm_register_data_cb_arg *arg,
	struct ping_mdm_register_data_cb_ret *ret)
{
	return msm_rpc_client_req2(client,
				   PING_MDM_REGISTER_DATA_CB_PROC,
				   ping_mdm_data_cb_register_arg, arg,
				   ping_mdm_data_cb_register_ret, ret, -1);
}
Example #6
0
int oem_rapi_client_streaming_function(
	struct msm_rpc_client *client,
	struct oem_rapi_client_streaming_func_arg *arg,
	struct oem_rapi_client_streaming_func_ret *ret)
{
	return msm_rpc_client_req2(client,
				   OEM_RAPI_STREAMING_FUNCTION_PROC,
				   oem_rapi_client_streaming_function_arg, arg,
				   oem_rapi_client_streaming_function_ret,
				   ret, -1);
}
int npa_remote_destroy_client(void *handle)
{
	int err = 0;
	struct npa_remote_destroy_client_arg arg;
	struct npa_remote_destroy_client_ret ret;

	arg.handle = (uint32_t)handle;

	err = msm_rpc_client_req2(npa_rpc_client,
			NPA_REMOTE_DESTROY_CLIENT_PROC,
			npa_remote_destroy_client_arg_fn, &arg,
			npa_remote_destroy_client_ret_fn, &ret, -1);
	if (err) {
		pr_err("NPA Remote func %s returned error %d\n", __func__, err);
		BUG();
	}

	return ret.result;
}
Example #8
0
int oem_rapi_client_streaming_function(
	struct msm_rpc_client *client,
	struct oem_rapi_client_streaming_func_arg *arg,
	struct oem_rapi_client_streaming_func_ret *ret)
{
/* [email protected] error check to prevent from infinite reset */
    if (IS_ERR(client))
    {
        pr_err("%s fail!! and return",__func__);
        return -1;
    }
/* end [email protected] */

	return msm_rpc_client_req2(client,
				   OEM_RAPI_STREAMING_FUNCTION_PROC,
				   oem_rapi_client_streaming_function_arg, arg,
				   oem_rapi_client_streaming_function_ret,
				   ret, msecs_to_jiffies(30000));
}
int npa_remote_resource_available(const char *resource_name,
		npa_remote_callback callback, void *context)
{
	int err = 0;
	struct npa_remote_resource_available_arg arg;
	struct npa_remote_resource_available_ret ret;

	arg.resource_name = resource_name;
	arg.callback = (void *)callback;
	arg.context = (uint32_t)context;

	err = msm_rpc_client_req2(npa_rpc_client,
			NPA_REMOTE_RESOURCE_AVAILABLE_PROC,
			npa_remote_resource_available_arg_fn, &arg,
			npa_remote_resource_available_ret_fn, &ret, -1);
	if (err) {
		pr_err("NPA Remote func %s returned error %d\n", __func__, err);
		BUG();
	}

	return ret.result;
}
int npa_remote_init(unsigned int major, unsigned int minor, unsigned int build,
		npa_remote_callback callback, void *context)
{
	int err = 0;
	struct npa_remote_init_arg arg;
	struct npa_remote_init_ret ret;

	arg.major = major;
	arg.minor = minor;
	arg.build = build;
	arg.callback = (void *)callback;
	arg.context = (uint32_t)context;

	err = msm_rpc_client_req2(npa_rpc_client,
			NPA_REMOTE_INIT_PROC,
			npa_remote_init_arg_fn, &arg,
			npa_remote_init_ret_fn, &ret, -1);
	if (err) {
		pr_err("NPA Remote func %s returned error %d\n", __func__, err);
		BUG();
	}

	return ret.result;
}
Example #11
0
static int oem_rapi_client_null(struct msm_rpc_client *client,
				void *arg, void *ret)
{
	return msm_rpc_client_req2(client, OEM_RAPI_NULL_PROC,
				   NULL, NULL, NULL, NULL, -1);
}
int npa_remote_null(void)
{
	return msm_rpc_client_req2(npa_rpc_client, NPA_REMOTE_NULL_PROC,
			NULL, NULL, NULL, NULL, -1);
}
static int ping_mdm_null(struct msm_rpc_client *client,
			 void *arg, void *ret)
{
	return msm_rpc_client_req2(client, PING_MDM_NULL_PROC,
				   NULL, NULL, NULL, NULL, -1);
}