Lines Matching refs:handle
78 static inline int xf_proxy_cmd(xf_proxy_t *proxy, xf_handle_t *handle, xf_user_msg_t *m)
83 msg.id = __XF_MSG_ID(__XF_AP_CLIENT(proxy->core, handle->client), m->id);
96 static inline u32 xf_client_alloc(xf_proxy_t *proxy, xf_handle_t *handle) in xf_client_alloc() argument
106 handle->client = client, proxy->cmap[client].handle = handle; in xf_client_alloc()
113 static inline void xf_client_free(xf_proxy_t *proxy, xf_handle_t *handle) in xf_client_free() argument
115 u32 client = handle->client; in xf_client_free()
134 return proxy->cmap[client].handle; in xf_client_lookup()
138 static inline int xf_client_register(xf_proxy_t *proxy, xf_handle_t *handle, xf_id_t id, u32 core) in xf_client_register() argument
140 void *b = xf_handle_aux(handle); in xf_client_register()
150 strncpy(b, id, xf_buffer_length(handle->aux)); in xf_client_register()
159 handle->id = XF_MSG_SRC(msg.id); in xf_client_register()
161 …TRACE(REG, _b("[%p]=[%s:%u:%u]"), handle, id, XF_PORT_CORE(handle->id), XF_PORT_CLIENT(handle->id)… in xf_client_register()
167 static inline int xf_client_unregister(xf_proxy_t *proxy, xf_handle_t *handle) in xf_client_unregister() argument
172 BUG(proxy->cmap[handle->client].handle != handle, _x("Invalid handle: %p"), handle); in xf_client_unregister()
175 msg.id = __XF_MSG_ID(__XF_AP_PROXY(proxy->core), handle->id); in xf_client_unregister()
186 …TRACE(REG, _b("%p[%u:%u] unregistered"), handle, XF_PORT_CORE(handle->id), XF_PORT_CLIENT(handle->… in xf_client_unregister()
368 int xf_open(xf_proxy_t *proxy, xf_handle_t *handle, xf_id_t id, u32 core, xf_response_cb response) in xf_open() argument
373 XF_CHK_ERR(handle->aux = xf_buffer_get(proxy->aux), -EBUSY); in xf_open()
376 XF_CHK_API(xf_ipc_data_init(&handle->ipc)); in xf_open()
382 if (xf_client_alloc(proxy, handle) == 0) in xf_open()
387 else if ((r = xf_client_register(proxy, handle, id, core)) < 0) in xf_open()
390 xf_client_free(proxy, handle); in xf_open()
399 xf_buffer_put(handle->aux), handle->aux = NULL; in xf_open()
404 handle->response = response; in xf_open()
405 handle->proxy = proxy; in xf_open()
407 TRACE(INIT, _b("component[%p]:(id=%s,core=%u) created"), handle, id, core); in xf_open()
414 void xf_close(xf_handle_t *handle) in xf_close() argument
416 xf_proxy_t *proxy = handle->proxy; in xf_close()
426 (void) xf_client_unregister(proxy, handle); in xf_close()
429 xf_client_free(proxy, handle); in xf_close()
435 xf_ipc_data_destroy(&handle->ipc); in xf_close()
438 xf_buffer_put(handle->aux), handle->aux = NULL; in xf_close()
441 handle->proxy = NULL; in xf_close()
443 TRACE(INIT, _b("component[%p] destroyed"), handle); in xf_close()
542 int xf_command(xf_handle_t *handle, u32 port, u32 opcode, void *buffer, u32 length) in xf_command() argument
544 xf_proxy_t *proxy = handle->proxy; in xf_command()
548 …msg.id = __XF_MSG_ID(__XF_AP_CLIENT(proxy->core, handle->client), __XF_PORT_SPEC2(handle->id, port… in xf_command()
553 TRACE(CMD, _b("[%p]:[%08x]:(%08x,%u,%p)"), handle, msg.id, opcode, length, buffer); in xf_command()