GUI: Fix Tomato RAF theme for all builds. Compilation typo.
[tomato.git] / release / src-rt-6.x.4708 / linux / linux-2.6.36 / drivers / staging / hv / storvsc_api.h
blob1ddee24f749874687a675350b918e0a8b422f6a5
1 /*
3 * Copyright (c) 2009, Microsoft Corporation.
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
16 * Place - Suite 330, Boston, MA 02111-1307 USA.
18 * Authors:
19 * Haiyang Zhang <haiyangz@microsoft.com>
20 * Hank Janssen <hjanssen@microsoft.com>
25 #ifndef _STORVSC_API_H_
26 #define _STORVSC_API_H_
28 #include "vmbus_api.h"
30 /* Defines */
31 #define STORVSC_RING_BUFFER_SIZE (20*PAGE_SIZE)
32 #define BLKVSC_RING_BUFFER_SIZE (20*PAGE_SIZE)
34 #define STORVSC_MAX_IO_REQUESTS 128
37 * In Hyper-V, each port/path/target maps to 1 scsi host adapter. In
38 * reality, the path/target is not used (ie always set to 0) so our
39 * scsi host adapter essentially has 1 bus with 1 target that contains
40 * up to 256 luns.
42 #define STORVSC_MAX_LUNS_PER_TARGET 64
43 #define STORVSC_MAX_TARGETS 1
44 #define STORVSC_MAX_CHANNELS 1
46 struct hv_storvsc_request;
48 /* Matches Windows-end */
49 enum storvsc_request_type{
50 WRITE_TYPE,
51 READ_TYPE,
52 UNKNOWN_TYPE,
55 struct hv_storvsc_request {
56 enum storvsc_request_type Type;
57 u32 Host;
58 u32 Bus;
59 u32 TargetId;
60 u32 LunId;
61 u8 *Cdb;
62 u32 CdbLen;
63 u32 Status;
64 u32 BytesXfer;
66 unsigned char *SenseBuffer;
67 u32 SenseBufferSize;
69 void *Context;
71 void (*OnIOCompletion)(struct hv_storvsc_request *Request);
73 /* This points to the memory after DataBuffer */
74 void *Extension;
76 struct hv_multipage_buffer DataBuffer;
79 /* Represents the block vsc driver */
80 struct storvsc_driver_object {
81 /* Must be the first field */
82 struct hv_driver Base;
84 /* Set by caller (in bytes) */
85 u32 RingBufferSize;
87 /* Allocate this much private extension for each I/O request */
88 u32 RequestExtSize;
90 /* Maximum # of requests in flight per channel/device */
91 u32 MaxOutstandingRequestsPerChannel;
93 /* Specific to this driver */
94 int (*OnIORequest)(struct hv_device *Device,
95 struct hv_storvsc_request *Request);
98 struct storvsc_device_info {
99 unsigned int PortNumber;
100 unsigned char PathId;
101 unsigned char TargetId;
104 /* Interface */
105 int StorVscInitialize(struct hv_driver *driver);
106 int StorVscOnHostReset(struct hv_device *Device);
107 int BlkVscInitialize(struct hv_driver *driver);
109 #endif /* _STORVSC_API_H_ */