win-pvdrivers

view xenvbd_common/common.h @ 1066:24fae56a87bf

Fix build errors
author James Harper <james.harper@bendigoit.com.au>
date Tue Oct 29 19:38:31 2013 +1100 (2013-10-29)
parents 2b8784b1a034
children
line source
1 /*
2 PV Drivers for Windows Xen HVM Domains
3 Copyright (C) 2013 James Harper
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 */
20 #define SCSIOP_UNMAP 0x42
21 #define VPD_BLOCK_LIMITS 0xB0
23 #define XENVBD_POOL_TAG (ULONG) 'XVBD'
25 #define DEVICE_STATE_DISCONNECTED 0 /* -> INITIALISING */
26 #define DEVICE_STATE_INITIALISING 1 /* -> INACTIVE | ACTIVE */
27 #define DEVICE_STATE_INACTIVE 2
28 #define DEVICE_STATE_ACTIVE 3 /* -> DISCONNECTING */
29 #define DEVICE_STATE_DISCONNECTING 4 /* -> DISCONNECTED */
31 #define SCSI_DEVICE_MANUFACTURER "XEN "
32 #define SCSI_DISK_MODEL "PV DISK "
33 #define SCSI_CDROM_MODEL "PV CDROM "
35 typedef enum {
36 XENVBD_DEVICETYPE_UNKNOWN,
37 XENVBD_DEVICETYPE_DISK,
38 XENVBD_DEVICETYPE_CDROM,
39 XENVBD_DEVICETYPE_CONTROLLER // Not yet used
40 } XENVBD_DEVICETYPE;
42 typedef enum {
43 XENVBD_DEVICEMODE_UNKNOWN,
44 XENVBD_DEVICEMODE_READ,
45 XENVBD_DEVICEMODE_WRITE
46 } XENVBD_DEVICEMODE;
48 typedef struct {
49 LIST_ENTRY list_entry;
50 PSCSI_REQUEST_BLOCK srb;
51 ULONG length; /* cached srb length */
52 ULONG offset; /* current srb offset */
53 ULONG outstanding_requests; /* number of requests sent to xen for this srb */
54 BOOLEAN error; /* true if any sub requests have returned an error */
55 } srb_list_entry_t;
57 typedef struct {
58 blkif_request_t req;
59 srb_list_entry_t *srb_list_entry;
60 PSCSI_REQUEST_BLOCK srb;
61 PVOID system_address;
62 ULONG length;
63 BOOLEAN aligned_buffer_in_use;
64 BOOLEAN reset;
65 #if DBG && NTDDI_VERSION >= NTDDI_WINXP
66 LARGE_INTEGER ring_submit_time;
67 #endif
68 } blkif_shadow_t;