Lines Matching refs:stp

105     struct ast_softc *stp;
109 if (!(stp = malloc(sizeof(struct ast_softc), M_AST, M_NOWAIT | M_ZERO))) {
113 device_set_ivars(dev, stp);
118 free(stp, M_AST);
125 stp->flags |= F_ONSTREAM;
137 stp->stats = devstat_new_entry("ast", device_get_unit(dev), DEV_BSIZE,
145 stp->dev1 = device;
150 stp->dev2 = device;
160 struct ast_softc *stp = device_get_ivars(dev);
163 destroy_dev(stp->dev1);
164 destroy_dev(stp->dev2);
170 devstat_remove_entry(stp->stats);
172 free(stp, M_AST);
205 struct ast_softc *stp = device_get_ivars(dev);
207 if (!stp)
213 if (stp->cap.lock)
219 stp->flags &= ~(F_DATA_WRITTEN | F_FM_WRITTEN);
228 struct ast_softc *stp = device_get_ivars(dev);
231 if (stp->cap.ctl && (stp->flags & F_DATA_WRITTEN))
235 if (!(stp->flags & F_ONSTREAM) &&
236 (stp->flags & (F_DATA_WRITTEN | F_FM_WRITTEN)) == F_DATA_WRITTEN)
243 if (stp->cap.lock && count_dev(cdev) == 1)
246 stp->flags &= ~F_CTL_WARN;
257 struct ast_softc *stp = device_get_ivars(dev);
268 g->mt_blksiz = stp->blksize;
269 g->mt_comp = stp->cap.compress;
376 struct ast_softc *stp = device_get_ivars(dev);
387 if (!(bp->bio_cmd == BIO_READ) && stp->flags & F_WRITEPROTECT) {
393 if (bp->bio_bcount % stp->blksize) {
394 device_printf(dev, "transfers must be multiple of %d\n", stp->blksize);
400 if (bp->bio_bcount > stp->blksize * stp->cap.ctl) {
401 if ((stp->flags & F_CTL_WARN) == 0) {
403 bp->bio_bcount, stp->blksize * stp->cap.ctl);
404 stp->flags |= F_CTL_WARN;
415 blkcount = bp->bio_bcount / stp->blksize;
430 request->bytecount = blkcount * stp->blksize;
448 devstat_start_transaction_bio(stp->stats, bp);
455 struct ast_softc *stp = device_get_ivars(request->dev);
462 stp->flags |= F_DATA_WRITTEN;
465 biofinish(bp, stp->stats, 0);
472 struct ast_softc *stp = device_get_ivars(dev);
478 &stp->cap, sizeof(stp->cap)) &&
479 stp->cap.page_code == ATAPI_TAPE_CAP_PAGE) {
480 if (stp->cap.blk32k)
481 stp->blksize = 32768;
482 if (stp->cap.blk1024)
483 stp->blksize = 1024;
484 if (stp->cap.blk512)
485 stp->blksize = 512;
486 if (!stp->blksize)
488 stp->cap.max_speed = ntohs(stp->cap.max_speed);
489 stp->cap.max_defects = ntohs(stp->cap.max_defects);
490 stp->cap.ctl = ntohs(stp->cap.ctl);
491 stp->cap.speed = ntohs(stp->cap.speed);
492 stp->cap.buffer_size = ntohs(stp->cap.buffer_size);
522 struct ast_softc *stp = device_get_ivars(dev);
527 if (stp->flags & F_ONSTREAM)
531 if (stp->flags & F_FM_WRITTEN)
532 stp->flags &= ~F_DATA_WRITTEN;
534 stp->flags |= F_FM_WRITTEN;
592 struct ast_softc *stp = device_get_ivars(dev);
597 if ((function & ATAPI_SS_EJECT) && !stp->cap.eject)
666 struct ast_softc *stp = device_get_ivars(dev);
672 device_printf(dev, "%dKB/s, ", stp->cap.max_speed);
674 stp->cap.ctl, (stp->cap.ctl > 1) ? "s" : "");
675 printf("%dKB buffer, ", (stp->cap.buffer_size * DEV_BSIZE) / 1024);
679 switch (stp->cap.medium_type) {
689 printf("unknown (0x%x)", stp->cap.medium_type);
691 if (stp->cap.readonly) printf(", readonly");
692 if (stp->cap.reverse) printf(", reverse");
693 if (stp->cap.eformat) printf(", eformat");
694 if (stp->cap.qfa) printf(", qfa");
695 if (stp->cap.lock) printf(", lock");
696 if (stp->cap.locked) printf(", locked");
697 if (stp->cap.prevent) printf(", prevent");
698 if (stp->cap.eject) printf(", eject");
699 if (stp->cap.disconnect) printf(", disconnect");
700 if (stp->cap.ecc) printf(", ecc");
701 if (stp->cap.compress) printf(", compress");
702 if (stp->cap.blk512) printf(", 512b");
703 if (stp->cap.blk1024) printf(", 1024b");
704 if (stp->cap.blk32k) printf(", 32kb");