Lines Matching refs:periph

120 static void		sgdone(struct cam_periph *periph, union ccb *done_ccb);
121 static int sgsendccb(struct cam_periph *periph, union ccb *ccb);
122 static int sgsendrdwr(struct cam_periph *periph, union ccb *ccb);
170 struct cam_periph *periph; in sgdevgonecb() local
175 periph = (struct cam_periph *)arg; in sgdevgonecb()
176 mtx = cam_periph_mtx(periph); in sgdevgonecb()
179 softc = (struct sg_softc *)periph->softc; in sgdevgonecb()
189 cam_periph_release_locked(periph); in sgdevgonecb()
196 cam_periph_release_locked(periph); in sgdevgonecb()
209 sgoninvalidate(struct cam_periph *periph) in sgoninvalidate() argument
213 softc = (struct sg_softc *)periph->softc; in sgoninvalidate()
218 xpt_register_async(0, sgasync, periph, periph->path); in sgoninvalidate()
226 destroy_dev_sched_cb(softc->dev, sgdevgonecb, periph); in sgoninvalidate()
237 sgcleanup(struct cam_periph *periph) in sgcleanup() argument
241 softc = (struct sg_softc *)periph->softc; in sgcleanup()
251 struct cam_periph *periph; in sgasync() local
253 periph = (struct cam_periph *)callback_arg; in sgasync()
287 cam_periph_async(periph, code, path, arg); in sgasync()
293 sgregister(struct cam_periph *periph, void *arg) in sgregister() argument
318 periph->softc = softc; in sgregister()
320 xpt_path_inq(&cpi, periph->path); in sgregister()
333 cam_periph_unlock(periph); in sgregister()
336 periph->unit_number, 0, in sgregister()
349 if (cam_periph_acquire(periph) != 0) { in sgregister()
350 xpt_print(periph->path, "%s: lost periph during " in sgregister()
352 cam_periph_lock(periph); in sgregister()
359 args.mda_unit = periph->unit_number; in sgregister()
363 args.mda_si_drv1 = periph; in sgregister()
365 periph->periph_name, periph->unit_number); in sgregister()
367 cam_periph_lock(periph); in sgregister()
368 cam_periph_release_locked(periph); in sgregister()
371 if (periph->unit_number < 26) { in sgregister()
373 periph->unit_number + 'a'); in sgregister()
376 ((periph->unit_number / 26) - 1) + 'a', in sgregister()
377 (periph->unit_number % 26) + 'a'); in sgregister()
379 cam_periph_lock(periph); in sgregister()
385 xpt_register_async(AC_LOST_DEVICE, sgasync, periph, periph->path); in sgregister()
388 xpt_announce_periph(periph, NULL); in sgregister()
394 sgdone(struct cam_periph *periph, union ccb *done_ccb) in sgdone() argument
399 softc = (struct sg_softc *)periph->softc; in sgdone()
428 struct cam_periph *periph; in sgopen() local
432 periph = (struct cam_periph *)dev->si_drv1; in sgopen()
433 if (cam_periph_acquire(periph) != 0) in sgopen()
441 cam_periph_release(periph); in sgopen()
445 cam_periph_lock(periph); in sgopen()
447 softc = (struct sg_softc *)periph->softc; in sgopen()
449 cam_periph_release_locked(periph); in sgopen()
450 cam_periph_unlock(periph); in sgopen()
456 cam_periph_unlock(periph); in sgopen()
464 struct cam_periph *periph; in sgclose() local
468 periph = (struct cam_periph *)dev->si_drv1; in sgclose()
469 mtx = cam_periph_mtx(periph); in sgclose()
472 softc = periph->softc; in sgclose()
475 cam_periph_release_locked(periph); in sgclose()
499 struct cam_periph *periph; in sgioctl() local
504 periph = (struct cam_periph *)dev->si_drv1; in sgioctl()
505 cam_periph_lock(periph); in sgioctl()
507 softc = (struct sg_softc *)periph->softc; in sgioctl()
546 ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL); in sgioctl()
583 error = sgsendccb(periph, ccb); in sgioctl()
619 id->host_no = cam_sim_path(xpt_path_sim(periph->path)); in sgioctl()
620 id->channel = xpt_path_path_id(periph->path); in sgioctl()
621 id->scsi_id = xpt_path_target_id(periph->path); in sgioctl()
622 id->lun = xpt_path_lun_id(periph->path); in sgioctl()
664 cam_periph_unlock(periph); in sgioctl()
672 struct cam_periph *periph; in sgwrite() local
681 periph = dev->si_drv1; in sgwrite()
751 cam_periph_lock(periph); in sgwrite()
752 sc = periph->softc; in sgwrite()
753 xpt_setup_ccb(&ccb->ccb_h, periph->path, CAM_PRIORITY_NORMAL); in sgwrite()
777 error = sgsendrdwr(periph, ccb); in sgwrite()
778 cam_periph_unlock(periph); in sgwrite()
794 struct cam_periph *periph; in sgread() local
801 periph = dev->si_drv1; in sgread()
815 cam_periph_lock(periph); in sgread()
816 sc = periph->softc; in sgread()
823 if (cam_periph_sleep(periph, rdwr, PCATCH, "sgread", 0) == ERESTART) in sgread()
828 cam_periph_unlock(periph); in sgread()
872 cam_periph_lock(periph); in sgread()
874 cam_periph_unlock(periph); in sgread()
881 sgsendccb(struct cam_periph *periph, union ccb *ccb) in sgsendccb() argument
887 softc = periph->softc; in sgsendccb()
897 cam_periph_unlock(periph); in sgsendccb()
899 cam_periph_lock(periph); in sgsendccb()
909 cam_periph_unlock(periph); in sgsendccb()
913 cam_periph_lock(periph); in sgsendccb()
919 sgsendrdwr(struct cam_periph *periph, union ccb *ccb) in sgsendrdwr() argument
923 softc = periph->softc; in sgsendrdwr()