tape 230 drivers/block/paride/pt.c static int pt_identify(struct pt_unit *tape); tape 267 drivers/block/paride/pt.c static inline u8 DRIVE(struct pt_unit *tape) tape 269 drivers/block/paride/pt.c return 0xa0+0x10*tape->drive; tape 272 drivers/block/paride/pt.c static int pt_wait(struct pt_unit *tape, int go, int stop, char *fun, char *msg) tape 275 drivers/block/paride/pt.c struct pi_adapter *pi = tape->pi; tape 291 drivers/block/paride/pt.c tape->name, fun, msg, r, s, e, j, p); tape 297 drivers/block/paride/pt.c static int pt_command(struct pt_unit *tape, char *cmd, int dlen, char *fun) tape 299 drivers/block/paride/pt.c struct pi_adapter *pi = tape->pi; tape 302 drivers/block/paride/pt.c write_reg(pi, 6, DRIVE(tape)); tape 304 drivers/block/paride/pt.c if (pt_wait(tape, STAT_BUSY | STAT_DRQ, 0, fun, "before command")) { tape 313 drivers/block/paride/pt.c if (pt_wait(tape, STAT_BUSY, STAT_DRQ, fun, "command DRQ")) { tape 319 drivers/block/paride/pt.c printk("%s: %s: command phase error\n", tape->name, fun); tape 329 drivers/block/paride/pt.c static int pt_completion(struct pt_unit *tape, char *buf, char *fun) tape 331 drivers/block/paride/pt.c struct pi_adapter *pi = tape->pi; tape 334 drivers/block/paride/pt.c r = pt_wait(tape, STAT_BUSY, STAT_DRQ | STAT_READY | STAT_ERR, tape 347 drivers/block/paride/pt.c s = pt_wait(tape, STAT_BUSY, STAT_READY | STAT_ERR, fun, "data done"); tape 354 drivers/block/paride/pt.c static void pt_req_sense(struct pt_unit *tape, int quiet) tape 360 drivers/block/paride/pt.c r = pt_command(tape, rs_cmd, 16, "Request sense"); tape 363 drivers/block/paride/pt.c pt_completion(tape, buf, "Request sense"); tape 365 drivers/block/paride/pt.c tape->last_sense = -1; tape 369 drivers/block/paride/pt.c tape->name, buf[2] & 0xf, buf[12], buf[13]); tape 370 drivers/block/paride/pt.c tape->last_sense = (buf[2] & 0xf) | ((buf[12] & 0xff) << 8) tape 375 drivers/block/paride/pt.c static int pt_atapi(struct pt_unit *tape, char *cmd, int dlen, char *buf, char *fun) tape 379 drivers/block/paride/pt.c r = pt_command(tape, cmd, dlen, fun); tape 382 drivers/block/paride/pt.c r = pt_completion(tape, buf, fun); tape 384 drivers/block/paride/pt.c pt_req_sense(tape, !fun); tape 394 drivers/block/paride/pt.c static int pt_poll_dsc(struct pt_unit *tape, int pause, int tmo, char *msg) tape 396 drivers/block/paride/pt.c struct pi_adapter *pi = tape->pi; tape 406 drivers/block/paride/pt.c write_reg(pi, 6, DRIVE(tape)); tape 415 drivers/block/paride/pt.c printk("%s: %s DSC timeout\n", tape->name, msg); tape 417 drivers/block/paride/pt.c printk("%s: %s stat=0x%x err=0x%x\n", tape->name, msg, s, tape 419 drivers/block/paride/pt.c pt_req_sense(tape, 0); tape 425 drivers/block/paride/pt.c static void pt_media_access_cmd(struct pt_unit *tape, int tmo, char *cmd, char *fun) tape 427 drivers/block/paride/pt.c if (pt_command(tape, cmd, 0, fun)) { tape 428 drivers/block/paride/pt.c pt_req_sense(tape, 0); tape 431 drivers/block/paride/pt.c pi_disconnect(tape->pi); tape 432 drivers/block/paride/pt.c pt_poll_dsc(tape, HZ, tmo, fun); tape 435 drivers/block/paride/pt.c static void pt_rewind(struct pt_unit *tape) tape 439 drivers/block/paride/pt.c pt_media_access_cmd(tape, PT_REWIND_TMO, rw_cmd, "rewind"); tape 442 drivers/block/paride/pt.c static void pt_write_fm(struct pt_unit *tape) tape 446 drivers/block/paride/pt.c pt_media_access_cmd(tape, PT_TMO, wm_cmd, "write filemark"); tape 451 drivers/block/paride/pt.c static int pt_reset(struct pt_unit *tape) tape 453 drivers/block/paride/pt.c struct pi_adapter *pi = tape->pi; tape 458 drivers/block/paride/pt.c write_reg(pi, 6, DRIVE(tape)); tape 472 drivers/block/paride/pt.c printk("%s: Reset (%d) signature = ", tape->name, k); tape 484 drivers/block/paride/pt.c static int pt_ready_wait(struct pt_unit *tape, int tmo) tape 491 drivers/block/paride/pt.c tape->last_sense = 0; tape 492 drivers/block/paride/pt.c pt_atapi(tape, tr_cmd, 0, NULL, DBMSG("test unit ready")); tape 493 drivers/block/paride/pt.c p = tape->last_sense; tape 528 drivers/block/paride/pt.c static int pt_identify(struct pt_unit *tape) tape 540 drivers/block/paride/pt.c s = pt_atapi(tape, id_cmd, 36, buf, "identify"); tape 548 drivers/block/paride/pt.c tape->name, tape->drive, dt); tape 555 drivers/block/paride/pt.c tape->flags = 0; tape 556 drivers/block/paride/pt.c tape->capacity = 0; tape 557 drivers/block/paride/pt.c tape->bs = 0; tape 559 drivers/block/paride/pt.c if (!pt_ready_wait(tape, PT_READY_TMO)) tape 560 drivers/block/paride/pt.c tape->flags |= PT_MEDIA; tape 562 drivers/block/paride/pt.c if (!pt_atapi(tape, ms_cmd, 36, buf, "mode sense")) { tape 564 drivers/block/paride/pt.c tape->flags |= PT_WRITE_OK; tape 565 drivers/block/paride/pt.c tape->bs = xn(buf, 10, 2); tape 568 drivers/block/paride/pt.c if (!pt_atapi(tape, ls_cmd, 36, buf, "log sense")) tape 569 drivers/block/paride/pt.c tape->capacity = xn(buf, 24, 4); tape 571 drivers/block/paride/pt.c printk("%s: %s %s, %s", tape->name, mf, id, ms[tape->drive]); tape 572 drivers/block/paride/pt.c if (!(tape->flags & PT_MEDIA)) tape 575 drivers/block/paride/pt.c if (!(tape->flags & PT_WRITE_OK)) tape 577 drivers/block/paride/pt.c printk(", blocksize %d, %d MB\n", tape->bs, tape->capacity / 1024); tape 588 drivers/block/paride/pt.c static int pt_probe(struct pt_unit *tape) tape 590 drivers/block/paride/pt.c if (tape->drive == -1) { tape 591 drivers/block/paride/pt.c for (tape->drive = 0; tape->drive <= 1; tape->drive++) tape 592 drivers/block/paride/pt.c if (!pt_reset(tape)) tape 593 drivers/block/paride/pt.c return pt_identify(tape); tape 595 drivers/block/paride/pt.c if (!pt_reset(tape)) tape 596 drivers/block/paride/pt.c return pt_identify(tape); tape 603 drivers/block/paride/pt.c struct pt_unit *tape; tape 617 drivers/block/paride/pt.c struct pt_unit *tape = &pt[unit]; tape 618 drivers/block/paride/pt.c tape->pi = &tape->pia; tape 619 drivers/block/paride/pt.c atomic_set(&tape->available, 1); tape 620 drivers/block/paride/pt.c tape->flags = 0; tape 621 drivers/block/paride/pt.c tape->last_sense = 0; tape 622 drivers/block/paride/pt.c tape->present = 0; tape 623 drivers/block/paride/pt.c tape->bufptr = NULL; tape 624 drivers/block/paride/pt.c tape->drive = DU[D_SLV]; tape 625 drivers/block/paride/pt.c snprintf(tape->name, PT_NAMELEN, "%s%d", name, unit); tape 629 drivers/block/paride/pt.c if (pi_init(tape->pi, 0, DU[D_PRT], DU[D_MOD], DU[D_UNI], tape 631 drivers/block/paride/pt.c verbose, tape->name)) { tape 632 drivers/block/paride/pt.c if (!pt_probe(tape)) { tape 633 drivers/block/paride/pt.c tape->present = 1; tape 636 drivers/block/paride/pt.c pi_release(tape->pi); tape 640 drivers/block/paride/pt.c tape = pt; tape 641 drivers/block/paride/pt.c if (pi_init(tape->pi, 1, -1, -1, -1, -1, -1, pt_scratch, tape 642 drivers/block/paride/pt.c PI_PT, verbose, tape->name)) { tape 643 drivers/block/paride/pt.c if (!pt_probe(tape)) { tape 644 drivers/block/paride/pt.c tape->present = 1; tape 647 drivers/block/paride/pt.c pi_release(tape->pi); tape 662 drivers/block/paride/pt.c struct pt_unit *tape = pt + unit; tape 666 drivers/block/paride/pt.c if (unit >= PT_UNITS || (!tape->present)) { tape 672 drivers/block/paride/pt.c if (!atomic_dec_and_test(&tape->available)) tape 675 drivers/block/paride/pt.c pt_identify(tape); tape 678 drivers/block/paride/pt.c if (!(tape->flags & PT_MEDIA)) tape 682 drivers/block/paride/pt.c if ((!(tape->flags & PT_WRITE_OK)) && (file->f_mode & FMODE_WRITE)) tape 686 drivers/block/paride/pt.c tape->flags |= PT_REWIND; tape 689 drivers/block/paride/pt.c tape->bufptr = kmalloc(PT_BUFSIZE, GFP_KERNEL); tape 690 drivers/block/paride/pt.c if (tape->bufptr == NULL) { tape 691 drivers/block/paride/pt.c printk("%s: buffer allocation failed\n", tape->name); tape 695 drivers/block/paride/pt.c file->private_data = tape; tape 700 drivers/block/paride/pt.c atomic_inc(&tape->available); tape 707 drivers/block/paride/pt.c struct pt_unit *tape = file->private_data; tape 720 drivers/block/paride/pt.c pt_rewind(tape); tape 726 drivers/block/paride/pt.c pt_write_fm(tape); tape 732 drivers/block/paride/pt.c printk(KERN_DEBUG "%s: Unimplemented mt_op %d\n", tape->name, tape 745 drivers/block/paride/pt.c struct pt_unit *tape = file->private_data; tape 747 drivers/block/paride/pt.c if (atomic_read(&tape->available) > 1) tape 750 drivers/block/paride/pt.c if (tape->flags & PT_WRITING) tape 751 drivers/block/paride/pt.c pt_write_fm(tape); tape 753 drivers/block/paride/pt.c if (tape->flags & PT_REWIND) tape 754 drivers/block/paride/pt.c pt_rewind(tape); tape 756 drivers/block/paride/pt.c kfree(tape->bufptr); tape 757 drivers/block/paride/pt.c tape->bufptr = NULL; tape 759 drivers/block/paride/pt.c atomic_inc(&tape->available); tape 767 drivers/block/paride/pt.c struct pt_unit *tape = filp->private_data; tape 768 drivers/block/paride/pt.c struct pi_adapter *pi = tape->pi; tape 772 drivers/block/paride/pt.c if (!(tape->flags & (PT_READING | PT_WRITING))) { tape 773 drivers/block/paride/pt.c tape->flags |= PT_READING; tape 774 drivers/block/paride/pt.c if (pt_atapi(tape, rd_cmd, 0, NULL, "start read-ahead")) tape 776 drivers/block/paride/pt.c } else if (tape->flags & PT_WRITING) tape 779 drivers/block/paride/pt.c if (tape->flags & PT_EOF) tape 786 drivers/block/paride/pt.c if (!pt_poll_dsc(tape, HZ / 100, PT_TMO, "read")) tape 792 drivers/block/paride/pt.c b = (n - 1 + tape->bs) / tape->bs; tape 793 drivers/block/paride/pt.c n = b * tape->bs; /* rounded up to even block */ tape 797 drivers/block/paride/pt.c r = pt_command(tape, rd_cmd, n, "read"); tape 802 drivers/block/paride/pt.c pt_req_sense(tape, 0); tape 808 drivers/block/paride/pt.c r = pt_wait(tape, STAT_BUSY, tape 814 drivers/block/paride/pt.c pt_req_sense(tape, 0); tape 819 drivers/block/paride/pt.c tape->flags |= PT_EOF; tape 830 drivers/block/paride/pt.c printk("%s: Phase error on read: %d\n", tape->name, tape 839 drivers/block/paride/pt.c pi_read_block(pi, tape->bufptr, k); tape 844 drivers/block/paride/pt.c if (copy_to_user(buf + t, tape->bufptr, b)) { tape 854 drivers/block/paride/pt.c if (tape->flags & PT_EOF) tape 864 drivers/block/paride/pt.c struct pt_unit *tape = filp->private_data; tape 865 drivers/block/paride/pt.c struct pi_adapter *pi = tape->pi; tape 869 drivers/block/paride/pt.c if (!(tape->flags & PT_WRITE_OK)) tape 872 drivers/block/paride/pt.c if (!(tape->flags & (PT_READING | PT_WRITING))) { tape 873 drivers/block/paride/pt.c tape->flags |= PT_WRITING; tape 875 drivers/block/paride/pt.c (tape, wr_cmd, 0, NULL, "start buffer-available mode")) tape 877 drivers/block/paride/pt.c } else if (tape->flags & PT_READING) tape 880 drivers/block/paride/pt.c if (tape->flags & PT_EOF) tape 887 drivers/block/paride/pt.c if (!pt_poll_dsc(tape, HZ / 100, PT_TMO, "write")) tape 893 drivers/block/paride/pt.c b = (n - 1 + tape->bs) / tape->bs; tape 894 drivers/block/paride/pt.c n = b * tape->bs; /* rounded up to even block */ tape 898 drivers/block/paride/pt.c r = pt_command(tape, wr_cmd, n, "write"); tape 903 drivers/block/paride/pt.c pt_req_sense(tape, 0); tape 909 drivers/block/paride/pt.c r = pt_wait(tape, STAT_BUSY, tape 915 drivers/block/paride/pt.c pt_req_sense(tape, 0); tape 920 drivers/block/paride/pt.c tape->flags |= PT_EOF; tape 932 drivers/block/paride/pt.c tape->name, p); tape 943 drivers/block/paride/pt.c if (copy_from_user(tape->bufptr, buf + t, b)) { tape 947 drivers/block/paride/pt.c pi_write_block(pi, tape->bufptr, k); tape 955 drivers/block/paride/pt.c if (tape->flags & PT_EOF) tape 234 drivers/ide/ide-tape.c struct ide_tape_obj *tape = NULL; tape 239 drivers/ide/ide-tape.c tape = idetape_devs[i]; tape 241 drivers/ide/ide-tape.c tape = ide_drv_g(disk, ide_tape_obj); tape 243 drivers/ide/ide-tape.c if (tape) { tape 244 drivers/ide/ide-tape.c if (ide_device_get(tape->drive)) tape 245 drivers/ide/ide-tape.c tape = NULL; tape 247 drivers/ide/ide-tape.c get_device(&tape->dev); tape 251 drivers/ide/ide-tape.c return tape; tape 254 drivers/ide/ide-tape.c static void ide_tape_put(struct ide_tape_obj *tape) tape 256 drivers/ide/ide-tape.c ide_drive_t *drive = tape->drive; tape 259 drivers/ide/ide-tape.c put_device(&tape->dev); tape 270 drivers/ide/ide-tape.c idetape_tape_t *tape = drive->driver_data; tape 275 drivers/ide/ide-tape.c tape->sense_key = sense[2] & 0xF; tape 276 drivers/ide/ide-tape.c tape->asc = sense[12]; tape 277 drivers/ide/ide-tape.c tape->ascq = sense[13]; tape 281 drivers/ide/ide-tape.c rq->cmd[0], tape->sense_key, tape->asc, tape->ascq); tape 285 drivers/ide/ide-tape.c scsi_req(rq)->resid_len = tape->blk_size * get_unaligned_be32(&sense[3]); tape 295 drivers/ide/ide-tape.c if (tape->sense_key == 5) { tape 307 drivers/ide/ide-tape.c if ((sense[2] & 0x40) || (tape->sense_key == 0xd tape 308 drivers/ide/ide-tape.c && tape->asc == 0x0 && tape->ascq == 0x2)) { tape 314 drivers/ide/ide-tape.c if (tape->sense_key == 8) { tape 328 drivers/ide/ide-tape.c idetape_tape_t *tape = drive->driver_data; tape 351 drivers/ide/ide-tape.c (blk_rq_bytes(rq) - scsi_req(rq)->resid_len) / tape->blk_size; tape 353 drivers/ide/ide-tape.c tape->avg_size += blocks * tape->blk_size; tape 355 drivers/ide/ide-tape.c if (time_after_eq(jiffies, tape->avg_time + HZ)) { tape 356 drivers/ide/ide-tape.c tape->avg_speed = tape->avg_size * HZ / tape 357 drivers/ide/ide-tape.c (jiffies - tape->avg_time) / 1024; tape 358 drivers/ide/ide-tape.c tape->avg_size = 0; tape 359 drivers/ide/ide-tape.c tape->avg_time = jiffies; tape 362 drivers/ide/ide-tape.c tape->first_frame += blocks; tape 380 drivers/ide/ide-tape.c idetape_tape_t *tape = drive->driver_data; tape 383 drivers/ide/ide-tape.c drive->hwif->rq->cmd[0], tape->dsc_poll_freq); tape 385 drivers/ide/ide-tape.c tape->postponed_rq = true; tape 387 drivers/ide/ide-tape.c ide_stall_queue(drive, tape->dsc_poll_freq); tape 392 drivers/ide/ide-tape.c idetape_tape_t *tape = drive->driver_data; tape 395 drivers/ide/ide-tape.c tape->dsc_polling_start = jiffies; tape 396 drivers/ide/ide-tape.c tape->dsc_poll_freq = IDETAPE_DSC_MA_FAST; tape 397 drivers/ide/ide-tape.c tape->dsc_timeout = jiffies + IDETAPE_DSC_MA_TIMEOUT; tape 443 drivers/ide/ide-tape.c idetape_tape_t *tape = drive->driver_data; tape 462 drivers/ide/ide-tape.c tape->sense_key == 2 && tape->asc == 4 && tape 463 drivers/ide/ide-tape.c (tape->ascq == 1 || tape->ascq == 8))) { tape 467 drivers/ide/ide-tape.c tape->name, pc->c[0], tape 468 drivers/ide/ide-tape.c tape->sense_key, tape->asc, tape 469 drivers/ide/ide-tape.c tape->ascq); tape 518 drivers/ide/ide-tape.c idetape_tape_t *tape = drive->driver_data; tape 529 drivers/ide/ide-tape.c tape->name); tape 543 drivers/ide/ide-tape.c static void ide_tape_create_rw_cmd(idetape_tape_t *tape, tape 547 drivers/ide/ide-tape.c unsigned int length = blk_rq_sectors(rq) / (tape->blk_size >> 9); tape 553 drivers/ide/ide-tape.c if (blk_rq_bytes(rq) == tape->buffer_size) tape 570 drivers/ide/ide-tape.c idetape_tape_t *tape = drive->driver_data; tape 607 drivers/ide/ide-tape.c if (!tape->postponed_rq) { tape 608 drivers/ide/ide-tape.c tape->dsc_polling_start = jiffies; tape 609 drivers/ide/ide-tape.c tape->dsc_poll_freq = tape->best_dsc_rw_freq; tape 610 drivers/ide/ide-tape.c tape->dsc_timeout = jiffies + IDETAPE_DSC_RW_TIMEOUT; tape 611 drivers/ide/ide-tape.c } else if (time_after(jiffies, tape->dsc_timeout)) { tape 613 drivers/ide/ide-tape.c tape->name); tape 621 drivers/ide/ide-tape.c tape->dsc_polling_start + tape 623 drivers/ide/ide-tape.c tape->dsc_poll_freq = IDETAPE_DSC_MA_SLOW; tape 628 drivers/ide/ide-tape.c tape->postponed_rq = false; tape 632 drivers/ide/ide-tape.c pc = &tape->queued_pc; tape 633 drivers/ide/ide-tape.c ide_tape_create_rw_cmd(tape, pc, rq, READ_6); tape 637 drivers/ide/ide-tape.c pc = &tape->queued_pc; tape 638 drivers/ide/ide-tape.c ide_tape_create_rw_cmd(tape, pc, rq, WRITE_6); tape 685 drivers/ide/ide-tape.c idetape_tape_t *tape = drive->driver_data; tape 686 drivers/ide/ide-tape.c struct gendisk *disk = tape->disk; tape 695 drivers/ide/ide-tape.c if ((tape->sense_key == 2 && tape->asc == 4 && tape->ascq == 2) tape 696 drivers/ide/ide-tape.c || (tape->asc == 0x3A)) { tape 703 drivers/ide/ide-tape.c } else if (!(tape->sense_key == 2 && tape->asc == 4 && tape 704 drivers/ide/ide-tape.c (tape->ascq == 1 || tape->ascq == 8))) tape 713 drivers/ide/ide-tape.c struct ide_tape_obj *tape = drive->driver_data; tape 718 drivers/ide/ide-tape.c rc = ide_queue_pc_tail(drive, tape->disk, &pc, NULL, 0); tape 727 drivers/ide/ide-tape.c idetape_tape_t *tape = drive->driver_data; tape 738 drivers/ide/ide-tape.c if (ide_queue_pc_tail(drive, tape->disk, &pc, buf, pc.req_xfer)) tape 757 drivers/ide/ide-tape.c tape->partition = buf[1]; tape 758 drivers/ide/ide-tape.c tape->first_frame = be32_to_cpup((__be32 *)&buf[4]); tape 764 drivers/ide/ide-tape.c return tape->first_frame; tape 781 drivers/ide/ide-tape.c idetape_tape_t *tape = drive->driver_data; tape 783 drivers/ide/ide-tape.c if (tape->chrdev_dir != IDETAPE_DIR_READ) tape 787 drivers/ide/ide-tape.c tape->valid = 0; tape 788 drivers/ide/ide-tape.c if (tape->buf != NULL) { tape 789 drivers/ide/ide-tape.c kfree(tape->buf); tape 790 drivers/ide/ide-tape.c tape->buf = NULL; tape 793 drivers/ide/ide-tape.c tape->chrdev_dir = IDETAPE_DIR_NONE; tape 805 drivers/ide/ide-tape.c idetape_tape_t *tape = drive->driver_data; tape 806 drivers/ide/ide-tape.c struct gendisk *disk = tape->disk; tape 810 drivers/ide/ide-tape.c if (tape->chrdev_dir == IDETAPE_DIR_READ) tape 827 drivers/ide/ide-tape.c idetape_tape_t *tape = drive->driver_data; tape 836 drivers/ide/ide-tape.c " %s\n", tape->name, __func__); tape 848 drivers/ide/ide-tape.c idetape_tape_t *tape = drive->driver_data; tape 855 drivers/ide/ide-tape.c BUG_ON(size < 0 || size % tape->blk_size); tape 860 drivers/ide/ide-tape.c rq->rq_disk = tape->disk; tape 861 drivers/ide/ide-tape.c rq->__sector = tape->first_frame; tape 864 drivers/ide/ide-tape.c ret = blk_rq_map_kern(drive->queue, rq, tape->buf, size, tape 870 drivers/ide/ide-tape.c blk_execute_rq(drive->queue, tape->disk, rq, 0); tape 874 drivers/ide/ide-tape.c tape->cur = tape->buf; tape 876 drivers/ide/ide-tape.c tape->valid = size; tape 878 drivers/ide/ide-tape.c tape->valid = 0; tape 923 drivers/ide/ide-tape.c idetape_tape_t *tape = drive->driver_data; tape 925 drivers/ide/ide-tape.c if (tape->chrdev_dir != IDETAPE_DIR_WRITE) { tape 930 drivers/ide/ide-tape.c if (tape->buf) { tape 931 drivers/ide/ide-tape.c size_t aligned = roundup(tape->valid, tape->blk_size); tape 933 drivers/ide/ide-tape.c memset(tape->cur, 0, aligned - tape->valid); tape 935 drivers/ide/ide-tape.c kfree(tape->buf); tape 936 drivers/ide/ide-tape.c tape->buf = NULL; tape 938 drivers/ide/ide-tape.c tape->chrdev_dir = IDETAPE_DIR_NONE; tape 943 drivers/ide/ide-tape.c idetape_tape_t *tape = drive->driver_data; tape 948 drivers/ide/ide-tape.c if (tape->chrdev_dir == dir) tape 951 drivers/ide/ide-tape.c if (tape->chrdev_dir == IDETAPE_DIR_READ) tape 953 drivers/ide/ide-tape.c else if (tape->chrdev_dir == IDETAPE_DIR_WRITE) { tape 958 drivers/ide/ide-tape.c if (tape->buf || tape->valid) { tape 960 drivers/ide/ide-tape.c tape->valid = 0; tape 963 drivers/ide/ide-tape.c tape->buf = kmalloc(tape->buffer_size, GFP_KERNEL); tape 964 drivers/ide/ide-tape.c if (!tape->buf) tape 966 drivers/ide/ide-tape.c tape->chrdev_dir = dir; tape 967 drivers/ide/ide-tape.c tape->cur = tape->buf; tape 981 drivers/ide/ide-tape.c kfree(tape->buf); tape 982 drivers/ide/ide-tape.c tape->buf = NULL; tape 983 drivers/ide/ide-tape.c tape->chrdev_dir = IDETAPE_DIR_NONE; tape 993 drivers/ide/ide-tape.c idetape_tape_t *tape = drive->driver_data; tape 995 drivers/ide/ide-tape.c memset(tape->buf, 0, tape->buffer_size); tape 998 drivers/ide/ide-tape.c unsigned int count = min(tape->buffer_size, bcount); tape 1011 drivers/ide/ide-tape.c struct ide_tape_obj *tape = drive->driver_data; tape 1012 drivers/ide/ide-tape.c struct gendisk *disk = tape->disk; tape 1033 drivers/ide/ide-tape.c idetape_tape_t *tape = drive->driver_data; tape 1048 drivers/ide/ide-tape.c tape->best_dsc_rw_freq = config.dsc_rw_frequency; tape 1052 drivers/ide/ide-tape.c config.dsc_rw_frequency = (int) tape->best_dsc_rw_freq; tape 1066 drivers/ide/ide-tape.c idetape_tape_t *tape = drive->driver_data; tape 1067 drivers/ide/ide-tape.c struct gendisk *disk = tape->disk; tape 1070 drivers/ide/ide-tape.c int sprev = !!(tape->caps[4] & 0x20); tape 1083 drivers/ide/ide-tape.c if (tape->chrdev_dir == IDETAPE_DIR_READ) { tape 1084 drivers/ide/ide-tape.c tape->valid = 0; tape 1132 drivers/ide/ide-tape.c struct ide_tape_obj *tape = file->private_data; tape 1133 drivers/ide/ide-tape.c ide_drive_t *drive = tape->drive; tape 1140 drivers/ide/ide-tape.c if (tape->chrdev_dir != IDETAPE_DIR_READ) { tape 1142 drivers/ide/ide-tape.c if (count > tape->blk_size && tape 1143 drivers/ide/ide-tape.c (count % tape->blk_size) == 0) tape 1144 drivers/ide/ide-tape.c tape->user_bs_factor = count / tape->blk_size; tape 1155 drivers/ide/ide-tape.c if (!tape->valid) { tape 1162 drivers/ide/ide-tape.c tape->buffer_size) <= 0) tape 1167 drivers/ide/ide-tape.c todo = min_t(size_t, count - done, tape->valid); tape 1168 drivers/ide/ide-tape.c if (copy_to_user(buf + done, tape->cur, todo)) tape 1171 drivers/ide/ide-tape.c tape->cur += todo; tape 1172 drivers/ide/ide-tape.c tape->valid -= todo; tape 1187 drivers/ide/ide-tape.c struct ide_tape_obj *tape = file->private_data; tape 1188 drivers/ide/ide-tape.c ide_drive_t *drive = tape->drive; tape 1194 drivers/ide/ide-tape.c if (tape->write_prot) tape 1208 drivers/ide/ide-tape.c if (tape->valid == tape->buffer_size && tape 1210 drivers/ide/ide-tape.c tape->buffer_size) <= 0) tape 1215 drivers/ide/ide-tape.c tape->buffer_size - tape->valid); tape 1216 drivers/ide/ide-tape.c if (copy_from_user(tape->cur, buf + done, todo)) tape 1219 drivers/ide/ide-tape.c tape->cur += todo; tape 1220 drivers/ide/ide-tape.c tape->valid += todo; tape 1229 drivers/ide/ide-tape.c struct ide_tape_obj *tape = drive->driver_data; tape 1234 drivers/ide/ide-tape.c if (ide_queue_pc_tail(drive, tape->disk, &pc, NULL, 0)) { tape 1256 drivers/ide/ide-tape.c idetape_tape_t *tape = drive->driver_data; tape 1257 drivers/ide/ide-tape.c struct gendisk *disk = tape->disk; tape 1278 drivers/ide/ide-tape.c if (tape->write_prot) tape 1301 drivers/ide/ide-tape.c if (tape->door_locked) { tape 1303 drivers/ide/ide-tape.c tape->door_locked = DOOR_UNLOCKED; tape 1327 drivers/ide/ide-tape.c if (mt_count < tape->blk_size || tape 1328 drivers/ide/ide-tape.c mt_count % tape->blk_size) tape 1330 drivers/ide/ide-tape.c tape->user_bs_factor = mt_count / tape->blk_size; tape 1340 drivers/ide/ide-tape.c mt_count * tape->user_bs_factor, tape->partition, 0); tape 1350 drivers/ide/ide-tape.c tape->door_locked = DOOR_EXPLICITLY_LOCKED; tape 1356 drivers/ide/ide-tape.c tape->door_locked = DOOR_UNLOCKED; tape 1373 drivers/ide/ide-tape.c struct ide_tape_obj *tape = file->private_data; tape 1374 drivers/ide/ide-tape.c ide_drive_t *drive = tape->drive; tape 1378 drivers/ide/ide-tape.c int block_offset = 0, position = tape->first_frame; tape 1383 drivers/ide/ide-tape.c if (tape->chrdev_dir == IDETAPE_DIR_WRITE) { tape 1388 drivers/ide/ide-tape.c block_offset = tape->valid / tape 1389 drivers/ide/ide-tape.c (tape->blk_size * tape->user_bs_factor); tape 1402 drivers/ide/ide-tape.c mtget.mt_blkno = position / tape->user_bs_factor - block_offset; tape 1404 drivers/ide/ide-tape.c ((tape->blk_size * tape->user_bs_factor) tape 1407 drivers/ide/ide-tape.c if (tape->drv_write_prot) tape 1414 drivers/ide/ide-tape.c mtpos.mt_blkno = position / tape->user_bs_factor - block_offset; tape 1419 drivers/ide/ide-tape.c if (tape->chrdev_dir == IDETAPE_DIR_READ) tape 1441 drivers/ide/ide-tape.c idetape_tape_t *tape = drive->driver_data; tape 1446 drivers/ide/ide-tape.c if (ide_queue_pc_tail(drive, tape->disk, &pc, buf, pc.req_xfer)) { tape 1448 drivers/ide/ide-tape.c if (tape->blk_size == 0) { tape 1451 drivers/ide/ide-tape.c tape->blk_size = 32768; tape 1455 drivers/ide/ide-tape.c tape->blk_size = (buf[4 + 5] << 16) + tape 1458 drivers/ide/ide-tape.c tape->drv_write_prot = (buf[2] & 0x80) >> 7; tape 1461 drivers/ide/ide-tape.c tape->blk_size, tape->drv_write_prot); tape 1468 drivers/ide/ide-tape.c idetape_tape_t *tape; tape 1476 drivers/ide/ide-tape.c tape = ide_tape_get(NULL, true, i); tape 1477 drivers/ide/ide-tape.c if (!tape) { tape 1482 drivers/ide/ide-tape.c drive = tape->drive; tape 1483 drivers/ide/ide-tape.c filp->private_data = tape; tape 1503 drivers/ide/ide-tape.c printk(KERN_ERR "ide-tape: %s: drive not ready\n", tape->name); tape 1516 drivers/ide/ide-tape.c tape->write_prot = 1; tape 1518 drivers/ide/ide-tape.c tape->write_prot = tape->drv_write_prot; tape 1521 drivers/ide/ide-tape.c if (tape->write_prot) { tape 1531 drivers/ide/ide-tape.c if (tape->chrdev_dir == IDETAPE_DIR_NONE) { tape 1532 drivers/ide/ide-tape.c if (!ide_set_media_lock(drive, tape->disk, 1)) { tape 1533 drivers/ide/ide-tape.c if (tape->door_locked != DOOR_EXPLICITLY_LOCKED) tape 1534 drivers/ide/ide-tape.c tape->door_locked = DOOR_LOCKED; tape 1542 drivers/ide/ide-tape.c ide_tape_put(tape); tape 1551 drivers/ide/ide-tape.c idetape_tape_t *tape = drive->driver_data; tape 1554 drivers/ide/ide-tape.c tape->buf = kmalloc(tape->buffer_size, GFP_KERNEL); tape 1555 drivers/ide/ide-tape.c if (tape->buf != NULL) { tape 1556 drivers/ide/ide-tape.c idetape_pad_zeros(drive, tape->blk_size * tape 1557 drivers/ide/ide-tape.c (tape->user_bs_factor - 1)); tape 1558 drivers/ide/ide-tape.c kfree(tape->buf); tape 1559 drivers/ide/ide-tape.c tape->buf = NULL; tape 1568 drivers/ide/ide-tape.c struct ide_tape_obj *tape = filp->private_data; tape 1569 drivers/ide/ide-tape.c ide_drive_t *drive = tape->drive; tape 1574 drivers/ide/ide-tape.c tape = drive->driver_data; tape 1578 drivers/ide/ide-tape.c if (tape->chrdev_dir == IDETAPE_DIR_WRITE) tape 1580 drivers/ide/ide-tape.c if (tape->chrdev_dir == IDETAPE_DIR_READ) { tape 1589 drivers/ide/ide-tape.c if (tape->chrdev_dir == IDETAPE_DIR_NONE) { tape 1590 drivers/ide/ide-tape.c if (tape->door_locked == DOOR_LOCKED) { tape 1591 drivers/ide/ide-tape.c if (!ide_set_media_lock(drive, tape->disk, 0)) tape 1592 drivers/ide/ide-tape.c tape->door_locked = DOOR_UNLOCKED; tape 1596 drivers/ide/ide-tape.c ide_tape_put(tape); tape 1605 drivers/ide/ide-tape.c idetape_tape_t *tape = drive->driver_data; tape 1611 drivers/ide/ide-tape.c if (ide_queue_pc_tail(drive, tape->disk, &pc, pc_buf, pc.req_xfer)) { tape 1613 drivers/ide/ide-tape.c tape->name); tape 1625 drivers/ide/ide-tape.c drive->name, tape->name, vendor_id, product_id, fw_rev); tape 1634 drivers/ide/ide-tape.c idetape_tape_t *tape = drive->driver_data; tape 1640 drivers/ide/ide-tape.c if (ide_queue_pc_tail(drive, tape->disk, &pc, buf, pc.req_xfer)) { tape 1643 drivers/ide/ide-tape.c tape->blk_size = 512; tape 1644 drivers/ide/ide-tape.c put_unaligned(52, (u16 *)&tape->caps[12]); tape 1645 drivers/ide/ide-tape.c put_unaligned(540, (u16 *)&tape->caps[14]); tape 1646 drivers/ide/ide-tape.c put_unaligned(6*52, (u16 *)&tape->caps[16]); tape 1671 drivers/ide/ide-tape.c memcpy(&tape->caps, caps, 20); tape 1678 drivers/ide/ide-tape.c tape->blk_size = 512; tape 1680 drivers/ide/ide-tape.c tape->blk_size = 1024; tape 1687 drivers/ide/ide-tape.c idetape_tape_t *tape = drive->driver_data; \ tape 1688 drivers/ide/ide-tape.c return tape->field; \ tape 1694 drivers/ide/ide-tape.c idetape_tape_t *tape = drive->driver_data; \ tape 1695 drivers/ide/ide-tape.c tape->field = arg; \ tape 1745 drivers/ide/ide-tape.c static void idetape_setup(ide_drive_t *drive, idetape_tape_t *tape, int minor) tape 1749 drivers/ide/ide-tape.c u16 *ctl = (u16 *)&tape->caps[12]; tape 1759 drivers/ide/ide-tape.c tape->name); tape 1767 drivers/ide/ide-tape.c tape->minor = minor; tape 1768 drivers/ide/ide-tape.c tape->name[0] = 'h'; tape 1769 drivers/ide/ide-tape.c tape->name[1] = 't'; tape 1770 drivers/ide/ide-tape.c tape->name[2] = '0' + minor; tape 1771 drivers/ide/ide-tape.c tape->chrdev_dir = IDETAPE_DIR_NONE; tape 1776 drivers/ide/ide-tape.c tape->user_bs_factor = 1; tape 1777 drivers/ide/ide-tape.c tape->buffer_size = *ctl * tape->blk_size; tape 1778 drivers/ide/ide-tape.c while (tape->buffer_size > 0xffff) { tape 1781 drivers/ide/ide-tape.c tape->buffer_size = *ctl * tape->blk_size; tape 1785 drivers/ide/ide-tape.c speed = max(*(u16 *)&tape->caps[14], *(u16 *)&tape->caps[8]); tape 1787 drivers/ide/ide-tape.c t = (IDETAPE_FIFO_THRESHOLD * tape->buffer_size * HZ) / (speed * 1000); tape 1793 drivers/ide/ide-tape.c tape->best_dsc_rw_freq = clamp_t(unsigned long, t, IDETAPE_DSC_RW_MIN, tape 1797 drivers/ide/ide-tape.c drive->name, tape->name, *(u16 *)&tape->caps[14], tape 1798 drivers/ide/ide-tape.c (*(u16 *)&tape->caps[16] * 512) / tape->buffer_size, tape 1799 drivers/ide/ide-tape.c tape->buffer_size / 1024, tape 1800 drivers/ide/ide-tape.c jiffies_to_msecs(tape->best_dsc_rw_freq), tape 1803 drivers/ide/ide-tape.c ide_proc_register_driver(drive, tape->driver); tape 1808 drivers/ide/ide-tape.c idetape_tape_t *tape = drive->driver_data; tape 1810 drivers/ide/ide-tape.c ide_proc_unregister_driver(drive, tape->driver); tape 1811 drivers/ide/ide-tape.c device_del(&tape->dev); tape 1812 drivers/ide/ide-tape.c ide_unregister_region(tape->disk); tape 1815 drivers/ide/ide-tape.c put_device(&tape->dev); tape 1821 drivers/ide/ide-tape.c struct ide_tape_obj *tape = to_ide_drv(dev, ide_tape_obj); tape 1822 drivers/ide/ide-tape.c ide_drive_t *drive = tape->drive; tape 1823 drivers/ide/ide-tape.c struct gendisk *g = tape->disk; tape 1825 drivers/ide/ide-tape.c BUG_ON(tape->valid); tape 1829 drivers/ide/ide-tape.c device_destroy(idetape_sysfs_class, MKDEV(IDETAPE_MAJOR, tape->minor)); tape 1831 drivers/ide/ide-tape.c MKDEV(IDETAPE_MAJOR, tape->minor + 128)); tape 1832 drivers/ide/ide-tape.c idetape_devs[tape->minor] = NULL; tape 1835 drivers/ide/ide-tape.c kfree(tape); tape 1842 drivers/ide/ide-tape.c idetape_tape_t *tape = drive->driver_data; tape 1844 drivers/ide/ide-tape.c seq_printf(m, "%s\n", tape->name); tape 1896 drivers/ide/ide-tape.c struct ide_tape_obj *tape; tape 1899 drivers/ide/ide-tape.c tape = ide_tape_get(bdev->bd_disk, false, 0); tape 1902 drivers/ide/ide-tape.c if (!tape) tape 1910 drivers/ide/ide-tape.c struct ide_tape_obj *tape = ide_drv_g(disk, ide_tape_obj); tape 1913 drivers/ide/ide-tape.c ide_tape_put(tape); tape 1920 drivers/ide/ide-tape.c struct ide_tape_obj *tape = ide_drv_g(bdev->bd_disk, ide_tape_obj); tape 1921 drivers/ide/ide-tape.c ide_drive_t *drive = tape->drive; tape 1942 drivers/ide/ide-tape.c idetape_tape_t *tape; tape 1960 drivers/ide/ide-tape.c tape = kzalloc(sizeof(idetape_tape_t), GFP_KERNEL); tape 1961 drivers/ide/ide-tape.c if (tape == NULL) { tape 1973 drivers/ide/ide-tape.c tape->dev.parent = &drive->gendev; tape 1974 drivers/ide/ide-tape.c tape->dev.release = ide_tape_release; tape 1975 drivers/ide/ide-tape.c dev_set_name(&tape->dev, "%s", dev_name(&drive->gendev)); tape 1977 drivers/ide/ide-tape.c if (device_register(&tape->dev)) tape 1980 drivers/ide/ide-tape.c tape->drive = drive; tape 1981 drivers/ide/ide-tape.c tape->driver = &idetape_driver; tape 1982 drivers/ide/ide-tape.c tape->disk = g; tape 1984 drivers/ide/ide-tape.c g->private_data = &tape->driver; tape 1986 drivers/ide/ide-tape.c drive->driver_data = tape; tape 1991 drivers/ide/ide-tape.c idetape_devs[minor] = tape; tape 1994 drivers/ide/ide-tape.c idetape_setup(drive, tape, minor); tape 1997 drivers/ide/ide-tape.c MKDEV(IDETAPE_MAJOR, minor), NULL, "%s", tape->name); tape 2000 drivers/ide/ide-tape.c "n%s", tape->name); tape 2010 drivers/ide/ide-tape.c kfree(tape); tape 310 drivers/scsi/st.c static inline char *tape_name(struct scsi_tape *tape) tape 312 drivers/scsi/st.c return tape->disk->disk_name; tape 4171 drivers/scsi/st.c static int create_one_cdev(struct scsi_tape *tape, int mode, int rew) tape 4177 drivers/scsi/st.c struct st_modedef *STm = &(tape->modes[mode]); tape 4179 drivers/scsi/st.c int dev_num = tape->index; tape 4203 drivers/scsi/st.c tape->disk->disk_name, st_formats[i]); tape 4205 drivers/scsi/st.c dev = device_create(&st_sysfs_class, &tape->device->sdev_gendev, tape 4206 drivers/scsi/st.c cdev_devno, &tape->modes[mode], "%s", name); tape 4224 drivers/scsi/st.c static int create_cdevs(struct scsi_tape *tape) tape 4228 drivers/scsi/st.c error = create_one_cdev(tape, mode, 0); tape 4231 drivers/scsi/st.c error = create_one_cdev(tape, mode, 1); tape 4236 drivers/scsi/st.c return sysfs_create_link(&tape->device->sdev_gendev.kobj, tape 4237 drivers/scsi/st.c &tape->modes[0].devs[0]->kobj, "tape"); tape 4240 drivers/scsi/st.c static void remove_cdevs(struct scsi_tape *tape) tape 4243 drivers/scsi/st.c sysfs_remove_link(&tape->device->sdev_gendev.kobj, "tape"); tape 4245 drivers/scsi/st.c struct st_modedef *STm = &(tape->modes[mode]); tape 4355 drivers/scsi/st.c STm->tape = tpnt; tape 4655 drivers/scsi/st.c struct scsi_tape *STp = STm->tape; tape 4694 drivers/scsi/st.c (long long)atomic64_read(&STm->tape->stats->read_cnt)); tape 4712 drivers/scsi/st.c (long long)atomic64_read(&STm->tape->stats->read_byte_cnt)); tape 4728 drivers/scsi/st.c (long long)atomic64_read(&STm->tape->stats->tot_read_time)); tape 4745 drivers/scsi/st.c (long long)atomic64_read(&STm->tape->stats->write_cnt)); tape 4762 drivers/scsi/st.c (long long)atomic64_read(&STm->tape->stats->write_byte_cnt)); tape 4779 drivers/scsi/st.c (long long)atomic64_read(&STm->tape->stats->tot_write_time)); tape 4797 drivers/scsi/st.c (long long)atomic64_read(&STm->tape->stats->in_flight)); tape 4817 drivers/scsi/st.c (long long)atomic64_read(&STm->tape->stats->tot_io_time)); tape 4836 drivers/scsi/st.c (long long)atomic64_read(&STm->tape->stats->other_cnt)); tape 4854 drivers/scsi/st.c (long long)atomic64_read(&STm->tape->stats->resid_cnt)); tape 70 drivers/scsi/st.h struct scsi_tape *tape; tape 37 include/acpi/acbuffer.h u32 tape;