• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-13-stable/sys/cam/nvme/

Lines Matching defs:periph

160 static	void		ndadone(struct cam_periph *periph,
216 * we ever grow another NVME periph, we should move them
293 struct cam_periph *periph;
297 periph = (struct cam_periph *)dp->d_drv1;
298 if (cam_periph_acquire(periph) != 0) {
302 cam_periph_lock(periph);
303 if ((error = cam_periph_hold(periph, PRIBIO|PCATCH)) != 0) {
304 cam_periph_unlock(periph);
305 cam_periph_release(periph);
309 CAM_DEBUG(periph->path, CAM_DEBUG_TRACE | CAM_DEBUG_PERIPH,
312 softc = (struct nda_softc *)periph->softc;
315 cam_periph_unhold(periph);
316 cam_periph_unlock(periph);
323 struct cam_periph *periph;
328 periph = (struct cam_periph *)dp->d_drv1;
329 softc = (struct nda_softc *)periph->softc;
330 cam_periph_lock(periph);
332 CAM_DEBUG(periph->path, CAM_DEBUG_TRACE | CAM_DEBUG_PERIPH,
336 (periph->flags & CAM_PERIPH_INVALID) == 0 &&
337 cam_periph_hold(periph, PRIBIO) == 0) {
338 ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL);
344 xpt_print(periph->path, "Synchronize cache failed\n");
348 cam_periph_unhold(periph);
354 cam_periph_sleep(periph, &softc->refcount, PRIBIO, "ndaclose", 1);
357 cam_periph_unlock(periph);
358 cam_periph_release(periph);
363 ndaschedule(struct cam_periph *periph)
365 struct nda_softc *softc = (struct nda_softc *)periph->softc;
370 cam_iosched_schedule(softc->cam_iosched, periph);
377 struct cam_periph *periph;
380 periph = (struct cam_periph *)dp->d_drv1;
381 softc = (struct nda_softc *)periph->softc;
396 xpt_path_inq(&cpi, periph->path);
415 xpt_setup_ccb(&ccb->ccb_h, periph->path, CAM_PRIORITY_NORMAL);
435 * Lock the periph and run the command.
437 cam_periph_lock(periph);
444 cam_periph_unlock(periph);
448 cam_periph_lock(periph);
450 cam_periph_unlock(periph);
467 struct cam_periph *periph;
470 periph = (struct cam_periph *)bp->bio_disk->d_drv1;
471 softc = (struct nda_softc *)periph->softc;
473 cam_periph_lock(periph);
475 CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("ndastrategy(%p)\n", bp));
480 if ((periph->flags & CAM_PERIPH_INVALID) != 0) {
481 cam_periph_unlock(periph);
497 ndaschedule(periph);
498 cam_periph_unlock(periph);
506 struct cam_periph *periph;
516 periph = dp->d_drv1;
517 softc = (struct nda_softc *)periph->softc;
522 if ((periph->flags & CAM_PERIPH_INVALID) != 0)
528 xpt_setup_ccb(&nvmeio.ccb_h, periph->path, CAM_PRIORITY_NORMAL);
540 xpt_setup_ccb(&nvmeio.ccb_h, periph->path, CAM_PRIORITY_NORMAL);
547 xpt_print(periph->path, "flush cmd failed\n");
583 struct cam_periph *periph;
585 periph = (struct cam_periph *)dp->d_drv1;
587 cam_periph_release(periph);
591 ndaoninvalidate(struct cam_periph *periph)
595 softc = (struct nda_softc *)periph->softc;
600 xpt_register_async(0, ndaasync, periph, periph->path);
616 ndacleanup(struct cam_periph *periph)
620 softc = (struct nda_softc *)periph->softc;
622 cam_periph_unlock(periph);
632 xpt_print(periph->path,
636 xpt_print(periph->path,
642 cam_periph_lock(periph);
649 struct cam_periph *periph;
651 periph = (struct cam_periph *)callback_arg;
690 softc = periph->softc;
698 cam_periph_async(periph, code, path, arg);
706 struct cam_periph *periph;
710 periph = (struct cam_periph *)context;
712 /* periph was held for us when this task was enqueued */
713 if ((periph->flags & CAM_PERIPH_INVALID) != 0) {
714 cam_periph_release(periph);
718 softc = (struct nda_softc *)periph->softc;
719 snprintf(tmpstr, sizeof(tmpstr), "CAM NDA unit %d", periph->unit_number);
720 snprintf(tmpstr2, sizeof(tmpstr2), "%d", periph->unit_number);
729 cam_periph_release(periph);
769 cam_periph_release(periph);
792 periph, 0, cam_periph_invalidate_sysctl, "I",
799 cam_periph_release(periph);
824 struct cam_periph *periph;
829 periph = (struct cam_periph *)bp->bio_disk->d_drv1;
830 cam_periph_lock(periph);
832 periph->path);
833 cam_periph_unlock(periph);
840 ndaregister(struct cam_periph *periph, void *arg)
852 nsd = nvme_get_identify_ns(periph);
853 cd = nvme_get_identify_cntrl(periph);
864 if (cam_iosched_init(&softc->cam_iosched, periph) != 0) {
873 periph->softc = softc;
875 xpt_path_inq(&cpi, periph->path);
876 TASK_INIT(&softc->sysctl_task, 0, ndasysctlinit, periph);
881 softc->nsid = (uint32_t)xpt_path_lun_id(periph->path);
886 (void)cam_periph_hold(periph, PRIBIO);
887 cam_periph_unlock(periph);
889 "kern.cam.nda.%d.quirks", periph->unit_number);
901 if (cam_sim_pollable(periph->sim))
905 disk->d_drv1 = periph;
906 disk->d_unit = periph->unit_number;
951 disk->d_devstat = devstat_new_entry(periph->periph_name,
952 periph->unit_number, disk->d_sectorsize,
963 * Acquire a reference to the periph before we register with GEOM.
967 if (cam_periph_acquire(periph) != 0) {
968 xpt_print(periph->path, "%s: lost periph during "
970 cam_periph_lock(periph);
974 cam_periph_lock(periph);
975 cam_periph_unhold(periph);
982 xpt_announce_periph(periph, announce_buf);
983 xpt_announce_quirks(periph, softc->quirks, NDA_Q_BIT_STRING);
989 if (cam_periph_acquire(periph) == 0)
997 ndaasync, periph, periph->path);
1004 ndastart(struct cam_periph *periph, union ccb *start_ccb)
1006 struct nda_softc *softc = (struct nda_softc *)periph->softc;
1009 CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("ndastart\n"));
1017 CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("ndastart: bio %p\n", bp));
1062 ndaschedule(periph);
1086 ndaschedule(periph);
1131 ndaschedule(periph);
1140 cam_periph_unlock(periph);
1142 cam_periph_lock(periph);
1146 ndaschedule(periph);
1153 ndadone(struct cam_periph *periph, union ccb *done_ccb)
1160 softc = (struct nda_softc *)periph->softc;
1172 cam_periph_lock(periph);
1177 cam_periph_unlock(periph);
1212 ndaschedule(periph);
1213 cam_periph_unlock(periph);
1240 ndaschedule(periph);
1241 cam_periph_unlock(periph);
1273 struct cam_periph *periph;
1275 periph = xpt_path_periph(ccb->ccb_h.path);
1276 softc = (struct nda_softc *)periph->softc;
1308 struct cam_periph *periph;
1313 CAM_PERIPH_FOREACH(periph, &ndadriver) {
1314 softc = (struct nda_softc *)periph->softc;
1318 * If we paniced with the lock held or the periph is not
1323 if (!cam_periph_owned(periph) &&
1333 cam_periph_lock(periph);
1335 cam_periph_unlock(periph);
1339 ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL);
1345 xpt_print(periph->path, "Synchronize cache failed\n");
1347 cam_periph_unlock(periph);