|
|
1.1 root 1: /*++
2:
3: Copyright (c) 1993 - Colorado Memory Systems, Inc.
4: All Rights Reserved
5:
6: Module Name:
7:
8: getstat.c
9:
10: Abstract:
11:
12: Gets the status of the tape drive (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: Q117iGetStatus(
37: IN PTAPE_EXTENSION TapeExtension,
38: OUT UCHAR *StatusRegister3
39: )
40:
41: /*++
42:
43: Routine Description:
44:
45: Get status byte from NEC floppy controller chip.
46:
47: Send the Sense Drive Status command to the floppy controller
48:
49: Read the response from the floppy controller which should be satus
50: register 3.
51:
52: Arguments:
53:
54: TapeExtension -
55:
56: StatusRegister3 -
57:
58: Return Value:
59:
60: --*/
61:
62: {
63: STATUS retval;
64: SHORT statLength;
65: struct sns_stat_cmd sendSt;
66: FDC_STATUS status;
67:
68: sendSt.command = 0x04;
69: sendSt.drive = (UCHAR)TapeExtension->DriveParms.DriveSelect;
70:
71: if((retval = Q117iProgramFDC(TapeExtension,
72: (CHAR *)&sendSt,
73: sizeof(sendSt),
74: FALSE)) != NoErr) {
75:
76: return(retval);
77:
78: }
79:
80: if((retval = Q117iReadFDC(TapeExtension,
81: (CHAR *)&status,
82: (SHORT *)&statLength)) != NoErr) {
83:
84: return(retval);
85:
86: }
87:
88: if(statLength != 1) {
89:
90: return(NECFlt);
91:
92: }
93:
94: *StatusRegister3 = status.ST0;
95: return(retval);
96: }
97:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.