Lines Matching defs:periph

123 static void		sgdone(struct cam_periph *periph, union ccb *done_ccb);
124 static int sgsendccb(struct cam_periph *periph, union ccb *ccb);
125 static int sgsendrdwr(struct cam_periph *periph, union ccb *ccb);
173 struct cam_periph *periph;
178 periph = (struct cam_periph *)arg;
179 mtx = cam_periph_mtx(periph);
182 softc = (struct sg_softc *)periph->softc;
192 cam_periph_release_locked(periph);
199 cam_periph_release_locked(periph);
204 * cam_periph_release_locked() above could result in the periph
205 * getting freed. If that is the case, dereferencing the periph
213 sgoninvalidate(struct cam_periph *periph)
217 softc = (struct sg_softc *)periph->softc;
222 xpt_register_async(0, sgasync, periph, periph->path);
230 destroy_dev_sched_cb(softc->dev, sgdevgonecb, periph);
241 sgcleanup(struct cam_periph *periph)
245 softc = (struct sg_softc *)periph->softc;
255 struct cam_periph *periph;
257 periph = (struct cam_periph *)callback_arg;
291 cam_periph_async(periph, code, path, arg);
297 sgregister(struct cam_periph *periph, void *arg)
321 periph->softc = softc;
324 xpt_setup_ccb(&cpi.ccb_h, periph->path, CAM_PRIORITY_NORMAL);
332 cam_periph_unlock(periph);
335 periph->unit_number, 0,
344 * Acquire a reference to the periph before we create the devfs
348 if (cam_periph_acquire(periph) != CAM_REQ_CMP) {
349 xpt_print(periph->path, "%s: lost periph during "
351 cam_periph_lock(periph);
356 softc->dev = make_dev(&sg_cdevsw, periph->unit_number,
358 periph->periph_name, periph->unit_number);
359 if (periph->unit_number < 26) {
361 periph->unit_number + 'a');
364 ((periph->unit_number / 26) - 1) + 'a',
365 (periph->unit_number % 26) + 'a');
367 cam_periph_lock(periph);
368 softc->dev->si_drv1 = periph;
374 xpt_register_async(AC_LOST_DEVICE, sgasync, periph, periph->path);
377 xpt_announce_periph(periph, NULL);
383 sgdone(struct cam_periph *periph, union ccb *done_ccb)
388 softc = (struct sg_softc *)periph->softc;
419 struct cam_periph *periph;
423 periph = (struct cam_periph *)dev->si_drv1;
424 if (periph == NULL)
427 if (cam_periph_acquire(periph) != CAM_REQ_CMP)
435 cam_periph_release(periph);
439 cam_periph_lock(periph);
441 softc = (struct sg_softc *)periph->softc;
443 cam_periph_release_locked(periph);
444 cam_periph_unlock(periph);
450 cam_periph_unlock(periph);
458 struct cam_periph *periph;
462 periph = (struct cam_periph *)dev->si_drv1;
463 if (periph == NULL)
465 mtx = cam_periph_mtx(periph);
468 softc = periph->softc;
471 cam_periph_release_locked(periph);
476 * cam_periph_release_locked() above could result in the periph
477 * getting freed. If that is the case, dereferencing the periph
495 struct cam_periph *periph;
500 periph = (struct cam_periph *)dev->si_drv1;
501 if (periph == NULL)
504 cam_periph_lock(periph);
506 softc = (struct sg_softc *)periph->softc;
545 ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL);
582 error = sgsendccb(periph, ccb);
618 id->host_no = cam_sim_path(xpt_path_sim(periph->path));
619 id->channel = xpt_path_path_id(periph->path);
620 id->scsi_id = xpt_path_target_id(periph->path);
621 id->lun = xpt_path_lun_id(periph->path);
663 cam_periph_unlock(periph);
671 struct cam_periph *periph;
680 periph = dev->si_drv1;
750 cam_periph_lock(periph);
751 sc = periph->softc;
752 xpt_setup_ccb(&ccb->ccb_h, periph->path, CAM_PRIORITY_NORMAL);
776 error = sgsendrdwr(periph, ccb);
777 cam_periph_unlock(periph);
793 struct cam_periph *periph;
800 periph = dev->si_drv1;
814 cam_periph_lock(periph);
815 sc = periph->softc;
822 if (cam_periph_sleep(periph, rdwr, PCATCH, "sgread", 0) == ERESTART)
827 cam_periph_unlock(periph);
871 cam_periph_lock(periph);
873 cam_periph_unlock(periph);
880 sgsendccb(struct cam_periph *periph, union ccb *ccb)
886 softc = periph->softc;
896 cam_periph_unlock(periph);
898 cam_periph_lock(periph);
914 sgsendrdwr(struct cam_periph *periph, union ccb *ccb)
918 softc = periph->softc;
927 struct cam_periph *periph;
930 periph = xpt_path_periph(ccb->ccb_h.path);
931 softc = (struct sg_softc *)periph->softc;