Lines Matching refs:agent

105 ldma_connexion_lookup(ldma_agent_t *agent, ds_hdl_t hdl)  in ldma_connexion_lookup()  argument
110 ASSERT(MUTEX_HELD(&agent->conn_lock)); in ldma_connexion_lookup()
111 for (connp = agent->conn, i = 0; i < LDOMS_MAX_DOMAINS; i++, connp++) { in ldma_connexion_lookup()
122 ldma_connexion_add(ldma_agent_t *agent, ds_hdl_t hdl, ds_domain_hdl_t dhdl, in ldma_connexion_add() argument
129 (void) mutex_lock(&agent->conn_lock); in ldma_connexion_add()
130 for (connp = agent->conn, i = 0; i < LDOMS_MAX_DOMAINS; i++, connp++) { in ldma_connexion_add()
138 (void) mutex_unlock(&agent->conn_lock); in ldma_connexion_add()
139 LDMA_INFO("agent %s hdl %llx already exists", agent->info->name, in ldma_connexion_add()
145 (void) mutex_unlock(&agent->conn_lock); in ldma_connexion_add()
146 LDMA_INFO("agent %s too many connections", agent->info->name); in ldma_connexion_add()
151 agent->info->name, availp, hdl, dhdl, verp->major, verp->minor); in ldma_connexion_add()
156 (void) mutex_unlock(&agent->conn_lock); in ldma_connexion_add()
164 ldma_connexion_delete(ldma_agent_t *agent, ds_hdl_t hdl) in ldma_connexion_delete() argument
168 (void) mutex_lock(&agent->conn_lock); in ldma_connexion_delete()
169 if ((connp = ldma_connexion_lookup(agent, hdl)) == NULL) { in ldma_connexion_delete()
170 (void) mutex_unlock(&agent->conn_lock); in ldma_connexion_delete()
172 agent->info->name, hdl); in ldma_connexion_delete()
176 LDMA_DBG("agent %s deleting connection (%x) %llx", agent->info->name, in ldma_connexion_delete()
183 (void) mutex_unlock(&agent->conn_lock); in ldma_connexion_delete()
191 ldma_connexion_init(ldma_agent_t *agent) in ldma_connexion_init() argument
196 for (connp = agent->conn, i = 0; i < LDOMS_MAX_DOMAINS; i++, connp++) { in ldma_connexion_init()
249 ldma_agent_t *agent = (ldma_agent_t *)arg; in ldma_reg_cb() local
257 agent->info->name, hdl, dhdl, dname, ver->major, ver->minor); in ldma_reg_cb()
263 if (!ldma_connexion_add(agent, hdl, dhdl, ver)) { in ldma_reg_cb()
265 "domain %s", agent->info->name, dname); in ldma_reg_cb()
276 ldma_agent_t *agent = (ldma_agent_t *)arg; in ldma_unreg_cb() local
278 LDMA_DBG("%s: UNREGISTER hdl=%llx", agent->info->name, hdl); in ldma_unreg_cb()
280 if (!ldma_connexion_delete(agent, hdl)) { in ldma_unreg_cb()
282 agent->info->name, hdl); in ldma_unreg_cb()
296 ldma_agent_t *agent = (ldma_agent_t *)arg; in ldma_data_cb() local
310 "size of %d bytes", agent->info->name, len); in ldma_data_cb()
317 "dlen=%d", agent->info->name, hdl, request->msg_num, in ldma_data_cb()
320 (void) mutex_lock(&agent->conn_lock); in ldma_data_cb()
321 connp = ldma_connexion_lookup(agent, hdl); in ldma_data_cb()
326 (void) mutex_unlock(&agent->conn_lock); in ldma_data_cb()
331 "distrusted domain", agent->info->name, hdl); in ldma_data_cb()
338 for (i = 0; i < agent->info->nhandlers; i++) { in ldma_data_cb()
339 if (agent->info->handlers[i].msg_type == request->msg_type) { in ldma_data_cb()
340 handler = &agent->info->handlers[i]; in ldma_data_cb()
348 agent->info->name, hdl, request->msg_type); in ldma_data_cb()
357 "distrusted domain", agent->info->name, hdl); in ldma_data_cb()
370 agent->info->name, hdl); in ldma_data_cb()
380 agent->info->name, hdl, status, (void *)reply, reply_dlen); in ldma_data_cb()
420 "dlen=%d", agent->info->name, hdl, reply->msg_num, in ldma_data_cb()
425 agent->info->name, request->msg_num); in ldma_data_cb()
438 ldma_agent_t *agent; in ldma_register() local
442 agent = malloc(sizeof (ldma_agent_t)); in ldma_register()
443 if (agent == NULL) in ldma_register()
446 agent->info = agent_info; in ldma_register()
447 (void) mutex_init(&agent->conn_lock, USYNC_THREAD, NULL); in ldma_register()
448 ldma_connexion_init(agent); in ldma_register()
457 ds_ops.cb_arg = agent; in ldma_register()
467 free(agent); in ldma_register()