Home | History | Annotate | Download | only in mscp

Lines Matching refs:mt

114 CFATTACH_DECL_NEW(mt, sizeof(struct mt_softc),
177 struct mt_softc *mt = device_private(self);
182 mt->mt_dev = self;
183 mt->mt_hwunit = mp->mscp_unit;
194 mt_putonline(struct mt_softc *mt)
198 device_private(device_parent(mt->mt_dev));
200 ((volatile struct mt_softc *) mt)->mt_state = MT_OFFLINE;
203 mp->mscp_unit = mt->mt_hwunit;
204 mp->mscp_cmdref = (long)&mt->mt_state;
209 if (tsleep(&mt->mt_state, PRIBIO, "mtonline", 240 * hz))
212 if ((volatile int)mt->mt_state != MT_ONLINE)
224 struct mt_softc *mt;
231 mt = device_lookup_private(&mt_cd, unit);
232 if (!mt)
235 if (mt->mt_inuse)
237 mt->mt_inuse = 1;
239 if (mt_putonline(mt) == MSCP_FAILED) {
240 mt->mt_inuse = 0;
252 struct mt_softc *mt = device_lookup_private(&mt_cd, unit);
257 if ((flags & FWRITE) && mt->mt_waswrite) {
258 mtcmd(mt, MTWEOF, 0, 0);
259 mtcmd(mt, MTWEOF, 0, 0);
260 mtcmd(mt, MTBSR, 1, 0);
263 mtcmd(mt, MTREW, 0, 1);
264 if (mt->mt_serex)
265 mtcmd(mt, -1, 0, 0);
267 mt->mt_inuse = 0; /* Release the tape */
275 struct mt_softc *mt;
281 if ((mt = device_lookup_private(&mt_cd, unit)) == NULL) {
287 mt->mt_waswrite = bp->b_flags & B_READ ? 0 : 1;
288 mscp_strategy(bp, device_parent(mt->mt_dev));
320 struct mt_softc *mt = device_lookup_private(&mt_cd, unit);
322 mp->mscp_unit = mt->mt_hwunit;
323 if (mt->mt_serex == 2) {
325 mt->mt_serex = 0;
338 if (mscp_decodeerror(usc == NULL?"unconf mt" : device_xname(usc), mp, mi))
349 struct mt_softc *mt = (void *)usc;
351 wakeup((void *)&mt->mt_state);
353 mt->mt_state = MT_ONLINE;
394 struct mt_softc *mt = (void *)usc;
398 mt->mt_serex = 1;
400 mt->mt_serex = 2;
403 printf("%s: error %d (%s)\n", device_xname(mt->mt_dev), st,
406 printf("%s: error %d\n", device_xname(mt->mt_dev), st);
420 struct mt_softc *mt = device_lookup_private(&mt_cd, unit);
430 if ((error = mtcmd(mt, mtop->mt_op, 0, 0)))
433 error = mtcmd(mt, mtop->mt_op, mtop->mt_count, 0);
465 mtcmd(struct mt_softc *mt, int cmd, int count, int complete)
468 struct mscp_softc *mi = device_private(device_parent(mt->mt_dev));
472 mt->mt_ioctlerr = 0;
473 mp->mscp_unit = mt->mt_hwunit;
502 mt->mt_serex = 0;
508 mt->mt_serex = 0;
518 mt->mt_serex = 0;
528 tsleep(&mt->mt_inuse, PRIBIO, "mtioctl", 0);
529 return mt->mt_ioctlerr;
538 struct mt_softc *mt = (void *)usc;
541 mt->mt_ioctlerr = EIO;
542 printf("%s: bad status %x\n", device_xname(mt->mt_dev),
545 wakeup(&mt->mt_inuse);