Index: sys/cam/cam_sim.c =================================================================== --- sys/cam/cam_sim.c +++ sys/cam/cam_sim.c @@ -127,6 +127,24 @@ return (sim); } +/** + * @brief frees up the sim + * + * Frees up the CAM @c sim and optionally the devq. After this call returns, no + * further @c sim_action or @c sim_poll requests will make it to the driver. The + * driver is responsible for cleaning up all requests submitted via sim_action + * that were received prior to calling this function. + * + * This function asserts that the mtx associated with this sim, if any, is + * locked when this function is called. It will remain locked. Once this + * function returns, CAM will cease using that mutex, however. + * + * This function will wait for all outstanding reference to the sim to clear + * before returning. + * + * @param sim The sim to free + * @param free_devq Free the devq associated with the sim at creation. + */ void cam_sim_free(struct cam_sim *sim, int free_devq) {