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

Staging: hv: hv_mouse: remove typedefs

Cc: Hank Janssen <hjanssen@microsoft.com>
Cc: K. Y. Srinivasan <kys@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 94fcc888
...@@ -99,56 +99,56 @@ enum synthhid_msg_type { ...@@ -99,56 +99,56 @@ enum synthhid_msg_type {
/* /*
* Basic message structures. * Basic message structures.
*/ */
typedef struct { struct synthhid_msg_hdr {
enum synthhid_msg_type Type; /* Type of the enclosed message */ enum synthhid_msg_type Type; /* Type of the enclosed message */
u32 Size; /* Size of the enclosed message u32 Size; /* Size of the enclosed message
* (size of the data payload) * (size of the data payload)
*/ */
} SYNTHHID_MESSAGE_HEADER, *PSYNTHHID_MESSAGE_HEADER; };
typedef struct { struct synthhid_msg {
SYNTHHID_MESSAGE_HEADER Header; struct synthhid_msg_hdr Header;
char Data[1]; /* Enclosed message */ char Data[1]; /* Enclosed message */
} SYNTHHID_MESSAGE, *PSYNTHHID_MESSAGE; };
typedef union { union synthhid_version {
struct { struct {
u16 Minor; u16 Minor;
u16 Major; u16 Major;
}; };
u32 AsDWord; u32 AsDWord;
} SYNTHHID_VERSION, *PSYNTHHID_VERSION; };
/* /*
* Protocol messages * Protocol messages
*/ */
typedef struct { struct synthhid_protocol_request {
SYNTHHID_MESSAGE_HEADER Header; struct synthhid_msg_hdr Header;
SYNTHHID_VERSION VersionRequested; union synthhid_version VersionRequested;
} SYNTHHID_PROTOCOL_REQUEST, *PSYNTHHID_PROTOCOL_REQUEST; };
typedef struct { struct synthhid_protocol_response {
SYNTHHID_MESSAGE_HEADER Header; struct synthhid_msg_hdr Header;
SYNTHHID_VERSION VersionRequested; union synthhid_version VersionRequested;
unsigned char Approved; unsigned char Approved;
} SYNTHHID_PROTOCOL_RESPONSE, *PSYNTHHID_PROTOCOL_RESPONSE; };
typedef struct { struct synthhid_device_info {
SYNTHHID_MESSAGE_HEADER Header; struct synthhid_msg_hdr Header;
struct input_dev_info HidDeviceAttributes; struct input_dev_info HidDeviceAttributes;
unsigned char HidDescriptorInformation[1]; unsigned char HidDescriptorInformation[1];
} SYNTHHID_DEVICE_INFO, *PSYNTHHID_DEVICE_INFO; };
typedef struct { struct synthhid_device_info_ack {
SYNTHHID_MESSAGE_HEADER Header; struct synthhid_msg_hdr Header;
unsigned char Reserved; unsigned char Reserved;
} SYNTHHID_DEVICE_INFO_ACK, *PSYNTHHID_DEVICE_INFO_ACK; };
typedef struct { struct synthhid_input_report {
SYNTHHID_MESSAGE_HEADER Header; struct synthhid_msg_hdr Header;
char ReportBuffer[1]; char ReportBuffer[1];
} SYNTHHID_INPUT_REPORT, *PSYNTHHID_INPUT_REPORT; };
#pragma pack(pop) #pragma pack(pop)
...@@ -177,9 +177,9 @@ struct mousevsc_prt_msg { ...@@ -177,9 +177,9 @@ struct mousevsc_prt_msg {
enum pipe_prot_msg_type PacketType; enum pipe_prot_msg_type PacketType;
u32 DataSize; u32 DataSize;
union { union {
SYNTHHID_PROTOCOL_REQUEST Request; struct synthhid_protocol_request Request;
SYNTHHID_PROTOCOL_RESPONSE Response; struct synthhid_protocol_response Response;
SYNTHHID_DEVICE_INFO_ACK Ack; struct synthhid_device_info_ack Ack;
} u; } u;
}; };
...@@ -478,24 +478,24 @@ MousevscConnectToVsp(struct hv_device *Device) ...@@ -478,24 +478,24 @@ MousevscConnectToVsp(struct hv_device *Device)
memset(request, sizeof(struct mousevsc_prt_msg), 0); memset(request, sizeof(struct mousevsc_prt_msg), 0);
request->PacketType = PipeMessageData; request->PacketType = PipeMessageData;
request->DataSize = sizeof(SYNTHHID_PROTOCOL_REQUEST); request->DataSize = sizeof(struct synthhid_protocol_request);
request->u.Request.Header.Type = SynthHidProtocolRequest; request->u.Request.Header.Type = SynthHidProtocolRequest;
request->u.Request.Header.Size = sizeof(unsigned long); request->u.Request.Header.Size = sizeof(unsigned long);
request->u.Request.VersionRequested.AsDWord = request->u.Request.VersionRequested.AsDWord =
SYNTHHID_INPUT_VERSION_DWORD; SYNTHHID_INPUT_VERSION_DWORD;
pr_info("SYNTHHID_PROTOCOL_REQUEST..."); pr_info("synthhid protocol request...");
ret = vmbus_sendpacket(Device->channel, request, ret = vmbus_sendpacket(Device->channel, request,
sizeof(struct pipe_prt_msg) - sizeof(struct pipe_prt_msg) -
sizeof(unsigned char) + sizeof(unsigned char) +
sizeof(SYNTHHID_PROTOCOL_REQUEST), sizeof(struct synthhid_protocol_request),
(unsigned long)request, (unsigned long)request,
VM_PKT_DATA_INBAND, VM_PKT_DATA_INBAND,
VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
if (ret != 0) { if (ret != 0) {
pr_err("unable to send SYNTHHID_PROTOCOL_REQUEST"); pr_err("unable to send synthhid protocol request.");
goto Cleanup; goto Cleanup;
} }
...@@ -509,7 +509,7 @@ MousevscConnectToVsp(struct hv_device *Device) ...@@ -509,7 +509,7 @@ MousevscConnectToVsp(struct hv_device *Device)
response = &inputDevice->ProtocolResp; response = &inputDevice->ProtocolResp;
if (!response->u.Response.Approved) { if (!response->u.Response.Approved) {
pr_err("SYNTHHID_PROTOCOL_REQUEST failed (version %d)", pr_err("synthhid protocol request failed (version %d)",
SYNTHHID_INPUT_VERSION_DWORD); SYNTHHID_INPUT_VERSION_DWORD);
ret = -1; ret = -1;
goto Cleanup; goto Cleanup;
...@@ -625,7 +625,7 @@ MousevscOnSendCompletion(struct hv_device *Device, ...@@ -625,7 +625,7 @@ MousevscOnSendCompletion(struct hv_device *Device,
void void
MousevscOnReceiveDeviceInfo( MousevscOnReceiveDeviceInfo(
struct mousevsc_dev *InputDevice, struct mousevsc_dev *InputDevice,
SYNTHHID_DEVICE_INFO *DeviceInfo) struct synthhid_device_info *DeviceInfo)
{ {
int ret = 0; int ret = 0;
struct hid_descriptor *desc; struct hid_descriptor *desc;
...@@ -669,7 +669,7 @@ MousevscOnReceiveDeviceInfo( ...@@ -669,7 +669,7 @@ MousevscOnReceiveDeviceInfo(
memset(&ack, sizeof(struct mousevsc_prt_msg), 0); memset(&ack, sizeof(struct mousevsc_prt_msg), 0);
ack.PacketType = PipeMessageData; ack.PacketType = PipeMessageData;
ack.DataSize = sizeof(SYNTHHID_DEVICE_INFO_ACK); ack.DataSize = sizeof(struct synthhid_device_info_ack);
ack.u.Ack.Header.Type = SynthHidInitialDeviceInfoAck; ack.u.Ack.Header.Type = SynthHidInitialDeviceInfoAck;
ack.u.Ack.Header.Size = 1; ack.u.Ack.Header.Size = 1;
...@@ -677,12 +677,13 @@ MousevscOnReceiveDeviceInfo( ...@@ -677,12 +677,13 @@ MousevscOnReceiveDeviceInfo(
ret = vmbus_sendpacket(InputDevice->Device->channel, ret = vmbus_sendpacket(InputDevice->Device->channel,
&ack, &ack,
sizeof(struct pipe_prt_msg) - sizeof(unsigned char) + sizeof(SYNTHHID_DEVICE_INFO_ACK), sizeof(struct pipe_prt_msg) - sizeof(unsigned char) +
sizeof(struct synthhid_device_info_ack),
(unsigned long)&ack, (unsigned long)&ack,
VM_PKT_DATA_INBAND, VM_PKT_DATA_INBAND,
VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
if (ret != 0) { if (ret != 0) {
pr_err("unable to send SYNTHHID_DEVICE_INFO_ACK - ret %d", pr_err("unable to send synthhid device info ack - ret %d",
ret); ret);
goto Cleanup; goto Cleanup;
} }
...@@ -712,7 +713,7 @@ MousevscOnReceiveDeviceInfo( ...@@ -712,7 +713,7 @@ MousevscOnReceiveDeviceInfo(
void void
MousevscOnReceiveInputReport( MousevscOnReceiveInputReport(
struct mousevsc_dev *InputDevice, struct mousevsc_dev *InputDevice,
SYNTHHID_INPUT_REPORT *InputReport) struct synthhid_input_report *InputReport)
{ {
struct mousevsc_drv_obj *inputDriver; struct mousevsc_drv_obj *inputDriver;
...@@ -732,7 +733,7 @@ void ...@@ -732,7 +733,7 @@ void
MousevscOnReceive(struct hv_device *Device, struct vmpacket_descriptor *Packet) MousevscOnReceive(struct hv_device *Device, struct vmpacket_descriptor *Packet)
{ {
struct pipe_prt_msg *pipeMsg; struct pipe_prt_msg *pipeMsg;
SYNTHHID_MESSAGE *hidMsg; struct synthhid_msg *hidMsg;
struct mousevsc_dev *inputDevice; struct mousevsc_dev *inputDevice;
inputDevice = MustGetInputDevice(Device); inputDevice = MustGetInputDevice(Device);
...@@ -750,7 +751,7 @@ MousevscOnReceive(struct hv_device *Device, struct vmpacket_descriptor *Packet) ...@@ -750,7 +751,7 @@ MousevscOnReceive(struct hv_device *Device, struct vmpacket_descriptor *Packet)
return ; return ;
} }
hidMsg = (SYNTHHID_MESSAGE *)&pipeMsg->Data[0]; hidMsg = (struct synthhid_msg *)&pipeMsg->Data[0];
switch (hidMsg->Header.Type) { switch (hidMsg->Header.Type) {
case SynthHidProtocolResponse: case SynthHidProtocolResponse:
...@@ -767,11 +768,11 @@ MousevscOnReceive(struct hv_device *Device, struct vmpacket_descriptor *Packet) ...@@ -767,11 +768,11 @@ MousevscOnReceive(struct hv_device *Device, struct vmpacket_descriptor *Packet)
* hid desc and report desc * hid desc and report desc
*/ */
MousevscOnReceiveDeviceInfo(inputDevice, MousevscOnReceiveDeviceInfo(inputDevice,
(SYNTHHID_DEVICE_INFO *)&pipeMsg->Data[0]); (struct synthhid_device_info *)&pipeMsg->Data[0]);
break; break;
case SynthHidInputReport: case SynthHidInputReport:
MousevscOnReceiveInputReport(inputDevice, MousevscOnReceiveInputReport(inputDevice,
(SYNTHHID_INPUT_REPORT *)&pipeMsg->Data[0]); (struct synthhid_input_report *)&pipeMsg->Data[0]);
break; break;
default: default:
......
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