Lines Matching defs:periph
141 struct cam_periph *periph;
167 static void passdone(struct cam_periph *periph,
169 static int passcreatezone(struct cam_periph *periph);
172 static int passcopysglist(struct cam_periph *periph,
175 static int passmemsetup(struct cam_periph *periph,
177 static int passmemdone(struct cam_periph *periph,
181 static int passsendccb(struct cam_periph *periph, union ccb *ccb,
232 passrejectios(struct cam_periph *periph)
237 softc = (struct pass_softc *)periph->softc;
280 cam_periph_doacquire(periph);
288 struct cam_periph *periph;
293 periph = (struct cam_periph *)arg;
294 mtx = cam_periph_mtx(periph);
297 softc = (struct pass_softc *)periph->softc;
307 cam_periph_release_locked(periph);
315 cam_periph_release_locked(periph);
316 passrejectios(periph);
321 * cam_periph_release_locked() above could result in the periph
322 * getting freed. If that is the case, dereferencing the periph
336 passoninvalidate(struct cam_periph *periph)
340 softc = (struct pass_softc *)periph->softc;
345 xpt_register_async(0, passasync, periph, periph->path);
353 destroy_dev_sched_cb(softc->dev, passdevgonecb, periph);
357 passcleanup(struct cam_periph *periph)
361 softc = (struct pass_softc *)periph->softc;
363 cam_periph_assert(periph, MA_OWNED);
379 cam_periph_unlock(periph);
388 * is because we hold a reference on the periph for kqueue, and
411 cam_periph_lock(periph);
419 struct cam_periph *periph;
422 periph = context;
423 softc = periph->softc;
431 cam_periph_release(periph);
437 struct cam_periph *periph;
446 periph = context;
447 softc = periph->softc;
449 mtx = cam_periph_mtx(periph);
452 if (periph->flags & CAM_PERIPH_INVALID)
456 "GEOM::physpath", periph->path) == 0
474 * We always acquire a reference to the periph before queueing this
478 cam_periph_release_locked(periph);
488 struct cam_periph *periph;
490 periph = (struct cam_periph *)callback_arg;
533 softc = (struct pass_softc *)periph->softc;
535 * Acquire a reference to the periph before we
537 * a situation where the periph goes away before
540 if (cam_periph_acquire(periph) != 0)
549 cam_periph_async(periph, code, path, arg);
555 passregister(struct cam_periph *periph, void *arg)
587 periph->softc = softc;
588 softc->periph = periph;
594 periph->periph_name, periph->unit_number);
596 periph->periph_name, periph->unit_number);
598 knlist_init_mtx(&softc->read_select.si_note, cam_periph_mtx(periph));
600 xpt_path_inq(&cpi, periph->path);
617 cam_periph_unlock(periph);
620 periph->unit_number, 0,
632 pass_shutdown_kqueue, periph);
635 * Acquire a reference to the periph that we can release once we've
638 if (cam_periph_acquire(periph) != 0) {
639 xpt_print(periph->path, "%s: lost periph during "
641 cam_periph_lock(periph);
646 * Acquire a reference to the periph before we create the devfs
650 if (cam_periph_acquire(periph) != 0) {
651 xpt_print(periph->path, "%s: lost periph during "
653 cam_periph_lock(periph);
660 args.mda_unit = periph->unit_number;
664 args.mda_si_drv1 = periph;
666 error = make_dev_s(&args, &softc->dev, "%s%d", periph->periph_name,
667 periph->unit_number);
669 cam_periph_lock(periph);
670 cam_periph_release_locked(periph);
675 * Hold a reference to the periph before we create the physical
678 if (cam_periph_acquire(periph) != 0) {
679 xpt_print(periph->path, "%s: lost periph during "
681 cam_periph_lock(periph);
685 cam_periph_lock(periph);
688 pass_add_physpath, periph);
702 passasync, periph, periph->path);
705 xpt_announce_periph(periph, NULL);
713 struct cam_periph *periph;
717 periph = (struct cam_periph *)dev->si_drv1;
718 if (cam_periph_acquire(periph) != 0)
721 cam_periph_lock(periph);
723 softc = (struct pass_softc *)periph->softc;
726 cam_periph_release_locked(periph);
727 cam_periph_unlock(periph);
736 cam_periph_release_locked(periph);
737 cam_periph_unlock(periph);
745 cam_periph_release_locked(periph);
746 cam_periph_unlock(periph);
754 xpt_print(periph->path, "can't do nonblocking access\n");
755 cam_periph_release_locked(periph);
756 cam_periph_unlock(periph);
762 cam_periph_unlock(periph);
770 struct cam_periph *periph;
774 periph = (struct cam_periph *)dev->si_drv1;
775 mtx = cam_periph_mtx(periph);
778 softc = periph->softc;
806 cam_periph_doacquire(periph);
827 cam_periph_release_locked(periph);
832 * cam_periph_release_locked() above could result in the periph
833 * getting freed. If that is the case, dereferencing the periph
847 passstart(struct cam_periph *periph, union ccb *start_ccb)
851 softc = (struct pass_softc *)periph->softc;
886 xpt_schedule(periph, CAM_PRIORITY_NORMAL);
895 passdone(struct cam_periph *periph, union ccb *done_ccb)
900 softc = (struct pass_softc *)periph->softc;
902 cam_periph_assert(periph, MA_OWNED);
911 xpt_print(periph->path, "%s: called for user CCB %p\n",
1012 * our reference to the periph since we won't have
1018 cam_periph_release_locked(periph);
1034 passcreatezone(struct cam_periph *periph)
1040 softc = (struct pass_softc *)periph->softc;
1042 cam_periph_assert(periph, MA_OWNED);
1059 cam_periph_unlock(periph);
1069 cam_periph_lock(periph);
1074 xpt_print(periph->path, "unable to allocate "
1077 xpt_print(periph->path, "unable to allocate "
1099 cam_periph_mtx(periph), PRIBIO,
1212 passcopysglist(struct cam_periph *periph, struct pass_io_req *io_req,
1244 xpt_print(periph->path, "%s: copyout of %u "
1253 xpt_print(periph->path, "%s: copyin of %u "
1278 passmemsetup(struct cam_periph *periph, struct pass_io_req *io_req)
1291 cam_periph_assert(periph, MA_NOTOWNED);
1293 softc = periph->softc;
1424 xpt_print(periph->path, "%s: data length %u > max allowed %u "
1449 xpt_print(periph->path, "%s: malloced %p len %u, user "
1463 xpt_print(periph->path, "%s: copy of user "
1487 xpt_print(periph->path, "%s: cannot currently handle "
1497 xpt_print(periph->path, "%s: CAM_DATA_SG flag set, "
1508 xpt_print(periph->path, "%s: no dxfer_len specified, "
1547 xpt_print(periph->path, "%s: copy of user S/G list "
1590 error = passcopysglist(periph, io_req, dirs[0]);
1610 xpt_print(periph->path, "%s: CAM_DATA_SG_PADDR flag "
1621 xpt_print(periph->path, "%s: no dxfer_len specified, "
1646 xpt_print(periph->path, "%s: copy of user S/G list "
1672 passmemdone(struct cam_periph *periph, struct pass_io_req *io_req)
1679 softc = (struct pass_softc *)periph->softc;
1693 xpt_print(periph->path, "Unable to copy %u "
1711 error = passcopysglist(periph, io_req, io_req->dirs[0]);
1749 struct cam_periph *periph;
1754 periph = (struct cam_periph *)dev->si_drv1;
1755 cam_periph_lock(periph);
1756 softc = (struct pass_softc *)periph->softc;
1783 xpt_print(periph->path, "CCB function code %#x is "
1803 ccb = cam_periph_getccb(periph, priority);
1809 xpt_setup_ccb(&ccb->ccb_h, periph->path,
1815 xpt_print(periph->path, "unable to allocate CCB\n");
1820 error = passsendccb(periph, ccb, inccb);
1842 error = passcreatezone(periph);
1851 cam_periph_unlock(periph);
1869 xpt_print(periph->path, "Copying user CCB %p to "
1874 xpt_print(periph->path, "Copy of user CCB %p to "
1906 xpt_print(periph->path, "CCB function code %#x is "
1938 xpt_setup_ccb_flags(&ccb->ccb_h, periph->path, priority,
1956 error = passmemsetup(periph, io_req);
1962 cam_periph_lock(periph);
1977 xpt_schedule(periph, priority);
2006 cam_periph_lock(periph);
2039 cam_periph_unlock(periph);
2045 error = passmemdone(periph, io_req);
2053 xpt_print(periph->path, "Copying to user CCB %p from "
2059 xpt_print(periph->path, "Copy to user CCB %p from "
2071 cam_periph_lock(periph);
2083 error = cam_periph_ioctl(periph, cmd, addr, passerror);
2088 cam_periph_unlock(periph);
2096 struct cam_periph *periph;
2100 periph = (struct cam_periph *)dev->si_drv1;
2101 softc = (struct pass_softc *)periph->softc;
2105 cam_periph_lock(periph);
2110 cam_periph_unlock(periph);
2121 struct cam_periph *periph;
2124 periph = (struct cam_periph *)dev->si_drv1;
2125 softc = (struct pass_softc *)periph->softc;
2127 kn->kn_hook = (caddr_t)periph;
2137 struct cam_periph *periph;
2140 periph = (struct cam_periph *)kn->kn_hook;
2141 softc = (struct pass_softc *)periph->softc;
2149 struct cam_periph *periph;
2153 periph = (struct cam_periph *)kn->kn_hook;
2154 softc = (struct pass_softc *)periph->softc;
2156 cam_periph_assert(periph, MA_OWNED);
2171 passsendccb(struct cam_periph *periph, union ccb *ccb, union ccb *inccb)
2179 softc = (struct pass_softc *)periph->softc;
2211 cam_periph_unlock(periph);
2213 cam_periph_lock(periph);
2238 cam_periph_unlock(periph);
2240 cam_periph_lock(periph);