win-pvdrivers

changeset 202:71b9f608bb80

Fixed compiler warnings so that it builds under Free
author James Harper <james.harper@bendigoit.com.au>
date Fri Feb 29 20:11:24 2008 +1100 (2008-02-29)
parents 63780c11acbe
children 2a3606fece27
files common.inc xennet/xennet.c xenpci/xenpci.c xenscsi/xenscsi.c xenvbd/xenvbd.c
line diff
     1.1 --- a/common.inc	Thu Feb 28 23:37:17 2008 +1100
     1.2 +++ b/common.inc	Fri Feb 29 20:11:24 2008 +1100
     1.3 @@ -1,4 +1,4 @@
     1.4 -VERSION=0.8.4.17
     1.5 +VERSION=0.8.4.20
     1.6  TARGETPATH=..\Target\$(DDK_TARGET_OS)
     1.7  KMDF_VERSION=1
     1.8  !IF $(_NT_TOOLS_VERSION) > 0x700
     2.1 --- a/xennet/xennet.c	Thu Feb 28 23:37:17 2008 +1100
     2.2 +++ b/xennet/xennet.c	Fri Feb 29 20:11:24 2008 +1100
     2.3 @@ -210,17 +210,17 @@ XenNet_TxBufferGC(struct xennet_info *xi
     2.4    unsigned short id;
     2.5    PNDIS_PACKET pkt;
     2.6    PMDL pmdl;
     2.7 -  KIRQL OldIrql;
     2.8    PVOID ptr;
     2.9    LARGE_INTEGER tsc, dummy;
    2.10  
    2.11    ASSERT(xi->connected);
    2.12 +  ASSERT(KeGetCurrentIrql() == DISPATCH_LEVEL);
    2.13  
    2.14  //  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
    2.15  
    2.16    tsc = KeQueryPerformanceCounter(&dummy);
    2.17  
    2.18 -  KeAcquireSpinLock(&xi->tx_lock, &OldIrql);
    2.19 +  KeAcquireSpinLockAtDpcLevel(&xi->tx_lock);
    2.20  
    2.21    do {
    2.22      prod = xi->tx.sring->rsp_prod;
    2.23 @@ -265,7 +265,7 @@ XenNet_TxBufferGC(struct xennet_info *xi
    2.24      KeMemoryBarrier();
    2.25    } while ((cons == prod) && (prod != xi->tx.sring->rsp_prod));
    2.26  
    2.27 -  KeReleaseSpinLock(&xi->tx_lock, OldIrql);
    2.28 +  KeReleaseSpinLockFromDpcLevel(&xi->tx_lock);
    2.29  
    2.30    /* if queued packets, send them now */
    2.31    XenNet_SendQueuedPackets(xi);
    2.32 @@ -507,6 +507,7 @@ XenNet_RxBufferCheck(struct xennet_info 
    2.33    int more_frags = 0;
    2.34    NDIS_STATUS status;
    2.35    LARGE_INTEGER tsc, dummy;
    2.36 +  LARGE_INTEGER time_received;
    2.37    
    2.38  //  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
    2.39  
    2.40 @@ -514,6 +515,7 @@ XenNet_RxBufferCheck(struct xennet_info 
    2.41  
    2.42    ASSERT(xi->connected);
    2.43  
    2.44 +  NdisGetCurrentSystemTime(&time_received);
    2.45    KeAcquireSpinLock(&xi->rx_lock, &OldIrql);
    2.46  
    2.47    packet_count = 0;
    2.48 @@ -557,6 +559,7 @@ XenNet_RxBufferCheck(struct xennet_info 
    2.49          xi->stat_rx_ok++;
    2.50          InterlockedIncrement(&xi->rx_outstanding);
    2.51          NDIS_SET_PACKET_STATUS(packets[packet_count], NDIS_STATUS_SUCCESS);
    2.52 +        NDIS_SET_PACKET_TIME_RECEIVED(packets[packet_count], time_received.QuadPart);
    2.53          packet_count++;
    2.54          if (packet_count == NET_RX_RING_SIZE)
    2.55          {
    2.56 @@ -1488,6 +1491,7 @@ XenNet_SetInformation(
    2.57    return status;
    2.58  }
    2.59  
    2.60 +/* Called at DISPATCH_LEVEL with tx_lock held */
    2.61  PMDL
    2.62  XenNet_Linearize(PNDIS_PACKET Packet)
    2.63  {
    2.64 @@ -1499,11 +1503,9 @@ XenNet_Linearize(PNDIS_PACKET Packet)
    2.65    UINT buff_len;
    2.66    UINT tot_buff_len;
    2.67    LARGE_INTEGER tsc, dummy;
    2.68 -  KIRQL OldIrql;
    2.69  
    2.70  //  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
    2.71  
    2.72 -  KeRaiseIrql(DISPATCH_LEVEL, &OldIrql);  
    2.73    tsc = KeQueryPerformanceCounter(&dummy);
    2.74  
    2.75    NdisGetFirstBufferFromPacketSafe(Packet, &buffer, &buff_va, &buff_len,
    2.76 @@ -1538,8 +1540,6 @@ XenNet_Linearize(PNDIS_PACKET Packet)
    2.77    ProfTime_Linearize.QuadPart += KeQueryPerformanceCounter(&dummy).QuadPart - tsc.QuadPart;
    2.78    ProfCount_Linearize++;
    2.79  
    2.80 -  KeLowerIrql(OldIrql);
    2.81 -
    2.82    return pmdl;
    2.83  }
    2.84  
    2.85 @@ -1629,8 +1629,10 @@ XenNet_SendPackets(
    2.86    KIRQL OldIrql2;
    2.87  
    2.88    KeRaiseIrql(DISPATCH_LEVEL, &OldIrql2);
    2.89 +  tsc = KeQueryPerformanceCounter(&dummy);
    2.90  
    2.91 -  tsc = KeQueryPerformanceCounter(&dummy);
    2.92 +  KeAcquireSpinLock(&xi->tx_lock, &OldIrql);
    2.93 +
    2.94    //  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
    2.95    for (i = 0; i < NumberOfPackets; i++)
    2.96    {
    2.97 @@ -1655,11 +1657,11 @@ XenNet_SendPackets(
    2.98      *(PMDL *)&curr_packet->MiniportReservedEx = pmdl;
    2.99  
   2.100      entry = (PLIST_ENTRY)&curr_packet->MiniportReservedEx[sizeof(PVOID)];
   2.101 -    KeAcquireSpinLock(&xi->tx_lock, &OldIrql);
   2.102      InsertTailList(&xi->tx_waiting_pkt_list, entry);
   2.103 -    KeReleaseSpinLock(&xi->tx_lock, OldIrql);
   2.104      InterlockedIncrement(&xi->tx_outstanding);
   2.105    }
   2.106 +  KeReleaseSpinLock(&xi->tx_lock, OldIrql);
   2.107 +
   2.108    ProfTime_SendPackets.QuadPart += KeQueryPerformanceCounter(&dummy).QuadPart - tsc.QuadPart;
   2.109    ProfCount_SendPackets++;
   2.110    KeLowerIrql(OldIrql2);
     3.1 --- a/xenpci/xenpci.c	Thu Feb 28 23:37:17 2008 +1100
     3.2 +++ b/xenpci/xenpci.c	Fri Feb 29 20:11:24 2008 +1100
     3.3 @@ -865,6 +865,9 @@ XenPci_Suspend(
     3.4    KIRQL OldIrql;
     3.5    int cancelled;
     3.6  
     3.7 +  UNREFERENCED_PARAMETER(Dpc);
     3.8 +  UNREFERENCED_PARAMETER(SystemArgument2);
     3.9 +
    3.10    KdPrint((__DRIVER_NAME " --> " __FUNCTION__ " (CPU = %d)\n", KeGetCurrentProcessorNumber()));
    3.11    KdPrint((__DRIVER_NAME "     Device = %p\n", Device));
    3.12  
     4.1 --- a/xenscsi/xenscsi.c	Thu Feb 28 23:37:17 2008 +1100
     4.2 +++ b/xenscsi/xenscsi.c	Fri Feb 29 20:11:24 2008 +1100
     4.3 @@ -135,7 +135,7 @@ XenScsi_HwScsiInterruptTarget(PVOID Devi
     4.4      {
     4.5        rep = RING_GET_RESPONSE(&TargetData->Ring, i);
     4.6        Srb = TargetData->shadow[rep->rqid].Srb;
     4.7 -      Srb->ScsiStatus = rep->rslt;
     4.8 +      Srb->ScsiStatus = (UCHAR)rep->rslt;
     4.9        if (!rep->rslt)
    4.10          Srb->SrbStatus = SRB_STATUS_SUCCESS;
    4.11        else
    4.12 @@ -675,9 +675,9 @@ XenScsi_PutSrbOnRing(PXENSCSI_TARGET_DAT
    4.13    memset(shadow->req.cmnd, 0, VSCSIIF_MAX_COMMAND_SIZE);
    4.14    memcpy(shadow->req.cmnd, Srb->Cdb, 16);
    4.15    shadow->req.cmd_len = Srb->CdbLength;
    4.16 -  shadow->req.id = TargetData->id;
    4.17 -  shadow->req.lun = TargetData->lun;
    4.18 -  shadow->req.channel = TargetData->channel;
    4.19 +  shadow->req.id = (USHORT)TargetData->id;
    4.20 +  shadow->req.lun = (USHORT)TargetData->lun;
    4.21 +  shadow->req.channel = (USHORT)TargetData->channel;
    4.22    if (Srb->DataTransferLength && (Srb->SrbFlags & SRB_FLAGS_DATA_IN) && (Srb->SrbFlags & SRB_FLAGS_DATA_OUT))
    4.23      shadow->req.sc_data_direction = DMA_BIDIRECTIONAL;
    4.24    else if (Srb->DataTransferLength && (Srb->SrbFlags & SRB_FLAGS_DATA_IN))
    4.25 @@ -703,7 +703,7 @@ XenScsi_PutSrbOnRing(PXENSCSI_TARGET_DAT
    4.26      }
    4.27      else
    4.28      {
    4.29 -      shadow->req.seg[i].length = remaining;
    4.30 +      shadow->req.seg[i].length = (USHORT)remaining;
    4.31        remaining = 0;
    4.32      }
    4.33  //    KdPrint((__DRIVER_NAME "     sg %d: offset = %d, size = %d\n", i, shadow->req.seg[i].offset, shadow->req.seg[i].length));
    4.34 @@ -723,7 +723,6 @@ XenScsi_HwScsiStartIo(PVOID DeviceExtens
    4.35    PXENSCSI_DEVICE_DATA DeviceData = (PXENSCSI_DEVICE_DATA)DeviceExtension;
    4.36    PXENSCSI_TARGET_DATA TargetData;
    4.37    int notify;
    4.38 -  int i;
    4.39  
    4.40  //  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ " PathId = %d, TargetId = %d, Lun = %d\n", Srb->PathId, Srb->TargetId, Srb->Lun));
    4.41  
     5.1 --- a/xenvbd/xenvbd.c	Thu Feb 28 23:37:17 2008 +1100
     5.2 +++ b/xenvbd/xenvbd.c	Fri Feb 29 20:11:24 2008 +1100
     5.3 @@ -667,7 +667,7 @@ XenVbd_EnumerateExisting(PXENVBD_DEVICE_
     5.4  static PXENPCI_XEN_DEVICE_DATA
     5.5  XenVbd_GetXenDeviceData(PPORT_CONFIGURATION_INFORMATION ConfigInfo)
     5.6  {
     5.7 -  int i;
     5.8 +  ULONG i;
     5.9    PACCESS_RANGE AccessRange;
    5.10    PXENPCI_XEN_DEVICE_DATA XenDeviceData = NULL;
    5.11  
    5.12 @@ -693,7 +693,7 @@ static VOID
    5.13  XenVbd_InitDeviceData(PXENVBD_DEVICE_DATA DeviceData, PPORT_CONFIGURATION_INFORMATION ConfigInfo)
    5.14  {
    5.15    ULONG i, j;
    5.16 -  PXENPCI_XEN_DEVICE_DATA XenDeviceData;
    5.17 +//  PXENPCI_XEN_DEVICE_DATA XenDeviceData;
    5.18  
    5.19    KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));  
    5.20  
    5.21 @@ -731,9 +731,9 @@ static ULONG
    5.22  XenVbd_HwScsiFindAdapter(PVOID DeviceExtension, PVOID HwContext, PVOID BusInformation, PCHAR ArgumentString, PPORT_CONFIGURATION_INFORMATION ConfigInfo, PBOOLEAN Again)
    5.23  {
    5.24    ULONG i, j, k;
    5.25 -  PACCESS_RANGE AccessRange;
    5.26 +//  PACCESS_RANGE AccessRange;
    5.27    PXENVBD_DEVICE_DATA DeviceData; // = ((PXENVBD_DEVICE_EXTENSION)DeviceExtension)->XenVbdDeviceData;
    5.28 -  ULONG status;
    5.29 +//  ULONG status;
    5.30    PXENPCI_XEN_DEVICE_DATA XenDeviceData;
    5.31  
    5.32    UNREFERENCED_PARAMETER(HwContext);