Lines Matching refs:buffer

368 	cmdstatp = &STp->buffer->cmdstat;  in st_chk_result()
372 scode = STp->buffer->cmdstat.sense_hdr.sense_key; in st_chk_result()
460 stp->buffer->syscall_result = -EINTR; in st_allocate_request()
462 stp->buffer->syscall_result = -EBUSY; in st_allocate_request()
485 - STp->buffer->cmdstat.residual, in st_do_stats()
487 if (STp->buffer->cmdstat.residual > 0) in st_do_stats()
499 - STp->buffer->cmdstat.residual, in st_do_stats()
501 if (STp->buffer->cmdstat.residual > 0) in st_do_stats()
520 STp->buffer->cmdstat.midlevel_result = SRpnt->result = req->errors; in st_scsi_execute_end()
521 STp->buffer->cmdstat.residual = req->resid_len; in st_scsi_execute_end()
534 int data_direction, void *buffer, unsigned bufflen, in st_scsi_execute() argument
538 struct rq_map_data *mdata = &SRpnt->stp->buffer->map_data; in st_scsi_execute()
595 struct rq_map_data *mdata = &STp->buffer->map_data; in st_do_scsi()
599 if (!do_wait && ((STp->buffer)->last_SRpnt)) { in st_do_scsi()
603 (STp->buffer)->syscall_result = (-EINTR); in st_do_scsi()
605 (STp->buffer)->syscall_result = (-EBUSY); in st_do_scsi()
618 (STp->buffer)->last_SRpnt = SRpnt; in st_do_scsi()
624 if (STp->buffer->do_dio) { in st_do_scsi()
626 mdata->nr_entries = STp->buffer->sg_segs; in st_do_scsi()
627 mdata->pages = STp->buffer->mapped_pages; in st_do_scsi()
629 mdata->page_order = STp->buffer->reserved_page_order; in st_do_scsi()
632 mdata->pages = STp->buffer->reserved_pages; in st_do_scsi()
637 STp->buffer->cmdstat.have_sense = 0; in st_do_scsi()
638 STp->buffer->syscall_result = 0; in st_do_scsi()
644 (STp->buffer)->syscall_result = (-EBUSY); in st_do_scsi()
645 (STp->buffer)->last_SRpnt = NULL; in st_do_scsi()
649 (STp->buffer)->syscall_result = st_chk_result(STp, SRpnt); in st_do_scsi()
668 STbuffer = STp->buffer; in write_behind_check()
684 (STp->buffer)->syscall_result = st_chk_result(STp, SRpnt); in write_behind_check()
745 return (STp->buffer)->syscall_result; in cross_eof()
750 if ((STp->buffer)->cmdstat.midlevel_result != 0) in cross_eof()
755 return (STp->buffer)->syscall_result; in cross_eof()
775 transfer = STp->buffer->buffer_bytes; in st_flush_write_buffer()
790 return (STp->buffer)->syscall_result; in st_flush_write_buffer()
793 if ((STp->buffer)->syscall_result != 0) { in st_flush_write_buffer()
794 struct st_cmdstatus *cmdstatp = &STp->buffer->cmdstat; in st_flush_write_buffer()
803 (STp->buffer)->buffer_bytes = 0; in st_flush_write_buffer()
816 (STp->buffer)->buffer_bytes = 0; in st_flush_write_buffer()
833 STbuffer = STp->buffer; in flush_buffer()
851 backspace = ((STp->buffer)->buffer_bytes + in flush_buffer()
852 (STp->buffer)->read_pointer) / STp->block_size - in flush_buffer()
853 ((STp->buffer)->read_pointer + STp->block_size - 1) / in flush_buffer()
855 (STp->buffer)->buffer_bytes = 0; in flush_buffer()
856 (STp->buffer)->read_pointer = 0; in flush_buffer()
971 struct st_cmdstatus *cmdstatp = &STp->buffer->cmdstat; in test_ready()
982 retval = (STp->buffer)->syscall_result; in test_ready()
1022 retval = (STp->buffer)->syscall_result; in test_ready()
1115 retval = (STp->buffer)->syscall_result; in check_tape()
1119 if (!SRpnt->result && !STp->buffer->cmdstat.have_sense) { in check_tape()
1120 STp->max_block = ((STp->buffer)->b_data[1] << 16) | in check_tape()
1121 ((STp->buffer)->b_data[2] << 8) | (STp->buffer)->b_data[3]; in check_tape()
1122 STp->min_block = ((STp->buffer)->b_data[4] << 8) | in check_tape()
1123 (STp->buffer)->b_data[5]; in check_tape()
1142 retval = (STp->buffer)->syscall_result; in check_tape()
1146 if ((STp->buffer)->syscall_result != 0) { in check_tape()
1149 (STp->buffer)->syscall_result = 0; /* Prevent error propagation */ in check_tape()
1154 (STp->buffer)->b_data[0], in check_tape()
1155 (STp->buffer)->b_data[1], in check_tape()
1156 (STp->buffer)->b_data[2], in check_tape()
1157 (STp->buffer)->b_data[3]); in check_tape()
1159 if ((STp->buffer)->b_data[3] >= 8) { in check_tape()
1160 STp->drv_buffer = ((STp->buffer)->b_data[2] >> 4) & 7; in check_tape()
1161 STp->density = (STp->buffer)->b_data[4]; in check_tape()
1162 STp->block_size = (STp->buffer)->b_data[9] * 65536 + in check_tape()
1163 (STp->buffer)->b_data[10] * 256 + (STp->buffer)->b_data[11]; in check_tape()
1167 (STp->buffer)->b_data[5] * 65536 + in check_tape()
1168 (STp->buffer)->b_data[6] * 256 + in check_tape()
1169 (STp->buffer)->b_data[7], in check_tape()
1172 STp->drv_write_prot = ((STp->buffer)->b_data[2] & 0x80) != 0; in check_tape()
1185 (STp->buffer)->buffer_blocks = in check_tape()
1186 (STp->buffer)->buffer_size / STp->block_size; in check_tape()
1188 (STp->buffer)->buffer_blocks = 1; in check_tape()
1189 (STp->buffer)->buffer_bytes = (STp->buffer)->read_pointer = 0; in check_tape()
1192 STp->block_size, (STp->buffer)->buffer_size, in check_tape()
1193 (STp->buffer)->buffer_blocks); in check_tape()
1290 if (!enlarge_buffer(STp->buffer, PAGE_SIZE, STp->restr_dma)) { in st_open()
1297 (STp->buffer)->cleared = 0; in st_open()
1298 (STp->buffer)->writing = 0; in st_open()
1299 (STp->buffer)->syscall_result = 0; in st_open()
1327 normalize_buffer(STp->buffer); in st_open()
1373 struct st_cmdstatus *cmdstatp = &STp->buffer->cmdstat; in st_flush()
1389 result = (STp->buffer)->syscall_result; in st_flush()
1393 if (STp->buffer->syscall_result == 0 || in st_flush()
1464 normalize_buffer(STp->buffer); in st_release()
1547 struct st_buffer *STbp = STp->buffer; in setup_buffering()
1609 STbp = STp->buffer; in release_buffering()
1681 STbp = STp->buffer; in st_write()
1791 struct st_cmdstatus *cmdstatp = &STp->buffer->cmdstat; in st_write()
1828 move_buffer_data(STp->buffer, transfer - undone); in st_write()
1838 STp->buffer->buffer_bytes); in st_write()
1917 STbp = STp->buffer; in read_tape()
1923 blks = (STp->buffer)->buffer_blocks; in read_tape()
1927 if (!STbp->do_dio && bytes > (STp->buffer)->buffer_size) in read_tape()
1928 bytes = (STp->buffer)->buffer_size; in read_tape()
1957 struct st_cmdstatus *cmdstatp = &STp->buffer->cmdstat; in read_tape()
2077 STbp->buffer_bytes -= STp->buffer->cmdstat.residual; in read_tape()
2102 struct st_buffer *STbp = STp->buffer; in st_read()
2488 return (STp->buffer)->syscall_result; in read_mode_page()
2492 return STp->buffer->syscall_result; in read_mode_page()
2508 pgo = MODE_HEADER_LENGTH + (STp->buffer)->b_data[MH_OFF_BDESCS_LENGTH]; in write_mode_page()
2509 cmd[4] = pgo + (STp->buffer)->b_data[pgo + MP_OFF_PAGE_LENGTH] + 2; in write_mode_page()
2512 (STp->buffer)->b_data[MH_OFF_DATA_LENGTH] = 0; in write_mode_page()
2513 (STp->buffer)->b_data[MH_OFF_MEDIUM_TYPE] = 0; in write_mode_page()
2514 (STp->buffer)->b_data[MH_OFF_DEV_SPECIFIC] &= ~MH_BIT_WP; in write_mode_page()
2515 (STp->buffer)->b_data[pgo + MP_OFF_PAGE_NBR] &= MP_MSK_PAGE_NBR; in write_mode_page()
2522 return (STp->buffer)->syscall_result; in write_mode_page()
2526 return STp->buffer->syscall_result; in write_mode_page()
2551 unsigned char *b_data = (STp->buffer)->b_data; in st_compression()
2643 return (STp->buffer)->syscall_result; in do_load_unload()
2645 retval = (STp->buffer)->syscall_result; in do_load_unload()
2706 WARN_ON(STp->buffer->do_dio != 0); in st_int_ioctl()
2894 if (STp->dirty || (STp->buffer)->buffer_bytes != 0) in st_int_ioctl()
2910 memset((STp->buffer)->b_data, 0, 12); in st_int_ioctl()
2912 (STp->buffer)->b_data[2] = (arg & 7) << 4; in st_int_ioctl()
2914 (STp->buffer)->b_data[2] = in st_int_ioctl()
2916 (STp->buffer)->b_data[3] = 8; /* block descriptor length */ in st_int_ioctl()
2918 (STp->buffer)->b_data[4] = arg; in st_int_ioctl()
2921 (STp->buffer)->b_data[4] = arg >> 24; in st_int_ioctl()
2923 (STp->buffer)->b_data[4] = STp->density; in st_int_ioctl()
2930 (STp->buffer)->b_data[9] = (ltmp >> 16); in st_int_ioctl()
2931 (STp->buffer)->b_data[10] = (ltmp >> 8); in st_int_ioctl()
2932 (STp->buffer)->b_data[11] = ltmp; in st_int_ioctl()
2938 (STp->buffer)->b_data[9] * 65536 + in st_int_ioctl()
2939 (STp->buffer)->b_data[10] * 256 + in st_int_ioctl()
2940 (STp->buffer)->b_data[11]); in st_int_ioctl()
2944 (STp->buffer)->b_data[4]); in st_int_ioctl()
2948 ((STp->buffer)->b_data[2] >> 4) & 7); in st_int_ioctl()
2958 return (STp->buffer)->syscall_result; in st_int_ioctl()
2960 ioctl_result = (STp->buffer)->syscall_result; in st_int_ioctl()
2977 (STp->buffer)->buffer_blocks = in st_int_ioctl()
2978 (STp->buffer)->buffer_size / STp->block_size; in st_int_ioctl()
2980 (STp->buffer)->buffer_bytes = (STp->buffer)->read_pointer = 0; in st_int_ioctl()
2999 struct st_cmdstatus *cmdstatp = &STp->buffer->cmdstat; in st_int_ioctl()
3122 return (STp->buffer)->syscall_result; in get_location()
3124 if ((STp->buffer)->syscall_result != 0 || in get_location()
3126 ((STp->buffer)->b_data[0] & 4) != 0)) { in get_location()
3133 *block = ((STp->buffer)->b_data[0] << 16) in get_location()
3134 + ((STp->buffer)->b_data[1] << 8) in get_location()
3135 + (STp->buffer)->b_data[2]; in get_location()
3138 *block = ((STp->buffer)->b_data[4] << 24) in get_location()
3139 + ((STp->buffer)->b_data[5] << 16) in get_location()
3140 + ((STp->buffer)->b_data[6] << 8) in get_location()
3141 + (STp->buffer)->b_data[7]; in get_location()
3142 *partition = (STp->buffer)->b_data[1]; in get_location()
3143 if (((STp->buffer)->b_data[0] & 0x80) && in get_location()
3144 (STp->buffer)->b_data[1] == 0) /* BOP of partition 0 */ in get_location()
3226 return (STp->buffer)->syscall_result; in set_location()
3230 if ((STp->buffer)->syscall_result != 0) { in set_location()
3316 result = (STp->buffer)->b_data[MODE_HEADER_LENGTH + in nbr_partitions()
3356 bp = (STp->buffer)->b_data; in partition_tape()
3657 (STp->buffer)->buffer_bytes / STp->block_size; in st_ioctl()
3660 ((STp->buffer)->buffer_bytes + in st_ioctl()
4157 struct st_buffer *buffer; in st_probe() local
4174 buffer = new_tape_buffer((SDp->host)->unchecked_isa_dma, i); in st_probe()
4175 if (buffer == NULL) { in st_probe()
4211 tpnt->buffer = buffer; in st_probe()
4212 tpnt->buffer->last_SRpnt = NULL; in st_probe()
4316 kfree(buffer); in st_probe()
4356 if (tpnt->buffer) { in scsi_tape_release()
4357 normalize_buffer(tpnt->buffer); in scsi_tape_release()
4358 kfree(tpnt->buffer->reserved_pages); in scsi_tape_release()
4359 kfree(tpnt->buffer); in scsi_tape_release()