/*ARGSUSED*/ static int eibnx_post_event(dev_info_t *dip, dev_info_t *rdip, ddi_eventcookie_t cookie, void *impl_data) { return (ndi_event_run_callbacks(enx_ndi_event_hdl, rdip, cookie, impl_data)); }
/* * nx1394_post_event() * Called when a child node calls ddi_post_event. If the event is one of * the events supported by us (bus reset/insert/remove, for now), builds * a t1394_localinfo_t structure and calls ndi_event_run_callbacks(). This * will result in all registered callbacks being invoked with * t1394_localinfo_t as the impl_data. (see ddi_add_eventcall for callback * arguments.) If the event is not defined by us, the request is * propagated up the device tree by calling ndi_post_event(). */ static int nx1394_post_event(dev_info_t *dip, dev_info_t *rdip, ddi_eventcookie_t cookie, void *impl_data) { int ret; char *name; s1394_hal_t *hal; t1394_localinfo_t localinfo; hal = s1394_dip_to_hal(dip); ASSERT(hal); TNF_PROBE_0_DEBUG(nx1394_post_event_enter, S1394_TNF_SL_NEXUS_STACK, ""); name = ndi_event_cookie_to_name(hal->hal_ndi_event_hdl, cookie); /* name is NULL if we don't generate the event */ if (name != NULL) { mutex_enter(&hal->topology_tree_mutex); localinfo.bus_generation = hal->generation_count; localinfo.local_nodeID = hal->node_id; mutex_exit(&hal->topology_tree_mutex); impl_data = &localinfo; ret = ndi_event_run_callbacks(hal->hal_ndi_event_hdl, rdip, cookie, impl_data); TNF_PROBE_4_DEBUG(nx1394_post_event_exit, S1394_TNF_SL_NEXUS_STACK, "", tnf_opaque, parent_dip, (void *)dip, tnf_opaque, requestor_dip, (void *)rdip, tnf_string, event_name, name, tnf_int, request_status, ret); return (ret); } else { ret = ndi_post_event(ddi_get_parent(dip), rdip, cookie, impl_data); TNF_PROBE_2_DEBUG(nx1394_post_event_exit, S1394_TNF_SL_NEXUS_STACK, "", tnf_string, msg, "Not our event", tnf_int, ret, ret); return (ret); } }