win-pvdrivers

diff xennet/xennet_tx.c @ 1023:1ce315b193d1

Change all NT_ASSERT to XN_ASSERT
author James Harper <james.harper@bendigoit.com.au>
date Tue Feb 19 15:12:35 2013 +1100 (2013-02-19)
parents c21a4feb4a27
children 00d29add6a2a
line diff
     1.1 --- a/xennet/xennet_tx.c	Tue Feb 19 15:11:49 2013 +1100
     1.2 +++ b/xennet/xennet_tx.c	Tue Feb 19 15:12:35 2013 +1100
     1.3 @@ -24,7 +24,7 @@ Foundation, Inc., 51 Franklin Street, Fi
     1.4  static USHORT
     1.5  get_id_from_freelist(struct xennet_info *xi)
     1.6  {
     1.7 -  NT_ASSERT(xi->tx_id_free);
     1.8 +  XN_ASSERT(xi->tx_id_free);
     1.9    xi->tx_id_free--;
    1.10  
    1.11    return xi->tx_id_list[xi->tx_id_free];
    1.12 @@ -47,15 +47,15 @@ XenNet_PutCbOnRing(struct xennet_info *x
    1.13    xi->tx_ring.req_prod_pvt++;
    1.14    xi->tx_ring_free--;
    1.15    tx->id = get_id_from_freelist(xi);
    1.16 -  NT_ASSERT(xi->tx_shadows[tx->id].gref == INVALID_GRANT_REF);
    1.17 -  NT_ASSERT(!xi->tx_shadows[tx->id].cb);
    1.18 +  XN_ASSERT(xi->tx_shadows[tx->id].gref == INVALID_GRANT_REF);
    1.19 +  XN_ASSERT(!xi->tx_shadows[tx->id].cb);
    1.20    xi->tx_shadows[tx->id].cb = coalesce_buf;
    1.21    tx->gref = XnGrantAccess(xi->handle, (ULONG)(MmGetPhysicalAddress(coalesce_buf).QuadPart >> PAGE_SHIFT), FALSE, gref, (ULONG)'XNTX');
    1.22    xi->tx_shadows[tx->id].gref = tx->gref;
    1.23    tx->offset = 0;
    1.24    tx->size = (USHORT)length;
    1.25 -  NT_ASSERT(tx->offset + tx->size <= PAGE_SIZE);
    1.26 -  NT_ASSERT(tx->size);
    1.27 +  XN_ASSERT(tx->offset + tx->size <= PAGE_SIZE);
    1.28 +  XN_ASSERT(tx->size);
    1.29    return tx;
    1.30  }
    1.31  
    1.32 @@ -228,7 +228,7 @@ XenNet_HWSendPacket(struct xennet_info *
    1.33  
    1.34    /* (A) */
    1.35    tx0 = XenNet_PutCbOnRing(xi, coalesce_buf, pi.header_length, gref);
    1.36 -  NT_ASSERT(tx0); /* this will never happen */
    1.37 +  XN_ASSERT(tx0); /* this will never happen */
    1.38    tx0->flags = flags;
    1.39    tx_length += pi.header_length;
    1.40  
    1.41 @@ -246,7 +246,7 @@ XenNet_HWSendPacket(struct xennet_info *
    1.42  
    1.43    /* (B) */
    1.44    if (xen_gso) {
    1.45 -    NT_ASSERT(flags & NETTXF_extra_info);
    1.46 +    XN_ASSERT(flags & NETTXF_extra_info);
    1.47      ei = (struct netif_extra_info *)RING_GET_REQUEST(&xi->tx_ring, xi->tx_ring.req_prod_pvt);
    1.48      //KdPrint((__DRIVER_NAME "     pos = %d\n", xi->tx_ring.req_prod_pvt));
    1.49      xi->tx_ring.req_prod_pvt++;
    1.50 @@ -259,7 +259,7 @@ XenNet_HWSendPacket(struct xennet_info *
    1.51      ei->u.gso.features = 0;
    1.52    }
    1.53  
    1.54 -  NT_ASSERT(xi->current_sg_supported || !remaining);
    1.55 +  XN_ASSERT(xi->current_sg_supported || !remaining);
    1.56    
    1.57    /* (C) - only if data is remaining */
    1.58    coalesce_buf = NULL;
    1.59 @@ -267,7 +267,7 @@ XenNet_HWSendPacket(struct xennet_info *
    1.60      ULONG length;
    1.61      PFN_NUMBER pfn;
    1.62  
    1.63 -    NT_ASSERT(pi.curr_mdl);
    1.64 +    XN_ASSERT(pi.curr_mdl);
    1.65      if (coalesce_required) {
    1.66        PVOID va;
    1.67        if (!coalesce_buf) {
    1.68 @@ -306,7 +306,7 @@ XenNet_HWSendPacket(struct xennet_info *
    1.69      if (coalesce_buf) {
    1.70        if (remaining) {
    1.71          txN = XenNet_PutCbOnRing(xi, coalesce_buf, min(PAGE_SIZE, remaining), gref);
    1.72 -        NT_ASSERT(txN);
    1.73 +        XN_ASSERT(txN);
    1.74          coalesce_buf = NULL;
    1.75          tx_length += min(PAGE_SIZE, remaining);
    1.76          remaining -= min(PAGE_SIZE, remaining);
    1.77 @@ -323,18 +323,18 @@ XenNet_HWSendPacket(struct xennet_info *
    1.78        xi->tx_ring.req_prod_pvt++;
    1.79        xi->tx_ring_free--;
    1.80        txN->id = get_id_from_freelist(xi);
    1.81 -      NT_ASSERT(!xi->tx_shadows[txN->id].cb);
    1.82 +      XN_ASSERT(!xi->tx_shadows[txN->id].cb);
    1.83        offset = MmGetMdlByteOffset(pi.curr_mdl) + pi.curr_mdl_offset;
    1.84        pfn = MmGetMdlPfnArray(pi.curr_mdl)[offset >> PAGE_SHIFT];
    1.85        txN->offset = (USHORT)offset & (PAGE_SIZE - 1);
    1.86        txN->gref = XnGrantAccess(xi->handle, (ULONG)pfn, FALSE, gref, (ULONG)'XNTX');
    1.87 -      NT_ASSERT(xi->tx_shadows[txN->id].gref == INVALID_GRANT_REF);
    1.88 +      XN_ASSERT(xi->tx_shadows[txN->id].gref == INVALID_GRANT_REF);
    1.89        xi->tx_shadows[txN->id].gref = txN->gref;
    1.90        //ASSERT(sg->Elements[sg_element].Length > sg_offset);
    1.91        txN->size = (USHORT)length;
    1.92 -      NT_ASSERT(txN->offset + txN->size <= PAGE_SIZE);
    1.93 -      NT_ASSERT(txN->size);
    1.94 -      NT_ASSERT(txN->gref != INVALID_GRANT_REF);
    1.95 +      XN_ASSERT(txN->offset + txN->size <= PAGE_SIZE);
    1.96 +      XN_ASSERT(txN->size);
    1.97 +      XN_ASSERT(txN->gref != INVALID_GRANT_REF);
    1.98        remaining -= length;
    1.99        tx_length += length;
   1.100      }
   1.101 @@ -343,8 +343,8 @@ XenNet_HWSendPacket(struct xennet_info *
   1.102      XenNet_EatData(&pi, length);
   1.103    }
   1.104    txN->flags &= ~NETTXF_more_data;
   1.105 -  NT_ASSERT(tx0->size == pi.total_length);
   1.106 -  NT_ASSERT(!xi->tx_shadows[txN->id].packet);
   1.107 +  XN_ASSERT(tx0->size == pi.total_length);
   1.108 +  XN_ASSERT(!xi->tx_shadows[txN->id].packet);
   1.109    xi->tx_shadows[txN->id].packet = packet;
   1.110  
   1.111    #if NTDDI_VERSION < NTDDI_VISTA
   1.112 @@ -414,7 +414,7 @@ XenNet_TxBufferGC(struct xennet_info *xi
   1.113    #endif
   1.114    ULONG tx_packets = 0;
   1.115  
   1.116 -  NT_ASSERT(KeGetCurrentIrql() == DISPATCH_LEVEL);
   1.117 +  XN_ASSERT(KeGetCurrentIrql() == DISPATCH_LEVEL);
   1.118  
   1.119    KeAcquireSpinLockAtDpcLevel(&xi->tx_lock);
   1.120  
   1.121 @@ -570,7 +570,7 @@ XenNet_SendPackets(NDIS_HANDLE MiniportA
   1.122  
   1.123    for (i = 0; i < NumberOfPackets; i++) {
   1.124      packet = PacketArray[i];
   1.125 -    ASSERT(packet);
   1.126 +    XN_ASSERT(packet);
   1.127      entry = &PACKET_LIST_ENTRY(packet);
   1.128      InsertTailList(&xi->tx_waiting_pkt_list, entry);
   1.129    }