Lines Matching defs:sim
56 static TW_VOID twa_action(struct cam_sim *sim, union ccb *ccb);
57 static TW_VOID twa_poll(struct cam_sim *sim);
98 sc->sim = cam_sim_alloc(twa_action, twa_poll, "twa", sc,
101 if (sc->sim == NULL) {
117 if (xpt_bus_register(sc->sim, sc->bus_dev, 0) != CAM_SUCCESS) {
118 cam_sim_free(sc->sim, TRUE);
119 sc->sim = NULL; /* so cam_detach will not try to free it */
132 cam_sim_path(sc->sim),
135 xpt_bus_deregister(cam_sim_path (sc->sim));
137 cam_sim_free(sc->sim, TRUE);
170 if (sc->sim) {
171 xpt_bus_deregister(cam_sim_path(sc->sim));
173 cam_sim_free(sc->sim, TRUE);
299 * Input: sim -- sim corresponding to the ctlr
305 twa_action(struct cam_sim *sim, union ccb *ccb)
307 struct twa_softc *sc = (struct twa_softc *)cam_sim_softc(sim);
415 path_inq->unit_number = cam_sim_unit(sim);
416 path_inq->bus_id = cam_sim_bus(sim);
421 strlcpy(path_inq->dev_name, cam_sim_name(sim), DEV_IDLEN);
445 * Input: sim -- sim corresponding to the controller
450 twa_poll(struct cam_sim *sim)
452 struct twa_softc *sc = (struct twa_softc *)(cam_sim_softc(sim));
475 /* If we get here before sc->sim is initialized, return an error. */
476 if (!(sc->sim))
481 if (xpt_create_path(&ccb->ccb_h.path, NULL, cam_sim_path(sc->sim),
512 xpt_freeze_simq(sc->sim, 1);