win-pvdrivers

changeset 821:9c0c4210b778

Fix xennet build under Windows 2000
Fix xenvbd install under Windows 2000
author James Harper <james.harper@bendigoit.com.au>
date Sat Oct 16 20:03:30 2010 +1100 (2010-10-16)
parents f611752480e4
children 553e9e4ea5ec
files installer.wxs makedist.bat xennet/sources xennet/xennet.c xennet/xennet.inx xennet/xennet_rx.c xennet/xennet_tx.c xenvbd/xenvbd.inx
line diff
     1.1 --- a/installer.wxs	Mon Oct 11 19:48:20 2010 +1100
     1.2 +++ b/installer.wxs	Sat Oct 16 20:03:30 2010 +1100
     1.3 @@ -94,6 +94,7 @@
     1.4                  <difx:Driver Sequence='2' Legacy='yes' PlugAndPlayPrompt='no' ForceInstall='yes' />
     1.5                </Component>
     1.6              </Directory>
     1.7 +            <?endif ?>
     1.8              <Directory Id='XenNetDir' Name='xennet'>
     1.9                <Component Id='XenNet' Guid='F16B1EC7-35B1-42c2-9017-22DC23D80BE7'>
    1.10                  <File Id='xennet.cat' Name='xennet.cat' DiskId='1' Source='xennet\obj$(env.BUILD_ALT_DIR)\$(var.ARCHDIR)\xennet.cat' />
    1.11 @@ -102,6 +103,7 @@
    1.12                  <difx:Driver Sequence='3' Legacy='yes' PlugAndPlayPrompt='no' ForceInstall='yes' />
    1.13                </Component>
    1.14              </Directory>
    1.15 +            <?if $(env.DDK_TARGET_OS) != Win2K ?>
    1.16              <Directory Id='XenUsbDir' Name='xenusb'>
    1.17                <Component Id='XenUsb' Guid='83746E68-DBCC-4feb-B521-09D5328D3BB0'>
    1.18                  <File Id='xenusb.cat' Name='xenusb.cat' DiskId='1' Source='xenusb\obj$(env.BUILD_ALT_DIR)\$(var.ARCHDIR)\xenusb.cat' />
    1.19 @@ -142,9 +144,11 @@
    1.20        <Feature Id='XenScsi' Title='XenScsi Driver' Level='1' AllowAdvertise='no' InstallDefault='local' Absent='allow'>
    1.21          <ComponentRef Id='XenScsi' />
    1.22        </Feature>
    1.23 +      <?endif ?>
    1.24        <Feature Id='XenNet' Title='XenNet Driver' Level='1' AllowAdvertise='no' InstallDefault='local' Absent='allow'>
    1.25          <ComponentRef Id='XenNet' />
    1.26        </Feature>
    1.27 +      <?if $(env.DDK_TARGET_OS) != Win2K ?>
    1.28        <Feature Id='XenUsb' Title='XenUsb Driver' Level='1' AllowAdvertise='no' InstallDefault='local' Absent='allow'>
    1.29          <ComponentRef Id='XenUsb' />
    1.30        </Feature>
     2.1 --- a/makedist.bat	Mon Oct 11 19:48:20 2010 +1100
     2.2 +++ b/makedist.bat	Sat Oct 16 20:03:30 2010 +1100
     2.3 @@ -29,7 +29,7 @@ IF NOT EXIST gplpv.cer "%DDK_PATH%"\bin\
     2.4  
     2.5  mkdir symbols\%GPLPV_VERSION%
     2.6  
     2.7 -cmd /C "%DDK_PATH_2K%\bin\setenv.bat %DDK_PATH_2K%\ chk W2K && CD /D "%PV_DIR%" && build -cZg ~xennet ~copyconfig ~xenusb ~waitnopendinginstallevents && call sign.bat && call archive.bat && call wix.bat"
     2.8 +cmd /C "%DDK_PATH_2K%\bin\setenv.bat %DDK_PATH_2K%\ chk W2K && CD /D "%PV_DIR%" && build -cZg ~xenusb ~copyconfig ~waitnopendinginstallevents && call sign.bat && call archive.bat && call wix.bat"
     2.9  
    2.10  cmd /C "%DDK_PATH%\bin\setenv.bat %DDK_PATH%\ chk WXP && CD /D "%PV_DIR%" && build -cZg && call sign.bat && call archive.bat && call wix.bat"
    2.11  
    2.12 @@ -41,7 +41,7 @@ cmd /C "%DDK_PATH%\bin\setenv.bat %DDK_P
    2.13  
    2.14  cmd /C "%DDK_PATH%\bin\setenv.bat %DDK_PATH%\ chk x64 WLH && CD /D "%PV_DIR%" && build -cZg && call sign.bat && call archive.bat && call wix.bat"
    2.15  
    2.16 -cmd /C "%DDK_PATH_2K%\bin\setenv.bat %DDK_PATH_2K%\ fre W2K && CD /D "%PV_DIR%" && build -cZg ~xennet ~copyconfig ~xenusb ~waitnopendinginstallevents && call sign.bat && call wix.bat"
    2.17 +cmd /C "%DDK_PATH_2K%\bin\setenv.bat %DDK_PATH_2K%\ fre W2K && CD /D "%PV_DIR%" && build -cZg ~xenusb ~copyconfig ~waitnopendinginstallevents && call sign.bat && call wix.bat"
    2.18  
    2.19  cmd /C "%DDK_PATH%\bin\setenv.bat %DDK_PATH%\ fre WXP && CD /D "%PV_DIR%" && build -cZg && call sign.bat && call wix.bat"
    2.20  
     3.1 --- a/xennet/sources	Mon Oct 11 19:48:20 2010 +1100
     3.2 +++ b/xennet/sources	Sat Oct 16 20:03:30 2010 +1100
     3.3 @@ -2,6 +2,9 @@
     3.4  TARGETNAME=xennet
     3.5  TARGETTYPE=DRIVER
     3.6  INF_NAME=$(TARGETNAME)
     3.7 +!IF $(WIN2K_DDKBUILD)
     3.8 +C_DEFINES=$(C_DEFINES) -D_WIN2K_COMPAT_SLIST_USAGE
     3.9 +!ENDIF
    3.10  TARGETLIBS=$(TARGETLIBS) $(DDK_LIB_PATH)\ndis.lib
    3.11  NTTARGETFILES=$(NTTARGETFILES) $(OBJ_PATH)\$(O)\$(INF_NAME).inf
    3.12  SOURCES=xennet.rc xennet.c xennet_tx.c xennet_rx.c xennet_oid.c xennet_common.c
     4.1 --- a/xennet/xennet.c	Mon Oct 11 19:48:20 2010 +1100
     4.2 +++ b/xennet/xennet.c	Sat Oct 16 20:03:30 2010 +1100
     4.3 @@ -25,7 +25,9 @@ Foundation, Inc., 51 Franklin Street, Fi
     4.4  /* Not really necessary but keeps PREfast happy */
     4.5  DRIVER_INITIALIZE DriverEntry;
     4.6  static IO_WORKITEM_ROUTINE XenNet_Resume;
     4.7 +#if (NTDDI_VERSION >= NTDDI_WINXP)
     4.8  static KDEFERRED_ROUTINE XenNet_SuspendResume;
     4.9 +#endif
    4.10  
    4.11  #pragma NDIS_INIT_FUNCTION(DriverEntry)
    4.12  
    4.13 @@ -522,9 +524,9 @@ XenNet_Init(
    4.14    xi->rx_min_target = RX_DFL_MIN_TARGET;
    4.15    xi->rx_max_target = RX_MAX_TARGET;
    4.16    xi->inactive      = TRUE;
    4.17 -  NdisMSetAttributesEx(xi->adapter_handle, (NDIS_HANDLE) xi, 0,
    4.18 +  NdisMSetAttributesEx(xi->adapter_handle, (NDIS_HANDLE) xi, 0, 0 /* the last zero is to give the next | something to | with */
    4.19  #ifdef NDIS51_MINIPORT
    4.20 -    NDIS_ATTRIBUTE_USES_SAFE_BUFFER_APIS
    4.21 +    |NDIS_ATTRIBUTE_USES_SAFE_BUFFER_APIS
    4.22  #endif
    4.23      |NDIS_ATTRIBUTE_DESERIALIZE
    4.24      |NDIS_ATTRIBUTE_SURPRISE_REMOVE_OK
     5.1 --- a/xennet/xennet.inx	Mon Oct 11 19:48:20 2010 +1100
     5.2 +++ b/xennet/xennet.inx	Sat Oct 16 20:03:30 2010 +1100
     5.3 @@ -17,6 +17,9 @@ ExcludeFromSelect=*
     5.4  [XenGplPv.NT$ARCH$]
     5.5  %XenNet.DRVDESC%=XenNet_Inst, XEN\VIF
     5.6  
     5.7 +[XenGplPv]
     5.8 +%XenNet.DRVDESC%=XenNet_Inst, XEN\VIF
     5.9 +
    5.10  [XenNet_Inst.NT]
    5.11  CopyFiles=XenNet.CopyFiles
    5.12  Characteristics = 0x1 ; NCF_VIRTUAL
     6.1 --- a/xennet/xennet_rx.c	Mon Oct 11 19:48:20 2010 +1100
     6.2 +++ b/xennet/xennet_rx.c	Sat Oct 16 20:03:30 2010 +1100
     6.3 @@ -21,7 +21,9 @@ Foundation, Inc., 51 Franklin Street, Fi
     6.4  #include "xennet.h"
     6.5  
     6.6  /* Not really necessary but keeps PREfast happy */
     6.7 +#if (NTDDI_VERSION >= NTDDI_WINXP)
     6.8  static KDEFERRED_ROUTINE XenNet_RxBufferCheck;
     6.9 +#endif
    6.10  
    6.11  static __inline shared_buffer_t *
    6.12  get_pb_from_freelist(struct xennet_info *xi)
    6.13 @@ -904,7 +906,7 @@ XenNet_BufferAlloc(xennet_info_t *xi)
    6.14        NdisFreeMemory(xi->rx_pbs[i].virtual, PAGE_SIZE, 0);
    6.15        break;
    6.16      }
    6.17 -    xi->rx_pbs[i].offset = (ULONG_PTR)xi->rx_pbs[i].virtual & (PAGE_SIZE - 1);
    6.18 +    xi->rx_pbs[i].offset = (USHORT)(ULONG_PTR)xi->rx_pbs[i].virtual & (PAGE_SIZE - 1);
    6.19      NdisAllocateBuffer(&status, &xi->rx_pbs[i].buffer, xi->rx_buffer_pool, (PUCHAR)xi->rx_pbs[i].virtual, PAGE_SIZE);
    6.20      if (status != STATUS_SUCCESS)
    6.21      {
    6.22 @@ -989,7 +991,9 @@ XenNet_RxShutdown(xennet_info_t *xi)
    6.23    }
    6.24  
    6.25    KeRemoveQueueDpc(&xi->rx_dpc);
    6.26 +#if (NTDDI_VERSION >= NTDDI_WINXP)
    6.27    KeFlushQueuedDpcs();
    6.28 +#endif
    6.29  
    6.30    while (xi->rx_outstanding)
    6.31    {
     7.1 --- a/xennet/xennet_tx.c	Mon Oct 11 19:48:20 2010 +1100
     7.2 +++ b/xennet/xennet_tx.c	Sat Oct 16 20:03:30 2010 +1100
     7.3 @@ -21,7 +21,9 @@ Foundation, Inc., 51 Franklin Street, Fi
     7.4  #include "xennet.h"
     7.5  
     7.6  /* Not really necessary but keeps PREfast happy */
     7.7 +#if (NTDDI_VERSION >= NTDDI_WINXP)
     7.8  static KDEFERRED_ROUTINE XenNet_TxBufferGC;
     7.9 +#endif
    7.10  
    7.11  static USHORT
    7.12  get_id_from_freelist(struct xennet_info *xi)
    7.13 @@ -706,7 +708,9 @@ XenNet_TxShutdown(xennet_info_t *xi)
    7.14    }
    7.15  
    7.16    KeRemoveQueueDpc(&xi->tx_dpc);
    7.17 +#if (NTDDI_VERSION >= NTDDI_WINXP)
    7.18    KeFlushQueuedDpcs();
    7.19 +#endif
    7.20  
    7.21    /* Free packets in tx queue */
    7.22    entry = RemoveHeadList(&xi->tx_waiting_pkt_list);
     8.1 --- a/xenvbd/xenvbd.inx	Mon Oct 11 19:48:20 2010 +1100
     8.2 +++ b/xenvbd/xenvbd.inx	Sat Oct 16 20:03:30 2010 +1100
     8.3 @@ -17,6 +17,9 @@ ExcludeFromSelect=*
     8.4  [XenGplPv.NT$ARCH$]
     8.5  %XenVbd.DRVDESC%=XenVbd_Inst, XEN\VBD
     8.6  
     8.7 +[XenGplPv]
     8.8 +%XenVbd.DRVDESC%=XenVbd_Inst, XEN\VBD
     8.9 +
    8.10  [XenVbd_Inst.NT]
    8.11  CopyFiles=XenVbd.CopyFiles
    8.12