Lines Matching defs:periph
151 static int cdcachesync(struct scsipi_periph *periph, int flags);
277 struct scsipi_periph *periph = sa->sa_periph;
280 SC_DEBUG(periph, SCSIPI_DB2, ("cdattach: "));
285 if (periph->periph_version == 0)
312 cd->sc_periph = periph;
314 periph->periph_dev = dksc->sc_dev;
315 periph->periph_switch = &cd_switch;
318 * Increase our openings to the maximum-per-periph
322 periph->periph_openings =
323 SCSIPI_CHAN_MAX_PERIPH(periph->periph_channel);
324 periph->periph_flags |= PERIPH_GROW_OPENINGS;
338 struct scsipi_periph *periph = cd->sc_periph;
339 struct scsipi_channel *chan = periph->periph_channel;
388 struct scsipi_periph *periph = cd->sc_periph;
389 struct scsipi_adapter *adapt = periph->periph_channel->chan_adapter;
408 error = scsipi_test_unit_ready(periph,
418 error = scsipi_start(periph, SSS_START, silent);
429 error = scsipi_prevent(periph, SPAMR_PREVENT_DT,
432 SC_DEBUG(periph, SCSIPI_DB1,
440 if ((periph->periph_flags & PERIPH_MEDIA_LOADED) == 0) {
449 periph->periph_flags |= PERIPH_MEDIA_LOADED;
451 SC_DEBUG(periph, SCSIPI_DB3, ("Params loaded "));
459 periph->periph_flags |= PERIPH_OPEN;
465 scsipi_prevent(periph, SPAMR_ALLOW,
483 struct scsipi_periph *periph;
493 periph = cd->sc_periph;
496 SC_DEBUG(periph, SCSIPI_DB1,
504 if ((periph->periph_flags & (PERIPH_OPEN | PERIPH_MEDIA_LOADED)) ==
512 SC_DEBUG(periph, SCSIPI_DB3, ("open complete\n"));
524 struct scsipi_periph *periph = cd->sc_periph;
525 struct scsipi_adapter *adapt = periph->periph_channel->chan_adapter;
529 (periph->periph_flags & PERIPH_MEDIA_LOADED) == 0)
534 cdcachesync(periph, silent);
536 scsipi_wait_drain(periph);
538 scsipi_prevent(periph, SPAMR_ALLOW,
542 periph->periph_flags &= ~PERIPH_OPEN;
544 scsipi_wait_drain(periph);
713 struct scsipi_periph *periph = cd->sc_periph;
724 if ((periph->periph_flags & PERIPH_MEDIA_LOADED) == 0) {
725 if (periph->periph_flags & PERIPH_OPEN)
767 struct scsipi_periph *periph = cd->sc_periph;
768 struct scsipi_channel *chan = periph->periph_channel;
775 SC_DEBUG(periph, SCSIPI_DB2, ("cdstart "));
779 if (periph->periph_active >= periph->periph_openings) {
789 if (periph->periph_flags & PERIPH_WAITING) {
790 periph->periph_flags &= ~PERIPH_WAITING;
791 cv_broadcast(periph_cv_periph(periph));
802 (periph->periph_flags & PERIPH_MEDIA_LOADED) == 0)) {
815 !(periph->periph_quirks & PQUIRK_ONLYBIG)) {
852 xs = scsipi_make_xs_locked(periph, cmdp, cmdlen,
896 cdstart(struct scsipi_periph *periph)
898 struct cd_softc *cd = device_private(periph->periph_dev);
900 struct scsipi_channel *chan = periph->periph_channel;
940 struct scsipi_periph *periph = xs->xs_periph;
964 SC_DEBUG(periph, SCSIPI_DB1, ("Waiting 5 sec for CD "
966 if (!callout_pending(&periph->periph_callout))
967 scsipi_periph_freeze(periph, 1);
968 callout_reset(&periph->periph_callout,
969 5 * hz, scsipi_periph_timed_thaw, periph);
988 if (!callout_pending(&periph->periph_callout))
989 scsipi_periph_freeze(periph, 1);
990 callout_reset(&periph->periph_callout,
991 hz/2, scsipi_periph_timed_thaw, periph);
1010 if (!callout_pending(&periph->periph_callout))
1011 scsipi_periph_freeze(periph, 1);
1012 callout_reset(&periph->periph_callout,
1013 hz/2, scsipi_periph_timed_thaw, periph);
1111 struct scsipi_periph *periph = cd->sc_periph;
1123 if (periph->periph_quirks & PQUIRK_LITTLETOC) {
1138 cdcachesync(struct scsipi_periph *periph, int flags) {
1154 return (scsipi_command(periph, (void *)&cmd, sizeof(cmd), 0, 0,
1207 struct scsipi_periph *periph = cd->sc_periph;
1218 if ((periph->periph_flags & PERIPH_MEDIA_LOADED) == 0 &&
1373 return (scsipi_start(periph, SSS_START, 0));
1375 return (scsipi_start(periph, SSS_STOP, 0));
1377 return (scsipi_start(periph, SSS_START|SSS_LOEJ,
1387 error = scsipi_prevent(periph, SPAMR_ALLOW,
1398 error = scsipi_start(periph, SSS_STOP|SSS_LOEJ, 0);
1405 return (cdcachesync(periph, 0));
1407 return (scsipi_prevent(periph, SPAMR_ALLOW, 0));
1409 return (scsipi_prevent(periph, SPAMR_PREVENT_DT, 0));
1411 return (scsipi_prevent(periph,
1436 return mmc_getdiscinfo(periph, (struct mmc_discinfo *) addr);
1439 return mmc_gettrackinfo(periph, (struct mmc_trackinfo *) addr);
1445 return mmc_do_op(periph, (struct mmc_op *) addr);
1448 return mmc_setup_writeparams(periph, (struct mmc_writeparams *) addr);
1452 error = scsipi_do_ioctl(periph, dev, cmd, addr, flag, l);
1465 struct scsipi_periph *periph = cd->sc_periph;
1473 if ((periph->periph_flags & PERIPH_MEDIA_LOADED) != 0) {
1500 read_cd_capacity(struct scsipi_periph *periph, uint32_t *blksize, u_long *last_lba)
1517 if (periph->periph_quirks & PQUIRK_NOCAPACITY)
1527 error = scsipi_command(periph,
1550 if (periph->periph_quirks & PQUIRK_NOREADDISCINFO)
1559 error = scsipi_command(periph,
1575 error = scsipi_command(periph,
2579 mmc_getdiscinfo_cdrom(struct scsipi_periph *periph,
2611 error = scsipi_command(periph,
2629 error = scsipi_command(periph,
2648 mmc_getdiscinfo_dvdrom(struct scsipi_periph *periph,
2676 error = scsipi_command(periph,
2696 mmc_getdiscinfo(struct scsipi_periph *periph,
2729 error = scsipi_command(periph,
2741 error = read_cd_capacity(periph, &mmc_discinfo->sector_size, &last_lba);
2758 error = scsipi_command(periph,
2836 error = scsipi_command(periph,
2844 error = mmc_getdiscinfo_cdrom(periph, mmc_discinfo);
2846 error = mmc_getdiscinfo_dvdrom(periph, mmc_discinfo);
2900 mmc_gettrackinfo_cdrom(struct scsipi_periph *periph,
2939 error = scsipi_command(periph,
2959 error = scsipi_command(periph,
3080 mmc_gettrackinfo_dvdrom(struct scsipi_periph *periph,
3118 error = scsipi_command(periph,
3137 error = scsipi_command(periph,
3213 mmc_gettrackinfo(struct scsipi_periph *periph,
3232 error = scsipi_command(periph,
3245 error = scsipi_command(periph,
3255 return mmc_gettrackinfo_cdrom(periph, trackinfo);
3257 return mmc_gettrackinfo_dvdrom(periph, trackinfo);
3315 mmc_doclose(struct scsipi_periph *periph, int param, int func) {
3326 error = scsipi_command(periph,
3335 mmc_do_closetrack(struct scsipi_periph *periph, struct mmc_op *mmc_op)
3349 return mmc_doclose(periph, mmc_op->tracknr, 1);
3353 mmc_do_close_or_finalise(struct scsipi_periph *periph, struct mmc_op *mmc_op)
3370 error = scsipi_mode_sense_big(periph, SMS_PF, 5,
3381 error = scsipi_mode_select_big(periph, SMS_PF,
3412 return mmc_doclose(periph, mmc_op->sessionnr, func);
3416 mmc_do_reserve_track(struct scsipi_periph *periph, struct mmc_op *mmc_op)
3432 error = scsipi_command(periph,
3441 mmc_do_reserve_track_nwa(struct scsipi_periph *periph, struct mmc_op *mmc_op)
3451 return mmc_do_reserve_track(periph, mmc_op);
3459 return mmc_do_reserve_track(periph, mmc_op);
3466 return mmc_do_reserve_track(periph, mmc_op);
3474 mmc_do_repair_track(struct scsipi_periph *periph, struct mmc_op *mmc_op)
3487 error = scsipi_command(periph,
3496 mmc_do_op(struct scsipi_periph *periph, struct mmc_op *mmc_op)
3504 return cdcachesync(periph, 0);
3517 return mmc_do_closetrack(periph, mmc_op);
3520 return mmc_do_close_or_finalise(periph, mmc_op);
3522 return mmc_do_reserve_track(periph, mmc_op);
3524 return mmc_do_reserve_track_nwa(periph, mmc_op);
3526 return mmc_do_repair_track(periph, mmc_op);
3538 mmc_setup_writeparams(struct scsipi_periph *periph,
3556 error = scsipi_mode_sense_big(periph, SMS_PF, 5, (void *)blob,
3578 error = mmc_gettrackinfo(periph, &trackinfo);
3618 error = scsipi_mode_select_big(periph, SMS_PF, (void *)blob,