Commit 8e865fc2 authored by Charlie Jacobsen's avatar Charlie Jacobsen
Browse files

Add thc_ipc_send.

Motivation: In some cases, we need to split the sending of the
request from the receipt of the response. For example, in LCDs,
we need to send an async request, then do a *microkernel sync
send*, and then get the async response.
parent 538c1110
Pipeline #554 skipped
......@@ -187,12 +187,46 @@ thc_ipc_call(struct fipc_ring_channel *chnl,
return 0;
fail2:
awe_mapper_remove_id(msg_id);
fail1:
awe_mapper_remove_id(msg_id);
return ret;
}
EXPORT_SYMBOL(thc_ipc_call);
int
LIBASYNC_FUNC_ATTR
thc_ipc_send(struct fipc_ring_channel *chnl,
struct fipc_message *request,
uint32_t *request_cookie)
{
uint32_t msg_id;
int ret;
/*
* Get an id for our current awe, and store in request.
*/
msg_id = awe_mapper_create_id();
thc_set_msg_type(request, msg_type_request);
thc_set_msg_id(request, msg_id);
/*
* Send request
*/
ret = fipc_send_msg_end(chnl, request);
if (ret) {
printk(KERN_ERR "thc: error sending request");
goto fail1;
}
*request_cookie = msg_id;
return 0;
fail2:
fail1:
awe_mapper_remove_id(msg_id);
return ret;
}
EXPORT_SYMBOL(thc_ipc_send);
int
LIBASYNC_FUNC_ATTR
thc_ipc_reply(struct fipc_ring_channel *chnl,
......
......@@ -83,6 +83,25 @@ int thc_ipc_call(struct fipc_ring_channel *chnl,
struct fipc_message *request,
struct fipc_message **response);
/*
* thc_ipc_send
*
* Associates a "request cookie" (the message id)
* with the request and does the send (this is
* essentially the top half of thc_ipc_call).
*
* The request cookie is returned as an out param.
*
* The caller should invoke a subsequent thc_ipc_recv
* with the request cookie as the msg_id argument to
* get the response.
*
* Returns 0 on success, non-zero otherwise.
*/
int thc_ipc_send(struct fipc_ring_channel *chnl,
struct fipc_message *request,
uint32_t *request_cookie);
/*
* thc_ipc_reply
*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment