Lines Matching refs:sim

47 static void  tws_action(struct cam_sim *sim, union ccb *ccb);
48 static void tws_poll(struct cam_sim *sim);
153 sc->sim = cam_sim_alloc(tws_action, tws_poll, "tws", sc, in tws_cam_attach()
158 if (sc->sim == NULL) { in tws_cam_attach()
164 if (xpt_bus_register(sc->sim, in tws_cam_attach()
167 cam_sim_free(sc->sim, TRUE); /* passing true will free the devq */ in tws_cam_attach()
168 sc->sim = NULL; /* so cam_detach will not try to free it */ in tws_cam_attach()
173 if (xpt_create_path(&sc->path, NULL, cam_sim_path(sc->sim), in tws_cam_attach()
176 xpt_bus_deregister(cam_sim_path(sc->sim)); in tws_cam_attach()
178 cam_sim_free(sc->sim, TRUE); in tws_cam_attach()
195 if (sc->sim) { in tws_cam_detach()
196 xpt_bus_deregister(cam_sim_path(sc->sim)); in tws_cam_detach()
197 cam_sim_free(sc->sim, TRUE); in tws_cam_detach()
208 if (!(sc->sim)) in tws_bus_scan()
212 if (xpt_create_path(&ccb->ccb_h.path, NULL, cam_sim_path(sc->sim), in tws_bus_scan()
224 tws_action(struct cam_sim *sim, union ccb *ccb) in tws_action() argument
226 struct tws_softc *sc = (struct tws_softc *)cam_sim_softc(sim); in tws_action()
244 TWS_TRACE_DEBUG(sc, "reset bus", sim, ccb); in tws_action()
249 TWS_TRACE_DEBUG(sc, "set tran settings", sim, ccb); in tws_action()
257 TWS_TRACE_DEBUG(sc, "get tran settings", sim, ccb); in tws_action()
284 TWS_TRACE_DEBUG(sc, "path inquiry", sim, ccb); in tws_action()
292 ccb->cpi.unit_number = cam_sim_unit(sim); in tws_action()
293 ccb->cpi.bus_id = cam_sim_bus(sim); in tws_action()
298 strlcpy(ccb->cpi.dev_name, cam_sim_name(sim), DEV_IDLEN); in tws_action()
310 TWS_TRACE_DEBUG(sc, "default", sim, ccb); in tws_action()
1108 tws_poll(struct cam_sim *sim) in tws_poll() argument
1110 struct tws_softc *sc = (struct tws_softc *)cam_sim_softc(sim); in tws_poll()
1136 xpt_freeze_simq(sc->sim, 1); in tws_timeout()
1157 xpt_release_simq(sc->sim, 1); in tws_timeout()
1171 xpt_freeze_simq(sc->sim, 1); in tws_reset()
1186 xpt_release_simq(sc->sim, 1); in tws_reset()
1270 xpt_freeze_simq(sc->sim, 1); in tws_freeze_simq()