|
|
1.1 root 1: /*++
2:
3: Copyright (c) 1993 - Colorado Memory Systems, Inc.
4: All Rights Reserved
5:
6: Module Name:
7:
8: do_stop.c
9:
10: Abstract:
11:
12: stops the tape motion (low level function).
13:
14: Revision History:
15:
16:
17:
18:
19: --*/
20:
21: //
22: // include files
23: //
24:
25: #include <ntddk.h> // various NT definitions
26: #include <ntdddisk.h> // disk device driver I/O control codes
27: #include <ntiologc.h>
28: #include "common.h"
29: #include "drvtask.h" // this driver's data declarations
30: #include "mt1defs.h" // this driver's data declarations
31: #include "mt1strc.h" // this driver's data declarations
32: #include "q117data.h" // this driver's data declarations
33:
34:
35: STATUS
36: Q117iStopTape(
37: IN PTAPE_EXTENSION TapeExtension
38: )
39:
40: /*++
41:
42: Routine Description:
43:
44: Stop the tape if it is moving.
45:
46: Arguments:
47:
48: TapeExtension -
49:
50: Return Value:
51:
52:
53:
54: --*/
55:
56: {
57: STATUS retval;
58:
59: //
60: // This first call to GetDriveError must be done to clear any errors that can
61: // occur due to ESD. Specifically, the select line may go away and if we
62: // do not reset it the Stop_Tape command will be ignored.
63: //
64:
65: retval = Q117iGetDriveError(TapeExtension);
66:
67: if (retval == NoErr || retval == NotRdy) {
68:
69: if ((retval = Q117iSendByte(TapeExtension, Stop_Tape)) == NoErr) {
70:
71: if ((retval = Q117iWaitCommandComplete(TapeExtension, mt_wt005s)) == NoErr) {
72:
73: TapeExtension->TapePosition.LogFwd = FALSE;
74:
75: }
76: }
77:
78: }
79:
80: if (retval == TimeOut) {
81:
82: retval = Q117iSendByte(TapeExtension, Stop_Tape);
83:
84: if ((retval = Q117iSendByte(TapeExtension, Stop_Tape)) == NoErr) {
85:
86: if ((retval = Q117iWaitCommandComplete(TapeExtension, mt_wt005s)) == NoErr) {
87:
88: TapeExtension->TapePosition.LogFwd = FALSE;
89:
90: }
91: }
92: }
93:
94: Q117iDLockUnlockDMA(TapeExtension, FALSE);
95:
96: return(retval);
97: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.