Develop and Download Open Source Software

Browse CVS Repository

Contents of /enbanfukusyaya/EnbanKensa/common/drive.h

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.5 - (show annotations) (download) (as text)
Sun Dec 11 15:25:30 2005 UTC (18 years, 4 months ago) by bananajinn
Branch: MAIN
CVS Tags: HEAD
Changes since 1.4: +67 -67 lines
File MIME type: text/x-chdr
*** empty log message ***

1 /**
2 * 円盤複写屋 - EnbanKensa
3 * Copyright (C) 2005 Kagetani Hideto
4 * drive.h - 光ディスク系ドライブアクセス関連定義
5 * $Date: 2005/12/11 15:21:45 $
6 * $Revision: 1.4 $
7 */
8 #ifndef __DRIVE_H__
9 #define __DRIVE_H__
10
11 #include "aspi.h"
12
13 #define CMDDRVCTYPE_UNKNOWN -1
14 #define CMDDRVCTYPE_CHECKING 0
15 #define CMDDRVCTYPE_ATAPI 1
16 #define CMDDRVCTYPE_SCSI 2
17
18 #define SD_SENSEKEY(d) (d->sense_data[2] & 0x0f)
19 #define SD_ASC(d) (d->sense_data[12])
20 #define SD_ASCQ(d) (d->sense_data[13])
21
22 /* return value */
23 #define RET_OK 0
24 #define RET_ABORT 1
25 #define RET_READFD 2
26 #define RET_COMPLETE 3
27 #define RET_NG -1
28 #define RET_TIMEOUT -2
29 #define RET_CMDERR -3
30 #define RET_MEMERR -4
31 #define RET_SOCKET -5
32
33 /* reqflag */
34 #define REQ_NODATA 0x18
35 #define REQ_DATAOUT 0x10
36 #define REQ_DATAIN 0x08
37
38 #define SENSEDATA_SIZE 0x20
39
40 typedef struct {
41 DRIVE drive;
42 BOOL own_alloc; /* この構造体でバッファメモリ管理 */
43 BYTE *data_buf;
44 int bufsize;
45 BYTE sense_data[SENSEDATA_SIZE];
46 int cmd_type; /* CMDDRVCTYPE_* */
47 BYTE cmdcode;
48 int disc_type;
49 } CMDDRIVE;
50
51
52 #ifdef __cplusplus
53 extern "C" {
54 #endif
55
56 extern int SendCmd(CMDDRIVE *drive, BYTE *cdb, DWORD buflen, BYTE reqflag);
57 extern int InitializeCmdDrive(CMDDRIVE *drive, int bufsize);
58 extern void FreeCmdDrive(CMDDRIVE *drive);
59 extern void CheckAtapi(CMDDRIVE *drive);
60 extern int SetDriveAspiSetting(CMDDRIVE *drive, int *ha, int *tg, DWORD *timeout);
61 extern void SetDriveBuffer(CMDDRIVE *drive, char *data_buf, int bufsize);
62
63 #ifdef __cplusplus
64 }
65 #endif
66
67 #endif /* !__DRIVE_H__ */

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26