|
|
1.1 root 1: /*
2: * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
3: *
4: * @APPLE_LICENSE_HEADER_START@
5: *
6: * "Portions Copyright (c) 1999 Apple Computer, Inc. All Rights
7: * Reserved. This file contains Original Code and/or Modifications of
8: * Original Code as defined in and that are subject to the Apple Public
9: * Source License Version 1.0 (the 'License'). You may not use this file
10: * except in compliance with the License. Please obtain a copy of the
11: * License at http://www.apple.com/publicsource and read it before using
12: * this file.
13: *
14: * The Original Code and all software distributed under the License are
15: * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
16: * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
17: * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
18: * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
19: * License for the specific language governing rights and limitations
20: * under the License."
21: *
22: * @APPLE_LICENSE_HEADER_END@
23: */
24: /*
25: * Copyright 1997-1998 by Apple Computer, Inc., All rights reserved.
26: * Copyright 1994-1997 NeXT Software, Inc., All rights reserved.
27: *
28: * AtapiCntCmds.h - ATAPI command interface for ATA.
29: *
30: * HISTORY
31: *
32: * 5-Jan-1998 Joe Liu at Apple
33: * Added fields in atapiIoReq_t for SCSI/ATAPI command conversion.
34: *
35: * 1-Sep-1994 Rakesh Dubey at NeXT
36: * Created.
37: */
38:
39: #ifndef _ATAPI_CNT_CMDS_H
40: #define _ATAPI_CNT_CMDS_H 1
41:
42: #import "atapi_extern.h"
43: #import "IdeCnt.h"
44: #import <driverkit/kernelDriver.h>
45: #import <driverkit/interruptMsg.h>
46: #import <mach/mach_interface.h>
47: #import <driverkit/IODevice.h>
48: #import <driverkit/align.h>
49: #import <machkit/NXLock.h>
50: #import <machdep/i386/io_inline.h>
51: #import <driverkit/scsiTypes.h>
52: #import <bsd/string.h>
53:
54: #define MAX_ATAPI_CMD_LEN 16
55:
56: typedef struct {
57: unsigned char drive;
58: unsigned char lun; /* dream on */
59: unsigned char atapiCmd[MAX_ATAPI_CMD_LEN];
60: unsigned char scsiCmd;
61: unsigned int timeout; /* timeout in seconds */
62: unsigned char cmdLen;
63: unsigned int maxTransfer;
64: BOOL read;
65: esense_reply_t senseData;
66: unsigned int bytesTransferred;
67: unsigned char scsiStatus;
68: } atapiIoReq_t;
69:
70: @interface IdeController(ATAPI)
71:
72: - (atapi_return_t) atapiWaitStatusBitsFor:(unsigned int)timeout
73: on:(unsigned char)on
74: off:(unsigned char)off
75: alt:(BOOL)alt;
76:
77: - (unsigned char) atapiCommandPacketSize:(unsigned char)unit;
78:
79: - (atapi_return_t) atapiSoftReset:(unsigned char)unit;
80:
81: - (void) printAtapiInfo:(ideIdentifyInfo_t *)ideIdentifyInfo
82: Device:(unsigned char)unit;
83:
84: - (atapi_return_t) atapiIdentifyDevice:(struct vm_map *)client
85: addr:(caddr_t)xferAddr
86: unit:(unsigned char)unit;
87:
88: - (void) atapiInitParameters:(ideIdentifyInfo_t *)infoPtr
89: Device:(unsigned char)unit;
90:
91: - (atapi_return_t) issuePacketCommand;
92:
93: - (void) sendAtapiCommand:(unsigned char *)atapiCmd
94: cmdLen:(unsigned char)len;
95:
96: - (sc_status_t) atapiPIODataTransfer:(atapiIoReq_t *)atapiIoReq
97: buffer:(void *)buffer
98: client:(struct vm_map *)client;
99:
100: - (void) dumpStatus:(atapiIoReq_t *)atapiIoReq;
101:
102: - (sc_status_t) atapiExecuteCmd:(atapiIoReq_t *)atapiIoReq
103: buffer : (void *)buffer
104: client : (struct vm_map *)client;
105: @end
106:
107: /*
108: * So that we can use ATAPI naming convention and still use the ATA
109: * registers.
110: */
111: #define interruptReason sectCnt
112: #define byteCountLow cylLow
113: #define byteCountHigh cylHigh
114: #define driveSelect drHead
115:
116: #endif /* _ATAPI_CNT_CMDS_H */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.