Lines Matching refs:sim
56 static TW_VOID twa_action(struct cam_sim *sim, union ccb *ccb);
57 static TW_VOID twa_poll(struct cam_sim *sim);
100 sc->sim = cam_sim_alloc(twa_action, twa_poll, "twa", sc,
103 if (sc->sim == NULL) {
119 if (xpt_bus_register(sc->sim, sc->bus_dev, 0) != CAM_SUCCESS) {
120 cam_sim_free(sc->sim, TRUE);
121 sc->sim = NULL; /* so cam_detach will not try to free it */
134 cam_sim_path(sc->sim),
137 xpt_bus_deregister(cam_sim_path (sc->sim));
139 cam_sim_free(sc->sim, TRUE);
174 if (sc->sim) {
175 xpt_bus_deregister(cam_sim_path(sc->sim));
177 cam_sim_free(sc->sim, TRUE);
307 * Input: sim -- sim corresponding to the ctlr
313 twa_action(struct cam_sim *sim, union ccb *ccb)
315 struct twa_softc *sc = (struct twa_softc *)cam_sim_softc(sim);
423 path_inq->unit_number = cam_sim_unit(sim);
424 path_inq->bus_id = cam_sim_bus(sim);
429 strlcpy(path_inq->dev_name, cam_sim_name(sim), DEV_IDLEN);
455 * Input: sim -- sim corresponding to the controller
460 twa_poll(struct cam_sim *sim)
462 struct twa_softc *sc = (struct twa_softc *)(cam_sim_softc(sim));
487 /* If we get here before sc->sim is initialized, return an error. */
488 if (!(sc->sim))
493 if (xpt_create_path(&ccb->ccb_h.path, NULL, cam_sim_path(sc->sim),
526 xpt_freeze_simq(sc->sim, 1);