From: Greg Kroah-Hartman Date: Thu, 6 May 2010 05:36:31 +0000 (-0700) Subject: Staging: hv: rename ChannelInterface.c and .h to channel_interface.c and .h X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5496c9c31d43633c85237d25d31c85cf735a8e7d;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git Staging: hv: rename ChannelInterface.c and .h to channel_interface.c and .h All of the uppercase .c files are now gone. Cc: Hank Janssen Cc: Haiyang Zhang Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/hv/ChannelInterface.c b/drivers/staging/hv/ChannelInterface.c deleted file mode 100644 index 019b064f7cb..00000000000 --- a/drivers/staging/hv/ChannelInterface.c +++ /dev/null @@ -1,152 +0,0 @@ -/* - * - * Copyright (c) 2009, Microsoft Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place - Suite 330, Boston, MA 02111-1307 USA. - * - * Authors: - * Haiyang Zhang - * Hank Janssen - * - */ -#include -#include -#include "osd.h" -#include "VmbusPrivate.h" - -static int IVmbusChannelOpen(struct hv_device *device, u32 SendBufferSize, - u32 RecvRingBufferSize, void *UserData, - u32 UserDataLen, - void (*ChannelCallback)(void *context), - void *Context) -{ - return VmbusChannelOpen(device->context, SendBufferSize, - RecvRingBufferSize, UserData, UserDataLen, - ChannelCallback, Context); -} - -static void IVmbusChannelClose(struct hv_device *device) -{ - VmbusChannelClose(device->context); -} - -static int IVmbusChannelSendPacket(struct hv_device *device, const void *Buffer, - u32 BufferLen, u64 RequestId, u32 Type, - u32 Flags) -{ - return VmbusChannelSendPacket(device->context, Buffer, BufferLen, - RequestId, Type, Flags); -} - -static int IVmbusChannelSendPacketPageBuffer(struct hv_device *device, - struct hv_page_buffer PageBuffers[], - u32 PageCount, void *Buffer, - u32 BufferLen, u64 RequestId) -{ - return VmbusChannelSendPacketPageBuffer(device->context, PageBuffers, - PageCount, Buffer, BufferLen, - RequestId); -} - -static int IVmbusChannelSendPacketMultiPageBuffer(struct hv_device *device, - struct hv_multipage_buffer *MultiPageBuffer, - void *Buffer, u32 BufferLen, u64 RequestId) -{ - return VmbusChannelSendPacketMultiPageBuffer(device->context, - MultiPageBuffer, Buffer, - BufferLen, RequestId); -} - -static int IVmbusChannelRecvPacket(struct hv_device *device, void *Buffer, - u32 BufferLen, u32 *BufferActualLen, - u64 *RequestId) -{ - return VmbusChannelRecvPacket(device->context, Buffer, BufferLen, - BufferActualLen, RequestId); -} - -static int IVmbusChannelRecvPacketRaw(struct hv_device *device, void *Buffer, - u32 BufferLen, u32 *BufferActualLen, - u64 *RequestId) -{ - return VmbusChannelRecvPacketRaw(device->context, Buffer, BufferLen, - BufferActualLen, RequestId); -} - -static int IVmbusChannelEstablishGpadl(struct hv_device *device, void *Buffer, - u32 BufferLen, u32 *GpadlHandle) -{ - return VmbusChannelEstablishGpadl(device->context, Buffer, BufferLen, - GpadlHandle); -} - -static int IVmbusChannelTeardownGpadl(struct hv_device *device, u32 GpadlHandle) -{ - return VmbusChannelTeardownGpadl(device->context, GpadlHandle); - -} - -void GetChannelInterface(struct vmbus_channel_interface *iface) -{ - iface->Open = IVmbusChannelOpen; - iface->Close = IVmbusChannelClose; - iface->SendPacket = IVmbusChannelSendPacket; - iface->SendPacketPageBuffer = IVmbusChannelSendPacketPageBuffer; - iface->SendPacketMultiPageBuffer = - IVmbusChannelSendPacketMultiPageBuffer; - iface->RecvPacket = IVmbusChannelRecvPacket; - iface->RecvPacketRaw = IVmbusChannelRecvPacketRaw; - iface->EstablishGpadl = IVmbusChannelEstablishGpadl; - iface->TeardownGpadl = IVmbusChannelTeardownGpadl; - iface->GetInfo = GetChannelInfo; -} - -void GetChannelInfo(struct hv_device *device, struct hv_device_info *info) -{ - struct vmbus_channel_debug_info debugInfo; - - if (!device->context) - return; - - VmbusChannelGetDebugInfo(device->context, &debugInfo); - - info->ChannelId = debugInfo.RelId; - info->ChannelState = debugInfo.State; - memcpy(&info->ChannelType, &debugInfo.InterfaceType, - sizeof(struct hv_guid)); - memcpy(&info->ChannelInstance, &debugInfo.InterfaceInstance, - sizeof(struct hv_guid)); - - info->MonitorId = debugInfo.MonitorId; - - info->ServerMonitorPending = debugInfo.ServerMonitorPending; - info->ServerMonitorLatency = debugInfo.ServerMonitorLatency; - info->ServerMonitorConnectionId = debugInfo.ServerMonitorConnectionId; - - info->ClientMonitorPending = debugInfo.ClientMonitorPending; - info->ClientMonitorLatency = debugInfo.ClientMonitorLatency; - info->ClientMonitorConnectionId = debugInfo.ClientMonitorConnectionId; - - info->Inbound.InterruptMask = debugInfo.Inbound.CurrentInterruptMask; - info->Inbound.ReadIndex = debugInfo.Inbound.CurrentReadIndex; - info->Inbound.WriteIndex = debugInfo.Inbound.CurrentWriteIndex; - info->Inbound.BytesAvailToRead = debugInfo.Inbound.BytesAvailToRead; - info->Inbound.BytesAvailToWrite = debugInfo.Inbound.BytesAvailToWrite; - - info->Outbound.InterruptMask = debugInfo.Outbound.CurrentInterruptMask; - info->Outbound.ReadIndex = debugInfo.Outbound.CurrentReadIndex; - info->Outbound.WriteIndex = debugInfo.Outbound.CurrentWriteIndex; - info->Outbound.BytesAvailToRead = debugInfo.Outbound.BytesAvailToRead; - info->Outbound.BytesAvailToWrite = debugInfo.Outbound.BytesAvailToWrite; -} diff --git a/drivers/staging/hv/ChannelInterface.h b/drivers/staging/hv/ChannelInterface.h deleted file mode 100644 index 27b7a253b71..00000000000 --- a/drivers/staging/hv/ChannelInterface.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * Copyright (c) 2009, Microsoft Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place - Suite 330, Boston, MA 02111-1307 USA. - * - * Authors: - * Haiyang Zhang - * Hank Janssen - * - */ - - -#ifndef _CHANNEL_INTERFACE_H_ -#define _CHANNEL_INTERFACE_H_ - -#include "VmbusApi.h" - -void GetChannelInterface(struct vmbus_channel_interface *ChannelInterface); - -void GetChannelInfo(struct hv_device *Device, - struct hv_device_info *DeviceInfo); - -#endif /* _CHANNEL_INTERFACE_H_ */ diff --git a/drivers/staging/hv/Makefile b/drivers/staging/hv/Makefile index 2f9ecd2a85f..1866f80a45d 100644 --- a/drivers/staging/hv/Makefile +++ b/drivers/staging/hv/Makefile @@ -6,7 +6,7 @@ obj-$(CONFIG_HYPERV_UTILS) += hv_utils.o hv_vmbus-objs := vmbus_drv.o osd.o \ vmbus.o hv.o connection.o channel.o \ - channel_mgmt.o ChannelInterface.o ring_buffer.o + channel_mgmt.o channel_interface.o ring_buffer.o hv_storvsc-objs := storvsc_drv.o storvsc.o hv_blkvsc-objs := blkvsc_drv.o blkvsc.o hv_netvsc-objs := netvsc_drv.o netvsc.o rndis_filter.o diff --git a/drivers/staging/hv/VmbusPrivate.h b/drivers/staging/hv/VmbusPrivate.h index 6e82183e9d5..57a116ca871 100644 --- a/drivers/staging/hv/VmbusPrivate.h +++ b/drivers/staging/hv/VmbusPrivate.h @@ -29,7 +29,7 @@ #include "VmbusApi.h" #include "channel.h" #include "channel_mgmt.h" -#include "ChannelInterface.h" +#include "channel_interface.h" #include "ring_buffer.h" #include diff --git a/drivers/staging/hv/channel_interface.c b/drivers/staging/hv/channel_interface.c new file mode 100644 index 00000000000..019b064f7cb --- /dev/null +++ b/drivers/staging/hv/channel_interface.c @@ -0,0 +1,152 @@ +/* + * + * Copyright (c) 2009, Microsoft Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place - Suite 330, Boston, MA 02111-1307 USA. + * + * Authors: + * Haiyang Zhang + * Hank Janssen + * + */ +#include +#include +#include "osd.h" +#include "VmbusPrivate.h" + +static int IVmbusChannelOpen(struct hv_device *device, u32 SendBufferSize, + u32 RecvRingBufferSize, void *UserData, + u32 UserDataLen, + void (*ChannelCallback)(void *context), + void *Context) +{ + return VmbusChannelOpen(device->context, SendBufferSize, + RecvRingBufferSize, UserData, UserDataLen, + ChannelCallback, Context); +} + +static void IVmbusChannelClose(struct hv_device *device) +{ + VmbusChannelClose(device->context); +} + +static int IVmbusChannelSendPacket(struct hv_device *device, const void *Buffer, + u32 BufferLen, u64 RequestId, u32 Type, + u32 Flags) +{ + return VmbusChannelSendPacket(device->context, Buffer, BufferLen, + RequestId, Type, Flags); +} + +static int IVmbusChannelSendPacketPageBuffer(struct hv_device *device, + struct hv_page_buffer PageBuffers[], + u32 PageCount, void *Buffer, + u32 BufferLen, u64 RequestId) +{ + return VmbusChannelSendPacketPageBuffer(device->context, PageBuffers, + PageCount, Buffer, BufferLen, + RequestId); +} + +static int IVmbusChannelSendPacketMultiPageBuffer(struct hv_device *device, + struct hv_multipage_buffer *MultiPageBuffer, + void *Buffer, u32 BufferLen, u64 RequestId) +{ + return VmbusChannelSendPacketMultiPageBuffer(device->context, + MultiPageBuffer, Buffer, + BufferLen, RequestId); +} + +static int IVmbusChannelRecvPacket(struct hv_device *device, void *Buffer, + u32 BufferLen, u32 *BufferActualLen, + u64 *RequestId) +{ + return VmbusChannelRecvPacket(device->context, Buffer, BufferLen, + BufferActualLen, RequestId); +} + +static int IVmbusChannelRecvPacketRaw(struct hv_device *device, void *Buffer, + u32 BufferLen, u32 *BufferActualLen, + u64 *RequestId) +{ + return VmbusChannelRecvPacketRaw(device->context, Buffer, BufferLen, + BufferActualLen, RequestId); +} + +static int IVmbusChannelEstablishGpadl(struct hv_device *device, void *Buffer, + u32 BufferLen, u32 *GpadlHandle) +{ + return VmbusChannelEstablishGpadl(device->context, Buffer, BufferLen, + GpadlHandle); +} + +static int IVmbusChannelTeardownGpadl(struct hv_device *device, u32 GpadlHandle) +{ + return VmbusChannelTeardownGpadl(device->context, GpadlHandle); + +} + +void GetChannelInterface(struct vmbus_channel_interface *iface) +{ + iface->Open = IVmbusChannelOpen; + iface->Close = IVmbusChannelClose; + iface->SendPacket = IVmbusChannelSendPacket; + iface->SendPacketPageBuffer = IVmbusChannelSendPacketPageBuffer; + iface->SendPacketMultiPageBuffer = + IVmbusChannelSendPacketMultiPageBuffer; + iface->RecvPacket = IVmbusChannelRecvPacket; + iface->RecvPacketRaw = IVmbusChannelRecvPacketRaw; + iface->EstablishGpadl = IVmbusChannelEstablishGpadl; + iface->TeardownGpadl = IVmbusChannelTeardownGpadl; + iface->GetInfo = GetChannelInfo; +} + +void GetChannelInfo(struct hv_device *device, struct hv_device_info *info) +{ + struct vmbus_channel_debug_info debugInfo; + + if (!device->context) + return; + + VmbusChannelGetDebugInfo(device->context, &debugInfo); + + info->ChannelId = debugInfo.RelId; + info->ChannelState = debugInfo.State; + memcpy(&info->ChannelType, &debugInfo.InterfaceType, + sizeof(struct hv_guid)); + memcpy(&info->ChannelInstance, &debugInfo.InterfaceInstance, + sizeof(struct hv_guid)); + + info->MonitorId = debugInfo.MonitorId; + + info->ServerMonitorPending = debugInfo.ServerMonitorPending; + info->ServerMonitorLatency = debugInfo.ServerMonitorLatency; + info->ServerMonitorConnectionId = debugInfo.ServerMonitorConnectionId; + + info->ClientMonitorPending = debugInfo.ClientMonitorPending; + info->ClientMonitorLatency = debugInfo.ClientMonitorLatency; + info->ClientMonitorConnectionId = debugInfo.ClientMonitorConnectionId; + + info->Inbound.InterruptMask = debugInfo.Inbound.CurrentInterruptMask; + info->Inbound.ReadIndex = debugInfo.Inbound.CurrentReadIndex; + info->Inbound.WriteIndex = debugInfo.Inbound.CurrentWriteIndex; + info->Inbound.BytesAvailToRead = debugInfo.Inbound.BytesAvailToRead; + info->Inbound.BytesAvailToWrite = debugInfo.Inbound.BytesAvailToWrite; + + info->Outbound.InterruptMask = debugInfo.Outbound.CurrentInterruptMask; + info->Outbound.ReadIndex = debugInfo.Outbound.CurrentReadIndex; + info->Outbound.WriteIndex = debugInfo.Outbound.CurrentWriteIndex; + info->Outbound.BytesAvailToRead = debugInfo.Outbound.BytesAvailToRead; + info->Outbound.BytesAvailToWrite = debugInfo.Outbound.BytesAvailToWrite; +} diff --git a/drivers/staging/hv/channel_interface.h b/drivers/staging/hv/channel_interface.h new file mode 100644 index 00000000000..27b7a253b71 --- /dev/null +++ b/drivers/staging/hv/channel_interface.h @@ -0,0 +1,35 @@ +/* + * + * Copyright (c) 2009, Microsoft Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place - Suite 330, Boston, MA 02111-1307 USA. + * + * Authors: + * Haiyang Zhang + * Hank Janssen + * + */ + + +#ifndef _CHANNEL_INTERFACE_H_ +#define _CHANNEL_INTERFACE_H_ + +#include "VmbusApi.h" + +void GetChannelInterface(struct vmbus_channel_interface *ChannelInterface); + +void GetChannelInfo(struct hv_device *Device, + struct hv_device_info *DeviceInfo); + +#endif /* _CHANNEL_INTERFACE_H_ */