static int ipmi_detach(dev_info_t *dip, ddi_detach_cmd_t cmd) { if (cmd != DDI_DETACH) return (DDI_FAILURE); if (ipmi_found == B_FALSE) return (DDI_SUCCESS); if (!list_is_empty(&dev_list)) return (DDI_FAILURE); /* poke the taskq so that it can terminate */ sc->ipmi_detaching = 1; cv_signal(&sc->ipmi_request_added); ddi_remove_minor_node(dip, NULL); ipmi_dip = NULL; taskq_destroy(sc->ipmi_kthread); list_destroy(&dev_list); id_space_destroy(minor_ids); ipmi_attached = B_FALSE; return (DDI_SUCCESS); }
static void ipmi_cleanup(dev_info_t *dip) { /* poke the taskq so that it can terminate */ IPMI_LOCK(sc); sc->ipmi_detaching = 1; cv_signal(&sc->ipmi_request_added); IPMI_UNLOCK(sc); ipmi_shutdown(sc); ddi_remove_minor_node(dip, NULL); ipmi_dip = NULL; list_destroy(&dev_list); id_space_destroy(minor_ids); sc->ipmi_detaching = 0; }