Annotation of ntddk/src/scsi/qic117/waitcc.c, revision 1.1

1.1     ! root        1: /*++
        !             2: 
        !             3: Copyright (c) 1993 - Colorado Memory Systems, Inc.
        !             4: All Rights Reserved
        !             5: 
        !             6: Module Name:
        !             7: 
        !             8:     waitcc.c
        !             9: 
        !            10: Abstract:
        !            11: 
        !            12:     Waits for the drive to become ready (command complete)
        !            13: 
        !            14: 
        !            15: Revision History:
        !            16: 
        !            17: 
        !            18: 
        !            19: 
        !            20: --*/
        !            21: 
        !            22: //
        !            23: // include files
        !            24: //
        !            25: 
        !            26: #include <ntddk.h>                        // various NT definitions
        !            27: #include <ntdddisk.h>                    // disk device driver I/O control codes
        !            28: #include <ntiologc.h>
        !            29: #include "common.h"
        !            30: #include "drvtask.h"                     // this driver's data declarations
        !            31: #include "mt1defs.h"                     // this driver's data declarations
        !            32: #include "mt1strc.h"                     // this driver's data declarations
        !            33: #include "q117data.h"                    // this driver's data declarations
        !            34: 
        !            35: 
        !            36: STATUS
        !            37: Q117iWaitCommandComplete(
        !            38:     IN PTAPE_EXTENSION TapeExtension,
        !            39:     IN QIC_TIME WaitTime
        !            40:     )
        !            41: 
        !            42: /*++
        !            43: 
        !            44: Routine Description:
        !            45: 
        !            46:     Wait a specified amount of time for the tape drive to become ready after
        !            47:     executing a command.
        !            48: 
        !            49:         Read the Drive Status byte from the tape drive.
        !            50: 
        !            51:         If the drive is not ready then wait 1/2 second and try again until
        !            52:         the specified time has elapsed.
        !            53: 
        !            54: Arguments:
        !            55: 
        !            56:     TapeExtension -
        !            57: 
        !            58:     WaitTime -
        !            59: 
        !            60: Return Value:
        !            61: 
        !            62: 
        !            63: --*/
        !            64: {
        !            65:     STATUS retval;
        !            66: 
        !            67:     do {
        !            68: 
        !            69:         Q117iSleep(TapeExtension, mt_wt2ticks, FALSE);
        !            70: 
        !            71:         if ((retval = Q117iGetDriveError(TapeExtension)) != NotRdy) {
        !            72: 
        !            73:             return(retval);
        !            74: 
        !            75:         }
        !            76: 
        !            77:         WaitTime -= mt_wt200ms;
        !            78: 
        !            79:     } while (WaitTime > 0l);
        !            80: 
        !            81:     retval = TimeOut;
        !            82: 
        !            83:     if (TapeExtension->DriveParms.Status.NewCart) {
        !            84: 
        !            85:         retval = NewCart;
        !            86: 
        !            87:     }
        !            88: 
        !            89:     return(retval);
        !            90: }
        !            91: 

unix.superglobalmegacorp.com

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