From 376a045f3a90ce4ca02aa9c32ea3c81332c10ecc Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 5 May 2010 22:24:25 -0700 Subject: Staging: hv: rename BlkVsc.c to blkvsc.c Cc: Hank Janssen Cc: Haiyang Zhang Signed-off-by: Greg Kroah-Hartman --- drivers/staging/hv/BlkVsc.c | 112 -------------------------------------------- drivers/staging/hv/Makefile | 2 +- drivers/staging/hv/blkvsc.c | 112 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 113 insertions(+), 113 deletions(-) delete mode 100644 drivers/staging/hv/BlkVsc.c create mode 100644 drivers/staging/hv/blkvsc.c (limited to 'drivers') diff --git a/drivers/staging/hv/BlkVsc.c b/drivers/staging/hv/BlkVsc.c deleted file mode 100644 index b2f600551f10..000000000000 --- a/drivers/staging/hv/BlkVsc.c +++ /dev/null @@ -1,112 +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 "StorVsc.c" - -static const char *gBlkDriverName = "blkvsc"; - -/* {32412632-86cb-44a2-9b5c-50d1417354f5} */ -static const struct hv_guid gBlkVscDeviceType = { - .data = { - 0x32, 0x26, 0x41, 0x32, 0xcb, 0x86, 0xa2, 0x44, - 0x9b, 0x5c, 0x50, 0xd1, 0x41, 0x73, 0x54, 0xf5 - } -}; - -static int BlkVscOnDeviceAdd(struct hv_device *Device, void *AdditionalInfo) -{ - struct storvsc_device_info *deviceInfo; - int ret = 0; - - DPRINT_ENTER(BLKVSC); - - deviceInfo = (struct storvsc_device_info *)AdditionalInfo; - - ret = StorVscOnDeviceAdd(Device, AdditionalInfo); - if (ret != 0) { - DPRINT_EXIT(BLKVSC); - return ret; - } - - /* - * We need to use the device instance guid to set the path and target - * id. For IDE devices, the device instance id is formatted as - * * - - 8899 - 000000000000. - */ - deviceInfo->PathId = Device->deviceInstance.data[3] << 24 | - Device->deviceInstance.data[2] << 16 | - Device->deviceInstance.data[1] << 8 | - Device->deviceInstance.data[0]; - - deviceInfo->TargetId = Device->deviceInstance.data[5] << 8 | - Device->deviceInstance.data[4]; - - DPRINT_EXIT(BLKVSC); - - return ret; -} - -int BlkVscInitialize(struct hv_driver *Driver) -{ - struct storvsc_driver_object *storDriver; - int ret = 0; - - DPRINT_ENTER(BLKVSC); - - storDriver = (struct storvsc_driver_object *)Driver; - - /* Make sure we are at least 2 pages since 1 page is used for control */ - /* ASSERT(storDriver->RingBufferSize >= (PAGE_SIZE << 1)); */ - - Driver->name = gBlkDriverName; - memcpy(&Driver->deviceType, &gBlkVscDeviceType, sizeof(struct hv_guid)); - - storDriver->RequestExtSize = sizeof(struct 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) - * by the max request size (which is - * VMBUS_CHANNEL_PACKET_MULITPAGE_BUFFER + struct vstor_packet + u64) - */ - storDriver->MaxOutstandingRequestsPerChannel = - ((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); - - /* Setup the dispatch table */ - storDriver->Base.OnDeviceAdd = BlkVscOnDeviceAdd; - storDriver->Base.OnDeviceRemove = StorVscOnDeviceRemove; - storDriver->Base.OnCleanup = StorVscOnCleanup; - storDriver->OnIORequest = StorVscOnIORequest; - - DPRINT_EXIT(BLKVSC); - - return ret; -} diff --git a/drivers/staging/hv/Makefile b/drivers/staging/hv/Makefile index faa8db1d86c0..6e8e8e82263a 100644 --- a/drivers/staging/hv/Makefile +++ b/drivers/staging/hv/Makefile @@ -8,5 +8,5 @@ hv_vmbus-objs := vmbus_drv.o osd.o \ Vmbus.o hv.o connection.o channel.o \ ChannelMgmt.o ChannelInterface.o ring_buffer.o hv_storvsc-objs := storvsc_drv.o StorVsc.o -hv_blkvsc-objs := blkvsc_drv.o BlkVsc.o +hv_blkvsc-objs := blkvsc_drv.o blkvsc.o hv_netvsc-objs := netvsc_drv.o NetVsc.o RndisFilter.o diff --git a/drivers/staging/hv/blkvsc.c b/drivers/staging/hv/blkvsc.c new file mode 100644 index 000000000000..b2f600551f10 --- /dev/null +++ b/drivers/staging/hv/blkvsc.c @@ -0,0 +1,112 @@ +/* + * + * 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 "StorVsc.c" + +static const char *gBlkDriverName = "blkvsc"; + +/* {32412632-86cb-44a2-9b5c-50d1417354f5} */ +static const struct hv_guid gBlkVscDeviceType = { + .data = { + 0x32, 0x26, 0x41, 0x32, 0xcb, 0x86, 0xa2, 0x44, + 0x9b, 0x5c, 0x50, 0xd1, 0x41, 0x73, 0x54, 0xf5 + } +}; + +static int BlkVscOnDeviceAdd(struct hv_device *Device, void *AdditionalInfo) +{ + struct storvsc_device_info *deviceInfo; + int ret = 0; + + DPRINT_ENTER(BLKVSC); + + deviceInfo = (struct storvsc_device_info *)AdditionalInfo; + + ret = StorVscOnDeviceAdd(Device, AdditionalInfo); + if (ret != 0) { + DPRINT_EXIT(BLKVSC); + return ret; + } + + /* + * We need to use the device instance guid to set the path and target + * id. For IDE devices, the device instance id is formatted as + * * - - 8899 - 000000000000. + */ + deviceInfo->PathId = Device->deviceInstance.data[3] << 24 | + Device->deviceInstance.data[2] << 16 | + Device->deviceInstance.data[1] << 8 | + Device->deviceInstance.data[0]; + + deviceInfo->TargetId = Device->deviceInstance.data[5] << 8 | + Device->deviceInstance.data[4]; + + DPRINT_EXIT(BLKVSC); + + return ret; +} + +int BlkVscInitialize(struct hv_driver *Driver) +{ + struct storvsc_driver_object *storDriver; + int ret = 0; + + DPRINT_ENTER(BLKVSC); + + storDriver = (struct storvsc_driver_object *)Driver; + + /* Make sure we are at least 2 pages since 1 page is used for control */ + /* ASSERT(storDriver->RingBufferSize >= (PAGE_SIZE << 1)); */ + + Driver->name = gBlkDriverName; + memcpy(&Driver->deviceType, &gBlkVscDeviceType, sizeof(struct hv_guid)); + + storDriver->RequestExtSize = sizeof(struct 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) + * by the max request size (which is + * VMBUS_CHANNEL_PACKET_MULITPAGE_BUFFER + struct vstor_packet + u64) + */ + storDriver->MaxOutstandingRequestsPerChannel = + ((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); + + /* Setup the dispatch table */ + storDriver->Base.OnDeviceAdd = BlkVscOnDeviceAdd; + storDriver->Base.OnDeviceRemove = StorVscOnDeviceRemove; + storDriver->Base.OnCleanup = StorVscOnCleanup; + storDriver->OnIORequest = StorVscOnIORequest; + + DPRINT_EXIT(BLKVSC); + + return ret; +} -- cgit v1.2.3