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

Lines Matching defs:periph

151 static	void		ndadone(struct cam_periph *periph,
201 * we ever grow another NVME periph, we should move them
278 struct cam_periph *periph;
282 periph = (struct cam_periph *)dp->d_drv1;
283 if (cam_periph_acquire(periph) != 0) {
287 cam_periph_lock(periph);
288 if ((error = cam_periph_hold(periph, PRIBIO|PCATCH)) != 0) {
289 cam_periph_unlock(periph);
290 cam_periph_release(periph);
294 CAM_DEBUG(periph->path, CAM_DEBUG_TRACE | CAM_DEBUG_PERIPH,
297 softc = (struct nda_softc *)periph->softc;
300 cam_periph_unhold(periph);
301 cam_periph_unlock(periph);
308 struct cam_periph *periph;
313 periph = (struct cam_periph *)dp->d_drv1;
314 softc = (struct nda_softc *)periph->softc;
315 cam_periph_lock(periph);
317 CAM_DEBUG(periph->path, CAM_DEBUG_TRACE | CAM_DEBUG_PERIPH,
321 (periph->flags & CAM_PERIPH_INVALID) == 0 &&
322 cam_periph_hold(periph, PRIBIO) == 0) {
324 ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL);
330 xpt_print(periph->path, "Synchronize cache failed\n");
334 cam_periph_unhold(periph);
340 cam_periph_sleep(periph, &softc->refcount, PRIBIO, "ndaclose", 1);
343 cam_periph_unlock(periph);
344 cam_periph_release(periph);
349 ndaschedule(struct cam_periph *periph)
351 struct nda_softc *softc = (struct nda_softc *)periph->softc;
356 cam_iosched_schedule(softc->cam_iosched, periph);
363 struct cam_periph *periph;
366 periph = (struct cam_periph *)dp->d_drv1;
367 softc = (struct nda_softc *)periph->softc;
382 xpt_path_inq(&cpi, periph->path);
401 xpt_setup_ccb(&ccb->ccb_h, periph->path, CAM_PRIORITY_NORMAL);
421 * Lock the periph and run the command. XXX do we need
422 * to lock the periph?
424 cam_periph_lock(periph);
427 cam_periph_unlock(periph);
433 cam_periph_lock(periph);
452 struct cam_periph *periph;
455 periph = (struct cam_periph *)bp->bio_disk->d_drv1;
456 softc = (struct nda_softc *)periph->softc;
458 cam_periph_lock(periph);
460 CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("ndastrategy(%p)\n", bp));
465 if ((periph->flags & CAM_PERIPH_INVALID) != 0) {
466 cam_periph_unlock(periph);
482 ndaschedule(periph);
483 cam_periph_unlock(periph);
491 struct cam_periph *periph;
501 periph = dp->d_drv1;
502 softc = (struct nda_softc *)periph->softc;
507 if ((periph->flags & CAM_PERIPH_INVALID) != 0)
513 xpt_setup_ccb(&nvmeio.ccb_h, periph->path, CAM_PRIORITY_NORMAL);
525 xpt_setup_ccb(&nvmeio.ccb_h, periph->path, CAM_PRIORITY_NORMAL);
532 xpt_print(periph->path, "flush cmd failed\n");
569 struct cam_periph *periph;
571 periph = (struct cam_periph *)dp->d_drv1;
573 cam_periph_release(periph);
577 ndaoninvalidate(struct cam_periph *periph)
581 softc = (struct nda_softc *)periph->softc;
586 xpt_register_async(0, ndaasync, periph, periph->path);
602 ndacleanup(struct cam_periph *periph)
606 softc = (struct nda_softc *)periph->softc;
608 cam_periph_unlock(periph);
618 xpt_print(periph->path,
622 xpt_print(periph->path,
628 cam_periph_lock(periph);
635 struct cam_periph *periph;
637 periph = (struct cam_periph *)callback_arg;
676 softc = periph->softc;
684 cam_periph_async(periph, code, path, arg);
692 struct cam_periph *periph;
696 periph = (struct cam_periph *)context;
698 /* periph was held for us when this task was enqueued */
699 if ((periph->flags & CAM_PERIPH_INVALID) != 0) {
700 cam_periph_release(periph);
704 softc = (struct nda_softc *)periph->softc;
705 snprintf(tmpstr, sizeof(tmpstr), "CAM NDA unit %d", periph->unit_number);
706 snprintf(tmpstr2, sizeof(tmpstr2), "%d", periph->unit_number);
715 cam_periph_release(periph);
741 cam_periph_release(periph);
764 periph, 0, cam_periph_invalidate_sysctl, "I",
771 cam_periph_release(periph);
778 struct cam_periph *periph;
780 periph = (struct cam_periph *)bp->bio_disk->d_drv1;
781 cam_periph_lock(periph);
783 periph->path);
784 cam_periph_unlock(periph);
791 ndaregister(struct cam_periph *periph, void *arg)
803 nsd = nvme_get_identify_ns(periph);
804 cd = nvme_get_identify_cntrl(periph);
815 if (cam_iosched_init(&softc->cam_iosched, periph) != 0) {
824 periph->softc = softc;
826 xpt_path_inq(&cpi, periph->path);
827 TASK_INIT(&softc->sysctl_task, 0, ndasysctlinit, periph);
832 softc->nsid = (uint32_t)xpt_path_lun_id(periph->path);
837 (void)cam_periph_hold(periph, PRIBIO);
838 cam_periph_unlock(periph);
840 "kern.cam.nda.%d.quirks", periph->unit_number);
855 disk->d_drv1 = periph;
856 disk->d_unit = periph->unit_number;
899 disk->d_devstat = devstat_new_entry(periph->periph_name,
900 periph->unit_number, disk->d_sectorsize,
910 * Acquire a reference to the periph before we register with GEOM.
914 if (cam_periph_acquire(periph) != 0) {
915 xpt_print(periph->path, "%s: lost periph during "
917 cam_periph_lock(periph);
921 cam_periph_lock(periph);
922 cam_periph_unhold(periph);
929 xpt_announce_periph(periph, announce_buf);
930 xpt_announce_quirks(periph, softc->quirks, NDA_Q_BIT_STRING);
936 if (cam_periph_acquire(periph) == 0)
944 ndaasync, periph, periph->path);
951 ndastart(struct cam_periph *periph, union ccb *start_ccb)
953 struct nda_softc *softc = (struct nda_softc *)periph->softc;
956 CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("ndastart\n"));
964 CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("ndastart: bio %p\n", bp));
1009 ndaschedule(periph);
1032 ndaschedule(periph);
1077 cam_periph_unlock(periph);
1079 cam_periph_lock(periph);
1083 ndaschedule(periph);
1090 ndadone(struct cam_periph *periph, union ccb *done_ccb)
1097 softc = (struct nda_softc *)periph->softc;
1109 cam_periph_lock(periph);
1114 cam_periph_unlock(periph);
1149 ndaschedule(periph);
1150 cam_periph_unlock(periph);
1177 ndaschedule(periph);
1178 cam_periph_unlock(periph);
1209 struct cam_periph *periph;
1211 periph = xpt_path_periph(ccb->ccb_h.path);
1212 softc = (struct nda_softc *)periph->softc;
1244 struct cam_periph *periph;
1249 CAM_PERIPH_FOREACH(periph, &ndadriver) {
1250 softc = (struct nda_softc *)periph->softc;
1254 * If we paniced with the lock held or the periph is not
1259 if (!cam_periph_owned(periph) &&
1269 cam_periph_lock(periph);
1271 cam_periph_unlock(periph);
1275 ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL);
1281 xpt_print(periph->path, "Synchronize cache failed\n");
1283 cam_periph_unlock(periph);