|
@@ -177,13 +177,13 @@ static int blkvsc_drv_init(int (*drv_init)(struct hv_driver *drv))
|
|
|
struct driver_context *drv_ctx = &g_blkvsc_drv.drv_ctx;
|
|
|
int ret;
|
|
|
|
|
|
- storvsc_drv_obj->RingBufferSize = blkvsc_ringbuffer_size;
|
|
|
+ storvsc_drv_obj->ring_buffer_size = blkvsc_ringbuffer_size;
|
|
|
|
|
|
/* Callback to client driver to complete the initialization */
|
|
|
- drv_init(&storvsc_drv_obj->Base);
|
|
|
+ drv_init(&storvsc_drv_obj->base);
|
|
|
|
|
|
- drv_ctx->driver.name = storvsc_drv_obj->Base.name;
|
|
|
- memcpy(&drv_ctx->class_id, &storvsc_drv_obj->Base.deviceType,
|
|
|
+ drv_ctx->driver.name = storvsc_drv_obj->base.name;
|
|
|
+ memcpy(&drv_ctx->class_id, &storvsc_drv_obj->base.deviceType,
|
|
|
sizeof(struct hv_guid));
|
|
|
|
|
|
drv_ctx->probe = blkvsc_probe;
|
|
@@ -230,8 +230,8 @@ static void blkvsc_drv_exit(void)
|
|
|
device_unregister(current_dev);
|
|
|
}
|
|
|
|
|
|
- if (storvsc_drv_obj->Base.OnCleanup)
|
|
|
- storvsc_drv_obj->Base.OnCleanup(&storvsc_drv_obj->Base);
|
|
|
+ if (storvsc_drv_obj->base.OnCleanup)
|
|
|
+ storvsc_drv_obj->base.OnCleanup(&storvsc_drv_obj->base);
|
|
|
|
|
|
vmbus_child_driver_unregister(drv_ctx);
|
|
|
|
|
@@ -262,7 +262,7 @@ static int blkvsc_probe(struct device *device)
|
|
|
|
|
|
DPRINT_DBG(BLKVSC_DRV, "blkvsc_probe - enter");
|
|
|
|
|
|
- if (!storvsc_drv_obj->Base.OnDeviceAdd) {
|
|
|
+ if (!storvsc_drv_obj->base.OnDeviceAdd) {
|
|
|
DPRINT_ERR(BLKVSC_DRV, "OnDeviceAdd() not set");
|
|
|
ret = -1;
|
|
|
goto Cleanup;
|
|
@@ -284,7 +284,7 @@ static int blkvsc_probe(struct device *device)
|
|
|
|
|
|
blkdev->request_pool = kmem_cache_create(dev_name(&device_ctx->device),
|
|
|
sizeof(struct blkvsc_request) +
|
|
|
- storvsc_drv_obj->RequestExtSize, 0,
|
|
|
+ storvsc_drv_obj->request_ext_size, 0,
|
|
|
SLAB_HWCACHE_ALIGN, NULL);
|
|
|
if (!blkdev->request_pool) {
|
|
|
ret = -ENOMEM;
|
|
@@ -293,7 +293,7 @@ static int blkvsc_probe(struct device *device)
|
|
|
|
|
|
|
|
|
/* Call to the vsc driver to add the device */
|
|
|
- ret = storvsc_drv_obj->Base.OnDeviceAdd(device_obj, &device_info);
|
|
|
+ ret = storvsc_drv_obj->base.OnDeviceAdd(device_obj, &device_info);
|
|
|
if (ret != 0) {
|
|
|
DPRINT_ERR(BLKVSC_DRV, "unable to add blkvsc device");
|
|
|
goto Cleanup;
|
|
@@ -301,9 +301,9 @@ static int blkvsc_probe(struct device *device)
|
|
|
|
|
|
blkdev->device_ctx = device_ctx;
|
|
|
/* this identified the device 0 or 1 */
|
|
|
- blkdev->target = device_info.TargetId;
|
|
|
+ blkdev->target = device_info.target_id;
|
|
|
/* this identified the ide ctrl 0 or 1 */
|
|
|
- blkdev->path = device_info.PathId;
|
|
|
+ blkdev->path = device_info.path_id;
|
|
|
|
|
|
dev_set_drvdata(device, blkdev);
|
|
|
|
|
@@ -391,7 +391,7 @@ static int blkvsc_probe(struct device *device)
|
|
|
return ret;
|
|
|
|
|
|
Remove:
|
|
|
- storvsc_drv_obj->Base.OnDeviceRemove(device_obj);
|
|
|
+ storvsc_drv_obj->base.OnDeviceRemove(device_obj);
|
|
|
|
|
|
Cleanup:
|
|
|
if (blkdev) {
|
|
@@ -459,9 +459,9 @@ static int blkvsc_do_flush(struct block_device_context *blkdev)
|
|
|
blkvsc_req->req = NULL;
|
|
|
blkvsc_req->write = 0;
|
|
|
|
|
|
- blkvsc_req->request.DataBuffer.PfnArray[0] = 0;
|
|
|
- blkvsc_req->request.DataBuffer.Offset = 0;
|
|
|
- blkvsc_req->request.DataBuffer.Length = 0;
|
|
|
+ blkvsc_req->request.data_buffer.PfnArray[0] = 0;
|
|
|
+ blkvsc_req->request.data_buffer.Offset = 0;
|
|
|
+ blkvsc_req->request.data_buffer.Length = 0;
|
|
|
|
|
|
blkvsc_req->cmnd[0] = SYNCHRONIZE_CACHE;
|
|
|
blkvsc_req->cmd_len = 10;
|
|
@@ -506,9 +506,9 @@ static int blkvsc_do_inquiry(struct block_device_context *blkdev)
|
|
|
blkvsc_req->req = NULL;
|
|
|
blkvsc_req->write = 0;
|
|
|
|
|
|
- blkvsc_req->request.DataBuffer.PfnArray[0] = page_to_pfn(page_buf);
|
|
|
- blkvsc_req->request.DataBuffer.Offset = 0;
|
|
|
- blkvsc_req->request.DataBuffer.Length = 64;
|
|
|
+ blkvsc_req->request.data_buffer.PfnArray[0] = page_to_pfn(page_buf);
|
|
|
+ blkvsc_req->request.data_buffer.Offset = 0;
|
|
|
+ blkvsc_req->request.data_buffer.Length = 64;
|
|
|
|
|
|
blkvsc_req->cmnd[0] = INQUIRY;
|
|
|
blkvsc_req->cmnd[1] = 0x1; /* Get product data */
|
|
@@ -593,9 +593,9 @@ static int blkvsc_do_read_capacity(struct block_device_context *blkdev)
|
|
|
blkvsc_req->req = NULL;
|
|
|
blkvsc_req->write = 0;
|
|
|
|
|
|
- blkvsc_req->request.DataBuffer.PfnArray[0] = page_to_pfn(page_buf);
|
|
|
- blkvsc_req->request.DataBuffer.Offset = 0;
|
|
|
- blkvsc_req->request.DataBuffer.Length = 8;
|
|
|
+ blkvsc_req->request.data_buffer.PfnArray[0] = page_to_pfn(page_buf);
|
|
|
+ blkvsc_req->request.data_buffer.Offset = 0;
|
|
|
+ blkvsc_req->request.data_buffer.Length = 8;
|
|
|
|
|
|
blkvsc_req->cmnd[0] = READ_CAPACITY;
|
|
|
blkvsc_req->cmd_len = 16;
|
|
@@ -614,7 +614,7 @@ static int blkvsc_do_read_capacity(struct block_device_context *blkdev)
|
|
|
wait_event_interruptible(blkvsc_req->wevent, blkvsc_req->cond);
|
|
|
|
|
|
/* check error */
|
|
|
- if (blkvsc_req->request.Status) {
|
|
|
+ if (blkvsc_req->request.status) {
|
|
|
scsi_normalize_sense(blkvsc_req->sense_buffer,
|
|
|
SCSI_SENSE_BUFFERSIZE, &sense_hdr);
|
|
|
|
|
@@ -670,9 +670,9 @@ static int blkvsc_do_read_capacity16(struct block_device_context *blkdev)
|
|
|
blkvsc_req->req = NULL;
|
|
|
blkvsc_req->write = 0;
|
|
|
|
|
|
- blkvsc_req->request.DataBuffer.PfnArray[0] = page_to_pfn(page_buf);
|
|
|
- blkvsc_req->request.DataBuffer.Offset = 0;
|
|
|
- blkvsc_req->request.DataBuffer.Length = 12;
|
|
|
+ blkvsc_req->request.data_buffer.PfnArray[0] = page_to_pfn(page_buf);
|
|
|
+ blkvsc_req->request.data_buffer.Offset = 0;
|
|
|
+ blkvsc_req->request.data_buffer.Length = 12;
|
|
|
|
|
|
blkvsc_req->cmnd[0] = 0x9E; /* READ_CAPACITY16; */
|
|
|
blkvsc_req->cmd_len = 16;
|
|
@@ -691,7 +691,7 @@ static int blkvsc_do_read_capacity16(struct block_device_context *blkdev)
|
|
|
wait_event_interruptible(blkvsc_req->wevent, blkvsc_req->cond);
|
|
|
|
|
|
/* check error */
|
|
|
- if (blkvsc_req->request.Status) {
|
|
|
+ if (blkvsc_req->request.status) {
|
|
|
scsi_normalize_sense(blkvsc_req->sense_buffer,
|
|
|
SCSI_SENSE_BUFFERSIZE, &sense_hdr);
|
|
|
if (sense_hdr.asc == 0x3A) {
|
|
@@ -741,14 +741,14 @@ static int blkvsc_remove(struct device *device)
|
|
|
|
|
|
DPRINT_DBG(BLKVSC_DRV, "blkvsc_remove()\n");
|
|
|
|
|
|
- if (!storvsc_drv_obj->Base.OnDeviceRemove)
|
|
|
+ if (!storvsc_drv_obj->base.OnDeviceRemove)
|
|
|
return -1;
|
|
|
|
|
|
/*
|
|
|
* Call to the vsc driver to let it know that the device is being
|
|
|
* removed
|
|
|
*/
|
|
|
- ret = storvsc_drv_obj->Base.OnDeviceRemove(device_obj);
|
|
|
+ ret = storvsc_drv_obj->base.OnDeviceRemove(device_obj);
|
|
|
if (ret != 0) {
|
|
|
/* TODO: */
|
|
|
DPRINT_ERR(BLKVSC_DRV,
|
|
@@ -865,38 +865,38 @@ static int blkvsc_submit_request(struct blkvsc_request *blkvsc_req,
|
|
|
(blkvsc_req->write) ? "WRITE" : "READ",
|
|
|
(unsigned long) blkvsc_req->sector_start,
|
|
|
blkvsc_req->sector_count,
|
|
|
- blkvsc_req->request.DataBuffer.Offset,
|
|
|
- blkvsc_req->request.DataBuffer.Length);
|
|
|
+ blkvsc_req->request.data_buffer.Offset,
|
|
|
+ blkvsc_req->request.data_buffer.Length);
|
|
|
#if 0
|
|
|
- for (i = 0; i < (blkvsc_req->request.DataBuffer.Length >> 12); i++) {
|
|
|
+ for (i = 0; i < (blkvsc_req->request.data_buffer.Length >> 12); i++) {
|
|
|
DPRINT_DBG(BLKVSC_DRV, "blkvsc_submit_request() - "
|
|
|
"req %p pfn[%d] %llx\n",
|
|
|
blkvsc_req, i,
|
|
|
- blkvsc_req->request.DataBuffer.PfnArray[i]);
|
|
|
+ blkvsc_req->request.data_buffer.PfnArray[i]);
|
|
|
}
|
|
|
#endif
|
|
|
|
|
|
storvsc_req = &blkvsc_req->request;
|
|
|
- storvsc_req->Extension = (void *)((unsigned long)blkvsc_req +
|
|
|
+ storvsc_req->extension = (void *)((unsigned long)blkvsc_req +
|
|
|
sizeof(struct blkvsc_request));
|
|
|
|
|
|
- storvsc_req->Type = blkvsc_req->write ? WRITE_TYPE : READ_TYPE;
|
|
|
+ storvsc_req->type = blkvsc_req->write ? WRITE_TYPE : READ_TYPE;
|
|
|
|
|
|
- storvsc_req->OnIOCompletion = request_completion;
|
|
|
- storvsc_req->Context = blkvsc_req;
|
|
|
+ storvsc_req->on_io_completion = request_completion;
|
|
|
+ storvsc_req->context = blkvsc_req;
|
|
|
|
|
|
- storvsc_req->Host = blkdev->port;
|
|
|
- storvsc_req->Bus = blkdev->path;
|
|
|
- storvsc_req->TargetId = blkdev->target;
|
|
|
- storvsc_req->LunId = 0; /* this is not really used at all */
|
|
|
+ storvsc_req->host = blkdev->port;
|
|
|
+ storvsc_req->bus = blkdev->path;
|
|
|
+ storvsc_req->target_id = blkdev->target;
|
|
|
+ storvsc_req->lun_id = 0; /* this is not really used at all */
|
|
|
|
|
|
- storvsc_req->CdbLen = blkvsc_req->cmd_len;
|
|
|
- storvsc_req->Cdb = blkvsc_req->cmnd;
|
|
|
+ storvsc_req->cdb_len = blkvsc_req->cmd_len;
|
|
|
+ storvsc_req->cdb = blkvsc_req->cmnd;
|
|
|
|
|
|
- storvsc_req->SenseBuffer = blkvsc_req->sense_buffer;
|
|
|
- storvsc_req->SenseBufferSize = SCSI_SENSE_BUFFERSIZE;
|
|
|
+ storvsc_req->sense_buffer = blkvsc_req->sense_buffer;
|
|
|
+ storvsc_req->sense_buffer_size = SCSI_SENSE_BUFFERSIZE;
|
|
|
|
|
|
- ret = storvsc_drv_obj->OnIORequest(&blkdev->device_ctx->device_obj,
|
|
|
+ ret = storvsc_drv_obj->on_io_request(&blkdev->device_ctx->device_obj,
|
|
|
&blkvsc_req->request);
|
|
|
if (ret == 0)
|
|
|
blkdev->num_outstanding_reqs++;
|
|
@@ -992,8 +992,10 @@ static int blkvsc_do_request(struct block_device_context *blkdev,
|
|
|
|
|
|
blkvsc_req->dev = blkdev;
|
|
|
blkvsc_req->req = req;
|
|
|
- blkvsc_req->request.DataBuffer.Offset = bvec->bv_offset;
|
|
|
- blkvsc_req->request.DataBuffer.Length = 0;
|
|
|
+ blkvsc_req->request.data_buffer.Offset
|
|
|
+ = bvec->bv_offset;
|
|
|
+ blkvsc_req->request.data_buffer.Length
|
|
|
+ = 0;
|
|
|
|
|
|
/* Add to the group */
|
|
|
blkvsc_req->group = group;
|
|
@@ -1007,8 +1009,11 @@ static int blkvsc_do_request(struct block_device_context *blkdev,
|
|
|
}
|
|
|
|
|
|
/* Add the curr bvec/segment to the curr blkvsc_req */
|
|
|
- blkvsc_req->request.DataBuffer.PfnArray[databuf_idx] = page_to_pfn(bvec->bv_page);
|
|
|
- blkvsc_req->request.DataBuffer.Length += bvec->bv_len;
|
|
|
+ blkvsc_req->request.data_buffer.
|
|
|
+ PfnArray[databuf_idx]
|
|
|
+ = page_to_pfn(bvec->bv_page);
|
|
|
+ blkvsc_req->request.data_buffer.Length
|
|
|
+ += bvec->bv_len;
|
|
|
|
|
|
prev_bvec = bvec;
|
|
|
|
|
@@ -1073,7 +1078,7 @@ static int blkvsc_do_request(struct block_device_context *blkdev,
|
|
|
static void blkvsc_cmd_completion(struct hv_storvsc_request *request)
|
|
|
{
|
|
|
struct blkvsc_request *blkvsc_req =
|
|
|
- (struct blkvsc_request *)request->Context;
|
|
|
+ (struct blkvsc_request *)request->context;
|
|
|
struct block_device_context *blkdev =
|
|
|
(struct block_device_context *)blkvsc_req->dev;
|
|
|
struct scsi_sense_hdr sense_hdr;
|
|
@@ -1083,7 +1088,7 @@ static void blkvsc_cmd_completion(struct hv_storvsc_request *request)
|
|
|
|
|
|
blkdev->num_outstanding_reqs--;
|
|
|
|
|
|
- if (blkvsc_req->request.Status)
|
|
|
+ if (blkvsc_req->request.status)
|
|
|
if (scsi_normalize_sense(blkvsc_req->sense_buffer,
|
|
|
SCSI_SENSE_BUFFERSIZE, &sense_hdr))
|
|
|
scsi_print_sense_hdr("blkvsc", &sense_hdr);
|
|
@@ -1095,7 +1100,7 @@ static void blkvsc_cmd_completion(struct hv_storvsc_request *request)
|
|
|
static void blkvsc_request_completion(struct hv_storvsc_request *request)
|
|
|
{
|
|
|
struct blkvsc_request *blkvsc_req =
|
|
|
- (struct blkvsc_request *)request->Context;
|
|
|
+ (struct blkvsc_request *)request->context;
|
|
|
struct block_device_context *blkdev =
|
|
|
(struct block_device_context *)blkvsc_req->dev;
|
|
|
unsigned long flags;
|
|
@@ -1110,7 +1115,7 @@ static void blkvsc_request_completion(struct hv_storvsc_request *request)
|
|
|
(blkvsc_req->write) ? "WRITE" : "READ",
|
|
|
(unsigned long)blkvsc_req->sector_start,
|
|
|
blkvsc_req->sector_count,
|
|
|
- blkvsc_req->request.DataBuffer.Length,
|
|
|
+ blkvsc_req->request.data_buffer.Length,
|
|
|
blkvsc_req->group->outstanding,
|
|
|
blkdev->num_outstanding_reqs);
|
|
|
|
|
@@ -1137,7 +1142,7 @@ static void blkvsc_request_completion(struct hv_storvsc_request *request)
|
|
|
list_del(&comp_req->req_entry);
|
|
|
|
|
|
if (!__blk_end_request(comp_req->req,
|
|
|
- (!comp_req->request.Status ? 0 : -EIO),
|
|
|
+ (!comp_req->request.status ? 0 : -EIO),
|
|
|
comp_req->sector_count * blkdev->sector_size)) {
|
|
|
/*
|
|
|
* All the sectors have been xferred ie the
|
|
@@ -1195,7 +1200,7 @@ static int blkvsc_cancel_pending_reqs(struct block_device_context *blkdev)
|
|
|
|
|
|
if (comp_req->req) {
|
|
|
ret = __blk_end_request(comp_req->req,
|
|
|
- (!comp_req->request.Status ? 0 : -EIO),
|
|
|
+ (!comp_req->request.status ? 0 : -EIO),
|
|
|
comp_req->sector_count *
|
|
|
blkdev->sector_size);
|
|
|
|