Lines Matching defs:periph
91 struct cam_periph *periph;
138 static void targdone(struct cam_periph *periph,
169 struct cam_periph *periph;
172 if (softc->periph == NULL) {
179 * Acquire a hold on the periph so that it doesn't go away before
182 periph = softc->periph;
183 cam_periph_acquire(periph);
184 cam_periph_lock(periph);
186 if (softc->periph != NULL) {
187 cam_periph_invalidate(softc->periph);
188 softc->periph = NULL;
190 cam_periph_unlock(periph);
191 cam_periph_release(periph);
197 * periph doesn't get created until an ioctl is issued to do so, and
209 softc->periph = NULL;
238 status = xpt_create_path(&path, /*periph*/NULL,
254 if (softc->periph == NULL) {
258 cam_periph_lock(softc->periph);
260 cam_periph_unlock(softc->periph);
266 /* If no periph available, disallow debugging changes */
304 cam_periph_lock(softc->periph);
309 cam_periph_unlock(softc->periph);
347 cam_periph_lock(softc->periph);
350 cam_periph_unlock(softc->periph);
383 struct cam_periph *periph;
409 /* Destroy any periph on our path if it is disabled */
410 periph = cam_periph_find(path, "targ");
411 if (periph != NULL) {
414 del_softc = (struct targ_softc *)periph->softc;
416 cam_periph_invalidate(del_softc->periph);
417 del_softc->periph = NULL;
420 periph->unit_number);
426 /* Create a periph instance attached to this path */
434 /* Ensure that the periph now exists. */
436 panic("targenable: succeeded but no periph?");
477 /* Initialize a periph (called from cam_periph_alloc) */
479 targctor(struct cam_periph *periph, void *arg)
483 /* Store pointer to softc for periph-driven routines */
485 periph->softc = softc;
486 softc->periph = periph;
487 softc->path = periph->path;
492 targdtor(struct cam_periph *periph)
498 softc = (struct targ_softc *)periph->softc;
514 softc->periph = NULL;
516 periph->softc = NULL;
552 cam_periph_lock(softc->periph);
563 cam_periph_unlock(softc->periph);
566 cam_periph_lock(softc->periph);
577 xpt_schedule(softc->periph, priority);
592 cam_periph_unlock(softc->periph);
611 /* Process requests (descrs) via the periph-supplied CCBs */
613 targstart(struct cam_periph *periph, union ccb *start_ccb)
619 softc = (struct targ_softc *)periph->softc;
634 xpt_print(periph->path,
645 xpt_schedule(periph, next_descr->priority);
758 targdone(struct cam_periph *periph, union ccb *done_ccb)
762 CAM_DEBUG(periph->path, CAM_DEBUG_PERIPH, ("targdone %p\n", done_ccb));
763 softc = (struct targ_softc *)periph->softc;
784 cam_periph_unlock(softc->periph);
786 cam_periph_lock(softc->periph);
815 cam_periph_lock(softc->periph);
820 error = cam_periph_sleep(softc->periph, user_queue,
832 cam_periph_unlock(softc->periph);
851 cam_periph_unlock(softc->periph);
853 cam_periph_lock(softc->periph);
874 cam_periph_unlock(softc->periph);
876 cam_periph_lock(softc->periph);
893 cam_periph_unlock(softc->periph);
979 /* Send back CCB if we got it from the periph */
1063 cam_periph_sleep(softc->periph, &softc->pending_ccb_queue,
1070 cam_periph_unlock(softc->periph);
1072 cam_periph_lock(softc->periph);