Lines Matching refs:buffer
369 cmdstatp = &STp->buffer->cmdstat; in st_chk_result()
373 scode = STp->buffer->cmdstat.sense_hdr.sense_key; in st_chk_result()
461 stp->buffer->syscall_result = -EINTR; in st_allocate_request()
463 stp->buffer->syscall_result = -EBUSY; in st_allocate_request()
480 STp->buffer->cmdstat.midlevel_result = SRpnt->result = req->errors; in st_scsi_execute_end()
481 STp->buffer->cmdstat.residual = req->resid_len; in st_scsi_execute_end()
492 int data_direction, void *buffer, unsigned bufflen, in st_scsi_execute() argument
496 struct rq_map_data *mdata = &SRpnt->stp->buffer->map_data; in st_scsi_execute()
541 struct rq_map_data *mdata = &STp->buffer->map_data; in st_do_scsi()
545 if (!do_wait && ((STp->buffer)->last_SRpnt)) { in st_do_scsi()
549 (STp->buffer)->syscall_result = (-EINTR); in st_do_scsi()
551 (STp->buffer)->syscall_result = (-EBUSY); in st_do_scsi()
564 (STp->buffer)->last_SRpnt = SRpnt; in st_do_scsi()
570 if (STp->buffer->do_dio) { in st_do_scsi()
572 mdata->nr_entries = STp->buffer->sg_segs; in st_do_scsi()
573 mdata->pages = STp->buffer->mapped_pages; in st_do_scsi()
575 mdata->page_order = STp->buffer->reserved_page_order; in st_do_scsi()
578 mdata->pages = STp->buffer->reserved_pages; in st_do_scsi()
583 STp->buffer->cmdstat.have_sense = 0; in st_do_scsi()
584 STp->buffer->syscall_result = 0; in st_do_scsi()
590 (STp->buffer)->syscall_result = (-EBUSY); in st_do_scsi()
591 (STp->buffer)->last_SRpnt = NULL; in st_do_scsi()
595 (STp->buffer)->syscall_result = st_chk_result(STp, SRpnt); in st_do_scsi()
614 STbuffer = STp->buffer; in write_behind_check()
630 (STp->buffer)->syscall_result = st_chk_result(STp, SRpnt); in write_behind_check()
691 return (STp->buffer)->syscall_result; in cross_eof()
696 if ((STp->buffer)->cmdstat.midlevel_result != 0) in cross_eof()
701 return (STp->buffer)->syscall_result; in cross_eof()
721 transfer = STp->buffer->buffer_bytes; in st_flush_write_buffer()
736 return (STp->buffer)->syscall_result; in st_flush_write_buffer()
739 if ((STp->buffer)->syscall_result != 0) { in st_flush_write_buffer()
740 struct st_cmdstatus *cmdstatp = &STp->buffer->cmdstat; in st_flush_write_buffer()
749 (STp->buffer)->buffer_bytes = 0; in st_flush_write_buffer()
762 (STp->buffer)->buffer_bytes = 0; in st_flush_write_buffer()
779 STbuffer = STp->buffer; in flush_buffer()
797 backspace = ((STp->buffer)->buffer_bytes + in flush_buffer()
798 (STp->buffer)->read_pointer) / STp->block_size - in flush_buffer()
799 ((STp->buffer)->read_pointer + STp->block_size - 1) / in flush_buffer()
801 (STp->buffer)->buffer_bytes = 0; in flush_buffer()
802 (STp->buffer)->read_pointer = 0; in flush_buffer()
917 struct st_cmdstatus *cmdstatp = &STp->buffer->cmdstat; in test_ready()
928 retval = (STp->buffer)->syscall_result; in test_ready()
968 retval = (STp->buffer)->syscall_result; in test_ready()
1061 retval = (STp->buffer)->syscall_result; in check_tape()
1065 if (!SRpnt->result && !STp->buffer->cmdstat.have_sense) { in check_tape()
1066 STp->max_block = ((STp->buffer)->b_data[1] << 16) | in check_tape()
1067 ((STp->buffer)->b_data[2] << 8) | (STp->buffer)->b_data[3]; in check_tape()
1068 STp->min_block = ((STp->buffer)->b_data[4] << 8) | in check_tape()
1069 (STp->buffer)->b_data[5]; in check_tape()
1088 retval = (STp->buffer)->syscall_result; in check_tape()
1092 if ((STp->buffer)->syscall_result != 0) { in check_tape()
1095 (STp->buffer)->syscall_result = 0; /* Prevent error propagation */ in check_tape()
1100 (STp->buffer)->b_data[0], in check_tape()
1101 (STp->buffer)->b_data[1], in check_tape()
1102 (STp->buffer)->b_data[2], in check_tape()
1103 (STp->buffer)->b_data[3]); in check_tape()
1105 if ((STp->buffer)->b_data[3] >= 8) { in check_tape()
1106 STp->drv_buffer = ((STp->buffer)->b_data[2] >> 4) & 7; in check_tape()
1107 STp->density = (STp->buffer)->b_data[4]; in check_tape()
1108 STp->block_size = (STp->buffer)->b_data[9] * 65536 + in check_tape()
1109 (STp->buffer)->b_data[10] * 256 + (STp->buffer)->b_data[11]; in check_tape()
1113 (STp->buffer)->b_data[5] * 65536 + in check_tape()
1114 (STp->buffer)->b_data[6] * 256 + in check_tape()
1115 (STp->buffer)->b_data[7], in check_tape()
1118 STp->drv_write_prot = ((STp->buffer)->b_data[2] & 0x80) != 0; in check_tape()
1131 (STp->buffer)->buffer_blocks = in check_tape()
1132 (STp->buffer)->buffer_size / STp->block_size; in check_tape()
1134 (STp->buffer)->buffer_blocks = 1; in check_tape()
1135 (STp->buffer)->buffer_bytes = (STp->buffer)->read_pointer = 0; in check_tape()
1138 STp->block_size, (STp->buffer)->buffer_size, in check_tape()
1139 (STp->buffer)->buffer_blocks); in check_tape()
1236 if (!enlarge_buffer(STp->buffer, PAGE_SIZE, STp->restr_dma)) { in st_open()
1243 (STp->buffer)->cleared = 0; in st_open()
1244 (STp->buffer)->writing = 0; in st_open()
1245 (STp->buffer)->syscall_result = 0; in st_open()
1273 normalize_buffer(STp->buffer); in st_open()
1319 struct st_cmdstatus *cmdstatp = &STp->buffer->cmdstat; in st_flush()
1335 result = (STp->buffer)->syscall_result; in st_flush()
1339 if (STp->buffer->syscall_result == 0 || in st_flush()
1410 normalize_buffer(STp->buffer); in st_release()
1493 struct st_buffer *STbp = STp->buffer; in setup_buffering()
1555 STbp = STp->buffer; in release_buffering()
1627 STbp = STp->buffer; in st_write()
1737 struct st_cmdstatus *cmdstatp = &STp->buffer->cmdstat; in st_write()
1774 move_buffer_data(STp->buffer, transfer - undone); in st_write()
1784 STp->buffer->buffer_bytes); in st_write()
1863 STbp = STp->buffer; in read_tape()
1869 blks = (STp->buffer)->buffer_blocks; in read_tape()
1873 if (!STbp->do_dio && bytes > (STp->buffer)->buffer_size) in read_tape()
1874 bytes = (STp->buffer)->buffer_size; in read_tape()
1903 struct st_cmdstatus *cmdstatp = &STp->buffer->cmdstat; in read_tape()
2023 STbp->buffer_bytes -= STp->buffer->cmdstat.residual; in read_tape()
2048 struct st_buffer *STbp = STp->buffer; in st_read()
2434 return (STp->buffer)->syscall_result; in read_mode_page()
2438 return STp->buffer->syscall_result; in read_mode_page()
2454 pgo = MODE_HEADER_LENGTH + (STp->buffer)->b_data[MH_OFF_BDESCS_LENGTH]; in write_mode_page()
2455 cmd[4] = pgo + (STp->buffer)->b_data[pgo + MP_OFF_PAGE_LENGTH] + 2; in write_mode_page()
2458 (STp->buffer)->b_data[MH_OFF_DATA_LENGTH] = 0; in write_mode_page()
2459 (STp->buffer)->b_data[MH_OFF_MEDIUM_TYPE] = 0; in write_mode_page()
2460 (STp->buffer)->b_data[MH_OFF_DEV_SPECIFIC] &= ~MH_BIT_WP; in write_mode_page()
2461 (STp->buffer)->b_data[pgo + MP_OFF_PAGE_NBR] &= MP_MSK_PAGE_NBR; in write_mode_page()
2468 return (STp->buffer)->syscall_result; in write_mode_page()
2472 return STp->buffer->syscall_result; in write_mode_page()
2497 unsigned char *b_data = (STp->buffer)->b_data; in st_compression()
2589 return (STp->buffer)->syscall_result; in do_load_unload()
2591 retval = (STp->buffer)->syscall_result; in do_load_unload()
2652 WARN_ON(STp->buffer->do_dio != 0); in st_int_ioctl()
2840 if (STp->dirty || (STp->buffer)->buffer_bytes != 0) in st_int_ioctl()
2856 memset((STp->buffer)->b_data, 0, 12); in st_int_ioctl()
2858 (STp->buffer)->b_data[2] = (arg & 7) << 4; in st_int_ioctl()
2860 (STp->buffer)->b_data[2] = in st_int_ioctl()
2862 (STp->buffer)->b_data[3] = 8; /* block descriptor length */ in st_int_ioctl()
2864 (STp->buffer)->b_data[4] = arg; in st_int_ioctl()
2867 (STp->buffer)->b_data[4] = arg >> 24; in st_int_ioctl()
2869 (STp->buffer)->b_data[4] = STp->density; in st_int_ioctl()
2876 (STp->buffer)->b_data[9] = (ltmp >> 16); in st_int_ioctl()
2877 (STp->buffer)->b_data[10] = (ltmp >> 8); in st_int_ioctl()
2878 (STp->buffer)->b_data[11] = ltmp; in st_int_ioctl()
2884 (STp->buffer)->b_data[9] * 65536 + in st_int_ioctl()
2885 (STp->buffer)->b_data[10] * 256 + in st_int_ioctl()
2886 (STp->buffer)->b_data[11]); in st_int_ioctl()
2890 (STp->buffer)->b_data[4]); in st_int_ioctl()
2894 ((STp->buffer)->b_data[2] >> 4) & 7); in st_int_ioctl()
2904 return (STp->buffer)->syscall_result; in st_int_ioctl()
2906 ioctl_result = (STp->buffer)->syscall_result; in st_int_ioctl()
2923 (STp->buffer)->buffer_blocks = in st_int_ioctl()
2924 (STp->buffer)->buffer_size / STp->block_size; in st_int_ioctl()
2926 (STp->buffer)->buffer_bytes = (STp->buffer)->read_pointer = 0; in st_int_ioctl()
2945 struct st_cmdstatus *cmdstatp = &STp->buffer->cmdstat; in st_int_ioctl()
3068 return (STp->buffer)->syscall_result; in get_location()
3070 if ((STp->buffer)->syscall_result != 0 || in get_location()
3072 ((STp->buffer)->b_data[0] & 4) != 0)) { in get_location()
3079 *block = ((STp->buffer)->b_data[0] << 16) in get_location()
3080 + ((STp->buffer)->b_data[1] << 8) in get_location()
3081 + (STp->buffer)->b_data[2]; in get_location()
3084 *block = ((STp->buffer)->b_data[4] << 24) in get_location()
3085 + ((STp->buffer)->b_data[5] << 16) in get_location()
3086 + ((STp->buffer)->b_data[6] << 8) in get_location()
3087 + (STp->buffer)->b_data[7]; in get_location()
3088 *partition = (STp->buffer)->b_data[1]; in get_location()
3089 if (((STp->buffer)->b_data[0] & 0x80) && in get_location()
3090 (STp->buffer)->b_data[1] == 0) /* BOP of partition 0 */ in get_location()
3172 return (STp->buffer)->syscall_result; in set_location()
3176 if ((STp->buffer)->syscall_result != 0) { in set_location()
3262 result = (STp->buffer)->b_data[MODE_HEADER_LENGTH + in nbr_partitions()
3302 bp = (STp->buffer)->b_data; in partition_tape()
3603 (STp->buffer)->buffer_bytes / STp->block_size; in st_ioctl()
3606 ((STp->buffer)->buffer_bytes + in st_ioctl()
4102 struct st_buffer *buffer; in st_probe() local
4119 buffer = new_tape_buffer((SDp->host)->unchecked_isa_dma, i); in st_probe()
4120 if (buffer == NULL) { in st_probe()
4156 tpnt->buffer = buffer; in st_probe()
4157 tpnt->buffer->last_SRpnt = NULL; in st_probe()
4253 kfree(buffer); in st_probe()
4293 if (tpnt->buffer) { in scsi_tape_release()
4294 normalize_buffer(tpnt->buffer); in scsi_tape_release()
4295 kfree(tpnt->buffer->reserved_pages); in scsi_tape_release()
4296 kfree(tpnt->buffer); in scsi_tape_release()