Lines Matching refs:periph

185 static	void		chdone(struct cam_periph *periph,
189 static int chmove(struct cam_periph *periph,
191 static int chexchange(struct cam_periph *periph,
193 static int chposition(struct cam_periph *periph,
195 static int chgetelemstatus(struct cam_periph *periph,
198 static int chsetvoltag(struct cam_periph *periph,
200 static int chielem(struct cam_periph *periph,
202 static int chgetparams(struct cam_periph *periph);
203 static int chscsiversion(struct cam_periph *periph);
245 struct cam_periph *periph; in chdevgonecb() local
249 periph = (struct cam_periph *)arg; in chdevgonecb()
250 mtx = cam_periph_mtx(periph); in chdevgonecb()
253 softc = (struct ch_softc *)periph->softc; in chdevgonecb()
263 cam_periph_release_locked(periph); in chdevgonecb()
270 cam_periph_release_locked(periph); in chdevgonecb()
283 choninvalidate(struct cam_periph *periph) in choninvalidate() argument
287 softc = (struct ch_softc *)periph->softc; in choninvalidate()
292 xpt_register_async(0, chasync, periph, periph->path); in choninvalidate()
300 destroy_dev_sched_cb(softc->dev, chdevgonecb, periph); in choninvalidate()
304 chcleanup(struct cam_periph *periph) in chcleanup() argument
308 softc = (struct ch_softc *)periph->softc; in chcleanup()
318 struct cam_periph *periph; in chasync() local
320 periph = (struct cam_periph *)callback_arg; in chasync()
357 cam_periph_async(periph, code, path, arg); in chasync()
363 chregister(struct cam_periph *periph, void *arg) in chregister() argument
387 periph->softc = softc; in chregister()
398 xpt_path_inq(&cpi, periph->path); in chregister()
404 cam_periph_unlock(periph); in chregister()
406 periph->unit_number, 0, in chregister()
417 if (cam_periph_acquire(periph) != 0) { in chregister()
418 xpt_print(periph->path, "%s: lost periph during " in chregister()
420 cam_periph_lock(periph); in chregister()
427 args.mda_unit = periph->unit_number; in chregister()
431 args.mda_si_drv1 = periph; in chregister()
432 error = make_dev_s(&args, &softc->dev, "%s%d", periph->periph_name, in chregister()
433 periph->unit_number); in chregister()
434 cam_periph_lock(periph); in chregister()
436 cam_periph_release_locked(periph); in chregister()
444 xpt_register_async(AC_LOST_DEVICE, chasync, periph, periph->path); in chregister()
450 (void)cam_periph_hold(periph, PRIBIO); in chregister()
451 xpt_schedule(periph, CAM_PRIORITY_DEV); in chregister()
459 struct cam_periph *periph; in chopen() local
463 periph = (struct cam_periph *)dev->si_drv1; in chopen()
464 if (cam_periph_acquire(periph) != 0) in chopen()
467 softc = (struct ch_softc *)periph->softc; in chopen()
469 cam_periph_lock(periph); in chopen()
472 cam_periph_release_locked(periph); in chopen()
473 cam_periph_unlock(periph); in chopen()
477 if ((error = cam_periph_hold(periph, PRIBIO | PCATCH)) != 0) { in chopen()
478 cam_periph_unlock(periph); in chopen()
479 cam_periph_release(periph); in chopen()
486 if ((error = chgetparams(periph)) != 0) { in chopen()
487 cam_periph_unhold(periph); in chopen()
488 cam_periph_release_locked(periph); in chopen()
489 cam_periph_unlock(periph); in chopen()
493 cam_periph_unhold(periph); in chopen()
497 cam_periph_unlock(periph); in chopen()
505 struct cam_periph *periph; in chclose() local
509 periph = (struct cam_periph *)dev->si_drv1; in chclose()
510 mtx = cam_periph_mtx(periph); in chclose()
513 softc = (struct ch_softc *)periph->softc; in chclose()
516 cam_periph_release_locked(periph); in chclose()
536 chstart(struct cam_periph *periph, union ccb *start_ccb) in chstart() argument
540 softc = (struct ch_softc *)periph->softc; in chstart()
594 chdone(struct cam_periph *periph, union ccb *done_ccb) in chdone() argument
599 softc = (struct ch_softc *)periph->softc; in chdone()
640 xpt_announce_periph(periph, announce_buf); in chdone()
641 xpt_announce_quirks(periph, softc->quirks, in chdone()
678 (periph->flags & CAM_PERIPH_INVALID) == 0) { in chdone()
701 xpt_print(periph->path, in chdone()
705 xpt_print(periph->path, "fatal error, failed " in chdone()
708 cam_periph_invalidate(periph); in chdone()
722 cam_periph_unhold(periph); in chdone()
741 struct cam_periph *periph; in chioctl() local
745 periph = (struct cam_periph *)dev->si_drv1; in chioctl()
746 cam_periph_lock(periph); in chioctl()
747 CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("entering chioctl\n")); in chioctl()
749 softc = (struct ch_softc *)periph->softc; in chioctl()
753 CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, in chioctl()
769 cam_periph_unlock(periph); in chioctl()
776 error = chmove(periph, (struct changer_move *)addr); in chioctl()
780 error = chexchange(periph, (struct changer_exchange *)addr); in chioctl()
784 error = chposition(periph, (struct changer_position *)addr); in chioctl()
813 error = chielem(periph, *(unsigned int *)addr); in chioctl()
818 error = chgetelemstatus(periph, SCSI_REV_2, cmd, in chioctl()
827 scsi_version = chscsiversion(periph); in chioctl()
829 error = chgetelemstatus(periph, scsi_version, cmd, in chioctl()
833 cam_periph_unlock(periph); in chioctl()
841 error = chsetvoltag(periph, in chioctl()
849 error = cam_periph_ioctl(periph, cmd, addr, cherror); in chioctl()
853 cam_periph_unlock(periph); in chioctl()
858 chmove(struct cam_periph *periph, struct changer_move *cm) in chmove() argument
866 softc = (struct ch_softc *)periph->softc; in chmove()
889 ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL); in chmove()
912 chexchange(struct cam_periph *periph, struct changer_exchange *ce) in chexchange() argument
920 softc = (struct ch_softc *)periph->softc; in chexchange()
948 ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL); in chexchange()
975 chposition(struct cam_periph *periph, struct changer_position *cp) in chposition() argument
983 softc = (struct ch_softc *)periph->softc; in chposition()
998 ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL); in chposition()
1179 chgetelemstatus(struct cam_periph *periph, int scsi_version, u_long cmd, in chgetelemstatus() argument
1197 softc = (struct ch_softc *)periph->softc; in chgetelemstatus()
1216 cam_periph_unlock(periph); in chgetelemstatus()
1219 cam_periph_lock(periph); in chgetelemstatus()
1220 ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL); in chgetelemstatus()
1288 cam_periph_unlock(periph); in chgetelemstatus()
1305 cam_periph_lock(periph); in chgetelemstatus()
1327 cam_periph_unlock(periph); in chgetelemstatus()
1338 xpt_print(periph->path, in chgetelemstatus()
1388 cam_periph_lock(periph); in chgetelemstatus()
1402 chielem(struct cam_periph *periph, in chielem() argument
1416 softc = (struct ch_softc *)periph->softc; in chielem()
1418 ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL); in chielem()
1437 chsetvoltag(struct cam_periph *periph, in chsetvoltag() argument
1449 softc = (struct ch_softc *)periph->softc; in chsetvoltag()
1502 ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL); in chsetvoltag()
1525 chgetparams(struct cam_periph *periph) in chgetparams() argument
1538 softc = (struct ch_softc *)periph->softc; in chgetparams()
1540 ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL); in chgetparams()
1604 xpt_print(periph->path, in chgetparams()
1667 xpt_print(periph->path, in chgetparams()
1696 chscsiversion(struct cam_periph *periph) in chscsiversion() argument
1702 cam_periph_assert(periph, MA_OWNED); in chscsiversion()
1708 xpt_gdev_type(cgd, periph->path); in chscsiversion()