win-pvdrivers

changeset 926:d16dfda0ebce

Tidy up dump usage of grant references
author James Harper <james.harper@bendigoit.com.au>
date Sat Jun 04 16:44:36 2011 +1000 (2011-06-04)
parents 80b2f4b8263b
children ca7b237a61b1
files xenvbd/xenvbd_scsiport.c
line diff
     1.1 --- a/xenvbd/xenvbd_scsiport.c	Sat May 21 21:56:06 2011 +1000
     1.2 +++ b/xenvbd/xenvbd_scsiport.c	Sat Jun 04 16:44:36 2011 +1000
     1.3 @@ -232,10 +232,6 @@ XenVbd_InitFromConfig(PXENVBD_DEVICE_DAT
     1.4      case XEN_INIT_TYPE_QEMU_PROTOCOL_VERSION:
     1.5        qemu_protocol_version = PtrToUlong(value);
     1.6        break;
     1.7 -    case XEN_INIT_TYPE_GRANT_ENTRIES:
     1.8 -      KdPrint((__DRIVER_NAME "     XEN_INIT_TYPE_GRANT_ENTRIES - entries = %d\n", PtrToUlong(value)));
     1.9 -      memcpy(xvdd->dump_grant_refs, value2, PtrToUlong(value) * sizeof(grant_ref_t));
    1.10 -      break;
    1.11      case XEN_INIT_TYPE_QEMU_HIDE_FLAGS:
    1.12        qemu_hide_flags_value = PtrToUlong(value);
    1.13        KdPrint((__DRIVER_NAME "     qemu_hide_flags_value = %d\n", qemu_hide_flags_value));
    1.14 @@ -484,17 +480,8 @@ XenVbd_PutQueuedSrbsOnRing(PXENVBD_DEVIC
    1.15      {
    1.16        PHYSICAL_ADDRESS physical_address = MmGetPhysicalAddress(ptr);
    1.17        
    1.18 -      if (dump_mode)
    1.19 -      {
    1.20 -        gref = xvdd->vectors.GntTbl_GrantAccess(xvdd->vectors.context, 0,
    1.21 -                 (ULONG)(physical_address.QuadPart >> PAGE_SHIFT), FALSE,
    1.22 -                 xvdd->dump_grant_refs[shadow->req.nr_segments], (ULONG)'SCSI');
    1.23 -      }
    1.24 -      else
    1.25 -      {
    1.26 -        gref = xvdd->vectors.GntTbl_GrantAccess(xvdd->vectors.context, 0,
    1.27 -                 (ULONG)(physical_address.QuadPart >> PAGE_SHIFT), FALSE, INVALID_GRANT_REF, (ULONG)'SCSI');
    1.28 -      }
    1.29 +      gref = xvdd->vectors.GntTbl_GrantAccess(xvdd->vectors.context, 0,
    1.30 +               (ULONG)(physical_address.QuadPart >> PAGE_SHIFT), FALSE, INVALID_GRANT_REF, (ULONG)'SCSI');
    1.31        if (gref == INVALID_GRANT_REF)
    1.32        {
    1.33          ULONG i;
    1.34 @@ -1008,16 +995,8 @@ XenVbd_HwScsiInterrupt(PVOID DeviceExten
    1.35            KdPrint((__DRIVER_NAME "     discarding reset shadow\n"));
    1.36            for (j = 0; j < shadow->req.nr_segments; j++)
    1.37            {
    1.38 -            if (dump_mode)
    1.39 -            {
    1.40 -              xvdd->vectors.GntTbl_EndAccess(xvdd->vectors.context,
    1.41 -                shadow->req.seg[j].gref, TRUE, (ULONG)'SCSI');
    1.42 -            }
    1.43 -            else
    1.44 -            {
    1.45 -              xvdd->vectors.GntTbl_EndAccess(xvdd->vectors.context,
    1.46 -                shadow->req.seg[j].gref, FALSE, (ULONG)'SCSI');
    1.47 -            }
    1.48 +            xvdd->vectors.GntTbl_EndAccess(xvdd->vectors.context,
    1.49 +              shadow->req.seg[j].gref, FALSE, (ULONG)'SCSI');
    1.50            }
    1.51          }
    1.52          else if (dump_mode && !(rep->id & SHADOW_ID_DUMP_FLAG))
    1.53 @@ -1075,16 +1054,8 @@ XenVbd_HwScsiInterrupt(PVOID DeviceExten
    1.54            }
    1.55            for (j = 0; j < shadow->req.nr_segments; j++)
    1.56            {
    1.57 -            if (dump_mode)
    1.58 -            {
    1.59 -              xvdd->vectors.GntTbl_EndAccess(xvdd->vectors.context,
    1.60 -                shadow->req.seg[j].gref, TRUE, (ULONG)'SCSI');
    1.61 -            }
    1.62 -            else
    1.63 -            {
    1.64 -              xvdd->vectors.GntTbl_EndAccess(xvdd->vectors.context,
    1.65 -                shadow->req.seg[j].gref, FALSE, (ULONG)'SCSI');
    1.66 -            }
    1.67 +            xvdd->vectors.GntTbl_EndAccess(xvdd->vectors.context,
    1.68 +              shadow->req.seg[j].gref, FALSE, (ULONG)'SCSI');
    1.69            }
    1.70            ScsiPortNotification(RequestComplete, xvdd, srb);
    1.71          }
    1.72 @@ -1692,7 +1663,6 @@ DriverEntry(PDRIVER_OBJECT DriverObject,
    1.73      ADD_XEN_INIT_REQ(&ptr, XEN_INIT_TYPE_READ_STRING_BACK, "mode", NULL, NULL);
    1.74      ADD_XEN_INIT_REQ(&ptr, XEN_INIT_TYPE_READ_STRING_BACK, "sectors", NULL, NULL);
    1.75      ADD_XEN_INIT_REQ(&ptr, XEN_INIT_TYPE_READ_STRING_BACK, "sector-size", NULL, NULL);
    1.76 -    ADD_XEN_INIT_REQ(&ptr, XEN_INIT_TYPE_GRANT_ENTRIES, ULongToPtr((ULONG)'SCSI'), ULongToPtr(BLKIF_MAX_SEGMENTS_PER_REQUEST), NULL); /* for use in crash dump */
    1.77      ADD_XEN_INIT_REQ(&ptr, XEN_INIT_TYPE_XB_STATE_MAP_PRE_CONNECT, NULL, NULL, NULL);
    1.78      __ADD_XEN_INIT_UCHAR(&ptr, XenbusStateConnected);
    1.79      __ADD_XEN_INIT_UCHAR(&ptr, XenbusStateConnected);