Hank Janssen | bef4a34 | 2009-07-13 16:01:31 -0700 | [diff] [blame] | 1 | /* |
Hank Janssen | bef4a34 | 2009-07-13 16:01:31 -0700 | [diff] [blame] | 2 | * Copyright (c) 2009, Microsoft Corporation. |
| 3 | * |
| 4 | * This program is free software; you can redistribute it and/or modify it |
| 5 | * under the terms and conditions of the GNU General Public License, |
| 6 | * version 2, as published by the Free Software Foundation. |
| 7 | * |
| 8 | * This program is distributed in the hope it will be useful, but WITHOUT |
| 9 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 10 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
| 11 | * more details. |
| 12 | * |
| 13 | * You should have received a copy of the GNU General Public License along with |
| 14 | * this program; if not, write to the Free Software Foundation, Inc., 59 Temple |
| 15 | * Place - Suite 330, Boston, MA 02111-1307 USA. |
| 16 | * |
| 17 | * Authors: |
| 18 | * Haiyang Zhang <haiyangz@microsoft.com> |
| 19 | * Hank Janssen <hjanssen@microsoft.com> |
K. Y. Srinivasan | 972621c | 2011-05-10 07:54:19 -0700 | [diff] [blame] | 20 | * K. Y. Srinivasan <kys@microsoft.com> |
Hank Janssen | bef4a34 | 2009-07-13 16:01:31 -0700 | [diff] [blame] | 21 | */ |
Hank Janssen | bef4a34 | 2009-07-13 16:01:31 -0700 | [diff] [blame] | 22 | #include <linux/init.h> |
Tejun Heo | 5a0e3ad | 2010-03-24 17:04:11 +0900 | [diff] [blame] | 23 | #include <linux/slab.h> |
Hank Janssen | bef4a34 | 2009-07-13 16:01:31 -0700 | [diff] [blame] | 24 | #include <linux/module.h> |
| 25 | #include <linux/device.h> |
| 26 | #include <linux/blkdev.h> |
K. Y. Srinivasan | 3e1edf6 | 2011-06-06 15:49:36 -0700 | [diff] [blame] | 27 | #include <linux/dmi.h> |
Hank Janssen | bef4a34 | 2009-07-13 16:01:31 -0700 | [diff] [blame] | 28 | #include <scsi/scsi.h> |
| 29 | #include <scsi/scsi_cmnd.h> |
| 30 | #include <scsi/scsi_host.h> |
| 31 | #include <scsi/scsi_device.h> |
| 32 | #include <scsi/scsi_tcq.h> |
| 33 | #include <scsi/scsi_eh.h> |
| 34 | #include <scsi/scsi_devinfo.h> |
Hank Janssen | bef4a34 | 2009-07-13 16:01:31 -0700 | [diff] [blame] | 35 | #include <scsi/scsi_dbg.h> |
K. Y. Srinivasan | 3f335ea | 2011-05-12 19:34:15 -0700 | [diff] [blame] | 36 | |
| 37 | #include "hyperv.h" |
K. Y. Srinivasan | cdee150 | 2011-05-12 19:34:34 -0700 | [diff] [blame] | 38 | #include "hyperv_storage.h" |
Hank Janssen | bef4a34 | 2009-07-13 16:01:31 -0700 | [diff] [blame] | 39 | |
K. Y. Srinivasan | 2db2cab | 2011-05-10 07:54:39 -0700 | [diff] [blame] | 40 | static int storvsc_ringbuffer_size = STORVSC_RING_BUFFER_SIZE; |
Hank Janssen | bef4a34 | 2009-07-13 16:01:31 -0700 | [diff] [blame] | 41 | |
K. Y. Srinivasan | 3d598ce | 2011-05-10 07:54:40 -0700 | [diff] [blame] | 42 | module_param(storvsc_ringbuffer_size, int, S_IRUGO); |
| 43 | MODULE_PARM_DESC(storvsc_ringbuffer_size, "Ring buffer size (bytes)"); |
| 44 | |
K. Y. Srinivasan | 0f0cdc6 | 2011-05-10 07:54:18 -0700 | [diff] [blame] | 45 | static const char *driver_name = "storvsc"; |
K. Y. Srinivasan | 6dec244 | 2011-03-23 10:50:25 -0700 | [diff] [blame] | 46 | |
| 47 | /* {ba6163d9-04a1-4d29-b605-72e2ffb1dc7f} */ |
K. Y. Srinivasan | 990f05e | 2011-06-06 15:49:31 -0700 | [diff] [blame] | 48 | static const struct hv_guid stor_vsci_device_type = { |
K. Y. Srinivasan | 6dec244 | 2011-03-23 10:50:25 -0700 | [diff] [blame] | 49 | .data = { |
| 50 | 0xd9, 0x63, 0x61, 0xba, 0xa1, 0x04, 0x29, 0x4d, |
| 51 | 0xb6, 0x05, 0x72, 0xe2, 0xff, 0xb1, 0xdc, 0x7f |
| 52 | } |
| 53 | }; |
| 54 | |
K. Y. Srinivasan | 972621c | 2011-05-10 07:54:19 -0700 | [diff] [blame] | 55 | struct hv_host_device { |
K. Y. Srinivasan | 97c1529 | 2011-05-10 07:54:21 -0700 | [diff] [blame] | 56 | struct hv_device *dev; |
Greg Kroah-Hartman | ff568d3 | 2009-09-02 08:37:47 -0700 | [diff] [blame] | 57 | struct kmem_cache *request_pool; |
| 58 | unsigned int port; |
| 59 | unsigned char path; |
| 60 | unsigned char target; |
Hank Janssen | bef4a34 | 2009-07-13 16:01:31 -0700 | [diff] [blame] | 61 | }; |
| 62 | |
| 63 | struct storvsc_cmd_request { |
Greg Kroah-Hartman | ff568d3 | 2009-09-02 08:37:47 -0700 | [diff] [blame] | 64 | struct list_head entry; |
| 65 | struct scsi_cmnd *cmd; |
Hank Janssen | bef4a34 | 2009-07-13 16:01:31 -0700 | [diff] [blame] | 66 | |
| 67 | unsigned int bounce_sgl_count; |
Greg Kroah-Hartman | ff568d3 | 2009-09-02 08:37:47 -0700 | [diff] [blame] | 68 | struct scatterlist *bounce_sgl; |
Hank Janssen | bef4a34 | 2009-07-13 16:01:31 -0700 | [diff] [blame] | 69 | |
Nicolas Palix | 0b3f683 | 2009-07-29 14:10:19 +0200 | [diff] [blame] | 70 | struct hv_storvsc_request request; |
Hank Janssen | bef4a34 | 2009-07-13 16:01:31 -0700 | [diff] [blame] | 71 | }; |
| 72 | |
Hank Janssen | bef4a34 | 2009-07-13 16:01:31 -0700 | [diff] [blame] | 73 | |
K. Y. Srinivasan | 5b60ace | 2011-05-10 07:54:25 -0700 | [diff] [blame] | 74 | static int storvsc_device_alloc(struct scsi_device *sdevice) |
| 75 | { |
| 76 | /* |
| 77 | * This enables luns to be located sparsely. Otherwise, we may not |
| 78 | * discovered them. |
| 79 | */ |
| 80 | sdevice->sdev_bflags |= BLIST_SPARSELUN | BLIST_LARGELUN; |
| 81 | return 0; |
| 82 | } |
| 83 | |
K. Y. Srinivasan | a1ebfea | 2011-05-10 07:54:26 -0700 | [diff] [blame] | 84 | static int storvsc_merge_bvec(struct request_queue *q, |
| 85 | struct bvec_merge_data *bmd, struct bio_vec *bvec) |
| 86 | { |
| 87 | /* checking done by caller. */ |
| 88 | return bvec->bv_len; |
| 89 | } |
| 90 | |
K. Y. Srinivasan | 419f2d0 | 2011-05-10 07:54:27 -0700 | [diff] [blame] | 91 | static int storvsc_device_configure(struct scsi_device *sdevice) |
| 92 | { |
| 93 | scsi_adjust_queue_depth(sdevice, MSG_SIMPLE_TAG, |
| 94 | STORVSC_MAX_IO_REQUESTS); |
| 95 | |
K. Y. Srinivasan | 419f2d0 | 2011-05-10 07:54:27 -0700 | [diff] [blame] | 96 | blk_queue_max_segment_size(sdevice->request_queue, PAGE_SIZE); |
| 97 | |
K. Y. Srinivasan | 419f2d0 | 2011-05-10 07:54:27 -0700 | [diff] [blame] | 98 | blk_queue_merge_bvec(sdevice->request_queue, storvsc_merge_bvec); |
| 99 | |
| 100 | blk_queue_bounce_limit(sdevice->request_queue, BLK_BOUNCE_ANY); |
K. Y. Srinivasan | 419f2d0 | 2011-05-10 07:54:27 -0700 | [diff] [blame] | 101 | |
| 102 | return 0; |
| 103 | } |
| 104 | |
K. Y. Srinivasan | 49a3c7a | 2011-05-10 07:54:28 -0700 | [diff] [blame] | 105 | static void destroy_bounce_buffer(struct scatterlist *sgl, |
| 106 | unsigned int sg_count) |
| 107 | { |
| 108 | int i; |
| 109 | struct page *page_buf; |
| 110 | |
| 111 | for (i = 0; i < sg_count; i++) { |
| 112 | page_buf = sg_page((&sgl[i])); |
| 113 | if (page_buf != NULL) |
| 114 | __free_page(page_buf); |
| 115 | } |
| 116 | |
| 117 | kfree(sgl); |
| 118 | } |
| 119 | |
K. Y. Srinivasan | 3862ef3 | 2011-05-10 07:54:29 -0700 | [diff] [blame] | 120 | static int do_bounce_buffer(struct scatterlist *sgl, unsigned int sg_count) |
| 121 | { |
| 122 | int i; |
| 123 | |
| 124 | /* No need to check */ |
| 125 | if (sg_count < 2) |
| 126 | return -1; |
| 127 | |
| 128 | /* We have at least 2 sg entries */ |
| 129 | for (i = 0; i < sg_count; i++) { |
| 130 | if (i == 0) { |
| 131 | /* make sure 1st one does not have hole */ |
| 132 | if (sgl[i].offset + sgl[i].length != PAGE_SIZE) |
| 133 | return i; |
| 134 | } else if (i == sg_count - 1) { |
| 135 | /* make sure last one does not have hole */ |
| 136 | if (sgl[i].offset != 0) |
| 137 | return i; |
| 138 | } else { |
| 139 | /* make sure no hole in the middle */ |
| 140 | if (sgl[i].length != PAGE_SIZE || sgl[i].offset != 0) |
| 141 | return i; |
| 142 | } |
| 143 | } |
| 144 | return -1; |
| 145 | } |
| 146 | |
K. Y. Srinivasan | a9753cb | 2011-05-10 07:54:30 -0700 | [diff] [blame] | 147 | static struct scatterlist *create_bounce_buffer(struct scatterlist *sgl, |
| 148 | unsigned int sg_count, |
| 149 | unsigned int len) |
| 150 | { |
| 151 | int i; |
| 152 | int num_pages; |
| 153 | struct scatterlist *bounce_sgl; |
| 154 | struct page *page_buf; |
| 155 | |
| 156 | num_pages = ALIGN(len, PAGE_SIZE) >> PAGE_SHIFT; |
| 157 | |
| 158 | bounce_sgl = kcalloc(num_pages, sizeof(struct scatterlist), GFP_ATOMIC); |
| 159 | if (!bounce_sgl) |
| 160 | return NULL; |
| 161 | |
| 162 | for (i = 0; i < num_pages; i++) { |
| 163 | page_buf = alloc_page(GFP_ATOMIC); |
| 164 | if (!page_buf) |
| 165 | goto cleanup; |
| 166 | sg_set_page(&bounce_sgl[i], page_buf, 0, 0); |
| 167 | } |
| 168 | |
| 169 | return bounce_sgl; |
| 170 | |
| 171 | cleanup: |
| 172 | destroy_bounce_buffer(bounce_sgl, num_pages); |
| 173 | return NULL; |
| 174 | } |
| 175 | |
K. Y. Srinivasan | 29fe2c9 | 2011-05-10 07:54:31 -0700 | [diff] [blame] | 176 | |
| 177 | /* Assume the original sgl has enough room */ |
| 178 | static unsigned int copy_from_bounce_buffer(struct scatterlist *orig_sgl, |
| 179 | struct scatterlist *bounce_sgl, |
| 180 | unsigned int orig_sgl_count) |
| 181 | { |
| 182 | int i; |
| 183 | int j = 0; |
| 184 | unsigned long src, dest; |
| 185 | unsigned int srclen, destlen, copylen; |
| 186 | unsigned int total_copied = 0; |
| 187 | unsigned long bounce_addr = 0; |
| 188 | unsigned long dest_addr = 0; |
| 189 | unsigned long flags; |
| 190 | |
| 191 | local_irq_save(flags); |
| 192 | |
| 193 | for (i = 0; i < orig_sgl_count; i++) { |
| 194 | dest_addr = (unsigned long)kmap_atomic(sg_page((&orig_sgl[i])), |
| 195 | KM_IRQ0) + orig_sgl[i].offset; |
| 196 | dest = dest_addr; |
| 197 | destlen = orig_sgl[i].length; |
| 198 | |
| 199 | if (bounce_addr == 0) |
| 200 | bounce_addr = |
| 201 | (unsigned long)kmap_atomic(sg_page((&bounce_sgl[j])), |
| 202 | KM_IRQ0); |
| 203 | |
| 204 | while (destlen) { |
| 205 | src = bounce_addr + bounce_sgl[j].offset; |
| 206 | srclen = bounce_sgl[j].length - bounce_sgl[j].offset; |
| 207 | |
| 208 | copylen = min(srclen, destlen); |
| 209 | memcpy((void *)dest, (void *)src, copylen); |
| 210 | |
| 211 | total_copied += copylen; |
| 212 | bounce_sgl[j].offset += copylen; |
| 213 | destlen -= copylen; |
| 214 | dest += copylen; |
| 215 | |
| 216 | if (bounce_sgl[j].offset == bounce_sgl[j].length) { |
| 217 | /* full */ |
| 218 | kunmap_atomic((void *)bounce_addr, KM_IRQ0); |
| 219 | j++; |
| 220 | |
| 221 | /* if we need to use another bounce buffer */ |
| 222 | if (destlen || i != orig_sgl_count - 1) |
| 223 | bounce_addr = |
| 224 | (unsigned long)kmap_atomic( |
| 225 | sg_page((&bounce_sgl[j])), KM_IRQ0); |
| 226 | } else if (destlen == 0 && i == orig_sgl_count - 1) { |
| 227 | /* unmap the last bounce that is < PAGE_SIZE */ |
| 228 | kunmap_atomic((void *)bounce_addr, KM_IRQ0); |
| 229 | } |
| 230 | } |
| 231 | |
| 232 | kunmap_atomic((void *)(dest_addr - orig_sgl[i].offset), |
| 233 | KM_IRQ0); |
| 234 | } |
| 235 | |
| 236 | local_irq_restore(flags); |
| 237 | |
| 238 | return total_copied; |
| 239 | } |
| 240 | |
K. Y. Srinivasan | 6a8ff44 | 2011-05-10 07:54:32 -0700 | [diff] [blame] | 241 | |
| 242 | /* Assume the bounce_sgl has enough room ie using the create_bounce_buffer() */ |
| 243 | static unsigned int copy_to_bounce_buffer(struct scatterlist *orig_sgl, |
| 244 | struct scatterlist *bounce_sgl, |
| 245 | unsigned int orig_sgl_count) |
| 246 | { |
| 247 | int i; |
| 248 | int j = 0; |
| 249 | unsigned long src, dest; |
| 250 | unsigned int srclen, destlen, copylen; |
| 251 | unsigned int total_copied = 0; |
| 252 | unsigned long bounce_addr = 0; |
| 253 | unsigned long src_addr = 0; |
| 254 | unsigned long flags; |
| 255 | |
| 256 | local_irq_save(flags); |
| 257 | |
| 258 | for (i = 0; i < orig_sgl_count; i++) { |
| 259 | src_addr = (unsigned long)kmap_atomic(sg_page((&orig_sgl[i])), |
| 260 | KM_IRQ0) + orig_sgl[i].offset; |
| 261 | src = src_addr; |
| 262 | srclen = orig_sgl[i].length; |
| 263 | |
| 264 | if (bounce_addr == 0) |
| 265 | bounce_addr = |
| 266 | (unsigned long)kmap_atomic(sg_page((&bounce_sgl[j])), |
| 267 | KM_IRQ0); |
| 268 | |
| 269 | while (srclen) { |
| 270 | /* assume bounce offset always == 0 */ |
| 271 | dest = bounce_addr + bounce_sgl[j].length; |
| 272 | destlen = PAGE_SIZE - bounce_sgl[j].length; |
| 273 | |
| 274 | copylen = min(srclen, destlen); |
| 275 | memcpy((void *)dest, (void *)src, copylen); |
| 276 | |
| 277 | total_copied += copylen; |
| 278 | bounce_sgl[j].length += copylen; |
| 279 | srclen -= copylen; |
| 280 | src += copylen; |
| 281 | |
| 282 | if (bounce_sgl[j].length == PAGE_SIZE) { |
| 283 | /* full..move to next entry */ |
| 284 | kunmap_atomic((void *)bounce_addr, KM_IRQ0); |
| 285 | j++; |
| 286 | |
| 287 | /* if we need to use another bounce buffer */ |
| 288 | if (srclen || i != orig_sgl_count - 1) |
| 289 | bounce_addr = |
| 290 | (unsigned long)kmap_atomic( |
| 291 | sg_page((&bounce_sgl[j])), KM_IRQ0); |
| 292 | |
| 293 | } else if (srclen == 0 && i == orig_sgl_count - 1) { |
| 294 | /* unmap the last bounce that is < PAGE_SIZE */ |
| 295 | kunmap_atomic((void *)bounce_addr, KM_IRQ0); |
| 296 | } |
| 297 | } |
| 298 | |
| 299 | kunmap_atomic((void *)(src_addr - orig_sgl[i].offset), KM_IRQ0); |
| 300 | } |
| 301 | |
| 302 | local_irq_restore(flags); |
| 303 | |
| 304 | return total_copied; |
| 305 | } |
| 306 | |
K. Y. Srinivasan | 5c5c023 | 2011-05-10 07:54:33 -0700 | [diff] [blame] | 307 | |
K. Y. Srinivasan | 5c5c023 | 2011-05-10 07:54:33 -0700 | [diff] [blame] | 308 | static int storvsc_remove(struct hv_device *dev) |
| 309 | { |
K. Y. Srinivasan | 5c5c023 | 2011-05-10 07:54:33 -0700 | [diff] [blame] | 310 | struct Scsi_Host *host = dev_get_drvdata(&dev->device); |
| 311 | struct hv_host_device *host_dev = |
| 312 | (struct hv_host_device *)host->hostdata; |
| 313 | |
K. Y. Srinivasan | 5c5c023 | 2011-05-10 07:54:33 -0700 | [diff] [blame] | 314 | scsi_remove_host(host); |
| 315 | |
K. Y. Srinivasan | 5c5c023 | 2011-05-10 07:54:33 -0700 | [diff] [blame] | 316 | scsi_host_put(host); |
K. Y. Srinivasan | d36b0a0 | 2011-06-06 15:49:29 -0700 | [diff] [blame] | 317 | |
K. Y. Srinivasan | 2935a40 | 2011-06-06 15:49:28 -0700 | [diff] [blame] | 318 | storvsc_dev_remove(dev); |
| 319 | if (host_dev->request_pool) { |
| 320 | kmem_cache_destroy(host_dev->request_pool); |
| 321 | host_dev->request_pool = NULL; |
| 322 | } |
K. Y. Srinivasan | 5c5c023 | 2011-05-10 07:54:33 -0700 | [diff] [blame] | 323 | return 0; |
| 324 | } |
| 325 | |
K. Y. Srinivasan | 62838ce | 2011-05-10 07:54:34 -0700 | [diff] [blame] | 326 | |
| 327 | static int storvsc_get_chs(struct scsi_device *sdev, struct block_device * bdev, |
| 328 | sector_t capacity, int *info) |
| 329 | { |
K. Y. Srinivasan | 5326fd5 | 2011-05-10 07:54:52 -0700 | [diff] [blame] | 330 | sector_t nsect = capacity; |
| 331 | sector_t cylinders = nsect; |
| 332 | int heads, sectors_pt; |
K. Y. Srinivasan | 62838ce | 2011-05-10 07:54:34 -0700 | [diff] [blame] | 333 | |
K. Y. Srinivasan | 5326fd5 | 2011-05-10 07:54:52 -0700 | [diff] [blame] | 334 | /* |
| 335 | * We are making up these values; let us keep it simple. |
| 336 | */ |
| 337 | heads = 0xff; |
| 338 | sectors_pt = 0x3f; /* Sectors per track */ |
| 339 | sector_div(cylinders, heads * sectors_pt); |
| 340 | if ((sector_t)(cylinders + 1) * heads * sectors_pt < nsect) |
| 341 | cylinders = 0xffff; |
K. Y. Srinivasan | 62838ce | 2011-05-10 07:54:34 -0700 | [diff] [blame] | 342 | |
| 343 | info[0] = heads; |
K. Y. Srinivasan | 5326fd5 | 2011-05-10 07:54:52 -0700 | [diff] [blame] | 344 | info[1] = sectors_pt; |
| 345 | info[2] = (int)cylinders; |
K. Y. Srinivasan | 62838ce | 2011-05-10 07:54:34 -0700 | [diff] [blame] | 346 | |
K. Y. Srinivasan | 62838ce | 2011-05-10 07:54:34 -0700 | [diff] [blame] | 347 | return 0; |
| 348 | } |
K. Y. Srinivasan | aa3d789 | 2011-05-10 07:54:37 -0700 | [diff] [blame] | 349 | |
| 350 | static int storvsc_host_reset(struct hv_device *device) |
| 351 | { |
| 352 | struct storvsc_device *stor_device; |
| 353 | struct hv_storvsc_request *request; |
| 354 | struct vstor_packet *vstor_packet; |
| 355 | int ret, t; |
| 356 | |
K. Y. Srinivasan | aa3d789 | 2011-05-10 07:54:37 -0700 | [diff] [blame] | 357 | |
| 358 | stor_device = get_stor_device(device); |
| 359 | if (!stor_device) |
| 360 | return -1; |
| 361 | |
| 362 | request = &stor_device->reset_request; |
| 363 | vstor_packet = &request->vstor_packet; |
| 364 | |
| 365 | init_completion(&request->wait_event); |
| 366 | |
| 367 | vstor_packet->operation = VSTOR_OPERATION_RESET_BUS; |
| 368 | vstor_packet->flags = REQUEST_COMPLETION_FLAG; |
| 369 | vstor_packet->vm_srb.path_id = stor_device->path_id; |
| 370 | |
| 371 | ret = vmbus_sendpacket(device->channel, vstor_packet, |
| 372 | sizeof(struct vstor_packet), |
| 373 | (unsigned long)&stor_device->reset_request, |
| 374 | VM_PKT_DATA_INBAND, |
| 375 | VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); |
| 376 | if (ret != 0) |
| 377 | goto cleanup; |
| 378 | |
K. Y. Srinivasan | 46d2eb6 | 2011-06-16 13:16:36 -0700 | [diff] [blame^] | 379 | t = wait_for_completion_timeout(&request->wait_event, 5*HZ); |
K. Y. Srinivasan | aa3d789 | 2011-05-10 07:54:37 -0700 | [diff] [blame] | 380 | if (t == 0) { |
| 381 | ret = -ETIMEDOUT; |
| 382 | goto cleanup; |
| 383 | } |
| 384 | |
K. Y. Srinivasan | aa3d789 | 2011-05-10 07:54:37 -0700 | [diff] [blame] | 385 | |
| 386 | /* |
| 387 | * At this point, all outstanding requests in the adapter |
| 388 | * should have been flushed out and return to us |
| 389 | */ |
| 390 | |
| 391 | cleanup: |
| 392 | put_stor_device(device); |
| 393 | return ret; |
| 394 | } |
| 395 | |
| 396 | |
K. Y. Srinivasan | 96e690be | 2011-05-10 07:54:38 -0700 | [diff] [blame] | 397 | /* |
| 398 | * storvsc_host_reset_handler - Reset the scsi HBA |
| 399 | */ |
| 400 | static int storvsc_host_reset_handler(struct scsi_cmnd *scmnd) |
| 401 | { |
| 402 | int ret; |
| 403 | struct hv_host_device *host_dev = |
| 404 | (struct hv_host_device *)scmnd->device->host->hostdata; |
| 405 | struct hv_device *dev = host_dev->dev; |
| 406 | |
K. Y. Srinivasan | 96e690be | 2011-05-10 07:54:38 -0700 | [diff] [blame] | 407 | ret = storvsc_host_reset(dev); |
| 408 | if (ret != 0) |
| 409 | return ret; |
| 410 | |
K. Y. Srinivasan | 96e690be | 2011-05-10 07:54:38 -0700 | [diff] [blame] | 411 | return ret; |
| 412 | } |
| 413 | |
K. Y. Srinivasan | 8a411ba | 2011-05-10 07:54:41 -0700 | [diff] [blame] | 414 | |
| 415 | /* |
| 416 | * storvsc_commmand_completion - Command completion processing |
| 417 | */ |
| 418 | static void storvsc_commmand_completion(struct hv_storvsc_request *request) |
| 419 | { |
| 420 | struct storvsc_cmd_request *cmd_request = |
| 421 | (struct storvsc_cmd_request *)request->context; |
| 422 | struct scsi_cmnd *scmnd = cmd_request->cmd; |
| 423 | struct hv_host_device *host_dev = |
| 424 | (struct hv_host_device *)scmnd->device->host->hostdata; |
| 425 | void (*scsi_done_fn)(struct scsi_cmnd *); |
| 426 | struct scsi_sense_hdr sense_hdr; |
| 427 | struct vmscsi_request *vm_srb; |
| 428 | |
K. Y. Srinivasan | 8a411ba | 2011-05-10 07:54:41 -0700 | [diff] [blame] | 429 | if (cmd_request->bounce_sgl_count) { |
K. Y. Srinivasan | 8a411ba | 2011-05-10 07:54:41 -0700 | [diff] [blame] | 430 | |
| 431 | /* FIXME: We can optimize on writes by just skipping this */ |
| 432 | copy_from_bounce_buffer(scsi_sglist(scmnd), |
| 433 | cmd_request->bounce_sgl, |
| 434 | scsi_sg_count(scmnd)); |
| 435 | destroy_bounce_buffer(cmd_request->bounce_sgl, |
| 436 | cmd_request->bounce_sgl_count); |
| 437 | } |
| 438 | |
| 439 | vm_srb = &request->vstor_packet.vm_srb; |
| 440 | scmnd->result = vm_srb->scsi_status; |
| 441 | |
| 442 | if (scmnd->result) { |
| 443 | if (scsi_normalize_sense(scmnd->sense_buffer, |
| 444 | SCSI_SENSE_BUFFERSIZE, &sense_hdr)) |
| 445 | scsi_print_sense_hdr("storvsc", &sense_hdr); |
| 446 | } |
| 447 | |
K. Y. Srinivasan | 8a411ba | 2011-05-10 07:54:41 -0700 | [diff] [blame] | 448 | scsi_set_resid(scmnd, |
| 449 | request->data_buffer.len - |
| 450 | vm_srb->data_transfer_length); |
| 451 | |
| 452 | scsi_done_fn = scmnd->scsi_done; |
| 453 | |
| 454 | scmnd->host_scribble = NULL; |
| 455 | scmnd->scsi_done = NULL; |
| 456 | |
K. Y. Srinivasan | 8a411ba | 2011-05-10 07:54:41 -0700 | [diff] [blame] | 457 | scsi_done_fn(scmnd); |
| 458 | |
| 459 | kmem_cache_free(host_dev->request_pool, cmd_request); |
| 460 | } |
| 461 | |
K. Y. Srinivasan | c5b463a | 2011-05-10 07:54:42 -0700 | [diff] [blame] | 462 | |
| 463 | /* |
| 464 | * storvsc_queuecommand - Initiate command processing |
| 465 | */ |
| 466 | static int storvsc_queuecommand_lck(struct scsi_cmnd *scmnd, |
| 467 | void (*done)(struct scsi_cmnd *)) |
| 468 | { |
| 469 | int ret; |
| 470 | struct hv_host_device *host_dev = |
| 471 | (struct hv_host_device *)scmnd->device->host->hostdata; |
| 472 | struct hv_device *dev = host_dev->dev; |
K. Y. Srinivasan | c5b463a | 2011-05-10 07:54:42 -0700 | [diff] [blame] | 473 | struct hv_storvsc_request *request; |
| 474 | struct storvsc_cmd_request *cmd_request; |
| 475 | unsigned int request_size = 0; |
| 476 | int i; |
| 477 | struct scatterlist *sgl; |
| 478 | unsigned int sg_count = 0; |
| 479 | struct vmscsi_request *vm_srb; |
| 480 | |
| 481 | |
| 482 | /* If retrying, no need to prep the cmd */ |
| 483 | if (scmnd->host_scribble) { |
K. Y. Srinivasan | c5b463a | 2011-05-10 07:54:42 -0700 | [diff] [blame] | 484 | |
| 485 | cmd_request = |
| 486 | (struct storvsc_cmd_request *)scmnd->host_scribble; |
K. Y. Srinivasan | c5b463a | 2011-05-10 07:54:42 -0700 | [diff] [blame] | 487 | |
| 488 | goto retry_request; |
| 489 | } |
| 490 | |
K. Y. Srinivasan | c5b463a | 2011-05-10 07:54:42 -0700 | [diff] [blame] | 491 | scmnd->scsi_done = done; |
| 492 | |
| 493 | request_size = sizeof(struct storvsc_cmd_request); |
| 494 | |
| 495 | cmd_request = kmem_cache_zalloc(host_dev->request_pool, |
| 496 | GFP_ATOMIC); |
| 497 | if (!cmd_request) { |
| 498 | scmnd->scsi_done = NULL; |
| 499 | return SCSI_MLQUEUE_DEVICE_BUSY; |
| 500 | } |
| 501 | |
| 502 | /* Setup the cmd request */ |
| 503 | cmd_request->bounce_sgl_count = 0; |
| 504 | cmd_request->bounce_sgl = NULL; |
| 505 | cmd_request->cmd = scmnd; |
| 506 | |
| 507 | scmnd->host_scribble = (unsigned char *)cmd_request; |
| 508 | |
| 509 | request = &cmd_request->request; |
| 510 | vm_srb = &request->vstor_packet.vm_srb; |
| 511 | |
| 512 | |
| 513 | /* Build the SRB */ |
| 514 | switch (scmnd->sc_data_direction) { |
| 515 | case DMA_TO_DEVICE: |
| 516 | vm_srb->data_in = WRITE_TYPE; |
| 517 | break; |
| 518 | case DMA_FROM_DEVICE: |
| 519 | vm_srb->data_in = READ_TYPE; |
| 520 | break; |
| 521 | default: |
| 522 | vm_srb->data_in = UNKNOWN_TYPE; |
| 523 | break; |
| 524 | } |
| 525 | |
| 526 | request->on_io_completion = storvsc_commmand_completion; |
| 527 | request->context = cmd_request;/* scmnd; */ |
| 528 | |
K. Y. Srinivasan | c5b463a | 2011-05-10 07:54:42 -0700 | [diff] [blame] | 529 | vm_srb->port_number = host_dev->port; |
| 530 | vm_srb->path_id = scmnd->device->channel; |
| 531 | vm_srb->target_id = scmnd->device->id; |
| 532 | vm_srb->lun = scmnd->device->lun; |
| 533 | |
K. Y. Srinivasan | c5b463a | 2011-05-10 07:54:42 -0700 | [diff] [blame] | 534 | vm_srb->cdb_length = scmnd->cmd_len; |
| 535 | |
| 536 | memcpy(vm_srb->cdb, scmnd->cmnd, vm_srb->cdb_length); |
| 537 | |
| 538 | request->sense_buffer = scmnd->sense_buffer; |
| 539 | |
| 540 | |
| 541 | request->data_buffer.len = scsi_bufflen(scmnd); |
| 542 | if (scsi_sg_count(scmnd)) { |
| 543 | sgl = (struct scatterlist *)scsi_sglist(scmnd); |
| 544 | sg_count = scsi_sg_count(scmnd); |
| 545 | |
| 546 | /* check if we need to bounce the sgl */ |
| 547 | if (do_bounce_buffer(sgl, scsi_sg_count(scmnd)) != -1) { |
| 548 | cmd_request->bounce_sgl = |
| 549 | create_bounce_buffer(sgl, scsi_sg_count(scmnd), |
| 550 | scsi_bufflen(scmnd)); |
| 551 | if (!cmd_request->bounce_sgl) { |
| 552 | scmnd->scsi_done = NULL; |
| 553 | scmnd->host_scribble = NULL; |
| 554 | kmem_cache_free(host_dev->request_pool, |
| 555 | cmd_request); |
| 556 | |
| 557 | return SCSI_MLQUEUE_HOST_BUSY; |
| 558 | } |
| 559 | |
| 560 | cmd_request->bounce_sgl_count = |
| 561 | ALIGN(scsi_bufflen(scmnd), PAGE_SIZE) >> |
| 562 | PAGE_SHIFT; |
| 563 | |
| 564 | /* |
| 565 | * FIXME: We can optimize on reads by just skipping |
| 566 | * this |
| 567 | */ |
| 568 | copy_to_bounce_buffer(sgl, cmd_request->bounce_sgl, |
| 569 | scsi_sg_count(scmnd)); |
| 570 | |
| 571 | sgl = cmd_request->bounce_sgl; |
| 572 | sg_count = cmd_request->bounce_sgl_count; |
| 573 | } |
| 574 | |
| 575 | request->data_buffer.offset = sgl[0].offset; |
| 576 | |
| 577 | for (i = 0; i < sg_count; i++) |
| 578 | request->data_buffer.pfn_array[i] = |
| 579 | page_to_pfn(sg_page((&sgl[i]))); |
| 580 | |
| 581 | } else if (scsi_sglist(scmnd)) { |
K. Y. Srinivasan | c5b463a | 2011-05-10 07:54:42 -0700 | [diff] [blame] | 582 | request->data_buffer.offset = |
| 583 | virt_to_phys(scsi_sglist(scmnd)) & (PAGE_SIZE-1); |
| 584 | request->data_buffer.pfn_array[0] = |
| 585 | virt_to_phys(scsi_sglist(scmnd)) >> PAGE_SHIFT; |
| 586 | } |
| 587 | |
| 588 | retry_request: |
| 589 | /* Invokes the vsc to start an IO */ |
K. Y. Srinivasan | 636f0fd | 2011-05-10 07:54:50 -0700 | [diff] [blame] | 590 | ret = storvsc_do_io(dev, &cmd_request->request); |
| 591 | |
K. Y. Srinivasan | c5b463a | 2011-05-10 07:54:42 -0700 | [diff] [blame] | 592 | if (ret == -1) { |
| 593 | /* no more space */ |
| 594 | |
| 595 | if (cmd_request->bounce_sgl_count) { |
| 596 | /* |
| 597 | * FIXME: We can optimize on writes by just skipping |
| 598 | * this |
| 599 | */ |
| 600 | copy_from_bounce_buffer(scsi_sglist(scmnd), |
| 601 | cmd_request->bounce_sgl, |
| 602 | scsi_sg_count(scmnd)); |
| 603 | destroy_bounce_buffer(cmd_request->bounce_sgl, |
| 604 | cmd_request->bounce_sgl_count); |
| 605 | } |
| 606 | |
| 607 | kmem_cache_free(host_dev->request_pool, cmd_request); |
| 608 | |
| 609 | scmnd->scsi_done = NULL; |
| 610 | scmnd->host_scribble = NULL; |
| 611 | |
| 612 | ret = SCSI_MLQUEUE_DEVICE_BUSY; |
| 613 | } |
| 614 | |
| 615 | return ret; |
| 616 | } |
| 617 | |
| 618 | static DEF_SCSI_QCMD(storvsc_queuecommand) |
| 619 | |
Hank Janssen | bef4a34 | 2009-07-13 16:01:31 -0700 | [diff] [blame] | 620 | |
Bill Pemberton | 454f18a | 2009-07-27 16:47:24 -0400 | [diff] [blame] | 621 | /* Scsi driver */ |
Hank Janssen | bef4a34 | 2009-07-13 16:01:31 -0700 | [diff] [blame] | 622 | static struct scsi_host_template scsi_driver = { |
Greg Kroah-Hartman | ff568d3 | 2009-09-02 08:37:47 -0700 | [diff] [blame] | 623 | .module = THIS_MODULE, |
| 624 | .name = "storvsc_host_t", |
| 625 | .bios_param = storvsc_get_chs, |
| 626 | .queuecommand = storvsc_queuecommand, |
| 627 | .eh_host_reset_handler = storvsc_host_reset_handler, |
| 628 | .slave_alloc = storvsc_device_alloc, |
| 629 | .slave_configure = storvsc_device_configure, |
| 630 | .cmd_per_lun = 1, |
| 631 | /* 64 max_queue * 1 target */ |
Lars Lindley | 0686e4f | 2010-03-11 23:51:23 +0100 | [diff] [blame] | 632 | .can_queue = STORVSC_MAX_IO_REQUESTS*STORVSC_MAX_TARGETS, |
Greg Kroah-Hartman | ff568d3 | 2009-09-02 08:37:47 -0700 | [diff] [blame] | 633 | .this_id = -1, |
Bill Pemberton | 454f18a | 2009-07-27 16:47:24 -0400 | [diff] [blame] | 634 | /* no use setting to 0 since ll_blk_rw reset it to 1 */ |
Greg Kroah-Hartman | ff568d3 | 2009-09-02 08:37:47 -0700 | [diff] [blame] | 635 | /* currently 32 */ |
| 636 | .sg_tablesize = MAX_MULTIPAGE_BUFFER_COUNT, |
| 637 | /* |
| 638 | * ENABLE_CLUSTERING allows mutiple physically contig bio_vecs to merge |
| 639 | * into 1 sg element. If set, we must limit the max_segment_size to |
| 640 | * PAGE_SIZE, otherwise we may get 1 sg element that represents |
| 641 | * multiple |
| 642 | */ |
Bill Pemberton | 454f18a | 2009-07-27 16:47:24 -0400 | [diff] [blame] | 643 | /* physically contig pfns (ie sg[x].length > PAGE_SIZE). */ |
Greg Kroah-Hartman | ff568d3 | 2009-09-02 08:37:47 -0700 | [diff] [blame] | 644 | .use_clustering = ENABLE_CLUSTERING, |
Bill Pemberton | 454f18a | 2009-07-27 16:47:24 -0400 | [diff] [blame] | 645 | /* Make sure we dont get a sg segment crosses a page boundary */ |
Greg Kroah-Hartman | ff568d3 | 2009-09-02 08:37:47 -0700 | [diff] [blame] | 646 | .dma_boundary = PAGE_SIZE-1, |
Hank Janssen | bef4a34 | 2009-07-13 16:01:31 -0700 | [diff] [blame] | 647 | }; |
| 648 | |
| 649 | |
Hank Janssen | 3e18951 | 2010-03-04 22:11:00 +0000 | [diff] [blame] | 650 | /* |
K. Y. Srinivasan | f5c7887 | 2011-05-10 07:54:43 -0700 | [diff] [blame] | 651 | * storvsc_probe - Add a new device for this driver |
| 652 | */ |
| 653 | |
| 654 | static int storvsc_probe(struct hv_device *device) |
| 655 | { |
| 656 | int ret; |
K. Y. Srinivasan | f5c7887 | 2011-05-10 07:54:43 -0700 | [diff] [blame] | 657 | struct Scsi_Host *host; |
| 658 | struct hv_host_device *host_dev; |
| 659 | struct storvsc_device_info device_info; |
| 660 | |
K. Y. Srinivasan | f5c7887 | 2011-05-10 07:54:43 -0700 | [diff] [blame] | 661 | host = scsi_host_alloc(&scsi_driver, |
| 662 | sizeof(struct hv_host_device)); |
| 663 | if (!host) |
| 664 | return -ENOMEM; |
| 665 | |
| 666 | dev_set_drvdata(&device->device, host); |
| 667 | |
| 668 | host_dev = (struct hv_host_device *)host->hostdata; |
| 669 | memset(host_dev, 0, sizeof(struct hv_host_device)); |
| 670 | |
| 671 | host_dev->port = host->host_no; |
| 672 | host_dev->dev = device; |
| 673 | |
| 674 | host_dev->request_pool = |
| 675 | kmem_cache_create(dev_name(&device->device), |
| 676 | sizeof(struct storvsc_cmd_request), 0, |
| 677 | SLAB_HWCACHE_ALIGN, NULL); |
| 678 | |
| 679 | if (!host_dev->request_pool) { |
| 680 | scsi_host_put(host); |
| 681 | return -ENOMEM; |
| 682 | } |
| 683 | |
| 684 | device_info.port_number = host->host_no; |
K. Y. Srinivasan | fa4d123 | 2011-05-10 07:56:01 -0700 | [diff] [blame] | 685 | device_info.ring_buffer_size = storvsc_ringbuffer_size; |
K. Y. Srinivasan | f5c7887 | 2011-05-10 07:54:43 -0700 | [diff] [blame] | 686 | /* Call to the vsc driver to add the device */ |
K. Y. Srinivasan | 58f1f5c | 2011-05-10 07:54:49 -0700 | [diff] [blame] | 687 | ret = storvsc_dev_add(device, (void *)&device_info); |
K. Y. Srinivasan | f5c7887 | 2011-05-10 07:54:43 -0700 | [diff] [blame] | 688 | |
| 689 | if (ret != 0) { |
| 690 | kmem_cache_destroy(host_dev->request_pool); |
| 691 | scsi_host_put(host); |
| 692 | return -1; |
| 693 | } |
| 694 | |
| 695 | host_dev->path = device_info.path_id; |
| 696 | host_dev->target = device_info.target_id; |
| 697 | |
| 698 | /* max # of devices per target */ |
| 699 | host->max_lun = STORVSC_MAX_LUNS_PER_TARGET; |
| 700 | /* max # of targets per channel */ |
| 701 | host->max_id = STORVSC_MAX_TARGETS; |
| 702 | /* max # of channels */ |
| 703 | host->max_channel = STORVSC_MAX_CHANNELS - 1; |
| 704 | |
| 705 | /* Register the HBA and start the scsi bus scan */ |
| 706 | ret = scsi_add_host(host, &device->device); |
| 707 | if (ret != 0) { |
| 708 | |
K. Y. Srinivasan | 6cdc57c | 2011-05-10 07:54:48 -0700 | [diff] [blame] | 709 | storvsc_dev_remove(device); |
K. Y. Srinivasan | f5c7887 | 2011-05-10 07:54:43 -0700 | [diff] [blame] | 710 | |
| 711 | kmem_cache_destroy(host_dev->request_pool); |
| 712 | scsi_host_put(host); |
| 713 | return -1; |
| 714 | } |
| 715 | |
| 716 | scsi_scan_host(host); |
| 717 | return ret; |
| 718 | } |
| 719 | |
K. Y. Srinivasan | 7bd05b9 | 2011-05-10 07:54:45 -0700 | [diff] [blame] | 720 | /* The one and only one */ |
| 721 | |
K. Y. Srinivasan | 40bf63e | 2011-05-10 07:56:09 -0700 | [diff] [blame] | 722 | static struct hv_driver storvsc_drv = { |
| 723 | .probe = storvsc_probe, |
| 724 | .remove = storvsc_remove, |
K. Y. Srinivasan | 39ae6fa | 2011-05-10 07:54:46 -0700 | [diff] [blame] | 725 | }; |
K. Y. Srinivasan | 7bd05b9 | 2011-05-10 07:54:45 -0700 | [diff] [blame] | 726 | |
K. Y. Srinivasan | 3e1edf6 | 2011-06-06 15:49:36 -0700 | [diff] [blame] | 727 | /* |
| 728 | * We use a DMI table to determine if we should autoload this driver This is |
| 729 | * needed by distro tools to determine if the hyperv drivers should be |
| 730 | * installed and/or configured. We don't do anything else with the table, but |
| 731 | * it needs to be present. |
| 732 | */ |
| 733 | |
| 734 | static const struct dmi_system_id __initconst |
| 735 | hv_stor_dmi_table[] __maybe_unused = { |
| 736 | { |
| 737 | .ident = "Hyper-V", |
| 738 | .matches = { |
| 739 | DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"), |
| 740 | DMI_MATCH(DMI_PRODUCT_NAME, "Virtual Machine"), |
| 741 | DMI_MATCH(DMI_BOARD_NAME, "Virtual Machine"), |
| 742 | }, |
| 743 | }, |
| 744 | { }, |
| 745 | }; |
| 746 | MODULE_DEVICE_TABLE(dmi, hv_stor_dmi_table); |
| 747 | |
K. Y. Srinivasan | d9bbae8 | 2011-06-06 15:49:27 -0700 | [diff] [blame] | 748 | static int __init storvsc_drv_init(void) |
Hank Janssen | bef4a34 | 2009-07-13 16:01:31 -0700 | [diff] [blame] | 749 | { |
Greg Kroah-Hartman | ff568d3 | 2009-09-02 08:37:47 -0700 | [diff] [blame] | 750 | int ret; |
K. Y. Srinivasan | 40bf63e | 2011-05-10 07:56:09 -0700 | [diff] [blame] | 751 | struct hv_driver *drv = &storvsc_drv; |
K. Y. Srinivasan | 01415ab3 | 2011-05-10 07:55:58 -0700 | [diff] [blame] | 752 | u32 max_outstanding_req_per_channel; |
| 753 | |
| 754 | /* |
| 755 | * Divide the ring buffer data size (which is 1 page less |
| 756 | * than the ring buffer size since that page is reserved for |
| 757 | * the ring buffer indices) by the max request size (which is |
| 758 | * vmbus_channel_packet_multipage_buffer + struct vstor_packet + u64) |
| 759 | */ |
| 760 | |
| 761 | max_outstanding_req_per_channel = |
| 762 | ((storvsc_ringbuffer_size - PAGE_SIZE) / |
| 763 | ALIGN(MAX_MULTIPAGE_BUFFER_PACKET + |
| 764 | sizeof(struct vstor_packet) + sizeof(u64), |
| 765 | sizeof(u64))); |
Hank Janssen | bef4a34 | 2009-07-13 16:01:31 -0700 | [diff] [blame] | 766 | |
K. Y. Srinivasan | 990f05e | 2011-06-06 15:49:31 -0700 | [diff] [blame] | 767 | memcpy(&drv->dev_type, &stor_vsci_device_type, |
K. Y. Srinivasan | 1a96d9a | 2011-05-10 07:56:06 -0700 | [diff] [blame] | 768 | sizeof(struct hv_guid)); |
| 769 | |
K. Y. Srinivasan | 01415ab3 | 2011-05-10 07:55:58 -0700 | [diff] [blame] | 770 | if (max_outstanding_req_per_channel < |
K. Y. Srinivasan | f8feed0 | 2011-05-10 07:54:24 -0700 | [diff] [blame] | 771 | STORVSC_MAX_IO_REQUESTS) |
Hank Janssen | bef4a34 | 2009-07-13 16:01:31 -0700 | [diff] [blame] | 772 | return -1; |
Hank Janssen | bef4a34 | 2009-07-13 16:01:31 -0700 | [diff] [blame] | 773 | |
K. Y. Srinivasan | 206cf17 | 2011-05-10 07:56:04 -0700 | [diff] [blame] | 774 | drv->driver.name = driver_name; |
Hank Janssen | bef4a34 | 2009-07-13 16:01:31 -0700 | [diff] [blame] | 775 | |
Hank Janssen | bef4a34 | 2009-07-13 16:01:31 -0700 | [diff] [blame] | 776 | |
Bill Pemberton | 454f18a | 2009-07-27 16:47:24 -0400 | [diff] [blame] | 777 | /* The driver belongs to vmbus */ |
K. Y. Srinivasan | 150f939 | 2011-03-07 13:32:31 -0800 | [diff] [blame] | 778 | ret = vmbus_child_driver_register(&drv->driver); |
Hank Janssen | bef4a34 | 2009-07-13 16:01:31 -0700 | [diff] [blame] | 779 | |
Hank Janssen | bef4a34 | 2009-07-13 16:01:31 -0700 | [diff] [blame] | 780 | return ret; |
| 781 | } |
| 782 | |
K. Y. Srinivasan | c63ba9e | 2011-06-06 15:49:26 -0700 | [diff] [blame] | 783 | static void __exit storvsc_drv_exit(void) |
Hank Janssen | bef4a34 | 2009-07-13 16:01:31 -0700 | [diff] [blame] | 784 | { |
K. Y. Srinivasan | 2bda87c | 2011-05-12 19:34:45 -0700 | [diff] [blame] | 785 | vmbus_child_driver_unregister(&storvsc_drv.driver); |
Hank Janssen | bef4a34 | 2009-07-13 16:01:31 -0700 | [diff] [blame] | 786 | } |
| 787 | |
Greg Kroah-Hartman | ff568d3 | 2009-09-02 08:37:47 -0700 | [diff] [blame] | 788 | MODULE_LICENSE("GPL"); |
Hank Janssen | 26c14cc | 2010-02-11 23:02:42 +0000 | [diff] [blame] | 789 | MODULE_VERSION(HV_DRV_VERSION); |
Stephen Hemminger | 3afc7cc3 | 2010-05-06 21:44:45 -0700 | [diff] [blame] | 790 | MODULE_DESCRIPTION("Microsoft Hyper-V virtual storage driver"); |
K. Y. Srinivasan | d9bbae8 | 2011-06-06 15:49:27 -0700 | [diff] [blame] | 791 | module_init(storvsc_drv_init); |
K. Y. Srinivasan | c63ba9e | 2011-06-06 15:49:26 -0700 | [diff] [blame] | 792 | module_exit(storvsc_drv_exit); |