Commit b3715ee4 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Staging: hv: fix typedefs in vstorage.h

It's all clean now.

Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent f3c7c96c
...@@ -61,9 +61,9 @@ BlkVscInitialize( ...@@ -61,9 +61,9 @@ BlkVscInitialize(
storDriver->RequestExtSize = sizeof(STORVSC_REQUEST_EXTENSION); storDriver->RequestExtSize = sizeof(STORVSC_REQUEST_EXTENSION);
/* Divide the ring buffer data size (which is 1 page less than the ring buffer size since that page is reserved for the ring buffer indices) */ /* Divide the ring buffer data size (which is 1 page less than the ring buffer size since that page is reserved for the ring buffer indices) */
/* by the max request size (which is VMBUS_CHANNEL_PACKET_MULITPAGE_BUFFER + VSTOR_PACKET + u64) */ /* by the max request size (which is VMBUS_CHANNEL_PACKET_MULITPAGE_BUFFER + struct vstor_packet + u64) */
storDriver->MaxOutstandingRequestsPerChannel = storDriver->MaxOutstandingRequestsPerChannel =
((storDriver->RingBufferSize - PAGE_SIZE) / ALIGN_UP(MAX_MULTIPAGE_BUFFER_PACKET + sizeof(VSTOR_PACKET) + sizeof(u64),sizeof(u64))); ((storDriver->RingBufferSize - PAGE_SIZE) / ALIGN_UP(MAX_MULTIPAGE_BUFFER_PACKET + sizeof(struct vstor_packet) + sizeof(u64),sizeof(u64)));
DPRINT_INFO(BLKVSC, "max io outstd %u", storDriver->MaxOutstandingRequestsPerChannel); DPRINT_INFO(BLKVSC, "max io outstd %u", storDriver->MaxOutstandingRequestsPerChannel);
......
...@@ -49,7 +49,7 @@ typedef struct _STORVSC_REQUEST_EXTENSION { ...@@ -49,7 +49,7 @@ typedef struct _STORVSC_REQUEST_EXTENSION {
/* Synchronize the request/response if needed */ /* Synchronize the request/response if needed */
struct osd_waitevent *WaitEvent; struct osd_waitevent *WaitEvent;
VSTOR_PACKET VStorPacket; struct vstor_packet VStorPacket;
} STORVSC_REQUEST_EXTENSION; } STORVSC_REQUEST_EXTENSION;
...@@ -132,14 +132,14 @@ StorVscOnChannelCallback( ...@@ -132,14 +132,14 @@ StorVscOnChannelCallback(
static void static void
StorVscOnIOCompletion( StorVscOnIOCompletion(
struct hv_device *Device, struct hv_device *Device,
VSTOR_PACKET *VStorPacket, struct vstor_packet *VStorPacket,
STORVSC_REQUEST_EXTENSION *RequestExt STORVSC_REQUEST_EXTENSION *RequestExt
); );
static void static void
StorVscOnReceive( StorVscOnReceive(
struct hv_device *Device, struct hv_device *Device,
VSTOR_PACKET *VStorPacket, struct vstor_packet *VStorPacket,
STORVSC_REQUEST_EXTENSION *RequestExt STORVSC_REQUEST_EXTENSION *RequestExt
); );
...@@ -266,8 +266,8 @@ StorVscInitialize( ...@@ -266,8 +266,8 @@ StorVscInitialize(
DPRINT_ENTER(STORVSC); DPRINT_ENTER(STORVSC);
DPRINT_DBG(STORVSC, "sizeof(STORVSC_REQUEST)=%zd sizeof(STORVSC_REQUEST_EXTENSION)=%zd sizeof(VSTOR_PACKET)=%zd, sizeof(VMSCSI_REQUEST)=%zd", DPRINT_DBG(STORVSC, "sizeof(STORVSC_REQUEST)=%zd sizeof(STORVSC_REQUEST_EXTENSION)=%zd sizeof(struct vstor_packet)=%zd, sizeof(struct vmscsi_request)=%zd",
sizeof(struct hv_storvsc_request), sizeof(STORVSC_REQUEST_EXTENSION), sizeof(VSTOR_PACKET), sizeof(VMSCSI_REQUEST)); sizeof(struct hv_storvsc_request), sizeof(STORVSC_REQUEST_EXTENSION), sizeof(struct vstor_packet), sizeof(struct vmscsi_request));
/* Make sure we are at least 2 pages since 1 page is used for control */ /* Make sure we are at least 2 pages since 1 page is used for control */
ASSERT(storDriver->RingBufferSize >= (PAGE_SIZE << 1)); ASSERT(storDriver->RingBufferSize >= (PAGE_SIZE << 1));
...@@ -281,10 +281,10 @@ StorVscInitialize( ...@@ -281,10 +281,10 @@ StorVscInitialize(
* Divide the ring buffer data size (which is 1 page less * Divide the ring buffer data size (which is 1 page less
* than the ring buffer size since that page is reserved for * than the ring buffer size since that page is reserved for
* the ring buffer indices) by the max request size (which is * the ring buffer indices) by the max request size (which is
* VMBUS_CHANNEL_PACKET_MULITPAGE_BUFFER + VSTOR_PACKET + u64) * VMBUS_CHANNEL_PACKET_MULITPAGE_BUFFER + struct vstor_packet + u64)
*/ */
storDriver->MaxOutstandingRequestsPerChannel = storDriver->MaxOutstandingRequestsPerChannel =
((storDriver->RingBufferSize - PAGE_SIZE) / ALIGN_UP(MAX_MULTIPAGE_BUFFER_PACKET + sizeof(VSTOR_PACKET) + sizeof(u64),sizeof(u64))); ((storDriver->RingBufferSize - PAGE_SIZE) / ALIGN_UP(MAX_MULTIPAGE_BUFFER_PACKET + sizeof(struct vstor_packet) + sizeof(u64),sizeof(u64)));
DPRINT_INFO(STORVSC, "max io %u, currently %u\n", storDriver->MaxOutstandingRequestsPerChannel, STORVSC_MAX_IO_REQUESTS); DPRINT_INFO(STORVSC, "max io %u, currently %u\n", storDriver->MaxOutstandingRequestsPerChannel, STORVSC_MAX_IO_REQUESTS);
...@@ -318,7 +318,7 @@ StorVscOnDeviceAdd( ...@@ -318,7 +318,7 @@ StorVscOnDeviceAdd(
{ {
int ret=0; int ret=0;
STORVSC_DEVICE *storDevice; STORVSC_DEVICE *storDevice;
/* VMSTORAGE_CHANNEL_PROPERTIES *props; */ /* struct vmstorage_channel_properties *props; */
STORVSC_DEVICE_INFO *deviceInfo = (STORVSC_DEVICE_INFO*)AdditionalInfo; STORVSC_DEVICE_INFO *deviceInfo = (STORVSC_DEVICE_INFO*)AdditionalInfo;
DPRINT_ENTER(STORVSC); DPRINT_ENTER(STORVSC);
...@@ -331,7 +331,7 @@ StorVscOnDeviceAdd( ...@@ -331,7 +331,7 @@ StorVscOnDeviceAdd(
} }
/* Save the channel properties to our storvsc channel */ /* Save the channel properties to our storvsc channel */
/* props = (VMSTORAGE_CHANNEL_PROPERTIES*) channel->offerMsg.Offer.u.Standard.UserDefined; */ /* props = (struct vmstorage_channel_properties *) channel->offerMsg.Offer.u.Standard.UserDefined; */
/* FIXME: */ /* FIXME: */
/* /*
...@@ -365,7 +365,7 @@ static int StorVscChannelInit(struct hv_device *Device) ...@@ -365,7 +365,7 @@ static int StorVscChannelInit(struct hv_device *Device)
int ret=0; int ret=0;
STORVSC_DEVICE *storDevice; STORVSC_DEVICE *storDevice;
STORVSC_REQUEST_EXTENSION *request; STORVSC_REQUEST_EXTENSION *request;
VSTOR_PACKET *vstorPacket; struct vstor_packet *vstorPacket;
storDevice = GetStorDevice(Device); storDevice = GetStorDevice(Device);
if (!storDevice) if (!storDevice)
...@@ -394,7 +394,7 @@ static int StorVscChannelInit(struct hv_device *Device) ...@@ -394,7 +394,7 @@ static int StorVscChannelInit(struct hv_device *Device)
ret = Device->Driver->VmbusChannelInterface.SendPacket(Device, ret = Device->Driver->VmbusChannelInterface.SendPacket(Device,
vstorPacket, vstorPacket,
sizeof(VSTOR_PACKET), sizeof(struct vstor_packet),
(unsigned long)request, (unsigned long)request,
VmbusPacketTypeDataInBand, VmbusPacketTypeDataInBand,
VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
...@@ -415,7 +415,7 @@ static int StorVscChannelInit(struct hv_device *Device) ...@@ -415,7 +415,7 @@ static int StorVscChannelInit(struct hv_device *Device)
DPRINT_INFO(STORVSC, "QUERY_PROTOCOL_VERSION_OPERATION..."); DPRINT_INFO(STORVSC, "QUERY_PROTOCOL_VERSION_OPERATION...");
/* reuse the packet for version range supported */ /* reuse the packet for version range supported */
memset(vstorPacket, sizeof(VSTOR_PACKET), 0); memset(vstorPacket, sizeof(struct vstor_packet), 0);
vstorPacket->Operation = VStorOperationQueryProtocolVersion; vstorPacket->Operation = VStorOperationQueryProtocolVersion;
vstorPacket->Flags = REQUEST_COMPLETION_FLAG; vstorPacket->Flags = REQUEST_COMPLETION_FLAG;
...@@ -424,7 +424,7 @@ static int StorVscChannelInit(struct hv_device *Device) ...@@ -424,7 +424,7 @@ static int StorVscChannelInit(struct hv_device *Device)
ret = Device->Driver->VmbusChannelInterface.SendPacket(Device, ret = Device->Driver->VmbusChannelInterface.SendPacket(Device,
vstorPacket, vstorPacket,
sizeof(VSTOR_PACKET), sizeof(struct vstor_packet),
(unsigned long)request, (unsigned long)request,
VmbusPacketTypeDataInBand, VmbusPacketTypeDataInBand,
VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
...@@ -446,14 +446,14 @@ static int StorVscChannelInit(struct hv_device *Device) ...@@ -446,14 +446,14 @@ static int StorVscChannelInit(struct hv_device *Device)
/* Query channel properties */ /* Query channel properties */
DPRINT_INFO(STORVSC, "QUERY_PROPERTIES_OPERATION..."); DPRINT_INFO(STORVSC, "QUERY_PROPERTIES_OPERATION...");
memset(vstorPacket, sizeof(VSTOR_PACKET), 0); memset(vstorPacket, sizeof(struct vstor_packet), 0);
vstorPacket->Operation = VStorOperationQueryProperties; vstorPacket->Operation = VStorOperationQueryProperties;
vstorPacket->Flags = REQUEST_COMPLETION_FLAG; vstorPacket->Flags = REQUEST_COMPLETION_FLAG;
vstorPacket->StorageChannelProperties.PortNumber = storDevice->PortNumber; vstorPacket->StorageChannelProperties.PortNumber = storDevice->PortNumber;
ret = Device->Driver->VmbusChannelInterface.SendPacket(Device, ret = Device->Driver->VmbusChannelInterface.SendPacket(Device,
vstorPacket, vstorPacket,
sizeof(VSTOR_PACKET), sizeof(struct vstor_packet),
(unsigned long)request, (unsigned long)request,
VmbusPacketTypeDataInBand, VmbusPacketTypeDataInBand,
VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
...@@ -481,13 +481,13 @@ static int StorVscChannelInit(struct hv_device *Device) ...@@ -481,13 +481,13 @@ static int StorVscChannelInit(struct hv_device *Device)
DPRINT_INFO(STORVSC, "END_INITIALIZATION_OPERATION..."); DPRINT_INFO(STORVSC, "END_INITIALIZATION_OPERATION...");
memset(vstorPacket, sizeof(VSTOR_PACKET), 0); memset(vstorPacket, sizeof(struct vstor_packet), 0);
vstorPacket->Operation = VStorOperationEndInitialization; vstorPacket->Operation = VStorOperationEndInitialization;
vstorPacket->Flags = REQUEST_COMPLETION_FLAG; vstorPacket->Flags = REQUEST_COMPLETION_FLAG;
ret = Device->Driver->VmbusChannelInterface.SendPacket(Device, ret = Device->Driver->VmbusChannelInterface.SendPacket(Device,
vstorPacket, vstorPacket,
sizeof(VSTOR_PACKET), sizeof(struct vstor_packet),
(unsigned long)request, (unsigned long)request,
VmbusPacketTypeDataInBand, VmbusPacketTypeDataInBand,
VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
...@@ -528,18 +528,18 @@ StorVscConnectToVsp( ...@@ -528,18 +528,18 @@ StorVscConnectToVsp(
) )
{ {
int ret=0; int ret=0;
VMSTORAGE_CHANNEL_PROPERTIES props; struct vmstorage_channel_properties props;
STORVSC_DRIVER_OBJECT *storDriver = (STORVSC_DRIVER_OBJECT*) Device->Driver;; STORVSC_DRIVER_OBJECT *storDriver = (STORVSC_DRIVER_OBJECT*) Device->Driver;;
memset(&props, sizeof(VMSTORAGE_CHANNEL_PROPERTIES), 0); memset(&props, sizeof(struct vmstorage_channel_properties), 0);
/* Open the channel */ /* Open the channel */
ret = Device->Driver->VmbusChannelInterface.Open(Device, ret = Device->Driver->VmbusChannelInterface.Open(Device,
storDriver->RingBufferSize, storDriver->RingBufferSize,
storDriver->RingBufferSize, storDriver->RingBufferSize,
(void *)&props, (void *)&props,
sizeof(VMSTORAGE_CHANNEL_PROPERTIES), sizeof(struct vmstorage_channel_properties),
StorVscOnChannelCallback, StorVscOnChannelCallback,
Device Device
); );
...@@ -635,7 +635,7 @@ StorVscOnHostReset( ...@@ -635,7 +635,7 @@ StorVscOnHostReset(
STORVSC_DEVICE *storDevice; STORVSC_DEVICE *storDevice;
STORVSC_REQUEST_EXTENSION *request; STORVSC_REQUEST_EXTENSION *request;
VSTOR_PACKET *vstorPacket; struct vstor_packet *vstorPacket;
DPRINT_ENTER(STORVSC); DPRINT_ENTER(STORVSC);
...@@ -660,7 +660,7 @@ StorVscOnHostReset( ...@@ -660,7 +660,7 @@ StorVscOnHostReset(
ret = Device->Driver->VmbusChannelInterface.SendPacket(Device, ret = Device->Driver->VmbusChannelInterface.SendPacket(Device,
vstorPacket, vstorPacket,
sizeof(VSTOR_PACKET), sizeof(struct vstor_packet),
(unsigned long)&storDevice->ResetRequest, (unsigned long)&storDevice->ResetRequest,
VmbusPacketTypeDataInBand, VmbusPacketTypeDataInBand,
VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
...@@ -704,7 +704,7 @@ StorVscOnIORequest( ...@@ -704,7 +704,7 @@ StorVscOnIORequest(
{ {
STORVSC_DEVICE *storDevice; STORVSC_DEVICE *storDevice;
STORVSC_REQUEST_EXTENSION* requestExtension = (STORVSC_REQUEST_EXTENSION*) Request->Extension; STORVSC_REQUEST_EXTENSION* requestExtension = (STORVSC_REQUEST_EXTENSION*) Request->Extension;
VSTOR_PACKET* vstorPacket =&requestExtension->VStorPacket; struct vstor_packet *vstorPacket =&requestExtension->VStorPacket;
int ret=0; int ret=0;
DPRINT_ENTER(STORVSC); DPRINT_ENTER(STORVSC);
...@@ -729,11 +729,11 @@ StorVscOnIORequest( ...@@ -729,11 +729,11 @@ StorVscOnIORequest(
requestExtension->Request = Request; requestExtension->Request = Request;
requestExtension->Device = Device; requestExtension->Device = Device;
memset(vstorPacket, 0 , sizeof(VSTOR_PACKET)); memset(vstorPacket, 0 , sizeof(struct vstor_packet));
vstorPacket->Flags |= REQUEST_COMPLETION_FLAG; vstorPacket->Flags |= REQUEST_COMPLETION_FLAG;
vstorPacket->VmSrb.Length = sizeof(VMSCSI_REQUEST); vstorPacket->VmSrb.Length = sizeof(struct vmscsi_request);
vstorPacket->VmSrb.PortNumber = Request->Host; vstorPacket->VmSrb.PortNumber = Request->Host;
vstorPacket->VmSrb.PathId = Request->Bus; vstorPacket->VmSrb.PathId = Request->Bus;
...@@ -765,14 +765,14 @@ StorVscOnIORequest( ...@@ -765,14 +765,14 @@ StorVscOnIORequest(
ret = Device->Driver->VmbusChannelInterface.SendPacketMultiPageBuffer(Device, ret = Device->Driver->VmbusChannelInterface.SendPacketMultiPageBuffer(Device,
&requestExtension->Request->DataBuffer, &requestExtension->Request->DataBuffer,
vstorPacket, vstorPacket,
sizeof(VSTOR_PACKET), sizeof(struct vstor_packet),
(unsigned long)requestExtension); (unsigned long)requestExtension);
} }
else else
{ {
ret = Device->Driver->VmbusChannelInterface.SendPacket(Device, ret = Device->Driver->VmbusChannelInterface.SendPacket(Device,
vstorPacket, vstorPacket,
sizeof(VSTOR_PACKET), sizeof(struct vstor_packet),
(unsigned long)requestExtension, (unsigned long)requestExtension,
VmbusPacketTypeDataInBand, VmbusPacketTypeDataInBand,
VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
...@@ -813,7 +813,7 @@ StorVscOnCleanup( ...@@ -813,7 +813,7 @@ StorVscOnCleanup(
static void static void
StorVscOnIOCompletion( StorVscOnIOCompletion(
struct hv_device *Device, struct hv_device *Device,
VSTOR_PACKET *VStorPacket, struct vstor_packet *VStorPacket,
STORVSC_REQUEST_EXTENSION *RequestExt STORVSC_REQUEST_EXTENSION *RequestExt
) )
{ {
...@@ -883,7 +883,7 @@ StorVscOnIOCompletion( ...@@ -883,7 +883,7 @@ StorVscOnIOCompletion(
static void static void
StorVscOnReceive( StorVscOnReceive(
struct hv_device *Device, struct hv_device *Device,
VSTOR_PACKET *VStorPacket, struct vstor_packet *VStorPacket,
STORVSC_REQUEST_EXTENSION *RequestExt STORVSC_REQUEST_EXTENSION *RequestExt
) )
{ {
...@@ -924,7 +924,7 @@ StorVscOnChannelCallback( ...@@ -924,7 +924,7 @@ StorVscOnChannelCallback(
STORVSC_DEVICE *storDevice; STORVSC_DEVICE *storDevice;
u32 bytesRecvd; u32 bytesRecvd;
u64 requestId; u64 requestId;
unsigned char packet[ALIGN_UP(sizeof(VSTOR_PACKET),8)]; unsigned char packet[ALIGN_UP(sizeof(struct vstor_packet),8)];
STORVSC_REQUEST_EXTENSION *request; STORVSC_REQUEST_EXTENSION *request;
DPRINT_ENTER(STORVSC); DPRINT_ENTER(STORVSC);
...@@ -943,14 +943,14 @@ StorVscOnChannelCallback( ...@@ -943,14 +943,14 @@ StorVscOnChannelCallback(
{ {
ret = device->Driver->VmbusChannelInterface.RecvPacket(device, ret = device->Driver->VmbusChannelInterface.RecvPacket(device,
packet, packet,
ALIGN_UP(sizeof(VSTOR_PACKET),8), ALIGN_UP(sizeof(struct vstor_packet),8),
&bytesRecvd, &bytesRecvd,
&requestId); &requestId);
if (ret == 0 && bytesRecvd > 0) if (ret == 0 && bytesRecvd > 0)
{ {
DPRINT_DBG(STORVSC, "receive %d bytes - tid %llx", bytesRecvd, requestId); DPRINT_DBG(STORVSC, "receive %d bytes - tid %llx", bytesRecvd, requestId);
/* ASSERT(bytesRecvd == sizeof(VSTOR_PACKET)); */ /* ASSERT(bytesRecvd == sizeof(struct vstor_packet)); */
request = (STORVSC_REQUEST_EXTENSION*)(unsigned long)requestId; request = (STORVSC_REQUEST_EXTENSION*)(unsigned long)requestId;
ASSERT(request); ASSERT(request);
...@@ -960,13 +960,13 @@ StorVscOnChannelCallback( ...@@ -960,13 +960,13 @@ StorVscOnChannelCallback(
{ {
/* DPRINT_INFO(STORVSC, "reset completion - operation %u status %u", vstorPacket.Operation, vstorPacket.Status); */ /* DPRINT_INFO(STORVSC, "reset completion - operation %u status %u", vstorPacket.Operation, vstorPacket.Status); */
memcpy(&request->VStorPacket, packet, sizeof(VSTOR_PACKET)); memcpy(&request->VStorPacket, packet, sizeof(struct vstor_packet));
osd_WaitEventSet(request->WaitEvent); osd_WaitEventSet(request->WaitEvent);
} }
else else
{ {
StorVscOnReceive(device, (VSTOR_PACKET*)packet, request); StorVscOnReceive(device, (struct vstor_packet *)packet, request);
} }
} }
else else
......
...@@ -21,8 +21,6 @@ ...@@ -21,8 +21,6 @@
* *
*/ */
/* vstorage.w revision number. This is used in the case of a version match, */ /* vstorage.w revision number. This is used in the case of a version match, */
/* to alert the user that structure sizes may be mismatched even though the */ /* to alert the user that structure sizes may be mismatched even though the */
/* protocol versions match. */ /* protocol versions match. */
...@@ -61,12 +59,12 @@ ...@@ -61,12 +59,12 @@
/* The max transfer length will be published when we offer a vmbus channel. */ /* The max transfer length will be published when we offer a vmbus channel. */
#define MAX_TRANSFER_LENGTH 0x40000 #define MAX_TRANSFER_LENGTH 0x40000
#define DEFAULT_PACKET_SIZE (sizeof(VMDATA_GPA_DIRECT) + \ #define DEFAULT_PACKET_SIZE (sizeof(VMDATA_GPA_DIRECT) + \
sizeof(VSTOR_PACKET) + \ sizeof(struct vstor_packet) + \
(sizeof(u64) * (MAX_TRANSFER_LENGTH / PAGE_SIZE))) sizesizeof(u64) * (MAX_TRANSFER_LENGTH / PAGE_SIZE)))
/* Packet structure describing virtual storage requests. */ /* Packet structure describing virtual storage requests. */
typedef enum { enum vstor_packet_operation {
VStorOperationCompleteIo = 1, VStorOperationCompleteIo = 1,
VStorOperationRemoveDevice = 2, VStorOperationRemoveDevice = 2,
VStorOperationExecuteSRB = 3, VStorOperationExecuteSRB = 3,
...@@ -78,16 +76,13 @@ typedef enum { ...@@ -78,16 +76,13 @@ typedef enum {
VStorOperationQueryProtocolVersion = 9, VStorOperationQueryProtocolVersion = 9,
VStorOperationQueryProperties = 10, VStorOperationQueryProperties = 10,
VStorOperationMaximum = 10 VStorOperationMaximum = 10
} VSTOR_PACKET_OPERATION; };
/* /*
* Platform neutral description of a scsi request - * Platform neutral description of a scsi request -
* this remains the same across the write regardless of 32/64 bit * this remains the same across the write regardless of 32/64 bit
* note: it's patterned off the SCSI_PASS_THROUGH structure * note: it's patterned off the SCSI_PASS_THROUGH structure
*/ */
#define CDB16GENERIC_LENGTH 0x10 #define CDB16GENERIC_LENGTH 0x10
#ifndef SENSE_BUFFER_SIZE #ifndef SENSE_BUFFER_SIZE
...@@ -96,8 +91,7 @@ typedef enum { ...@@ -96,8 +91,7 @@ typedef enum {
#define MAX_DATA_BUFFER_LENGTH_WITH_PADDING 0x14 #define MAX_DATA_BUFFER_LENGTH_WITH_PADDING 0x14
struct vmscsi_request {
typedef struct {
unsigned short Length; unsigned short Length;
unsigned char SrbStatus; unsigned char SrbStatus;
unsigned char ScsiStatus; unsigned char ScsiStatus;
...@@ -121,14 +115,14 @@ typedef struct { ...@@ -121,14 +115,14 @@ typedef struct {
unsigned char ReservedArray[MAX_DATA_BUFFER_LENGTH_WITH_PADDING]; unsigned char ReservedArray[MAX_DATA_BUFFER_LENGTH_WITH_PADDING];
}; };
} __attribute((packed)) VMSCSI_REQUEST, *PVMSCSI_REQUEST; } __attribute((packed));
/* /*
* This structure is sent during the intialization phase to get the different * This structure is sent during the intialization phase to get the different
* properties of the channel. * properties of the channel.
*/ */
typedef struct { struct vmstorage_channel_properties {
unsigned short ProtocolVersion; unsigned short ProtocolVersion;
unsigned char PathId; unsigned char PathId;
unsigned char TargetId; unsigned char TargetId;
...@@ -141,10 +135,10 @@ typedef struct { ...@@ -141,10 +135,10 @@ typedef struct {
/* This id is unique for each channel and will correspond with */ /* This id is unique for each channel and will correspond with */
/* vendor specific data in the inquirydata */ /* vendor specific data in the inquirydata */
unsigned long long UniqueId; unsigned long long UniqueId;
} __attribute__((packed)) VMSTORAGE_CHANNEL_PROPERTIES, *PVMSTORAGE_CHANNEL_PROPERTIES; } __attribute__((packed));
/* This structure is sent during the storage protocol negotiations. */ /* This structure is sent during the storage protocol negotiations. */
typedef struct { struct vmstorage_protocol_version {
/* Major (MSW) and minor (LSW) version numbers. */ /* Major (MSW) and minor (LSW) version numbers. */
unsigned short MajorMinor; unsigned short MajorMinor;
...@@ -155,16 +149,15 @@ typedef struct { ...@@ -155,16 +149,15 @@ typedef struct {
* builds. * builds.
*/ */
unsigned short Revision; unsigned short Revision;
} __attribute__((packed)) VMSTORAGE_PROTOCOL_VERSION, *PVMSTORAGE_PROTOCOL_VERSION; } __attribute__((packed));
/* Channel Property Flags */ /* Channel Property Flags */
#define STORAGE_CHANNEL_REMOVABLE_FLAG 0x1 #define STORAGE_CHANNEL_REMOVABLE_FLAG 0x1
#define STORAGE_CHANNEL_EMULATED_IDE_FLAG 0x2 #define STORAGE_CHANNEL_EMULATED_IDE_FLAG 0x2
typedef struct _VSTOR_PACKET { struct vstor_packet {
/* Requested operation type */ /* Requested operation type */
VSTOR_PACKET_OPERATION Operation; enum vstor_packet_operation Operation;
/* Flags - see below for values */ /* Flags - see below for values */
unsigned int Flags; unsigned int Flags;
...@@ -178,22 +171,17 @@ typedef struct _VSTOR_PACKET { ...@@ -178,22 +171,17 @@ typedef struct _VSTOR_PACKET {
* Structure used to forward SCSI commands from the * Structure used to forward SCSI commands from the
* client to the server. * client to the server.
*/ */
VMSCSI_REQUEST VmSrb; struct vmscsi_request VmSrb;
/* Structure used to query channel properties. */ /* Structure used to query channel properties. */
VMSTORAGE_CHANNEL_PROPERTIES StorageChannelProperties; struct vmstorage_channel_properties StorageChannelProperties;
/* Used during version negotiations. */ /* Used during version negotiations. */
VMSTORAGE_PROTOCOL_VERSION Version; struct vmstorage_protocol_version Version;
}; };
} __attribute__((packed));
} __attribute__((packed)) VSTOR_PACKET, *PVSTOR_PACKET;
/* Packet flags */ /* Packet flags */
/* /*
* This flag indicates that the server should send back a completion for this * This flag indicates that the server should send back a completion for this
* packet. * packet.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment