win-pvdrivers

changeset 369:5a762fd1fba9

build xennet using mingw
author Andy Grover <andy.grover@oracle.com>
date Wed Jul 09 00:20:30 2008 -0700 (2008-07-09)
parents fa0a44a14fe3
children d76831a77d19
files xennet/makefile.mingw xennet/xennet.c xennet/xennet.h xennet/xennet_common.c xennet/xennet_oid.c xennet/xennet_rx.c xennet/xennet_tx.c
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/xennet/makefile.mingw	Wed Jul 09 00:20:30 2008 -0700
     1.3 @@ -0,0 +1,7 @@
     1.4 +W32API_PATH=/home/agrover/temp/w32api-3.11
     1.5 +
     1.6 +CFLAGS = -Wall -L$(W32API_PATH)/lib/ddk -I$(W32API_PATH)/include/ddk -I../common/include -I../common/include/public -Wno-multichar -Wno-unknown-pragmas
     1.7 +
     1.8 +xennet.sys: xennet.c xennet_oid.c xennet_tx.c xennet_rx.c xennet_common.c ../mingw/mingw_extras.c
     1.9 +	i586-mingw32msvc-gcc $(CFLAGS) -o $@ -s -shared -Wl,--entry,_load@8 -nostdlib $^ -lntoskrnl -lhal -lndis
    1.10 +
     2.1 --- a/xennet/xennet.c	Wed Jul 09 00:10:57 2008 -0700
     2.2 +++ b/xennet/xennet.c	Wed Jul 09 00:20:30 2008 -0700
     2.3 @@ -48,9 +48,72 @@ int ProfCount_RxPacketsTotal;
     2.4  int ProfCount_RxPacketsCsumOffload;
     2.5  int ProfCount_CallsToIndicateReceive;
     2.6  
     2.7 -/* This function copied from linux's lib/vsprintf.c, see it for attribution */
     2.8 -static unsigned long
     2.9 -simple_strtoul(const char *cp,char **endp,unsigned int base)
    2.10 +/* ----- BEGIN Other people's code --------- */
    2.11 +/* from linux/include/linux/ctype.h, used under GPLv2 */
    2.12 +#define _U      0x01    /* upper */
    2.13 +#define _L      0x02    /* lower */
    2.14 +#define _D      0x04    /* digit */
    2.15 +#define _C      0x08    /* cntrl */
    2.16 +#define _P      0x10    /* punct */
    2.17 +#define _S      0x20    /* white space (space/lf/tab) */
    2.18 +#define _X      0x40    /* hex digit */
    2.19 +#define _SP     0x80    /* hard space (0x20) */
    2.20 +
    2.21 +/* from linux/include/lib/ctype.c, used under GPLv2 */
    2.22 +unsigned char _ctype[] = {
    2.23 +_C,_C,_C,_C,_C,_C,_C,_C,                        /* 0-7 */
    2.24 +_C,_C|_S,_C|_S,_C|_S,_C|_S,_C|_S,_C,_C,         /* 8-15 */
    2.25 +_C,_C,_C,_C,_C,_C,_C,_C,                        /* 16-23 */
    2.26 +_C,_C,_C,_C,_C,_C,_C,_C,                        /* 24-31 */
    2.27 +_S|_SP,_P,_P,_P,_P,_P,_P,_P,                    /* 32-39 */
    2.28 +_P,_P,_P,_P,_P,_P,_P,_P,                        /* 40-47 */
    2.29 +_D,_D,_D,_D,_D,_D,_D,_D,                        /* 48-55 */
    2.30 +_D,_D,_P,_P,_P,_P,_P,_P,                        /* 56-63 */
    2.31 +_P,_U|_X,_U|_X,_U|_X,_U|_X,_U|_X,_U|_X,_U,      /* 64-71 */
    2.32 +_U,_U,_U,_U,_U,_U,_U,_U,                        /* 72-79 */
    2.33 +_U,_U,_U,_U,_U,_U,_U,_U,                        /* 80-87 */
    2.34 +_U,_U,_U,_P,_P,_P,_P,_P,                        /* 88-95 */
    2.35 +_P,_L|_X,_L|_X,_L|_X,_L|_X,_L|_X,_L|_X,_L,      /* 96-103 */
    2.36 +_L,_L,_L,_L,_L,_L,_L,_L,                        /* 104-111 */
    2.37 +_L,_L,_L,_L,_L,_L,_L,_L,                        /* 112-119 */
    2.38 +_L,_L,_L,_P,_P,_P,_P,_C,                        /* 120-127 */
    2.39 +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,                /* 128-143 */
    2.40 +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,                /* 144-159 */
    2.41 +_S|_SP,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,   /* 160-175 */
    2.42 +_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,       /* 176-191 */
    2.43 +_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,       /* 192-207 */
    2.44 +_U,_U,_U,_U,_U,_U,_U,_P,_U,_U,_U,_U,_U,_U,_U,_L,       /* 208-223 */
    2.45 +_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,       /* 224-239 */
    2.46 +_L,_L,_L,_L,_L,_L,_L,_P,_L,_L,_L,_L,_L,_L,_L,_L};      /* 240-255 */
    2.47 +
    2.48 +/* from linux/include/linux/ctype.h, used under GPLv2 */
    2.49 +#define __ismask(x) (_ctype[(int)(unsigned char)(x)])
    2.50 +
    2.51 +#define isalnum(c)      ((__ismask(c)&(_U|_L|_D)) != 0)
    2.52 +#define isalpha(c)      ((__ismask(c)&(_U|_L)) != 0)
    2.53 +#define iscntrl(c)      ((__ismask(c)&(_C)) != 0)
    2.54 +#define isdigit(c)      ((__ismask(c)&(_D)) != 0)
    2.55 +#define isgraph(c)      ((__ismask(c)&(_P|_U|_L|_D)) != 0)
    2.56 +#define islower(c)      ((__ismask(c)&(_L)) != 0)
    2.57 +#define isprint(c)      ((__ismask(c)&(_P|_U|_L|_D|_SP)) != 0)
    2.58 +#define ispunct(c)      ((__ismask(c)&(_P)) != 0)
    2.59 +#define isspace(c)      ((__ismask(c)&(_S)) != 0)
    2.60 +#define isupper(c)      ((__ismask(c)&(_U)) != 0)
    2.61 +#define isxdigit(c)     ((__ismask(c)&(_D|_X)) != 0)
    2.62 +
    2.63 +#define TOLOWER(x) ((x) | 0x20)
    2.64 +
    2.65 +/* from linux/lib/vsprintf.c, used under GPLv2 */
    2.66 +/* Copyright (C) 1991, 1992  Linus Torvalds
    2.67 + * Wirzenius wrote this portably, Torvalds fucked it up :-)
    2.68 + */
    2.69 +/**
    2.70 + * simple_strtoul - convert a string to an unsigned long
    2.71 + * @cp: The start of the string
    2.72 + * @endp: A pointer to the end of the parsed string will be placed here
    2.73 + * @base: The number base to use
    2.74 + */
    2.75 +unsigned long simple_strtoul(const char *cp,char **endp,unsigned int base)
    2.76  {
    2.77    unsigned long result = 0,value;
    2.78  
    2.79 @@ -59,28 +122,30 @@ simple_strtoul(const char *cp,char **end
    2.80      if (*cp == '0') {
    2.81        base = 8;
    2.82        cp++;
    2.83 -      if ((toupper(*cp) == 'X') && isxdigit(cp[1])) {
    2.84 +      if ((TOLOWER(*cp) == 'x') && isxdigit(cp[1])) {
    2.85          cp++;
    2.86          base = 16;
    2.87        }
    2.88      }
    2.89    } else if (base == 16) {
    2.90 -    if (cp[0] == '0' && toupper(cp[1]) == 'X')
    2.91 -    cp += 2;
    2.92 +    if (cp[0] == '0' && TOLOWER(cp[1]) == 'x')
    2.93 +      cp += 2;
    2.94    }
    2.95    while (isxdigit(*cp) &&
    2.96 -  (value = isdigit(*cp) ? *cp-'0' : toupper(*cp)-'A'+10) < base) {
    2.97 +    (value = isdigit(*cp) ? *cp-'0' : TOLOWER(*cp)-'a'+10) < base) {
    2.98      result = result*base + value;
    2.99      cp++;
   2.100    }
   2.101    if (endp)
   2.102 -  *endp = (char *)cp;
   2.103 +    *endp = (char *)cp;
   2.104    return result;
   2.105  }
   2.106 +/* end vsprintf.c code */
   2.107 +/* ----- END Other people's code --------- */
   2.108  
   2.109  // Called at DISPATCH_LEVEL
   2.110  
   2.111 -static VOID
   2.112 +static DDKAPI VOID
   2.113  XenNet_InterruptIsr(
   2.114    PBOOLEAN InterruptRecognized,
   2.115    PBOOLEAN QueueMiniportHandleInterrupt,
   2.116 @@ -96,7 +161,7 @@ XenNet_InterruptIsr(
   2.117    //KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
   2.118  }
   2.119  
   2.120 -static VOID
   2.121 +static DDKAPI VOID
   2.122  XenNet_InterruptDpc(NDIS_HANDLE  MiniportAdapterContext)
   2.123  {
   2.124    struct xennet_info *xi = MiniportAdapterContext;
   2.125 @@ -121,7 +186,7 @@ XenNet_ConnectBackend(struct xennet_info
   2.126    ASSERT(KeGetCurrentIrql() < DISPATCH_LEVEL);
   2.127  
   2.128    ptr = xi->config_page;
   2.129 -  while((type = GET_XEN_INIT_RSP(&ptr, &setting, &value)) != XEN_INIT_TYPE_END)
   2.130 +  while((type = GET_XEN_INIT_RSP(&ptr, (PVOID)&setting, (PVOID)&value)) != XEN_INIT_TYPE_END)
   2.131    {
   2.132      switch(type)
   2.133      {
   2.134 @@ -150,7 +215,7 @@ XenNet_ConnectBackend(struct xennet_info
   2.135          char *s, *e;
   2.136          s = value;
   2.137          for (i = 0; i < ETH_ALEN; i++) {
   2.138 -          xi->perm_mac_addr[i] = (UINT8)simple_strtoul(s, &e, 16);
   2.139 +          xi->perm_mac_addr[i] = (uint8_t)simple_strtoul(s, &e, 16);
   2.140            if ((s == e) || (*e != ((i == ETH_ALEN-1) ? '\0' : ':'))) {
   2.141              KdPrint((__DRIVER_NAME "Error parsing MAC address\n"));
   2.142            }
   2.143 @@ -167,7 +232,7 @@ XenNet_ConnectBackend(struct xennet_info
   2.144          KdPrint((__DRIVER_NAME "     vectors mismatch (magic = %08x, length = %d)\n",
   2.145            ((PXENPCI_VECTORS)value)->magic, ((PXENPCI_VECTORS)value)->length));
   2.146          KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
   2.147 -        return NDIS_ERROR_CODE_ADAPTER_NOT_FOUND;
   2.148 +        return NDIS_STATUS_ADAPTER_NOT_FOUND;
   2.149        }
   2.150        else
   2.151          memcpy(&xi->vectors, value, sizeof(XENPCI_VECTORS));
   2.152 @@ -184,7 +249,7 @@ XenNet_ConnectBackend(struct xennet_info
   2.153    return NDIS_STATUS_SUCCESS;
   2.154  }
   2.155  
   2.156 -static VOID
   2.157 +static DDKAPI VOID
   2.158  XenNet_Resume(PDEVICE_OBJECT device_object, PVOID context)
   2.159  {
   2.160    struct xennet_info *xi = context;
   2.161 @@ -200,7 +265,7 @@ XenNet_Resume(PDEVICE_OBJECT device_obje
   2.162    NdisMSetPeriodicTimer(&xi->resume_timer, 100);
   2.163  }
   2.164  
   2.165 -static VOID 
   2.166 +static DDKAPI VOID 
   2.167  XenResumeCheck_Timer(
   2.168   PVOID SystemSpecific1,
   2.169   PVOID FunctionContext,
   2.170 @@ -225,7 +290,7 @@ XenResumeCheck_Timer(
   2.171  }
   2.172  
   2.173  // Called at <= DISPATCH_LEVEL
   2.174 -static NDIS_STATUS
   2.175 +static DDKAPI NDIS_STATUS
   2.176  XenNet_Init(
   2.177    OUT PNDIS_STATUS OpenErrorStatus,
   2.178    OUT PUINT SelectedMediumIndex,
   2.179 @@ -275,7 +340,7 @@ XenNet_Init(
   2.180    *SelectedMediumIndex = i;
   2.181  
   2.182    /* Alloc memory for adapter private info */
   2.183 -  status = NdisAllocateMemoryWithTag(&xi, sizeof(*xi), XENNET_POOL_TAG);
   2.184 +  status = NdisAllocateMemoryWithTag((PVOID)&xi, sizeof(*xi), XENNET_POOL_TAG);
   2.185    if (!NT_SUCCESS(status))
   2.186    {
   2.187      KdPrint(("NdisAllocateMemoryWithTag failed with 0x%x\n", status));
   2.188 @@ -295,18 +360,18 @@ XenNet_Init(
   2.189    NdisMQueryAdapterResources(&status, WrapperConfigurationContext,
   2.190      NULL, (PUINT)&nrl_length);
   2.191    KdPrint((__DRIVER_NAME "     nrl_length = %d\n", nrl_length));
   2.192 -  status = NdisAllocateMemoryWithTag(&nrl, nrl_length, XENNET_POOL_TAG);
   2.193 +  status = NdisAllocateMemoryWithTag((PVOID)&nrl, nrl_length, XENNET_POOL_TAG);
   2.194    if (status != NDIS_STATUS_SUCCESS)
   2.195    {
   2.196      KdPrint((__DRIVER_NAME "     Could not get allocate memory for Adapter Resources 0x%x\n", status));
   2.197 -    return NDIS_ERROR_CODE_ADAPTER_NOT_FOUND;
   2.198 +    return NDIS_STATUS_RESOURCES;
   2.199    }
   2.200    NdisMQueryAdapterResources(&status, WrapperConfigurationContext,
   2.201      nrl, (PUINT)&nrl_length);
   2.202    if (status != NDIS_STATUS_SUCCESS)
   2.203    {
   2.204      KdPrint((__DRIVER_NAME "     Could not get Adapter Resources 0x%x\n", status));
   2.205 -    return NDIS_ERROR_CODE_ADAPTER_NOT_FOUND;
   2.206 +    return NDIS_STATUS_RESOURCES;
   2.207    }
   2.208    xi->event_channel = 0;
   2.209    xi->config_csum = 1;
   2.210 @@ -380,7 +445,7 @@ XenNet_Init(
   2.211    }
   2.212  
   2.213    ptr = xi->config_page;
   2.214 -  while((type = GET_XEN_INIT_RSP(&ptr, &setting, &value)) != XEN_INIT_TYPE_END)
   2.215 +  while((type = GET_XEN_INIT_RSP(&ptr, (PVOID)&setting, (PVOID)&value)) != XEN_INIT_TYPE_END)
   2.216    {
   2.217      switch(type)
   2.218      {
   2.219 @@ -392,7 +457,7 @@ XenNet_Init(
   2.220          KdPrint((__DRIVER_NAME "     vectors mismatch (magic = %08x, length = %d)\n",
   2.221            ((PXENPCI_VECTORS)value)->magic, ((PXENPCI_VECTORS)value)->length));
   2.222          KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
   2.223 -        return NDIS_ERROR_CODE_ADAPTER_NOT_FOUND;
   2.224 +        return NDIS_STATUS_FAILURE;
   2.225        }
   2.226        else
   2.227          memcpy(&xi->vectors, value, sizeof(XENPCI_VECTORS));
   2.228 @@ -485,7 +550,7 @@ XenNet_Init(
   2.229    ADD_XEN_INIT_REQ(&ptr, XEN_INIT_TYPE_READ_STRING_BACK, "mac", NULL);
   2.230    RtlStringCbPrintfA(buf, ARRAY_SIZE(buf), "%d", !xi->config_csum);
   2.231    ADD_XEN_INIT_REQ(&ptr, XEN_INIT_TYPE_WRITE_STRING, "feature-no-csum-offload", buf);
   2.232 -  RtlStringCbPrintfA(buf, ARRAY_SIZE(buf), "%d", xi->config_sg);
   2.233 +  RtlStringCbPrintfA(buf, ARRAY_SIZE(buf), "%d", (int)xi->config_sg);
   2.234    ADD_XEN_INIT_REQ(&ptr, XEN_INIT_TYPE_WRITE_STRING, "feature-sg", buf);
   2.235    RtlStringCbPrintfA(buf, ARRAY_SIZE(buf), "%d", !!xi->config_gso);
   2.236    ADD_XEN_INIT_REQ(&ptr, XEN_INIT_TYPE_WRITE_STRING, "feature-gso-tcpv4", buf);
   2.237 @@ -547,7 +612,7 @@ XenNet_PnPEventNotify(
   2.238  }
   2.239  
   2.240  /* Called when machine is shutting down, so just quiesce the HW and be done fast. */
   2.241 -VOID
   2.242 +VOID DDKAPI
   2.243  XenNet_Shutdown(
   2.244    IN NDIS_HANDLE MiniportAdapterContext
   2.245    )
   2.246 @@ -560,7 +625,7 @@ XenNet_Shutdown(
   2.247  }
   2.248  
   2.249  /* Opposite of XenNet_Init */
   2.250 -VOID
   2.251 +VOID DDKAPI
   2.252  XenNet_Halt(
   2.253    IN NDIS_HANDLE MiniportAdapterContext
   2.254    )
     3.1 --- a/xennet/xennet.h	Wed Jul 09 00:10:57 2008 -0700
     3.2 +++ b/xennet/xennet.h	Wed Jul 09 00:20:30 2008 -0700
     3.3 @@ -21,9 +21,16 @@ Foundation, Inc., 51 Franklin Street, Fi
     3.4  #pragma warning(disable: 4201)
     3.5  #pragma warning(disable: 4214)
     3.6  
     3.7 +#ifdef __MINGW32__
     3.8 +#include <ntddk.h>
     3.9 +#define NDIS50_MINIPORT 1
    3.10 +#include <ndis.h>
    3.11 +#include "../mingw/mingw_extras.h"
    3.12 +
    3.13 +#else
    3.14 +#define DDKAPI
    3.15  #include <ntddk.h>
    3.16  #include <wdm.h>
    3.17 -
    3.18  #define NDIS_MINIPORT_DRIVER
    3.19  #if NTDDI_VERSION < NTDDI_WINXP
    3.20  # define NDIS50_MINIPORT 1
    3.21 @@ -31,9 +38,9 @@ Foundation, Inc., 51 Franklin Street, Fi
    3.22  # define NDIS51_MINIPORT 1
    3.23  #endif
    3.24  #include <ndis.h>
    3.25 -
    3.26  #define NTSTRSAFE_LIB
    3.27  #include <ntstrsafe.h>
    3.28 +#endif
    3.29  
    3.30  
    3.31  #define __DRIVER_NAME "XenNet"
    3.32 @@ -165,8 +172,8 @@ struct xennet_info
    3.33    NDIS_MINIPORT_INTERRUPT interrupt;
    3.34    ULONG packet_filter;
    3.35    int connected;
    3.36 -  UINT8 perm_mac_addr[ETH_ALEN];
    3.37 -  UINT8 curr_mac_addr[ETH_ALEN];
    3.38 +  uint8_t perm_mac_addr[ETH_ALEN];
    3.39 +  uint8_t curr_mac_addr[ETH_ALEN];
    3.40  
    3.41    /* Misc. Xen vars */
    3.42    XENPCI_VECTORS vectors;
    3.43 @@ -265,7 +272,7 @@ extern int ProfCount_CallsToIndicateRece
    3.44  NDIS_STATUS
    3.45  XenNet_RxBufferCheck(struct xennet_info *xi);
    3.46  
    3.47 -VOID
    3.48 +VOID DDKAPI
    3.49  XenNet_ReturnPacket(
    3.50    IN NDIS_HANDLE MiniportAdapterContext,
    3.51    IN PNDIS_PACKET Packet
    3.52 @@ -292,7 +299,7 @@ XenNet_TxResumeStart(xennet_info_t *xi);
    3.53  VOID
    3.54  XenNet_TxResumeEnd(xennet_info_t *xi);
    3.55  
    3.56 -VOID
    3.57 +VOID DDKAPI
    3.58  XenNet_SendPackets(
    3.59    IN NDIS_HANDLE MiniportAdapterContext,
    3.60    IN PPNDIS_PACKET PacketArray,
    3.61 @@ -305,7 +312,7 @@ XenNet_TxInit(xennet_info_t *xi);
    3.62  BOOLEAN
    3.63  XenNet_TxShutdown(xennet_info_t *xi);
    3.64  
    3.65 -NDIS_STATUS 
    3.66 +NDIS_STATUS DDKAPI
    3.67  XenNet_QueryInformation(
    3.68    IN NDIS_HANDLE MiniportAdapterContext,
    3.69    IN NDIS_OID Oid,
    3.70 @@ -314,7 +321,7 @@ XenNet_QueryInformation(
    3.71    OUT PULONG BytesWritten,
    3.72    OUT PULONG BytesNeeded);
    3.73  
    3.74 -NDIS_STATUS 
    3.75 +NDIS_STATUS DDKAPI
    3.76  XenNet_SetInformation(
    3.77    IN NDIS_HANDLE MiniportAdapterContext,
    3.78    IN NDIS_OID Oid,
     4.1 --- a/xennet/xennet_common.c	Wed Jul 09 00:10:57 2008 -0700
     4.2 +++ b/xennet/xennet_common.c	Wed Jul 09 00:20:30 2008 -0700
     4.3 @@ -31,7 +31,7 @@ XenNet_ParsePacketHeader(
     4.4  
     4.5    ASSERT(pi->mdls[0]);
     4.6    
     4.7 -  NdisQueryBufferSafe(pi->mdls[0], &pi->header, &header_length, NormalPagePriority);
     4.8 +  NdisQueryBufferSafe(pi->mdls[0], (PVOID) &pi->header, &header_length, NormalPagePriority);
     4.9  
    4.10  // what about if the buffer isn't completely on one page???
    4.11    if (ADDRESS_AND_SIZE_TO_SPAN_PAGES(MmGetMdlVirtualAddress(pi->mdls[0]), header_length) != 1)
    4.12 @@ -144,7 +144,7 @@ XenNet_GetData(
    4.13  }
    4.14  
    4.15  /* Called at DISPATCH LEVEL */
    4.16 -static VOID 
    4.17 +static VOID DDKAPI
    4.18  XenFreelist_Timer(
    4.19    PVOID SystemSpecific1,
    4.20    PVOID FunctionContext,
     5.1 --- a/xennet/xennet_oid.c	Wed Jul 09 00:10:57 2008 -0700
     5.2 +++ b/xennet/xennet_oid.c	Wed Jul 09 00:20:30 2008 -0700
     5.3 @@ -68,7 +68,7 @@ NDIS_OID supported_oids[] =
     5.4      len = 8; \
     5.5      } }
     5.6  
     5.7 -NDIS_STATUS 
     5.8 +NDIS_STATUS DDKAPI
     5.9  XenNet_QueryInformation(
    5.10    IN NDIS_HANDLE MiniportAdapterContext,
    5.11    IN NDIS_OID Oid,
    5.12 @@ -377,7 +377,7 @@ XenNet_QueryInformation(
    5.13    return status;
    5.14  }
    5.15  
    5.16 -NDIS_STATUS 
    5.17 +NDIS_STATUS DDKAPI
    5.18  XenNet_SetInformation(
    5.19    IN NDIS_HANDLE MiniportAdapterContext,
    5.20    IN NDIS_OID Oid,
     6.1 --- a/xennet/xennet_rx.c	Wed Jul 09 00:10:57 2008 -0700
     6.2 +++ b/xennet/xennet_rx.c	Wed Jul 09 00:20:30 2008 -0700
     6.3 @@ -161,7 +161,7 @@ XenNet_SumPacketData(
     6.4          KdPrint((__DRIVER_NAME "     Ran out of buffers\n"));
     6.5          return;
     6.6        }
     6.7 -      NdisQueryBufferSafe(mdl, &buffer, &buffer_length, NormalPagePriority);
     6.8 +      NdisQueryBufferSafe(mdl, (PVOID) &buffer, &buffer_length, NormalPagePriority);
     6.9        csum += ((USHORT)buffer[0]);
    6.10        buffer_offset = (USHORT)-1;
    6.11      }
    6.12 @@ -176,7 +176,7 @@ XenNet_SumPacketData(
    6.13            KdPrint((__DRIVER_NAME "     Ran out of buffers\n"));
    6.14            return;
    6.15          }
    6.16 -        NdisQueryBufferSafe(mdl, &buffer, &buffer_length, NormalPagePriority);
    6.17 +        NdisQueryBufferSafe(mdl, (PVOID) &buffer, &buffer_length, NormalPagePriority);
    6.18          buffer_offset = 0;
    6.19        }
    6.20        csum += GET_NET_USHORT(buffer[buffer_offset]);
    6.21 @@ -473,7 +473,7 @@ XenNet_RxBufferCheck(struct xennet_info 
    6.22  
    6.23  /* called at DISPATCH_LEVEL */
    6.24  /* it's okay for return packet to be called while resume_state != RUNNING as the packet will simply be added back to the freelist, the grants will be fixed later */
    6.25 -VOID
    6.26 +VOID DDKAPI
    6.27  XenNet_ReturnPacket(
    6.28    IN NDIS_HANDLE MiniportAdapterContext,
    6.29    IN PNDIS_PACKET Packet
     7.1 --- a/xennet/xennet_tx.c	Wed Jul 09 00:10:57 2008 -0700
     7.2 +++ b/xennet/xennet_tx.c	Wed Jul 09 00:20:30 2008 -0700
     7.3 @@ -350,7 +350,7 @@ XenNet_TxBufferGC(struct xennet_info *xi
     7.4  }
     7.5  
     7.6  // called at <= DISPATCH_LEVEL
     7.7 -VOID
     7.8 +VOID DDKAPI
     7.9  XenNet_SendPackets(
    7.10    IN NDIS_HANDLE MiniportAdapterContext,
    7.11    IN PPNDIS_PACKET PacketArray,