taglinefilesource code
STp181drivers/scsi/st.cScsi_Tape * STp;
STp184drivers/scsi/st.cSTp = &(scsi_tapes[st_nbr]);
STp185drivers/scsi/st.cif ((STp->buffer)->writing &&
STp197drivers/scsi/st.c(STp->buffer)->last_result = SCpnt->result; /* Error */
STp199drivers/scsi/st.c(STp->buffer)->last_result = INT_MAX; /* OK */
STp202drivers/scsi/st.c(STp->buffer)->last_result = SCpnt->result;
STp203drivers/scsi/st.cif ((STp->buffer)->writing) {
STp205drivers/scsi/st.c(STp->buffer)->last_result_fatal = st_chk_result(SCpnt);
STp212drivers/scsi/st.cSTp->write_pending = 0;
STp226drivers/scsi/st.cst_do_scsi(Scsi_Cmnd *SCpnt, Scsi_Tape *STp, unsigned char *cmd, int bytes,
STp230drivers/scsi/st.cif ((SCpnt = allocate_device(NULL, STp->device, 1)) == NULL) {
STp231drivers/scsi/st.cprintk("st%d: Can't get SCSI request.\n", TAPE_NR(STp->devt));
STp236drivers/scsi/st.cSTp->sem = MUTEX_LOCKED;
STp237drivers/scsi/st.cSCpnt->request.sem = &(STp->sem);
STp239drivers/scsi/st.cSCpnt->request.rq_dev = STp->devt;
STp241drivers/scsi/st.cscsi_do_cmd(SCpnt, (void *)cmd, (STp->buffer)->b_data, bytes,
STp246drivers/scsi/st.c(STp->buffer)->last_result_fatal = st_chk_result(SCpnt);
STp254drivers/scsi/st.cwrite_behind_check(Scsi_Tape *STp)
STp258drivers/scsi/st.cSTbuffer = STp->buffer;
STp261drivers/scsi/st.cif (STp->write_pending)
STp262drivers/scsi/st.cSTp->nbr_waits++;
STp264drivers/scsi/st.cSTp->nbr_finished++;
STp267drivers/scsi/st.cdown(&(STp->sem));
STp274drivers/scsi/st.cif (STp->drv_block >= 0) {
STp275drivers/scsi/st.cif (STp->block_size == 0)
STp276drivers/scsi/st.cSTp->drv_block++;
STp278drivers/scsi/st.cSTp->drv_block += STbuffer->writing / STp->block_size;
STp289drivers/scsi/st.cback_over_eof(Scsi_Tape *STp)
STp299drivers/scsi/st.cSCpnt = st_do_scsi(NULL, STp, cmd, 0, ST_TIMEOUT, MAX_RETRIES);
STp304drivers/scsi/st.cif ((STp->buffer)->last_result != 0) {
STp305drivers/scsi/st.cprintk("st%d: Backing over filemark failed.\n", TAPE_NR(STp->devt));
STp306drivers/scsi/st.cif ((STp->mt_status)->mt_fileno >= 0)
STp307drivers/scsi/st.c(STp->mt_status)->mt_fileno += 1;
STp308drivers/scsi/st.c(STp->mt_status)->mt_blkno = 0;
STp311drivers/scsi/st.creturn (STp->buffer)->last_result_fatal;
STp317drivers/scsi/st.cflush_write_buffer(Scsi_Tape *STp)
STp324drivers/scsi/st.cif ((STp->buffer)->writing) {
STp325drivers/scsi/st.cwrite_behind_check(STp);
STp326drivers/scsi/st.cif ((STp->buffer)->last_result_fatal) {
STp329drivers/scsi/st.cprintk("st%d: Async write error (flush) %x.\n", TAPE_NR(STp->devt),
STp330drivers/scsi/st.c(STp->buffer)->last_result);
STp332drivers/scsi/st.cif ((STp->buffer)->last_result == INT_MAX)
STp338drivers/scsi/st.cif (STp->block_size == 0)
STp342drivers/scsi/st.cif (STp->dirty == 1) {
STp344drivers/scsi/st.coffset = (STp->buffer)->buffer_bytes;
STp345drivers/scsi/st.ctransfer = ((offset + STp->block_size - 1) /
STp346drivers/scsi/st.cSTp->block_size) * STp->block_size;
STp349drivers/scsi/st.cprintk("st%d: Flushing %d bytes.\n", TAPE_NR(STp->devt), transfer);
STp351drivers/scsi/st.cmemset((STp->buffer)->b_data + offset, 0, transfer - offset);
STp356drivers/scsi/st.cblks = transfer / STp->block_size;
STp361drivers/scsi/st.cSCpnt = st_do_scsi(NULL, STp, cmd, transfer, ST_TIMEOUT, MAX_WRITE_RETRIES);
STp365drivers/scsi/st.cif ((STp->buffer)->last_result_fatal != 0) {
STp366drivers/scsi/st.cprintk("st%d: Error on flush.\n", TAPE_NR(STp->devt));
STp370drivers/scsi/st.cSTp->dirty = 0;
STp371drivers/scsi/st.c(STp->buffer)->buffer_bytes = 0;
STp376drivers/scsi/st.cSTp->drv_block = (-1);
STp379drivers/scsi/st.cif (STp->drv_block >= 0)
STp380drivers/scsi/st.cSTp->drv_block += blks;
STp381drivers/scsi/st.cSTp->dirty = 0;
STp382drivers/scsi/st.c(STp->buffer)->buffer_bytes = 0;
STp396drivers/scsi/st.cScsi_Tape * STp;
STp400drivers/scsi/st.cSTp = &(scsi_tapes[dev]);
STp401drivers/scsi/st.cSTbuffer = STp->buffer;
STp407drivers/scsi/st.cif( STp->device->was_reset )
STp410drivers/scsi/st.cif (STp->ready != ST_READY)
STp413drivers/scsi/st.cif (STp->rw == ST_WRITING)  /* Writing */
STp414drivers/scsi/st.creturn flush_write_buffer(STp);
STp416drivers/scsi/st.cif (STp->block_size == 0)
STp419drivers/scsi/st.cbackspace = ((STp->buffer)->buffer_bytes +
STp420drivers/scsi/st.c(STp->buffer)->read_pointer) / STp->block_size -
STp421drivers/scsi/st.c((STp->buffer)->read_pointer + STp->block_size - 1) /
STp422drivers/scsi/st.cSTp->block_size;
STp423drivers/scsi/st.c(STp->buffer)->buffer_bytes = 0;
STp424drivers/scsi/st.c(STp->buffer)->read_pointer = 0;
STp427drivers/scsi/st.cif ((STp->eof == ST_FM) && !STp->eof_hit) {
STp428drivers/scsi/st.cresult = back_over_eof(STp); /* Back over the EOF hit */
STp430drivers/scsi/st.cSTp->eof = ST_NOEOF;
STp431drivers/scsi/st.cSTp->eof_hit = 0;
STp450drivers/scsi/st.cScsi_Tape * STp;
STp455drivers/scsi/st.cSTp = &(scsi_tapes[dev]);
STp456drivers/scsi/st.cif (STp->in_use) {
STp466drivers/scsi/st.cSTp->buffer = new_tape_buffer(FALSE);
STp467drivers/scsi/st.cif (STp->buffer == NULL) {
STp473drivers/scsi/st.cSTp->buffer = st_buffers[i];
STp474drivers/scsi/st.c(STp->buffer)->in_use = 1;
STp475drivers/scsi/st.c(STp->buffer)->writing = 0;
STp476drivers/scsi/st.cSTp->in_use = 1;
STp479drivers/scsi/st.cSTp->write_prot = ((flags & O_ACCMODE) == O_RDONLY);
STp481drivers/scsi/st.cSTp->dirty = 0;
STp482drivers/scsi/st.cSTp->rw = ST_IDLE;
STp483drivers/scsi/st.cSTp->ready = ST_READY;
STp484drivers/scsi/st.cif (STp->eof != ST_EOD)  /* Save EOD across opens */
STp485drivers/scsi/st.cSTp->eof = ST_NOEOF;
STp486drivers/scsi/st.cSTp->eof_hit = 0;
STp487drivers/scsi/st.cSTp->recover_count = 0;
STp489drivers/scsi/st.cSTp->nbr_waits = STp->nbr_finished = 0;
STp495drivers/scsi/st.cSCpnt = st_do_scsi(NULL, STp, cmd, 0, ST_LONG_TIMEOUT, MAX_READY_RETRIES);
STp501drivers/scsi/st.c(STp->mt_status)->mt_fileno = 0 ;
STp505drivers/scsi/st.cSCpnt = st_do_scsi(SCpnt, STp, cmd, 0, ST_LONG_TIMEOUT, MAX_READY_RETRIES);
STp507drivers/scsi/st.c(STp->mt_status)->mt_fileno = STp->drv_block = 0;
STp508drivers/scsi/st.cSTp->eof = ST_NOEOF;
STp509drivers/scsi/st.c(STp->device)->was_reset = 0;
STp512drivers/scsi/st.cif ((STp->buffer)->last_result_fatal != 0) {
STp515drivers/scsi/st.c(STp->mt_status)->mt_fileno = STp->drv_block = 0 ;
STp517drivers/scsi/st.cSTp->ready = ST_NO_TAPE;
STp519drivers/scsi/st.c(STp->mt_status)->mt_fileno = STp->drv_block = (-1);
STp520drivers/scsi/st.cSTp->ready = ST_NOT_READY;
STp523drivers/scsi/st.cSTp->density = 0;     /* Clear the erroneous "residue" */
STp524drivers/scsi/st.cSTp->write_prot = 0;
STp525drivers/scsi/st.cSTp->block_size = 0;
STp526drivers/scsi/st.cSTp->eof = ST_NOEOF;
STp527drivers/scsi/st.c(STp->mt_status)->mt_fileno = STp->drv_block = 0;
STp528drivers/scsi/st.cSTp->door_locked = ST_UNLOCKED;
STp538drivers/scsi/st.cSCpnt = st_do_scsi(SCpnt, STp, cmd, 6, ST_TIMEOUT, MAX_READY_RETRIES);
STp541drivers/scsi/st.cSTp->max_block = ((STp->buffer)->b_data[1] << 16) |
STp542drivers/scsi/st.c((STp->buffer)->b_data[2] << 8) | (STp->buffer)->b_data[3];
STp543drivers/scsi/st.cSTp->min_block = ((STp->buffer)->b_data[4] << 8) |
STp544drivers/scsi/st.c(STp->buffer)->b_data[5];
STp547drivers/scsi/st.cprintk("st%d: Block limits %d - %d bytes.\n", dev, STp->min_block,
STp548drivers/scsi/st.cSTp->max_block);
STp552drivers/scsi/st.cSTp->min_block = STp->max_block = (-1);
STp563drivers/scsi/st.cSCpnt = st_do_scsi(SCpnt, STp, cmd, 12, ST_TIMEOUT, MAX_READY_RETRIES);
STp565drivers/scsi/st.cif ((STp->buffer)->last_result_fatal != 0) {
STp570drivers/scsi/st.cSTp->block_size = ST_DEFAULT_BLOCK;  /* Educated guess (?) */
STp571drivers/scsi/st.c(STp->buffer)->last_result_fatal = 0;  /* Prevent error propagation */
STp572drivers/scsi/st.cSTp->drv_write_prot = 0;
STp579drivers/scsi/st.c(STp->buffer)->b_data[0], (STp->buffer)->b_data[1],
STp580drivers/scsi/st.c(STp->buffer)->b_data[2], (STp->buffer)->b_data[3]);
STp583drivers/scsi/st.cif ((STp->buffer)->b_data[3] >= 8) {
STp584drivers/scsi/st.cSTp->drv_buffer = ((STp->buffer)->b_data[2] >> 4) & 7;
STp585drivers/scsi/st.cSTp->density = (STp->buffer)->b_data[4];
STp586drivers/scsi/st.cSTp->block_size = (STp->buffer)->b_data[9] * 65536 +
STp587drivers/scsi/st.c(STp->buffer)->b_data[10] * 256 + (STp->buffer)->b_data[11];
STp591drivers/scsi/st.cdev, STp->density, (STp->buffer)->b_data[5] * 65536 +
STp592drivers/scsi/st.c(STp->buffer)->b_data[6] * 256 + (STp->buffer)->b_data[7],
STp593drivers/scsi/st.cSTp->drv_buffer);
STp597drivers/scsi/st.cif (STp->block_size > (STp->buffer)->buffer_size &&
STp598drivers/scsi/st.c!enlarge_buffer(STp->buffer, STp->block_size)) {
STp600drivers/scsi/st.cSTp->block_size);
STp601drivers/scsi/st.c(STp->buffer)->in_use = 0;
STp602drivers/scsi/st.cSTp->in_use = 0;
STp605drivers/scsi/st.cSTp->drv_write_prot = ((STp->buffer)->b_data[2] & 0x80) != 0;
STp609drivers/scsi/st.cif (STp->block_size > 0)
STp610drivers/scsi/st.c(STp->buffer)->buffer_blocks = st_buffer_size / STp->block_size;
STp612drivers/scsi/st.c(STp->buffer)->buffer_blocks = 1;
STp613drivers/scsi/st.c(STp->buffer)->buffer_bytes = (STp->buffer)->read_pointer = 0;
STp618drivers/scsi/st.cSTp->block_size, (STp->buffer)->buffer_size,
STp619drivers/scsi/st.c(STp->buffer)->buffer_blocks);
STp622drivers/scsi/st.cif (STp->drv_write_prot) {
STp623drivers/scsi/st.cSTp->write_prot = 1;
STp629drivers/scsi/st.c(STp->buffer)->in_use = 0;
STp630drivers/scsi/st.cSTp->buffer = 0;
STp631drivers/scsi/st.cSTp->in_use = 0;
STp652drivers/scsi/st.cScsi_Tape * STp;
STp659drivers/scsi/st.cSTp = &(scsi_tapes[dev]);
STp661drivers/scsi/st.cif ( STp->rw == ST_WRITING && !(STp->device)->was_reset) {
STp663drivers/scsi/st.cresult = flush_write_buffer(STp);
STp669drivers/scsi/st.cSTp->nbr_waits, STp->nbr_finished);
STp677drivers/scsi/st.ccmd[4] = 1 + STp->two_fm;
STp679drivers/scsi/st.cSCpnt = st_do_scsi(NULL, STp, cmd, 0, ST_TIMEOUT, MAX_WRITE_RETRIES);
STp685drivers/scsi/st.cif ((STp->buffer)->last_result_fatal != 0)
STp688drivers/scsi/st.cif ((STp->mt_status)->mt_fileno >= 0)
STp689drivers/scsi/st.c(STp->mt_status)->mt_fileno++ ;
STp690drivers/scsi/st.cSTp->drv_block = 0;
STp691drivers/scsi/st.cif (STp->two_fm)
STp692drivers/scsi/st.cback_over_eof(STp);
STp705drivers/scsi/st.cif ((STp->eof == ST_FM) && !STp->eof_hit)
STp706drivers/scsi/st.cback_over_eof(STp);
STp713drivers/scsi/st.cif (STp->door_locked == ST_LOCKED_AUTO)
STp716drivers/scsi/st.cif (STp->buffer != NULL) {
STp717drivers/scsi/st.cnormalize_buffer(STp->buffer);
STp718drivers/scsi/st.c(STp->buffer)->in_use = 0;
STp720drivers/scsi/st.cSTp->in_use = 0;
STp740drivers/scsi/st.cScsi_Tape * STp;
STp743drivers/scsi/st.cSTp = &(scsi_tapes[dev]);
STp744drivers/scsi/st.cif (STp->ready != ST_READY)
STp751drivers/scsi/st.cif( STp->device->was_reset )
STp755drivers/scsi/st.cif (!STp->in_use) {
STp761drivers/scsi/st.cif (STp->write_prot)
STp764drivers/scsi/st.cif (STp->block_size == 0 &&
STp765drivers/scsi/st.ccount > (STp->buffer)->buffer_size &&
STp766drivers/scsi/st.c!enlarge_buffer(STp->buffer, count))
STp769drivers/scsi/st.cif (STp->do_auto_lock && STp->door_locked == ST_UNLOCKED &&
STp771drivers/scsi/st.cSTp->door_locked = ST_LOCKED_AUTO;
STp773drivers/scsi/st.cif (STp->rw == ST_READING) {
STp777drivers/scsi/st.cSTp->rw = ST_WRITING;
STp780drivers/scsi/st.cif (STp->moves_after_eof < 255)
STp781drivers/scsi/st.cSTp->moves_after_eof++;
STp783drivers/scsi/st.cif ((STp->buffer)->writing) {
STp784drivers/scsi/st.cwrite_behind_check(STp);
STp785drivers/scsi/st.cif ((STp->buffer)->last_result_fatal) {
STp789drivers/scsi/st.c(STp->buffer)->last_result);
STp791drivers/scsi/st.cif ((STp->buffer)->last_result == INT_MAX) {
STp793drivers/scsi/st.cSTp->eof = ST_EOM_OK;
STp801drivers/scsi/st.cif (STp->eof == ST_EOM_OK)
STp803drivers/scsi/st.celse if (STp->eof == ST_EOM_ERROR)
STp806drivers/scsi/st.cif (!STp->do_buffer_writes) {
STp807drivers/scsi/st.cif (STp->block_size != 0 && (count % STp->block_size) != 0)
STp812drivers/scsi/st.cwrite_threshold = (STp->buffer)->buffer_blocks * STp->block_size;
STp813drivers/scsi/st.cif (!STp->do_async_writes)
STp820drivers/scsi/st.ccmd[1] = (STp->block_size != 0);
STp822drivers/scsi/st.cSTp->rw = ST_WRITING;
STp825drivers/scsi/st.cwhile((STp->block_size == 0 && !STp->do_async_writes && count > 0) ||
STp826drivers/scsi/st.c(STp->block_size != 0 &&
STp827drivers/scsi/st.c(STp->buffer)->buffer_bytes + count > write_threshold))
STp830drivers/scsi/st.cif (STp->block_size == 0)
STp833drivers/scsi/st.cdo_count = (STp->buffer)->buffer_blocks * STp->block_size -
STp834drivers/scsi/st.c(STp->buffer)->buffer_bytes;
STp838drivers/scsi/st.cmemcpy_fromfs((STp->buffer)->b_data +
STp839drivers/scsi/st.c(STp->buffer)->buffer_bytes, b_point, do_count);
STp841drivers/scsi/st.cif (STp->block_size == 0)
STp844drivers/scsi/st.cblks = ((STp->buffer)->buffer_bytes + do_count) /
STp845drivers/scsi/st.cSTp->block_size;
STp846drivers/scsi/st.ctransfer = blks * STp->block_size;
STp852drivers/scsi/st.cSCpnt = st_do_scsi(SCpnt, STp, cmd, transfer, ST_TIMEOUT, MAX_WRITE_RETRIES);
STp856drivers/scsi/st.cif ((STp->buffer)->last_result_fatal != 0) {
STp863drivers/scsi/st.cif (STp->block_size != 0 && (SCpnt->sense_buffer[0] & 0x80) != 0)
STp867drivers/scsi/st.celse if (STp->block_size == 0 &&
STp872drivers/scsi/st.cif (STp->block_size != 0)
STp873drivers/scsi/st.ctransfer *= STp->block_size;
STp877drivers/scsi/st.cif (STp->drv_block >= 0) {
STp878drivers/scsi/st.cif (STp->block_size == 0 && transfer < do_count)
STp879drivers/scsi/st.cSTp->drv_block++;
STp880drivers/scsi/st.celse if (STp->block_size != 0)
STp881drivers/scsi/st.cSTp->drv_block += (do_count - transfer) / STp->block_size;
STp883drivers/scsi/st.cSTp->eof = ST_EOM_OK;
STp892drivers/scsi/st.cSTp->eof = ST_EOM_ERROR;
STp893drivers/scsi/st.cSTp->drv_block = (-1);    /* Too cautious? */
STp902drivers/scsi/st.cSTp->drv_block = (-1);    /* Too cautious? */
STp907drivers/scsi/st.c(STp->buffer)->buffer_bytes = 0;
STp908drivers/scsi/st.cSTp->dirty = 0;
STp917drivers/scsi/st.cif (STp->drv_block >= 0) {
STp918drivers/scsi/st.cif (STp->block_size == 0)
STp919drivers/scsi/st.cSTp->drv_block++;
STp921drivers/scsi/st.cSTp->drv_block += blks;
STp923drivers/scsi/st.c(STp->buffer)->buffer_bytes = 0;
STp924drivers/scsi/st.cSTp->dirty = 0;
STp927drivers/scsi/st.cSTp->dirty = 1;
STp928drivers/scsi/st.cmemcpy_fromfs((STp->buffer)->b_data +
STp929drivers/scsi/st.c(STp->buffer)->buffer_bytes,b_point,count);
STp931drivers/scsi/st.c(STp->buffer)->buffer_bytes += count;
STp935drivers/scsi/st.cif (doing_write && (STp->buffer)->last_result_fatal != 0) {
STp937drivers/scsi/st.creturn (STp->buffer)->last_result_fatal;
STp940drivers/scsi/st.cif (STp->do_async_writes &&
STp941drivers/scsi/st.c((STp->buffer)->buffer_bytes >= STp->write_threshold ||
STp942drivers/scsi/st.cSTp->block_size == 0) ) {
STp945drivers/scsi/st.cSCpnt = allocate_device(NULL, STp->device, 1);
STp949drivers/scsi/st.cif (STp->block_size == 0)
STp950drivers/scsi/st.c(STp->buffer)->writing = (STp->buffer)->buffer_bytes;
STp952drivers/scsi/st.c(STp->buffer)->writing = ((STp->buffer)->buffer_bytes /
STp953drivers/scsi/st.cSTp->block_size) * STp->block_size;
STp954drivers/scsi/st.cSTp->dirty = !((STp->buffer)->writing ==
STp955drivers/scsi/st.c(STp->buffer)->buffer_bytes);
STp957drivers/scsi/st.cif (STp->block_size == 0)
STp958drivers/scsi/st.cblks = (STp->buffer)->writing;
STp960drivers/scsi/st.cblks = (STp->buffer)->writing / STp->block_size;
STp964drivers/scsi/st.cSTp->sem = MUTEX_LOCKED;
STp965drivers/scsi/st.cSCpnt->request.sem = &(STp->sem);
STp967drivers/scsi/st.cSCpnt->request.rq_dev = STp->devt;
STp969drivers/scsi/st.cSTp->write_pending = 1;
STp973drivers/scsi/st.c(void *) cmd, (STp->buffer)->b_data,
STp974drivers/scsi/st.c(STp->buffer)->writing,
STp980drivers/scsi/st.cSTp->at_sm &= (total != 0);
STp993drivers/scsi/st.cScsi_Tape * STp;
STp996drivers/scsi/st.cSTp = &(scsi_tapes[dev]);
STp997drivers/scsi/st.cif (STp->ready != ST_READY)
STp1000drivers/scsi/st.cif (!STp->in_use) {
STp1006drivers/scsi/st.cif (STp->block_size == 0 &&
STp1007drivers/scsi/st.ccount > (STp->buffer)->buffer_size &&
STp1008drivers/scsi/st.c!enlarge_buffer(STp->buffer, count))
STp1011drivers/scsi/st.cif (!(STp->do_read_ahead) && STp->block_size != 0 &&
STp1012drivers/scsi/st.c(count % STp->block_size) != 0)
STp1015drivers/scsi/st.cif (STp->do_auto_lock && STp->door_locked == ST_UNLOCKED &&
STp1017drivers/scsi/st.cSTp->door_locked = ST_LOCKED_AUTO;
STp1019drivers/scsi/st.cif (STp->rw == ST_WRITING) {
STp1023drivers/scsi/st.cSTp->rw = ST_READING;
STp1025drivers/scsi/st.cif (STp->moves_after_eof < 255)
STp1026drivers/scsi/st.cSTp->moves_after_eof++;
STp1029drivers/scsi/st.cif (debugging && STp->eof != ST_NOEOF)
STp1031drivers/scsi/st.c(STp->buffer)->buffer_bytes);
STp1033drivers/scsi/st.cif (((STp->buffer)->buffer_bytes == 0) &&
STp1034drivers/scsi/st.c(STp->eof == ST_EOM_OK || STp->eof == ST_EOD))
STp1037drivers/scsi/st.cSTp->rw = ST_READING;
STp1041drivers/scsi/st.cif ((STp->buffer)->buffer_bytes == 0 &&
STp1042drivers/scsi/st.cSTp->eof == ST_NOEOF) {
STp1046drivers/scsi/st.ccmd[1] = (STp->block_size != 0);
STp1047drivers/scsi/st.cif (STp->block_size == 0)
STp1050drivers/scsi/st.cif (STp->do_read_ahead) {
STp1051drivers/scsi/st.cblks = (STp->buffer)->buffer_blocks;
STp1052drivers/scsi/st.cbytes = blks * STp->block_size;
STp1056drivers/scsi/st.cif (bytes > (STp->buffer)->buffer_size)
STp1057drivers/scsi/st.cbytes = (STp->buffer)->buffer_size;
STp1058drivers/scsi/st.cblks = bytes / STp->block_size;
STp1059drivers/scsi/st.cbytes = blks * STp->block_size;
STp1066drivers/scsi/st.cSCpnt = st_do_scsi(SCpnt, STp, cmd, bytes, ST_TIMEOUT, MAX_RETRIES);
STp1070drivers/scsi/st.c(STp->buffer)->read_pointer = 0;
STp1071drivers/scsi/st.cSTp->eof_hit = 0;
STp1072drivers/scsi/st.cSTp->at_sm = 0;
STp1074drivers/scsi/st.cif ((STp->buffer)->last_result_fatal) {
STp1093drivers/scsi/st.cif (STp->block_size == 0 &&
STp1098drivers/scsi/st.cif (STp->block_size == 0) {
STp1101drivers/scsi/st.c(STp->buffer)->buffer_bytes = bytes - transfer;
STp1110drivers/scsi/st.cSTp->eof = ST_EOM_OK;
STp1111drivers/scsi/st.cif (STp->block_size == 0)
STp1112drivers/scsi/st.c(STp->buffer)->buffer_bytes = bytes - transfer;
STp1114drivers/scsi/st.c(STp->buffer)->buffer_bytes =
STp1115drivers/scsi/st.cbytes - transfer * STp->block_size;
STp1119drivers/scsi/st.c(STp->buffer)->buffer_bytes);
STp1123drivers/scsi/st.cSTp->eof = ST_FM;
STp1124drivers/scsi/st.cif (STp->block_size == 0)
STp1125drivers/scsi/st.c(STp->buffer)->buffer_bytes = 0;
STp1127drivers/scsi/st.c(STp->buffer)->buffer_bytes =
STp1128drivers/scsi/st.cbytes - transfer * STp->block_size;
STp1133drivers/scsi/st.cdev, (STp->buffer)->buffer_bytes, total);
STp1143drivers/scsi/st.cSTp->drv_block = (-1);
STp1146drivers/scsi/st.celse if (STp->moves_after_eof == 1 &&
STp1153drivers/scsi/st.cSTp->eof = ST_EOD;
STp1161drivers/scsi/st.ctransfer = (STp->buffer)->last_result_fatal;
STp1167drivers/scsi/st.c(STp->buffer)->buffer_bytes = bytes;
STp1169drivers/scsi/st.cif (STp->drv_block >= 0) {
STp1170drivers/scsi/st.cif (STp->block_size == 0)
STp1171drivers/scsi/st.cSTp->drv_block++;
STp1173drivers/scsi/st.cSTp->drv_block += (STp->buffer)->buffer_bytes / STp->block_size;
STp1179drivers/scsi/st.cif ((STp->buffer)->buffer_bytes > 0) {
STp1181drivers/scsi/st.cif (debugging && STp->eof != ST_NOEOF)
STp1183drivers/scsi/st.c(STp->buffer)->buffer_bytes, count - total);
STp1185drivers/scsi/st.ctransfer = (STp->buffer)->buffer_bytes < count - total ?
STp1186drivers/scsi/st.c(STp->buffer)->buffer_bytes : count - total;
STp1187drivers/scsi/st.cmemcpy_tofs(buf, (STp->buffer)->b_data +
STp1188drivers/scsi/st.c(STp->buffer)->read_pointer,transfer);
STp1192drivers/scsi/st.c(STp->buffer)->buffer_bytes -= transfer;
STp1193drivers/scsi/st.c(STp->buffer)->read_pointer += transfer;
STp1195drivers/scsi/st.celse if (STp->eof != ST_NOEOF) {
STp1196drivers/scsi/st.cSTp->eof_hit = 1;
STp1199drivers/scsi/st.cif (total == 0 && STp->eof == ST_FM) {
STp1200drivers/scsi/st.cSTp->eof = ST_NOEOF;
STp1201drivers/scsi/st.cSTp->drv_block = 0;
STp1202drivers/scsi/st.cif (STp->moves_after_eof > 1)
STp1203drivers/scsi/st.cSTp->moves_after_eof = 0;
STp1204drivers/scsi/st.cif ((STp->mt_status)->mt_fileno >= 0)
STp1205drivers/scsi/st.c(STp->mt_status)->mt_fileno++;
STp1207drivers/scsi/st.cif (total == 0 && STp->eof == ST_EOM_OK)
STp1212drivers/scsi/st.cif (STp->block_size == 0)
STp1230drivers/scsi/st.cScsi_Tape *STp;
STp1233drivers/scsi/st.cSTp = &(scsi_tapes[dev]);
STp1235drivers/scsi/st.cSTp->do_buffer_writes = (options & MT_ST_BUFFER_WRITES) != 0;
STp1236drivers/scsi/st.cSTp->do_async_writes  = (options & MT_ST_ASYNC_WRITES) != 0;
STp1237drivers/scsi/st.cSTp->do_read_ahead    = (options & MT_ST_READ_AHEAD) != 0;
STp1238drivers/scsi/st.cSTp->two_fm      = (options & MT_ST_TWO_FM) != 0;
STp1239drivers/scsi/st.cSTp->fast_mteom    = (options & MT_ST_FAST_MTEOM) != 0;
STp1240drivers/scsi/st.cSTp->do_auto_lock     = (options & MT_ST_AUTO_LOCK) != 0;
STp1245drivers/scsi/st.cdev, STp->do_buffer_writes, STp->do_async_writes,
STp1246drivers/scsi/st.cSTp->do_read_ahead);
STp1248drivers/scsi/st.cSTp->two_fm, STp->fast_mteom, STp->do_auto_lock, debugging);
STp1258drivers/scsi/st.cSTp->write_threshold = value;
STp1261drivers/scsi/st.cSTp->write_threshold);
STp1281drivers/scsi/st.cScsi_Tape * STp;
STp1285drivers/scsi/st.cSTp = &(scsi_tapes[dev]);
STp1286drivers/scsi/st.cif (STp->ready != ST_READY && cmd_in != MTLOAD)
STp1288drivers/scsi/st.cfileno = (STp->mt_status)->mt_fileno ;
STp1289drivers/scsi/st.cblkno = STp->drv_block;
STp1290drivers/scsi/st.cat_sm = STp->at_sm;
STp1405drivers/scsi/st.cif (STp->write_prot)
STp1474drivers/scsi/st.cif (!STp->fast_mteom) {
STp1477drivers/scsi/st.cfileno = (STp->mt_status)->mt_fileno ;
STp1478drivers/scsi/st.cif (STp->eof == ST_EOD || STp->eof == ST_EOM_OK)
STp1497drivers/scsi/st.cif (STp->write_prot)
STp1542drivers/scsi/st.cif ((STp->device)->scsi_level < SCSI_2) {
STp1571drivers/scsi/st.cif (STp->dirty || (STp->buffer)->buffer_bytes != 0)
STp1575drivers/scsi/st.c(arg < STp->min_block || arg > STp->max_block ||
STp1583drivers/scsi/st.cmemset((STp->buffer)->b_data, 0, 12);
STp1585drivers/scsi/st.c(STp->buffer)->b_data[2] = (arg & 7) << 4;
STp1587drivers/scsi/st.c(STp->buffer)->b_data[2] = 
STp1588drivers/scsi/st.cSTp->drv_buffer << 4;
STp1589drivers/scsi/st.c(STp->buffer)->b_data[3] = 8;     /* block descriptor length */
STp1591drivers/scsi/st.c(STp->buffer)->b_data[4] = arg;
STp1593drivers/scsi/st.c(STp->buffer)->b_data[4] = STp->density;
STp1597drivers/scsi/st.cltmp = STp->block_size;
STp1598drivers/scsi/st.c(STp->buffer)->b_data[9] = (ltmp >> 16);
STp1599drivers/scsi/st.c(STp->buffer)->b_data[10] = (ltmp >> 8);
STp1600drivers/scsi/st.c(STp->buffer)->b_data[11] = ltmp;
STp1606drivers/scsi/st.c(STp->buffer)->b_data[9] * 65536 +
STp1607drivers/scsi/st.c(STp->buffer)->b_data[10] * 256 +
STp1608drivers/scsi/st.c(STp->buffer)->b_data[11]);
STp1611drivers/scsi/st.c(STp->buffer)->b_data[4]);
STp1614drivers/scsi/st.c((STp->buffer)->b_data[2] >> 4) & 7);
STp1623drivers/scsi/st.cSCpnt = st_do_scsi(NULL, STp, cmd, datalen, timeout, MAX_RETRIES);
STp1627drivers/scsi/st.cioctl_result = (STp->buffer)->last_result_fatal;
STp1632drivers/scsi/st.cSTp->moves_after_eof = 0;
STp1634drivers/scsi/st.cSTp->moves_after_eof = 1;
STp1637drivers/scsi/st.cSTp->drv_block = blkno;
STp1638drivers/scsi/st.c(STp->mt_status)->mt_fileno = fileno;
STp1639drivers/scsi/st.cSTp->at_sm = at_sm;
STp1642drivers/scsi/st.cSTp->drv_block = (STp->mt_status)->mt_fileno = (-1);
STp1643drivers/scsi/st.cSTp->at_sm = 0;
STp1646drivers/scsi/st.cSTp->door_locked = ST_LOCKED_EXPLICIT;
STp1648drivers/scsi/st.cSTp->door_locked = ST_UNLOCKED;
STp1654drivers/scsi/st.cSTp->block_size = arg;
STp1656drivers/scsi/st.c(STp->buffer)->buffer_blocks =
STp1657drivers/scsi/st.c(STp->buffer)->buffer_size / STp->block_size;
STp1658drivers/scsi/st.c(STp->buffer)->buffer_bytes = (STp->buffer)->read_pointer = 0;
STp1661drivers/scsi/st.cSTp->drv_buffer = (arg & 7);
STp1663drivers/scsi/st.cSTp->density = arg;
STp1665drivers/scsi/st.cSTp->eof = ST_EOD;
STp1666drivers/scsi/st.cSTp->eof_hit = 0;
STp1669drivers/scsi/st.cSTp->eof = ST_NOEOF;
STp1670drivers/scsi/st.cSTp->eof_hit = 0;
STp1676drivers/scsi/st.cSTp->eof = ST_EOM_OK;
STp1677drivers/scsi/st.cSTp->eof_hit = 0;
STp1678drivers/scsi/st.cSTp->drv_block = 0;
STp1687drivers/scsi/st.c(STp->mt_status)->mt_fileno = fileno - undone ;
STp1689drivers/scsi/st.c(STp->mt_status)->mt_fileno = fileno;
STp1690drivers/scsi/st.cSTp->drv_block = 0;
STp1693drivers/scsi/st.c(STp->mt_status)->mt_fileno = fileno + undone ;
STp1694drivers/scsi/st.cSTp->drv_block = 0;
STp1698drivers/scsi/st.c(STp->mt_status)->mt_fileno++;
STp1699drivers/scsi/st.cSTp->drv_block = 0;
STp1703drivers/scsi/st.cSTp->drv_block = blkno - undone;
STp1705drivers/scsi/st.cSTp->drv_block = (-1);
STp1710drivers/scsi/st.c(STp->mt_status)->mt_fileno--;
STp1711drivers/scsi/st.cSTp->drv_block = (-1);
STp1715drivers/scsi/st.cSTp->drv_block = blkno + undone;
STp1717drivers/scsi/st.cSTp->drv_block = (-1);
STp1721drivers/scsi/st.c(STp->mt_status)->mt_fileno = (-1);
STp1722drivers/scsi/st.cSTp->drv_block = (-1);
STp1724drivers/scsi/st.cif (STp->eof == ST_NOEOF &&
STp1726drivers/scsi/st.cSTp->eof = ST_EOD;
STp1728drivers/scsi/st.cSTp->door_locked = ST_LOCK_FAILS;
STp1746drivers/scsi/st.cScsi_Tape *STp;
STp1749drivers/scsi/st.cSTp = &(scsi_tapes[dev]);
STp1751drivers/scsi/st.cif (debugging && !STp->in_use) {
STp1763drivers/scsi/st.creturn scsi_ioctl(STp->device, cmd_in, (void *) arg);
STp1778drivers/scsi/st.cif (!(STp->device)->was_reset) {
STp1799drivers/scsi/st.cSTp->device->was_reset = 0;
STp1800drivers/scsi/st.cif (STp->door_locked != ST_UNLOCKED &&
STp1801drivers/scsi/st.cSTp->door_locked != ST_LOCK_FAILS) {
STp1804drivers/scsi/st.cSTp->door_locked = ST_UNLOCKED;
STp1812drivers/scsi/st.cSTp->rw = ST_IDLE;  /* Prevent automatic WEOF */
STp1814drivers/scsi/st.cif (mtc.mt_op == MTOFFL && STp->door_locked != ST_UNLOCKED)
STp1831drivers/scsi/st.c(STp->mt_status)->mt_dsreg =
STp1832drivers/scsi/st.c((STp->block_size << MT_ST_BLKSIZE_SHIFT) & MT_ST_BLKSIZE_MASK) |
STp1833drivers/scsi/st.c((STp->density << MT_ST_DENSITY_SHIFT) & MT_ST_DENSITY_MASK);
STp1834drivers/scsi/st.c(STp->mt_status)->mt_blkno = STp->drv_block;
STp1835drivers/scsi/st.cif (STp->block_size != 0) {
STp1836drivers/scsi/st.cif (STp->rw == ST_WRITING)
STp1837drivers/scsi/st.c(STp->mt_status)->mt_blkno +=
STp1838drivers/scsi/st.c(STp->buffer)->buffer_bytes / STp->block_size;
STp1839drivers/scsi/st.celse if (STp->rw == ST_READING)
STp1840drivers/scsi/st.c(STp->mt_status)->mt_blkno -= ((STp->buffer)->buffer_bytes +
STp1841drivers/scsi/st.cSTp->block_size - 1) / STp->block_size;
STp1844drivers/scsi/st.c(STp->mt_status)->mt_gstat = 0;
STp1845drivers/scsi/st.cif (STp->drv_write_prot)
STp1846drivers/scsi/st.c(STp->mt_status)->mt_gstat |= GMT_WR_PROT(0xffffffff);
STp1847drivers/scsi/st.cif ((STp->mt_status)->mt_blkno == 0) {
STp1848drivers/scsi/st.cif ((STp->mt_status)->mt_fileno == 0)
STp1849drivers/scsi/st.c(STp->mt_status)->mt_gstat |= GMT_BOT(0xffffffff);
STp1851drivers/scsi/st.c(STp->mt_status)->mt_gstat |= GMT_EOF(0xffffffff);
STp1853drivers/scsi/st.cif (STp->eof == ST_EOM_OK || STp->eof == ST_EOM_ERROR)
STp1854drivers/scsi/st.c(STp->mt_status)->mt_gstat |= GMT_EOT(0xffffffff);
STp1855drivers/scsi/st.celse if (STp->eof == ST_EOD)
STp1856drivers/scsi/st.c(STp->mt_status)->mt_gstat |= GMT_EOD(0xffffffff);
STp1857drivers/scsi/st.cif (STp->density == 1)
STp1858drivers/scsi/st.c(STp->mt_status)->mt_gstat |= GMT_D_800(0xffffffff);
STp1859drivers/scsi/st.celse if (STp->density == 2)
STp1860drivers/scsi/st.c(STp->mt_status)->mt_gstat |= GMT_D_1600(0xffffffff);
STp1861drivers/scsi/st.celse if (STp->density == 3)
STp1862drivers/scsi/st.c(STp->mt_status)->mt_gstat |= GMT_D_6250(0xffffffff);
STp1863drivers/scsi/st.cif (STp->ready == ST_READY)
STp1864drivers/scsi/st.c(STp->mt_status)->mt_gstat |= GMT_ONLINE(0xffffffff);
STp1865drivers/scsi/st.cif (STp->ready == ST_NO_TAPE)
STp1866drivers/scsi/st.c(STp->mt_status)->mt_gstat |= GMT_DR_OPEN(0xffffffff);
STp1867drivers/scsi/st.cif (STp->at_sm)
STp1868drivers/scsi/st.c(STp->mt_status)->mt_gstat |= GMT_SM(0xffffffff);
STp1870drivers/scsi/st.cmemcpy_tofs((char *)arg, (char *)(STp->mt_status),
STp1873drivers/scsi/st.c(STp->mt_status)->mt_erreg = 0;  /* Clear after read */
STp1877drivers/scsi/st.cif (STp->ready != ST_READY)
STp1895drivers/scsi/st.cif ((STp->device)->scsi_level < SCSI_2) {
STp1903drivers/scsi/st.cSCpnt = st_do_scsi(NULL, STp, scmd, 20, ST_TIMEOUT, MAX_READY_RETRIES);
STp1907drivers/scsi/st.cif ((STp->buffer)->last_result_fatal != 0) {
STp1917drivers/scsi/st.cif ((STp->device)->scsi_level < SCSI_2)
STp1918drivers/scsi/st.cmt_pos.mt_blkno = ((STp->buffer)->b_data[0] << 16) 
STp1919drivers/scsi/st.c+ ((STp->buffer)->b_data[1] << 8) 
STp1920drivers/scsi/st.c+ (STp->buffer)->b_data[2];
STp1922drivers/scsi/st.cmt_pos.mt_blkno = ((STp->buffer)->b_data[4] << 24)
STp1923drivers/scsi/st.c+ ((STp->buffer)->b_data[5] << 16) 
STp1924drivers/scsi/st.c+ ((STp->buffer)->b_data[6] << 8) 
STp1925drivers/scsi/st.c+ (STp->buffer)->b_data[7];
STp1935drivers/scsi/st.creturn scsi_ioctl(STp->device, cmd_in, (void *) arg);
STp2127drivers/scsi/st.cScsi_Tape * STp;
STp2161drivers/scsi/st.cSTp = &(scsi_tapes[i]);
STp2162drivers/scsi/st.cSTp->device = NULL;
STp2163drivers/scsi/st.cSTp->capacity = 0xfffff;
STp2164drivers/scsi/st.cSTp->dirty = 0;
STp2165drivers/scsi/st.cSTp->rw = ST_IDLE;
STp2166drivers/scsi/st.cSTp->eof = ST_NOEOF;
STp2167drivers/scsi/st.cSTp->waiting = NULL;
STp2168drivers/scsi/st.cSTp->in_use = 0;
STp2169drivers/scsi/st.cSTp->drv_buffer = 1;  /* Try buffering if no mode sense */
STp2170drivers/scsi/st.cSTp->density = 0;
STp2171drivers/scsi/st.cSTp->do_buffer_writes = ST_BUFFER_WRITES;
STp2172drivers/scsi/st.cSTp->do_async_writes = ST_ASYNC_WRITES;
STp2173drivers/scsi/st.cSTp->do_read_ahead = ST_READ_AHEAD;
STp2174drivers/scsi/st.cSTp->do_auto_lock = ST_AUTO_LOCK;
STp2175drivers/scsi/st.cSTp->two_fm = ST_TWO_FM;
STp2176drivers/scsi/st.cSTp->fast_mteom = ST_FAST_MTEOM;
STp2177drivers/scsi/st.cSTp->write_threshold = st_write_threshold;
STp2178drivers/scsi/st.cSTp->drv_block = 0;
STp2179drivers/scsi/st.cSTp->moves_after_eof = 1;
STp2180drivers/scsi/st.cSTp->at_sm = 0;
STp2181drivers/scsi/st.cSTp->mt_status = (struct mtget *) scsi_init_malloc(sizeof(struct mtget),