win-pvdrivers

changeset 244:d31884ed02a9

tweaked a few things to make crashes go away
author James Harper <james.harper@bendigoit.com.au>
date Wed Apr 02 00:21:09 2008 +1100 (2008-04-02)
parents a442e03960cf
children 1b1f26917b6f
files common.inc target/install.bat xennet/xennet_rx.c xennet/xennet_tx.c
line diff
     1.1 --- a/common.inc	Mon Mar 31 22:09:13 2008 +1100
     1.2 +++ b/common.inc	Wed Apr 02 00:21:09 2008 +1100
     1.3 @@ -1,4 +1,4 @@
     1.4 -VERSION=0.8.8.0
     1.5 +VERSION=0.8.8.4
     1.6  TARGETPATH=..\Target\$(DDK_TARGET_OS)
     1.7  KMDF_VERSION=1
     1.8  !IF $(_NT_TOOLS_VERSION) > 0x700
     2.1 --- a/target/install.bat	Mon Mar 31 22:09:13 2008 +1100
     2.2 +++ b/target/install.bat	Wed Apr 02 00:21:09 2008 +1100
     2.3 @@ -1,15 +1,15 @@
     2.4  @ECHO OFF
     2.5  
     2.6 -ver | find /I "Version 5.00." > nul
     2.7 +ver | find " 5.00." > nul
     2.8  if %ERRORLEVEL% == 0 goto ver_2k
     2.9  
    2.10 -ver | find /I "Version 5.1." > nul
    2.11 +ver | find " 5.1." > nul
    2.12  if %ERRORLEVEL% == 0 goto ver_xp
    2.13  
    2.14 -ver | find /I "Version 5.2." > nul
    2.15 +ver | find " 5.2." > nul
    2.16  if %ERRORLEVEL% == 0 goto ver_2k3
    2.17  
    2.18 -ver | find /I "Version 6.0." > nul
    2.19 +ver | find " 6.0." > nul
    2.20  if %ERRORLEVEL% == 0 goto ver_2k8
    2.21  
    2.22  echo No automatic install available or machine not supported.
     3.1 --- a/xennet/xennet_rx.c	Mon Mar 31 22:09:13 2008 +1100
     3.2 +++ b/xennet/xennet_rx.c	Wed Apr 02 00:21:09 2008 +1100
     3.3 @@ -114,7 +114,6 @@ XenNet_RxBufferAlloc(struct xennet_info 
     3.4      if (mdl == NULL)
     3.5      {
     3.6        KdPrint((__DRIVER_NAME "     Added %d out of %d buffers to rx ring\n", i, batch_target));
     3.7 -      KdPrint((__DRIVER_NAME "     (rx_outstanding = %d)\n", xi->rx_outstanding));
     3.8        break;
     3.9      }
    3.10      xi->rx_id_free--;
    3.11 @@ -622,8 +621,6 @@ XenNet_RxBufferCheck(struct xennet_info 
    3.12  #endif
    3.13    }
    3.14  
    3.15 -//  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ " (rx_outstanding = %d)\n", xi->rx_outstanding));
    3.16 -
    3.17  #if defined(XEN_PROFILE)
    3.18    ProfTime_RxBufferCheck.QuadPart += KeQueryPerformanceCounter(&dummy).QuadPart - tsc.QuadPart;
    3.19    ProfTime_RxBufferCheckBotHalf.QuadPart += KeQueryPerformanceCounter(&dummy).QuadPart - tsc2.QuadPart;
    3.20 @@ -665,8 +662,8 @@ XenNet_ReturnPacket(
    3.21      NdisUnchainBufferAtBack(Packet, &mdl);
    3.22    }
    3.23  
    3.24 +  NdisFreePacket(Packet);
    3.25    xi->rx_outstanding--;
    3.26 -  NdisFreePacket(Packet);
    3.27  
    3.28    KeReleaseSpinLockFromDpcLevel(&xi->rx_lock);
    3.29    
    3.30 @@ -748,6 +745,8 @@ XenNet_RxShutdown(xennet_info_t *xi)
    3.31    }
    3.32    xi->rx_pgs = NULL;
    3.33  
    3.34 +  ASSERT(xi->rx_outstanding == 0);
    3.35 +
    3.36    KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
    3.37  
    3.38    return TRUE;
     4.1 --- a/xennet/xennet_tx.c	Mon Mar 31 22:09:13 2008 +1100
     4.2 +++ b/xennet/xennet_tx.c	Wed Apr 02 00:21:09 2008 +1100
     4.3 @@ -180,7 +180,7 @@ XenNet_PutOnTxRing(
     4.4    unsigned short id;
     4.5  
     4.6    id = get_id_from_freelist(xi);
     4.7 -  /* TODO: check id against FREELIST_ID_ERROR */
     4.8 +  ASSERT(id != FREELIST_ID_ERROR);
     4.9    ASSERT(xi->tx_pkts[id] == NULL);
    4.10    tx = RING_GET_REQUEST(&xi->tx, xi->tx.req_prod_pvt);
    4.11  
    4.12 @@ -286,7 +286,6 @@ XenNet_HWSendPacket(struct xennet_info *
    4.13  
    4.14    /* only set the packet on the last buffer, clear more_data */
    4.15    ASSERT(tx);
    4.16 -  ASSERT(tx->id);
    4.17    xi->tx_pkts[tx->id] = packet;
    4.18    tx->flags &= ~NETTXF_more_data;
    4.19  
    4.20 @@ -316,7 +315,7 @@ XenNet_SendQueuedPackets(struct xennet_i
    4.21    /* if empty, the above returns head*, not NULL */
    4.22    while (entry != &xi->tx_waiting_pkt_list)
    4.23    {
    4.24 -    ASSERT(cycles++ < 256);
    4.25 +    ASSERT(cycles++ < 65536);
    4.26      //KdPrint((__DRIVER_NAME "     Packet ready to send\n"));
    4.27      packet = CONTAINING_RECORD(entry, NDIS_PACKET, MiniportReservedEx[sizeof(PVOID)]);
    4.28      success = XenNet_HWSendPacket(xi, packet);
    4.29 @@ -366,7 +365,7 @@ XenNet_TxBufferGC(struct xennet_info *xi
    4.30    KeAcquireSpinLockAtDpcLevel(&xi->tx_lock);
    4.31  
    4.32    do {
    4.33 -    ASSERT(cycles++ < 256);
    4.34 +    ASSERT(cycles++ < 65536);
    4.35      prod = xi->tx.sring->rsp_prod;
    4.36      KeMemoryBarrier(); /* Ensure we see responses up to 'rp'. */
    4.37  
    4.38 @@ -374,7 +373,7 @@ XenNet_TxBufferGC(struct xennet_info *xi
    4.39      {
    4.40        struct netif_tx_response *txrsp;
    4.41  
    4.42 -      ASSERT(cycles++ < 256);
    4.43 +      ASSERT(cycles++ < 65536);
    4.44  
    4.45        txrsp = RING_GET_RESPONSE(&xi->tx, cons);
    4.46        if (txrsp->status == NETIF_RSP_NULL)
    4.47 @@ -401,7 +400,6 @@ XenNet_TxBufferGC(struct xennet_info *xi
    4.48        put_gref_on_freelist(xi, xi->tx_grefs[id]);
    4.49        xi->tx_grefs[id] = 0;
    4.50        put_id_on_freelist(xi, id);
    4.51 -      xi->tx_outstanding--;
    4.52      }
    4.53  
    4.54      xi->tx.rsp_cons = prod;
    4.55 @@ -419,6 +417,7 @@ XenNet_TxBufferGC(struct xennet_info *xi
    4.56      /* A miniport driver must release any spin lock that it is holding before
    4.57         calling NdisMSendComplete. */
    4.58      NdisMSendComplete(xi->adapter_handle, packets[i], NDIS_STATUS_SUCCESS);
    4.59 +    xi->tx_outstanding--;
    4.60    }
    4.61  
    4.62  //  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
    4.63 @@ -579,6 +578,9 @@ XenNet_TxShutdown(xennet_info_t *xi)
    4.64       pages Dom0 still has access to */
    4.65    xi->tx_pgs = NULL;
    4.66  
    4.67 +  /* I think that NDIS takes care of this for us... */
    4.68 +  ASSERT(xi->tx_outstanding == 0);
    4.69 +
    4.70    for (i = 0; i < NET_TX_RING_SIZE; i++)
    4.71    {
    4.72      xi->XenInterface.GntTbl_PutRef(