File:  [WindowsNT SDKs] / ntddk / src / scsi / qic117 / do_stop.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:

    do_stop.c

Abstract:

    stops the tape motion (low level function).

Revision History:




--*/

//
// include files
//

#include <ntddk.h>                        // various NT definitions
#include <ntdddisk.h>                    // disk device driver I/O control codes
#include <ntiologc.h>
#include "common.h"
#include "drvtask.h"                     // this driver's data declarations
#include "mt1defs.h"                     // this driver's data declarations
#include "mt1strc.h"                     // this driver's data declarations
#include "q117data.h"                    // this driver's data declarations


STATUS
Q117iStopTape(
    IN PTAPE_EXTENSION TapeExtension
    )

/*++

Routine Description:

    Stop the tape if it is moving.

Arguments:

    TapeExtension -

Return Value:



--*/

{
STATUS retval;

    //
    // This first call to GetDriveError must be done to clear any errors that can
    // occur due to ESD.  Specifically, the select line may go away and if we
    // do not reset it the Stop_Tape command will be ignored.
    //

    retval = Q117iGetDriveError(TapeExtension);

    if (retval == NoErr || retval == NotRdy) {

        if ((retval = Q117iSendByte(TapeExtension, Stop_Tape)) == NoErr) {

            if ((retval = Q117iWaitCommandComplete(TapeExtension, mt_wt005s)) == NoErr) {
                
                TapeExtension->TapePosition.LogFwd = FALSE;

            }
        }

    }

    if (retval == TimeOut) {
        
        retval = Q117iSendByte(TapeExtension, Stop_Tape);

        if ((retval = Q117iSendByte(TapeExtension, Stop_Tape)) == NoErr) {

            if ((retval = Q117iWaitCommandComplete(TapeExtension, mt_wt005s)) == NoErr) {
                
                TapeExtension->TapePosition.LogFwd = FALSE;

            }
        }
    }

    Q117iDLockUnlockDMA(TapeExtension, FALSE);

    return(retval);
}

unix.superglobalmegacorp.com

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