diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2009-08-20 15:15:54 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-09-15 15:01:58 -0400 |
commit | 1aa2383b144be596f7a09e237e47ecefdeef07af (patch) | |
tree | ee6daee9a1b34d78fef234f09aa2200d43b85bfb | |
parent | 65452d1f728c95877cad1b7e71dc2ef0c6a8297c (diff) |
Staging: hv: coding style cleanups for VmbusChannelInterface.h
typedefs still need to be fixed up.
Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/staging/hv/include/VmbusChannelInterface.h | 134 |
1 files changed, 52 insertions, 82 deletions
diff --git a/drivers/staging/hv/include/VmbusChannelInterface.h b/drivers/staging/hv/include/VmbusChannelInterface.h index 8ee8a073c15..953e1560980 100644 --- a/drivers/staging/hv/include/VmbusChannelInterface.h +++ b/drivers/staging/hv/include/VmbusChannelInterface.h | |||
@@ -21,101 +21,71 @@ | |||
21 | * | 21 | * |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #ifndef __VMBUSCHANNELINTERFACE_H | ||
25 | #define __VMBUSCHANNELINTERFACE_H | ||
24 | 26 | ||
25 | #pragma once | 27 | /* |
26 | /* allow nameless unions */ | 28 | * A revision number of vmbus that is used for ensuring both ends on a |
27 | /* #pragma warning(disable : 4201) */ | 29 | * partition are using compatible versions. |
28 | 30 | */ | |
29 | 31 | #define VMBUS_REVISION_NUMBER 13 | |
30 | /* A revision number of vmbus that is used for ensuring both ends on a */ | ||
31 | /* partition are using compatible versions. */ | ||
32 | |||
33 | #define VMBUS_REVISION_NUMBER 13 | ||
34 | |||
35 | 32 | ||
36 | /* Make maximum size of pipe payload of 16K */ | 33 | /* Make maximum size of pipe payload of 16K */ |
37 | 34 | #define MAX_PIPE_DATA_PAYLOAD (sizeof(u8) * 16384) | |
38 | #define MAX_PIPE_DATA_PAYLOAD (sizeof(BYTE) * 16384) | ||
39 | |||
40 | 35 | ||
41 | /* Define PipeMode values. */ | 36 | /* Define PipeMode values. */ |
42 | 37 | #define VMBUS_PIPE_TYPE_BYTE 0x00000000 | |
43 | #define VMBUS_PIPE_TYPE_BYTE 0x00000000 | 38 | #define VMBUS_PIPE_TYPE_MESSAGE 0x00000004 |
44 | #define VMBUS_PIPE_TYPE_MESSAGE 0x00000004 | ||
45 | |||
46 | 39 | ||
47 | /* The size of the user defined data buffer for non-pipe offers. */ | 40 | /* The size of the user defined data buffer for non-pipe offers. */ |
48 | 41 | #define MAX_USER_DEFINED_BYTES 120 | |
49 | #define MAX_USER_DEFINED_BYTES 120 | ||
50 | |||
51 | 42 | ||
52 | /* The size of the user defined data buffer for pipe offers. */ | 43 | /* The size of the user defined data buffer for pipe offers. */ |
44 | #define MAX_PIPE_USER_DEFINED_BYTES 116 | ||
53 | 45 | ||
54 | #define MAX_PIPE_USER_DEFINED_BYTES 116 | 46 | /* |
55 | 47 | * At the center of the Channel Management library is the Channel Offer. This | |
56 | 48 | * struct contains the fundamental information about an offer. | |
57 | 49 | */ | |
58 | /* At the center of the Channel Management library is */ | 50 | typedef struct { |
59 | /* the Channel Offer. This struct contains the */ | 51 | struct hv_guid InterfaceType; |
60 | /* fundamental information about an offer. */ | 52 | struct hv_guid InterfaceInstance; |
61 | 53 | u64 InterruptLatencyIn100nsUnits; | |
62 | #pragma pack(push,1) | 54 | u32 InterfaceRevision; |
63 | 55 | u32 ServerContextAreaSize; /* in bytes */ | |
64 | typedef struct | 56 | u16 ChannelFlags; |
65 | { | 57 | u16 MmioMegabytes; /* in bytes * 1024 * 1024 */ |
66 | 58 | ||
67 | struct hv_guid InterfaceType; | 59 | union { |
68 | struct hv_guid InterfaceInstance; | 60 | /* Non-pipes: The user has MAX_USER_DEFINED_BYTES bytes. */ |
69 | u64 InterruptLatencyIn100nsUnits; | 61 | struct { |
70 | u32 InterfaceRevision; | 62 | unsigned char UserDefined[MAX_USER_DEFINED_BYTES]; |
71 | u32 ServerContextAreaSize; /* in bytes */ | 63 | } Standard; |
72 | u16 ChannelFlags; | 64 | |
73 | u16 MmioMegabytes; /* in bytes * 1024 * 1024 */ | 65 | /* |
74 | 66 | * Pipes: | |
75 | union | 67 | * The following sructure is an integrated pipe protocol, which |
76 | { | 68 | * is implemented on top of standard user-defined data. Pipe |
77 | 69 | * clients have MAX_PIPE_USER_DEFINED_BYTES left for their own | |
78 | /* Non-pipes: The user has MAX_USER_DEFINED_BYTES bytes. */ | 70 | * use. |
79 | 71 | */ | |
80 | struct | 72 | struct { |
81 | { | 73 | u32 PipeMode; |
82 | unsigned char UserDefined[MAX_USER_DEFINED_BYTES]; | 74 | unsigned char UserDefined[MAX_PIPE_USER_DEFINED_BYTES]; |
83 | } Standard; | 75 | } Pipe; |
84 | 76 | } u; | |
85 | 77 | u32 Padding; | |
86 | /* Pipes: The following sructure is an integrated pipe protocol, which */ | 78 | } __attribute__((packed)) VMBUS_CHANNEL_OFFER, *PVMBUS_CHANNEL_OFFER; |
87 | /* is implemented on top of standard user-defined data. Pipe clients */ | ||
88 | /* have MAX_PIPE_USER_DEFINED_BYTES left for their own use. */ | ||
89 | |||
90 | struct | ||
91 | { | ||
92 | u32 PipeMode; | ||
93 | unsigned char UserDefined[MAX_PIPE_USER_DEFINED_BYTES]; | ||
94 | } Pipe; | ||
95 | } u; | ||
96 | u32 Padding; | ||
97 | } VMBUS_CHANNEL_OFFER, *PVMBUS_CHANNEL_OFFER; | ||
98 | #pragma pack(pop) | ||
99 | |||
100 | 79 | ||
101 | typedef u32 GPADL_HANDLE; | 80 | typedef u32 GPADL_HANDLE; |
102 | 81 | ||
103 | |||
104 | /* Server Flags */ | 82 | /* Server Flags */ |
83 | #define VMBUS_CHANNEL_ENUMERATE_DEVICE_INTERFACE 1 | ||
84 | #define VMBUS_CHANNEL_SERVER_SUPPORTS_TRANSFER_PAGES 2 | ||
85 | #define VMBUS_CHANNEL_SERVER_SUPPORTS_GPADLS 4 | ||
86 | #define VMBUS_CHANNEL_NAMED_PIPE_MODE 0x10 | ||
87 | #define VMBUS_CHANNEL_LOOPBACK_OFFER 0x100 | ||
88 | #define VMBUS_CHANNEL_PARENT_OFFER 0x200 | ||
89 | #define VMBUS_CHANNEL_REQUEST_MONITORED_NOTIFICATION 0x400 | ||
105 | 90 | ||
106 | |||
107 | #define VMBUS_CHANNEL_ENUMERATE_DEVICE_INTERFACE 1 | ||
108 | #define VMBUS_CHANNEL_SERVER_SUPPORTS_TRANSFER_PAGES 2 | ||
109 | #define VMBUS_CHANNEL_SERVER_SUPPORTS_GPADLS 4 | ||
110 | #define VMBUS_CHANNEL_NAMED_PIPE_MODE 0x10 | ||
111 | #define VMBUS_CHANNEL_LOOPBACK_OFFER 0x100 | ||
112 | #define VMBUS_CHANNEL_PARENT_OFFER 0x200 | ||
113 | #define VMBUS_CHANNEL_REQUEST_MONITORED_NOTIFICATION 0x400 | ||
114 | |||
115 | |||
116 | /* TEMPTEMP -- move this next define to devioctl.h some day */ | ||
117 | |||
118 | |||
119 | #ifndef FILE_DEVICE_VMBUS | ||
120 | #define FILE_DEVICE_VMBUS 0x0000003E | ||
121 | #endif | 91 | #endif |