-
Notifications
You must be signed in to change notification settings - Fork 25
/
aspi_hlio.h
103 lines (86 loc) · 3.18 KB
/
aspi_hlio.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
/*
* aspi_hlio.h - ASPI high-level I/O
* $Id: aspi_hlio.h,v 1.7 2006/09/01 17:32:42 bobi Exp $
*
* Copyright 2004 Bobi B., [email protected]
*
* This file is part of hdl_dump.
*
* hdl_dump is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* hdl_dump is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with hdl_dump; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#if !defined(_ASPI_HLIO_H)
#define _ASPI_HLIO_H
#include <stddef.h>
#include <windows.h>
#include "config.h"
#include "wnaspi32.h"
C_START
typedef struct scsi_device_type scsi_device_t;
typedef struct scsi_devices_list_type scsi_devices_list_t;
struct scsi_device_type
{
int host, scsi_id, lun;
int type; /* 0: probably a HDD; 5: MMC device (CD- or DVD-drive) */
u_int32_t align;
char name[28 + 1];
u_int32_t sector_size, size_in_sectors;
unsigned long status;
};
struct scsi_devices_list_type
{
u_int32_t used, alloc;
scsi_device_t *device;
};
int aspi_load(void);
int aspi_unload(void);
int aspi_scan_scsi_bus(scsi_devices_list_t **list);
void aspi_dlist_free(scsi_devices_list_t *list);
SRB_ExecSCSICmd *aspi_prepare_stat(int host,
int scsi_id,
int lun,
/*@out@*/ u_int8_t buf[8],
/*@returned@*/ /*@out@*/ SRB_ExecSCSICmd *cmd);
int aspi_stat(int host,
int scsi_id,
int lun,
u_int32_t *sector_size,
u_int32_t *size_in_sectors);
int aspi_mmc_read_cd(int host,
int scsi_id,
int lun,
u_int32_t start_sector,
u_int32_t num_sectors,
u_int32_t sector_size,
void *output);
SRB_ExecSCSICmd *aspi_prepare_read_10(int host,
int scsi_id,
int lun,
u_int32_t start_sector,
u_int32_t num_sectors,
/*@out@*/ void *output,
/*@returned@*/ /*@out@*/ SRB_ExecSCSICmd *cmd);
int aspi_read_10(int host,
int scsi_id,
int lun,
u_int32_t start_sector,
u_int32_t num_sectors,
void *output);
/* pointer should be passed to aspi_dispose_error_msg when no longer needed */
unsigned long aspi_get_last_error_code(void);
const char *aspi_get_last_error_msg(void);
const char *aspi_get_error_msg(unsigned long aspi_error_code);
void aspi_dispose_error_msg(char *msg);
C_END
#endif /* _ASPI_HLIO_H defined? */