File:  [WindowsNT SDKs] / ntddk / src / scsi / qic117 / selvol.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Thu Aug 9 18:31:12 2018 UTC (7 years, 9 months ago) by root
Branches: msft, MAIN
CVS tags: ntddk-nov-1993, HEAD
Microsoft Windows NT Build 511 (DDK SDK) 11-01-1993

/*++

Copyright (c) 1993 - Colorado Memory Systems, Inc.
All Rights Reserved

Module Name:

    selvol.c

Abstract:

    Sets "state" to read an existing QIC-40/80 volume.

Revision History:




--*/

//
// include files
//

#include <ntddk.h>
#include <ntddtape.h>
#include "common.h"
#include "q117.h"
#include "protos.h"


STATUS
q117SelVol (
    PVOLUME_TABLE_ENTRY TheVolumeTable,
    PQ117_CONTEXT Context
    )

/*++

Routine Description:

    May be called from SelectVol() or StBk().  Decides how many tracks
    to read in to start a backup or restore.  Allocates memory for
    track buffers and redundancy data and IORequest structures through
    ArrangeMem().

Arguments:

    TheVolumeTable - the tape directory entry for this volume.

    Context -

Return Value:

    NoErr, any Driver error except BadBlk, RdncUnsc, <LinkRC>,
    <EndOfVol>, TapeFull.

--*/

{
    LONG ret = NoErr;

    //
    // set up global variables
    //
    Context->CurrentOperation.LastSegment = TheVolumeTable->EndingSegment;
    Context->CurrentOperation.CurrentSegment = TheVolumeTable->StartSegment;
    Context->CurrentOperation.LastSegmentRead = Context->CurrentOperation.CurrentSegment - 1;
    Context->CurrentOperation.BytesOnTape = TheVolumeTable->DataSize;
    Context->CurrentMark = 0;
    Context->CurrentOperation.BytesRead = 0;
    //
    // force a read of the first segment (if skipblock not called)
    //
    Context->CurrentOperation.SegmentBytesRemaining = 0;

    if (TheVolumeTable->SequenceNumber == 1) {
        Context->CurrentOperation.SegmentStatus = NoErr;
    }

    return(ret);
}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.