]>
Commit | Line | Data |
---|---|---|
d2e702cf GI |
1 | /* aacraid.h |
2 | * Copyright (C) 2014 Raghava Aditya <Raghava.Aditya@pmcs.com> | |
3 | * | |
4 | * This program is free software; you can redistribute it and/or modify | |
5 | * it under the terms of the GNU General Public License as published by | |
6 | * the Free Software Foundation; either version 2, or (at your option) | |
7 | * any later version. | |
8 | * | |
9 | * You should have received a copy of the GNU General Public License | |
10 | * (for example COPYING); If not, see <http://www.gnu.org/licenses/>. | |
11 | * | |
12 | */ | |
13 | ||
14 | // Check windows | |
15 | #if _WIN32 || _WIN64 | |
16 | #if _WIN64 | |
17 | #define ENVIRONMENT64 | |
18 | #else | |
19 | #define ENVIRONMENT32 | |
20 | #endif | |
21 | #endif | |
22 | ||
23 | // Check GCC | |
24 | #if __GNUC__ | |
25 | #if __x86_64__ || __ppc64__ | |
26 | #define ENVIRONMENT64 | |
27 | #else | |
28 | #define ENVIRONMENT32 | |
29 | #endif | |
30 | #endif | |
31 | ||
32 | #define METHOD_BUFFERED 0 | |
33 | #define METHOD_NEITHER 3 | |
34 | ||
35 | #define CTL_CODE(function, method) ((4<< 16) | ((function) << 2) | (method) ) | |
36 | ||
37 | #define FSACTL_SEND_RAW_SRB CTL_CODE(2067, METHOD_BUFFERED) | |
38 | ||
39 | #define SRB_FUNCTION_EXECUTE_SCSI 0X00 | |
40 | ||
41 | #define SRB_DataIn 0x0040 | |
42 | #define SRB_DataOut 0x0080 | |
43 | #define SRB_NoDataXfer 0x0000 | |
44 | ||
45 | typedef struct { | |
46 | uint32_t lo32; | |
47 | uint32_t hi32; | |
48 | } address64; | |
49 | ||
50 | typedef struct { | |
51 | address64 addr64; | |
52 | uint32_t length; /* Length. */ | |
53 | } user_sgentry64; | |
54 | ||
55 | typedef struct { | |
56 | uint32_t addr32; | |
57 | uint32_t length; | |
58 | } user_sgentry32; | |
59 | ||
60 | typedef struct { | |
61 | uint32_t count; | |
62 | user_sgentry64 sg64[1]; | |
63 | } user_sgmap64; | |
64 | ||
65 | typedef struct { | |
66 | uint32_t count; | |
67 | user_sgentry32 sg32[1]; | |
68 | } user_sgmap32; | |
69 | ||
70 | typedef struct { | |
71 | uint32_t function; //SRB_FUNCTION_EXECUTE_SCSI 0x00 | |
72 | uint32_t channel; //bus | |
73 | uint32_t id; //use the ID number this is wrong | |
74 | uint32_t lun; //Logical unit number | |
75 | uint32_t timeout; | |
76 | uint32_t flags; //Interesting stuff I must say | |
77 | uint32_t count; // Data xfer size | |
78 | uint32_t retry_limit; // We shall see | |
79 | uint32_t cdb_size; // Length of CDB | |
80 | uint8_t cdb[16]; // The actual cdb command | |
81 | user_sgmap64 sg64; // pDatabuffer and address of Databuffer | |
82 | } user_aac_srb64; | |
83 | ||
84 | typedef struct { | |
85 | uint32_t function; //SRB_FUNCTION_EXECUTE_SCSI 0x00 | |
86 | uint32_t channel; //bus | |
87 | uint32_t id; //use the ID number this is wrong | |
88 | uint32_t lun; //Logical unit number | |
89 | uint32_t timeout; | |
90 | uint32_t flags; //Interesting stuff I must say | |
91 | uint32_t count; // Data xfer size | |
92 | uint32_t retry_limit; // We shall see | |
93 | uint32_t cdb_size; // Length of CDB | |
94 | uint8_t cdb[16]; // The actual cdb command | |
95 | user_sgmap32 sg32; // pDatabuffer and address of Databuffer | |
96 | } user_aac_srb32; | |
97 | ||
98 | typedef struct { | |
99 | uint32_t status; | |
100 | uint32_t srb_status; | |
101 | uint32_t scsi_status; | |
102 | uint32_t data_xfer_length; | |
103 | uint32_t sense_data_size; | |
104 | uint8_t sense_data[30]; | |
105 | } user_aac_reply; |