Annotation of ntddk/src/scsi/qic117/gtendblk.c, revision 1.1.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:     gtendblk.c
                      9: 
                     10: Abstract:
                     11: 
                     12:     Calls SelectTD() once and ReadVolumeEntry() as many times as needed to
                     13:     find out what the CurrentOperation.EndOfUsedTape is.  Also calls EndRest() which will
                     14:     verify the entire tape directory.
                     15: 
                     16: 
                     17: Revision History:
                     18: 
                     19: 
                     20: 
                     21: --*/
                     22: 
                     23: //
                     24: // include files
                     25: //
                     26: 
                     27: #include <ntddk.h>
                     28: #include <ntddtape.h>
                     29: #include "common.h"
                     30: #include "q117.h"
                     31: #include "protos.h"
                     32: 
                     33: 
                     34: STATUS
                     35: q117GetEndBlock (
                     36:     OUT PVOLUME_TABLE_ENTRY TheVolumeTable,
                     37:     OUT LONG *NumberVolumes,
                     38:     IN PQ117_CONTEXT Context
                     39:     )
                     40: 
                     41: /*++
                     42: 
                     43: Routine Description:
                     44: 
                     45:     Calls SelectTD() once and ReadVolumeEntry() as many times as needed to
                     46:     find out what the CurrentOperation.EndOfUsedTape is.  Also calls EndRest() which will
                     47:     verify the entire tape directory.
                     48: 
                     49: Arguments:
                     50: 
                     51:     TheVolumeTable - Last volume on the tape
                     52: 
                     53:     NumberVolumes - Number of volumes on the tape
                     54: 
                     55:     Context - Current context of the driver.
                     56: 
                     57: Return Value:
                     58: 
                     59:     NoErr,  any Driver error except BadBlk,
                     60:     <EndOfVol>, <LinkRC>, RdncUnsc.
                     61: 
                     62: --*/
                     63: 
                     64: {
                     65:     VOLUME_TABLE_ENTRY cur_table;
                     66:     STATUS ret;                     // Return value from other routines called.
                     67: 
                     68:     *NumberVolumes = 0;
                     69: 
                     70:     //
                     71:     // This will initialize 'ActiveVolumeNumber' and 'CurrentOperation.EndOfUsedTape'.
                     72:     // FMemErr, any Driver error except BadBlk, <EndOfVol>, RdncUnsc.
                     73:     //
                     74: 
                     75:     ret=q117SelectTD(Context);
                     76: 
                     77:     while (ret == NoErr) {
                     78: 
                     79:         if (ret = q117ReadVolumeEntry(&cur_table,Context)) {
                     80: 
                     81:             //
                     82:             // <FMemErr>, any Driver error except BadBlk, <LinkRC>,
                     83:             // <EndOfVol>, RdncUnsc.
                     84:             //
                     85: 
                     86:             if (ret != EndOfVol) {
                     87: 
                     88:                 return(ret);
                     89: 
                     90:             }
                     91: 
                     92:         }
                     93: 
                     94:         if (ret != EndOfVol) {
                     95: 
                     96:             ++(*NumberVolumes);
                     97:             *TheVolumeTable = cur_table;
                     98: 
                     99:         }
                    100:     }
                    101: 
                    102:     if (ret && ret != EndOfVol) {
                    103: 
                    104:         return(ret);
                    105: 
                    106:     }
                    107: 
                    108:     ret=q117EndRest(Context);
                    109: 
                    110:     return(ret);
                    111: }
                    112: 

unix.superglobalmegacorp.com

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