[go: up one dir, main page]

File: aacraid.h

package info (click to toggle)
smartmontools 6.3%2Bsvn4002-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 3,440 kB
  • ctags: 6,954
  • sloc: cpp: 38,549; ansic: 9,556; sh: 1,165; makefile: 846
file content (105 lines) | stat: -rw-r--r-- 2,873 bytes parent folder | download | duplicates (2)
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
104
105
/* aacraid.h
 * Copyright (C) 2014 Raghava Aditya <Raghava.Aditya@pmcs.com>
 *
 * This program 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, or (at your option)
 * any later version.
 *
 * You should have received a copy of the GNU General Public License
 * (for example COPYING); If not, see <http://www.gnu.org/licenses/>.
 *
 */

// Check windows
#if _WIN32 || _WIN64
#if _WIN64
  #define ENVIRONMENT64
#else
  #define ENVIRONMENT32
#endif
#endif

// Check GCC
#if __GNUC__
#if __x86_64__ || __ppc64__
  #define ENVIRONMENT64
#else
  #define ENVIRONMENT32
#endif
#endif

#define METHOD_BUFFERED 0
#define METHOD_NEITHER  3

#define CTL_CODE(function, method) ((4<< 16) | ((function) << 2) | (method) )

#define FSACTL_SEND_RAW_SRB  CTL_CODE(2067, METHOD_BUFFERED)

#define  SRB_FUNCTION_EXECUTE_SCSI 0X00

#define  SRB_DataIn      0x0040
#define  SRB_DataOut     0x0080
#define  SRB_NoDataXfer  0x0000

typedef struct {
  uint32_t lo32;
  uint32_t hi32;
  }  address64;

typedef struct {
  address64 addr64;
  uint32_t length;  /* Length. */
  }  user_sgentry64;

typedef struct {
  uint32_t addr32;
  uint32_t length;
  }  user_sgentry32;

typedef struct {
  uint32_t         count;
  user_sgentry64   sg64[1];
  }  user_sgmap64;

typedef struct {
  uint32_t         count;
  user_sgentry32   sg32[1];
  }  user_sgmap32;

typedef struct {
  uint32_t function;           //SRB_FUNCTION_EXECUTE_SCSI 0x00
  uint32_t channel;            //bus
  uint32_t id;                 //use the ID number this is wrong
  uint32_t lun;                //Logical unit number
  uint32_t timeout;
  uint32_t flags;              //Interesting stuff I must say
  uint32_t count;              // Data xfer size
  uint32_t retry_limit;        // We shall see
  uint32_t cdb_size;           // Length of CDB
  uint8_t  cdb[16];            // The actual cdb command
  user_sgmap64 sg64;           // pDatabuffer and address of Databuffer
  }  user_aac_srb64;

typedef struct {
  uint32_t function;           //SRB_FUNCTION_EXECUTE_SCSI 0x00
  uint32_t channel;            //bus
  uint32_t id;                 //use the ID number this is wrong
  uint32_t lun;                //Logical unit number
  uint32_t timeout;
  uint32_t flags;              //Interesting stuff I must say
  uint32_t count;              // Data xfer size
  uint32_t retry_limit;        // We shall see
  uint32_t cdb_size;           // Length of CDB
  uint8_t  cdb[16];            // The actual cdb command
  user_sgmap32 sg32;           // pDatabuffer and address of Databuffer
  }  user_aac_srb32;

typedef struct {
  uint32_t status;
  uint32_t srb_status;
  uint32_t scsi_status;
  uint32_t data_xfer_length;
  uint32_t sense_data_size;
  uint8_t  sense_data[30];
  }  user_aac_reply;