本文整理汇总了C++中xdr_recv_uint32函数的典型用法代码示例。如果您正苦于以下问题:C++ xdr_recv_uint32函数的具体用法?C++ xdr_recv_uint32怎么用?C++ xdr_recv_uint32使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了xdr_recv_uint32函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: npa_remote_cb
static int npa_remote_cb(struct msm_rpc_client *client, struct msm_rpc_xdr *xdr)
{
int err = 0;
int array_length = 0;
unsigned int status = RPC_ACCEPTSTAT_SYSTEM_ERR;
struct npa_remote_cb_data arg;
npa_remote_callback cb_fn = NULL;
xdr_recv_uint32(xdr, &arg.cb_id);
xdr_recv_uint32(xdr, &arg.context);
xdr_recv_uint32(xdr, &arg.type);
xdr_recv_array(xdr, (void **)&arg.buffer, &array_length, INT_MAX,
sizeof(int32_t), (void *)xdr_recv_int32);
xdr_recv_uint32(xdr, &arg.size);
cb_fn = (npa_remote_callback) msm_rpc_get_cb_func(client, arg.cb_id);
if (cb_fn) {
cb_fn((void *)arg.context, arg.type, arg.buffer, arg.size);
status = RPC_ACCEPTSTAT_SUCCESS;
}
xdr_start_accepted_reply(xdr, status);
err = xdr_send_msg(xdr);
if (err) {
pr_err("NPA Remote callback %s: send accepted reply failed: "
"%d\n", __func__, err);
BUG();
}
kfree(arg.buffer);
return 0;
}
示例2: npa_remote_create_sync_client_ret_fn
static int npa_remote_create_sync_client_ret_fn(struct msm_rpc_client *client,
struct msm_rpc_xdr *xdr, void *data)
{
struct npa_remote_create_sync_client_ret *ret = data;
xdr_recv_int32(xdr, &ret->result);
xdr_recv_uint32(xdr, &ret->handle_is_valid);
if (ret->handle_is_valid)
xdr_recv_uint32(xdr, &ret->handle);
return 0;
}
示例3: npa_remote_issue_required_request_ret_fn
static int npa_remote_issue_required_request_ret_fn(
struct msm_rpc_client *client,
struct msm_rpc_xdr *xdr, void *data)
{
struct npa_remote_issue_required_request_ret *ret = data;
xdr_recv_int32(xdr, &ret->result);
xdr_recv_uint32(xdr, &ret->new_state_is_valid);
if (ret->new_state_is_valid)
xdr_recv_uint32(xdr, &ret->new_state);
return 0;
}
示例4: xdr_recv_array
int xdr_recv_array(struct msm_rpc_xdr *xdr, void **addr, uint32_t *size,
uint32_t maxsize, uint32_t elm_size, void *xdr_op)
{
int i, rc;
void *tmp_addr;
if (!size || !xdr_op)
return -1;
rc = xdr_recv_uint32(xdr, size);
if (rc)
return rc;
if (*size > maxsize)
return -1;
tmp_addr = kmalloc((*size * elm_size), GFP_KERNEL);
if (!tmp_addr)
return -1;
*addr = tmp_addr;
for (i = 0; i < *size; i++) {
rc = ((int (*) (struct msm_rpc_xdr *, void *))xdr_op)
(xdr, tmp_addr);
if (rc) {
kfree(*addr);
*addr = NULL;
return rc;
}
tmp_addr += elm_size;
}
return 0;
}
示例5: ping_mdm_register_cb
static int ping_mdm_register_cb(struct msm_rpc_client *client,
struct msm_rpc_xdr *xdr)
{
int rc;
uint32_t accept_status;
struct ping_mdm_register_cb_arg arg;
void *cb_func;
xdr_recv_uint32(xdr, &arg.cb_id); /* cb_id */
xdr_recv_int32(xdr, &arg.val); /* val */
cb_func = msm_rpc_get_cb_func(client, arg.cb_id);
if (cb_func) {
rc = ((int (*)(struct ping_mdm_register_cb_arg *, void *))
cb_func)(&arg, NULL);
if (rc)
accept_status = RPC_ACCEPTSTAT_SYSTEM_ERR;
else
accept_status = RPC_ACCEPTSTAT_SUCCESS;
} else
accept_status = RPC_ACCEPTSTAT_SYSTEM_ERR;
xdr_start_accepted_reply(xdr, accept_status);
rc = xdr_send_msg(xdr);
if (rc)
pr_err("%s: send accepted reply failed: %d\n", __func__, rc);
return rc;
}
示例6: npa_remote_resource_available_ret_fn
static int npa_remote_resource_available_ret_fn(struct msm_rpc_client *client,
struct msm_rpc_xdr *xdr, void *data)
{
struct npa_remote_resource_available_ret *ret = data;
xdr_recv_uint32(xdr, &ret->result);
return 0;
}
示例7: ping_mdm_register_ret
static int ping_mdm_register_ret(struct msm_rpc_client *client,
struct msm_rpc_xdr *xdr, void *data)
{
struct ping_mdm_register_ret *ret = data;
xdr_recv_uint32(xdr, &ret->result); /* result */
return 0;
}
示例8: xdr_recv_req
int xdr_recv_req(struct msm_rpc_xdr *xdr, struct rpc_request_hdr *req)
{
int rc = 0;
if (!req)
return -1;
rc |= xdr_recv_uint32(xdr, &req->xid); /* xid */
rc |= xdr_recv_uint32(xdr, &req->type); /* type */
rc |= xdr_recv_uint32(xdr, &req->rpc_vers); /* rpc_vers */
rc |= xdr_recv_uint32(xdr, &req->prog); /* prog */
rc |= xdr_recv_uint32(xdr, &req->vers); /* vers */
rc |= xdr_recv_uint32(xdr, &req->procedure); /* procedure */
rc |= xdr_recv_uint32(xdr, &req->cred_flavor); /* cred_flavor */
rc |= xdr_recv_uint32(xdr, &req->cred_length); /* cred_length */
rc |= xdr_recv_uint32(xdr, &req->verf_flavor); /* verf_flavor */
rc |= xdr_recv_uint32(xdr, &req->verf_length); /* verf_length */
return rc;
}
示例9: ping_mdm_data_cb
static int ping_mdm_data_cb(struct msm_rpc_client *client,
struct msm_rpc_xdr *xdr)
{
int rc;
void *cb_func;
uint32_t size, accept_status;
struct ping_mdm_register_data_cb_cb_arg arg;
struct ping_mdm_register_data_cb_cb_ret ret;
xdr_recv_uint32(xdr, &arg.cb_id); /* cb_id */
/* data */
xdr_recv_array(xdr, (void **)(&(arg.data)), &size, 64,
sizeof(uint32_t), (void *)xdr_recv_uint32);
xdr_recv_uint32(xdr, &arg.size); /* size */
xdr_recv_uint32(xdr, &arg.sum); /* sum */
cb_func = msm_rpc_get_cb_func(client, arg.cb_id);
if (cb_func) {
rc = ((int (*)
(struct ping_mdm_register_data_cb_cb_arg *,
struct ping_mdm_register_data_cb_cb_ret *))
cb_func)(&arg, &ret);
if (rc)
accept_status = RPC_ACCEPTSTAT_SYSTEM_ERR;
else
accept_status = RPC_ACCEPTSTAT_SUCCESS;
} else
accept_status = RPC_ACCEPTSTAT_SYSTEM_ERR;
xdr_start_accepted_reply(xdr, accept_status);
if (accept_status == RPC_ACCEPTSTAT_SUCCESS)
xdr_send_uint32(xdr, &ret.result); /* result */
rc = xdr_send_msg(xdr);
if (rc)
pr_err("%s: send accepted reply failed: %d\n", __func__, rc);
kfree(arg.data);
return rc;
}
示例10: handle_lg_fw_helper_misc_blk_write
static int handle_lg_fw_helper_misc_blk_write(struct msm_rpc_xdr *xdr)
{
int ret;
struct lg_fw_helper_misc_blk_rpc arg;
// get block number
ret = xdr_recv_uint32(xdr, &arg.block_no);
if (ret != 0)
return ret;
// get block data
ret = xdr_recv_array(xdr, (void **)&arg.data, &arg.size, 128,
sizeof(uint32_t), (void *)xdr_recv_uint32);
if (ret != 0)
return ret;
// write block data
print_hex_dump(KERN_INFO, "data: ", DUMP_PREFIX_OFFSET, 16, 1, arg.data, 512, true);
printk(KERN_ERR "[sunny] block num = %d \n", arg.block_no);
ret = lge_emmc_wallpaper_write(arg.block_no, (unsigned char*) arg.data, 512);
ret = xdr_start_accepted_reply(xdr, RPC_ACCEPTSTAT_SUCCESS);
if (ret != 0)
goto handle_lg_fw_helper_misc_blk_write_exit;
ret = 0xabcdef12; // for debugging
ret = xdr_send_uint32(xdr, &ret);
if (ret != 0)
goto handle_lg_fw_helper_misc_blk_write_exit;
ret = xdr_send_msg(xdr);
if (ret < 0)
pr_err("%s: sending reply failed\n", __func__);
handle_lg_fw_helper_misc_blk_write_exit:
if (arg.data)
kfree(arg.data);
return 0;
}
示例11: xdr_recv_pointer
int xdr_recv_pointer(struct msm_rpc_xdr *xdr, void **obj,
uint32_t obj_size, void *xdr_op)
{
uint32_t rc, ptr_valid = 0;
rc = xdr_recv_uint32(xdr, &ptr_valid);
if (rc)
return rc;
if (!ptr_valid) {
*obj = NULL;
return 0;
}
*obj = kmalloc(obj_size, GFP_KERNEL);
if (!*obj)
return -1;
rc = ((int (*) (struct msm_rpc_xdr *, void *))xdr_op)(xdr, *obj);
if (rc)
kfree(*obj);
return rc;
}
示例12: xdr_recv_reply
int xdr_recv_reply(struct msm_rpc_xdr *xdr, struct rpc_reply_hdr *reply)
{
int rc = 0;
if (!reply)
return -1;
rc |= xdr_recv_uint32(xdr, &reply->xid); /* xid */
rc |= xdr_recv_uint32(xdr, &reply->type); /* type */
rc |= xdr_recv_uint32(xdr, &reply->reply_stat); /* reply_stat */
/* acc_hdr */
if (reply->reply_stat == RPCMSG_REPLYSTAT_ACCEPTED) {
rc |= xdr_recv_uint32(xdr, &reply->data.acc_hdr.verf_flavor);
rc |= xdr_recv_uint32(xdr, &reply->data.acc_hdr.verf_length);
rc |= xdr_recv_uint32(xdr, &reply->data.acc_hdr.accept_stat);
}
return rc;
}
示例13: oem_rapi_client_cb
/* TODO: check where to allocate memory for return */
static int oem_rapi_client_cb(struct msm_rpc_client *client,
struct rpc_request_hdr *req,
struct msm_rpc_xdr *xdr)
{
uint32_t cb_id, accept_status;
int rc;
void *cb_func;
uint32_t temp;
struct oem_rapi_client_streaming_func_cb_arg arg;
struct oem_rapi_client_streaming_func_cb_ret ret;
arg.input = NULL;
ret.out_len = NULL;
ret.output = NULL;
xdr_recv_uint32(xdr, &cb_id); /* cb_id */
xdr_recv_uint32(xdr, &arg.event); /* enum */
xdr_recv_uint32(xdr, (uint32_t *)(&arg.handle)); /* handle */
xdr_recv_uint32(xdr, &arg.in_len); /* in_len */
xdr_recv_bytes(xdr, (void **)&arg.input, &temp); /* input */
xdr_recv_uint32(xdr, &arg.out_len_valid); /* out_len */
if (arg.out_len_valid) {
ret.out_len = kmalloc(sizeof(*ret.out_len), GFP_KERNEL);
if (!ret.out_len) {
accept_status = RPC_ACCEPTSTAT_SYSTEM_ERR;
goto oem_rapi_send_ack;
}
}
xdr_recv_uint32(xdr, &arg.output_valid); /* out */
if (arg.output_valid) {
xdr_recv_uint32(xdr, &arg.output_size); /* ouput_size */
ret.output = kmalloc(arg.output_size, GFP_KERNEL);
if (!ret.output) {
accept_status = RPC_ACCEPTSTAT_SYSTEM_ERR;
goto oem_rapi_send_ack;
}
}
cb_func = msm_rpc_get_cb_func(client, cb_id);
if (cb_func) {
rc = ((int (*)(struct oem_rapi_client_streaming_func_cb_arg *,
struct oem_rapi_client_streaming_func_cb_ret *))
cb_func)(&arg, &ret);
if (rc)
accept_status = RPC_ACCEPTSTAT_SYSTEM_ERR;
else
accept_status = RPC_ACCEPTSTAT_SUCCESS;
} else
accept_status = RPC_ACCEPTSTAT_SYSTEM_ERR;
oem_rapi_send_ack:
xdr_start_accepted_reply(xdr, accept_status);
if (accept_status == RPC_ACCEPTSTAT_SUCCESS) {
uint32_t temp = sizeof(uint32_t);
xdr_send_pointer(xdr, (void **)&(ret.out_len), temp,
xdr_send_uint32);
/* output */
if (ret.output && ret.out_len)
xdr_send_bytes(xdr, (const void **)&ret.output,
ret.out_len);
else {
temp = 0;
xdr_send_uint32(xdr, &temp);
}
}
rc = xdr_send_msg(xdr);
if (rc)
pr_err("%s: sending reply failed: %d\n", __func__, rc);
kfree(arg.input);
kfree(ret.out_len);
kfree(ret.output);
return 0;
}
示例14: xdr_recv_int32
int xdr_recv_int32(struct msm_rpc_xdr *xdr, int32_t *value)
{
return xdr_recv_uint32(xdr, (uint32_t *)value);
}