blkvsc_req->req = NULL;
blkvsc_req->write = 0;
- blkvsc_req->request.extension.data_buffer.pfn_array[0] = 0;
- blkvsc_req->request.extension.data_buffer.offset = 0;
- blkvsc_req->request.extension.data_buffer.len = 0;
+ blkvsc_req->request.data_buffer.pfn_array[0] = 0;
+ blkvsc_req->request.data_buffer.offset = 0;
+ blkvsc_req->request.data_buffer.len = 0;
blkvsc_req->cmnd[0] = SYNCHRONIZE_CACHE;
blkvsc_req->cmd_len = 10;
blkvsc_req->req = NULL;
blkvsc_req->write = 0;
- blkvsc_req->request.extension.data_buffer.pfn_array[0] =
+ blkvsc_req->request.data_buffer.pfn_array[0] =
page_to_pfn(page_buf);
- blkvsc_req->request.extension.data_buffer.offset = 0;
- blkvsc_req->request.extension.data_buffer.len = 64;
+ blkvsc_req->request.data_buffer.offset = 0;
+ blkvsc_req->request.data_buffer.len = 64;
blkvsc_req->cmnd[0] = INQUIRY;
blkvsc_req->cmnd[1] = 0x1; /* Get product data */
return -ENOMEM;
}
- vm_srb = &blkvsc_req->request.extension.vstor_packet.vm_srb;
+ vm_srb = &blkvsc_req->request.vstor_packet.vm_srb;
init_waitqueue_head(&blkvsc_req->wevent);
blkvsc_req->dev = blkdev;
blkvsc_req->req = NULL;
blkvsc_req->write = 0;
- blkvsc_req->request.extension.data_buffer.pfn_array[0] =
+ blkvsc_req->request.data_buffer.pfn_array[0] =
page_to_pfn(page_buf);
- blkvsc_req->request.extension.data_buffer.offset = 0;
- blkvsc_req->request.extension.data_buffer.len = 8;
+ blkvsc_req->request.data_buffer.offset = 0;
+ blkvsc_req->request.data_buffer.len = 8;
blkvsc_req->cmnd[0] = READ_CAPACITY;
blkvsc_req->cmd_len = 16;
return -ENOMEM;
memset(blkvsc_req, 0, sizeof(struct blkvsc_request));
- vm_srb = &blkvsc_req->request.extension.vstor_packet.vm_srb;
+ vm_srb = &blkvsc_req->request.vstor_packet.vm_srb;
page_buf = alloc_page(GFP_KERNEL);
if (!page_buf) {
kmem_cache_free(blkvsc_req->dev->request_pool, blkvsc_req);
blkvsc_req->req = NULL;
blkvsc_req->write = 0;
- blkvsc_req->request.extension.data_buffer.pfn_array[0] =
+ blkvsc_req->request.data_buffer.pfn_array[0] =
page_to_pfn(page_buf);
- blkvsc_req->request.extension.data_buffer.offset = 0;
- blkvsc_req->request.extension.data_buffer.len = 12;
+ blkvsc_req->request.data_buffer.offset = 0;
+ blkvsc_req->request.data_buffer.len = 12;
blkvsc_req->cmnd[0] = 0x9E; /* READ_CAPACITY16; */
blkvsc_req->cmd_len = 16;
(blkvsc_req->write) ? "WRITE" : "READ",
(unsigned long) blkvsc_req->sector_start,
blkvsc_req->sector_count,
- blkvsc_req->request.extension.data_buffer.offset,
- blkvsc_req->request.extension.data_buffer.len);
+ blkvsc_req->request.data_buffer.offset,
+ blkvsc_req->request.data_buffer.len);
#if 0
for (i = 0; i < (blkvsc_req->request.data_buffer.len >> 12); i++) {
DPRINT_DBG(BLKVSC_DRV, "blkvsc_submit_request() - "
#endif
storvsc_req = &blkvsc_req->request;
- vm_srb = &storvsc_req->extension.vstor_packet.vm_srb;
+ vm_srb = &storvsc_req->vstor_packet.vm_srb;
vm_srb->data_in = blkvsc_req->write ? WRITE_TYPE : READ_TYPE;
- storvsc_req->extension.on_io_completion = request_completion;
- storvsc_req->extension.context = blkvsc_req;
+ storvsc_req->on_io_completion = request_completion;
+ storvsc_req->context = blkvsc_req;
vm_srb->port_number = blkdev->port;
vm_srb->path_id = blkdev->path;
memcpy(vm_srb->cdb, blkvsc_req->cmnd, vm_srb->cdb_length);
- storvsc_req->extension.sense_buffer = blkvsc_req->sense_buffer;
+ storvsc_req->sense_buffer = blkvsc_req->sense_buffer;
ret = storvsc_drv_obj->on_io_request(blkdev->device_ctx,
&blkvsc_req->request);
blkvsc_req->dev = blkdev;
blkvsc_req->req = req;
- blkvsc_req->request.extension.
+ blkvsc_req->request.
data_buffer.offset
= bvec->bv_offset;
- blkvsc_req->request.extension.
+ blkvsc_req->request.
data_buffer.len = 0;
/* Add to the group */
}
/* Add the curr bvec/segment to the curr blkvsc_req */
- blkvsc_req->request.extension.data_buffer.
+ blkvsc_req->request.data_buffer.
pfn_array[databuf_idx]
= page_to_pfn(bvec->bv_page);
- blkvsc_req->request.extension.data_buffer.len
+ blkvsc_req->request.data_buffer.len
+= bvec->bv_len;
prev_bvec = bvec;
static void blkvsc_cmd_completion(struct hv_storvsc_request *request)
{
struct blkvsc_request *blkvsc_req =
- (struct blkvsc_request *)request->extension.context;
+ (struct blkvsc_request *)request->context;
struct block_device_context *blkdev =
(struct block_device_context *)blkvsc_req->dev;
struct scsi_sense_hdr sense_hdr;
DPRINT_DBG(BLKVSC_DRV, "blkvsc_cmd_completion() - req %p\n",
blkvsc_req);
- vm_srb = &blkvsc_req->request.extension.vstor_packet.vm_srb;
+ vm_srb = &blkvsc_req->request.vstor_packet.vm_srb;
blkdev->num_outstanding_reqs--;
if (vm_srb->scsi_status)
static void blkvsc_request_completion(struct hv_storvsc_request *request)
{
struct blkvsc_request *blkvsc_req =
- (struct blkvsc_request *)request->extension.context;
+ (struct blkvsc_request *)request->context;
struct block_device_context *blkdev =
(struct block_device_context *)blkvsc_req->dev;
unsigned long flags;
(blkvsc_req->write) ? "WRITE" : "READ",
(unsigned long)blkvsc_req->sector_start,
blkvsc_req->sector_count,
- blkvsc_req->request.extension.data_buffer.len,
+ blkvsc_req->request.data_buffer.len,
blkvsc_req->group->outstanding,
blkdev->num_outstanding_reqs);
list_del(&comp_req->req_entry);
vm_srb =
- &comp_req->request.extension.vstor_packet.vm_srb;
+ &comp_req->request.vstor_packet.vm_srb;
if (!__blk_end_request(comp_req->req,
(!vm_srb->scsi_status ? 0 : -EIO),
comp_req->sector_count * blkdev->sector_size)) {
if (comp_req->req) {
vm_srb =
- &comp_req->request.extension.vstor_packet.
+ &comp_req->request.vstor_packet.
vm_srb;
ret = __blk_end_request(comp_req->req,
(!vm_srb->scsi_status ? 0 : -EIO),
static int stor_vsc_channel_init(struct hv_device *device)
{
struct storvsc_device *stor_device;
- struct storvsc_request_extension *request;
+ struct hv_storvsc_request *request;
struct vstor_packet *vstor_packet;
int ret, t;
* Now, initiate the vsc/vsp initialization protocol on the open
* channel
*/
- memset(request, 0, sizeof(struct storvsc_request_extension));
+ memset(request, 0, sizeof(struct hv_storvsc_request));
init_completion(&request->wait_event);
vstor_packet->operation = VSTOR_OPERATION_BEGIN_INITIALIZATION;
vstor_packet->flags = REQUEST_COMPLETION_FLAG;
static void stor_vsc_on_io_completion(struct hv_device *device,
struct vstor_packet *vstor_packet,
- struct storvsc_request_extension *request_ext)
+ struct hv_storvsc_request *request)
{
- struct hv_storvsc_request *request;
struct storvsc_device *stor_device;
stor_device = must_get_stor_device(device);
return;
}
- DPRINT_DBG(STORVSC, "IO_COMPLETE_OPERATION - request extension %p "
- "completed bytes xfer %u", request_ext,
+ DPRINT_DBG(STORVSC, "IO_COMPLETE_OPERATION - request %p "
+ "completed bytes xfer %u", request,
vstor_packet->vm_srb.data_transfer_length);
- request = request_ext->request;
/* Copy over the status...etc */
if (vstor_packet->vm_srb.srb_status & 0x80) {
/* autosense data available */
DPRINT_WARN(STORVSC, "storvsc pkt %p autosense data "
- "valid - len %d\n", request_ext,
+ "valid - len %d\n", request,
vstor_packet->vm_srb.sense_info_length);
- memcpy(request->extension.sense_buffer,
+ memcpy(request->sense_buffer,
vstor_packet->vm_srb.sense_data,
vstor_packet->vm_srb.sense_info_length);
}
- request->extension.on_io_completion(request);
+ request->on_io_completion(request);
atomic_dec(&stor_device->num_outstanding_req);
static void stor_vsc_on_receive(struct hv_device *device,
struct vstor_packet *vstor_packet,
- struct storvsc_request_extension *request_ext)
+ struct hv_storvsc_request *request)
{
switch (vstor_packet->operation) {
case VSTOR_OPERATION_COMPLETE_IO:
DPRINT_DBG(STORVSC, "IO_COMPLETE_OPERATION");
- stor_vsc_on_io_completion(device, vstor_packet, request_ext);
+ stor_vsc_on_io_completion(device, vstor_packet, request);
break;
case VSTOR_OPERATION_REMOVE_DEVICE:
DPRINT_INFO(STORVSC, "REMOVE_DEVICE_OPERATION");
u32 bytes_recvd;
u64 request_id;
unsigned char packet[ALIGN(sizeof(struct vstor_packet), 8)];
- struct storvsc_request_extension *request;
+ struct hv_storvsc_request *request;
int ret;
bytes_recvd, request_id);
- request = (struct storvsc_request_extension *)
+ request = (struct hv_storvsc_request *)
(unsigned long)request_id;
if ((request == &stor_device->init_request) ||
struct hv_storvsc_request *request)
{
struct storvsc_device *stor_device;
- struct storvsc_request_extension *request_extension;
struct vstor_packet *vstor_packet;
int ret = 0;
- request_extension = &request->extension;
- vstor_packet = &request_extension->vstor_packet;
+ vstor_packet = &request->vstor_packet;
stor_device = get_stor_device(device);
DPRINT_DBG(STORVSC, "enter - Device %p, DeviceExt %p, Request %p, "
- "Extension %p", device, stor_device, request,
- request_extension);
+ , device, stor_device, request);
DPRINT_DBG(STORVSC, "req %p len %d",
- request, request->extension.data_buffer.len);
+ request, request->data_buffer.len);
if (!stor_device) {
DPRINT_ERR(STORVSC, "unable to get stor device..."
}
- request_extension->request = request;
- request_extension->device = device;
+ request->device = device;
vstor_packet->flags |= REQUEST_COMPLETION_FLAG;
vstor_packet->vm_srb.data_transfer_length =
- request->extension.data_buffer.len;
+ request->data_buffer.len;
vstor_packet->operation = VSTOR_OPERATION_EXECUTE_SRB;
vstor_packet->vm_srb.sense_info_length,
vstor_packet->vm_srb.cdb_length);
- if (request_extension->request->extension.data_buffer.len) {
+ if (request->data_buffer.len) {
ret = vmbus_sendpacket_multipagebuffer(device->channel,
- &request_extension->request->extension.
- data_buffer,
+ &request->data_buffer,
vstor_packet,
sizeof(struct vstor_packet),
- (unsigned long)request_extension);
+ (unsigned long)request);
} else {
ret = vmbus_sendpacket(device->channel, vstor_packet,
sizeof(struct vstor_packet),
- (unsigned long)request_extension,
+ (unsigned long)request,
VM_PKT_DATA_INBAND,
VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
}
};
-struct storvsc_request_extension {
+struct hv_storvsc_request {
struct hv_storvsc_request *request;
struct hv_device *device;
struct vstor_packet vstor_packet;
};
-struct hv_storvsc_request {
-
- struct storvsc_request_extension extension;
-
-};
/* Represents the block vsc driver */
struct storvsc_driver_object {
unsigned char target_id;
/* Used for vsc/vsp channel reset process */
- struct storvsc_request_extension init_request;
- struct storvsc_request_extension reset_request;
+ struct hv_storvsc_request init_request;
+ struct hv_storvsc_request reset_request;
};
stor_driver = hvdr_to_stordr(driver);
- DPRINT_DBG(STORVSC, "sizeof(STORVSC_REQUEST)=%zd "
- "sizeof(struct storvsc_request_extension)=%zd "
+ DPRINT_DBG(STORVSC,
+ "sizeof(struct hv_storvsc_request)=%zd "
"sizeof(struct vstor_packet)=%zd, "
"sizeof(struct vmscsi_request)=%zd",
sizeof(struct hv_storvsc_request),
- sizeof(struct storvsc_request_extension),
sizeof(struct vstor_packet),
sizeof(struct vmscsi_request));
static int stor_vsc_on_host_reset(struct hv_device *device)
{
struct storvsc_device *stor_device;
- struct storvsc_request_extension *request;
+ struct hv_storvsc_request *request;
struct vstor_packet *vstor_packet;
int ret, t;
static void storvsc_commmand_completion(struct hv_storvsc_request *request)
{
struct storvsc_cmd_request *cmd_request =
- (struct storvsc_cmd_request *)request->extension.context;
+ (struct storvsc_cmd_request *)request->context;
struct scsi_cmnd *scmnd = cmd_request->cmd;
struct host_device_context *host_device_ctx =
(struct host_device_context *)scmnd->device->host->hostdata;
cmd_request->bounce_sgl_count);
}
- vm_srb = &request->extension.vstor_packet.vm_srb;
+ vm_srb = &request->vstor_packet.vm_srb;
scmnd->result = vm_srb->scsi_status;
if (scmnd->result) {
/* ASSERT(request->BytesXfer <= request->data_buffer.Length); */
scsi_set_resid(scmnd,
- request->extension.data_buffer.len -
+ request->data_buffer.len -
vm_srb->data_transfer_length);
scsi_done_fn = scmnd->scsi_done;
scmnd->host_scribble = (unsigned char *)cmd_request;
request = &cmd_request->request;
- vm_srb = &request->extension.vstor_packet.vm_srb;
+ vm_srb = &request->vstor_packet.vm_srb;
DPRINT_DBG(STORVSC_DRV, "req %p size %d", request, request_size);
break;
}
- request->extension.on_io_completion = storvsc_commmand_completion;
- request->extension.context = cmd_request;/* scmnd; */
+ request->on_io_completion = storvsc_commmand_completion;
+ request->context = cmd_request;/* scmnd; */
/* request->PortId = scmnd->device->channel; */
vm_srb->port_number = host_device_ctx->port;
memcpy(vm_srb->cdb, scmnd->cmnd, vm_srb->cdb_length);
- request->extension.sense_buffer = scmnd->sense_buffer;
+ request->sense_buffer = scmnd->sense_buffer;
- request->extension.data_buffer.len = scsi_bufflen(scmnd);
+ request->data_buffer.len = scsi_bufflen(scmnd);
if (scsi_sg_count(scmnd)) {
sgl = (struct scatterlist *)scsi_sglist(scmnd);
sg_count = scsi_sg_count(scmnd);
sg_count = cmd_request->bounce_sgl_count;
}
- request->extension.data_buffer.offset = sgl[0].offset;
+ request->data_buffer.offset = sgl[0].offset;
for (i = 0; i < sg_count; i++) {
DPRINT_DBG(STORVSC_DRV, "sgl[%d] len %d offset %d\n",
i, sgl[i].length, sgl[i].offset);
- request->extension.data_buffer.pfn_array[i] =
+ request->data_buffer.pfn_array[i] =
page_to_pfn(sg_page((&sgl[i])));
}
} else if (scsi_sglist(scmnd)) {
/* ASSERT(scsi_bufflen(scmnd) <= PAGE_SIZE); */
- request->extension.data_buffer.offset =
+ request->data_buffer.offset =
virt_to_phys(scsi_sglist(scmnd)) & (PAGE_SIZE-1);
- request->extension.data_buffer.pfn_array[0] =
+ request->data_buffer.pfn_array[0] =
virt_to_phys(scsi_sglist(scmnd)) >> PAGE_SHIFT;
}