win-pvdrivers

changeset 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 cd72cd0e1c19
children 53d89db72d24
files xennet/xennet_common.c xennet/xennet_rx.c xennet/xennet_tx.c
line diff
     1.1 --- a/xennet/xennet_common.c	Tue Feb 19 15:11:49 2013 +1100
     1.2 +++ b/xennet/xennet_common.c	Tue Feb 19 15:12:35 2013 +1100
     1.3 @@ -73,7 +73,7 @@ XenNet_BuildHeader(packet_info_t *pi, PU
     1.4    while (bytes_remaining && pi->curr_mdl) {
     1.5      ULONG copy_size;
     1.6      
     1.7 -    ASSERT(pi->curr_mdl);
     1.8 +    XN_ASSERT(pi->curr_mdl);
     1.9      //KdPrint((__DRIVER_NAME "     B bytes_remaining = %d, pi->curr_mdl = %p\n", bytes_remaining, pi->curr_mdl));
    1.10      if (MmGetMdlByteCount(pi->curr_mdl)) {
    1.11        PUCHAR src_addr;
    1.12 @@ -116,7 +116,7 @@ XenNet_ParsePacketHeader(packet_info_t *
    1.13  {
    1.14    //FUNCTION_ENTER();
    1.15  
    1.16 -  ASSERT(pi->first_mdl);
    1.17 +  XN_ASSERT(pi->first_mdl);
    1.18    
    1.19    #if NTDDI_VERSION < NTDDI_VISTA
    1.20    NdisQueryBufferSafe(pi->first_mdl, (PVOID)&pi->first_mdl_virtual, &pi->first_mdl_length, NormalPagePriority);
    1.21 @@ -245,8 +245,8 @@ XenNet_CheckIpHeaderSum(PUCHAR header, U
    1.22    ULONG csum = 0;
    1.23    USHORT i;
    1.24  
    1.25 -  ASSERT(ip4_header_length > 12);
    1.26 -  ASSERT(!(ip4_header_length & 1));
    1.27 +  XN_ASSERT(ip4_header_length > 12);
    1.28 +  XN_ASSERT(!(ip4_header_length & 1));
    1.29  
    1.30    for (i = 0; i < ip4_header_length; i += 2) {
    1.31      csum += GET_NET_PUSHORT(&header[XN_HDR_SIZE + i]);
    1.32 @@ -261,8 +261,8 @@ XenNet_SumIpHeader(PUCHAR header, USHORT
    1.33    ULONG csum = 0;
    1.34    USHORT i;
    1.35  
    1.36 -  ASSERT(ip4_header_length > 12);
    1.37 -  ASSERT(!(ip4_header_length & 1));
    1.38 +  XN_ASSERT(ip4_header_length > 12);
    1.39 +  XN_ASSERT(!(ip4_header_length & 1));
    1.40  
    1.41    header[XN_HDR_SIZE + 10] = 0;
    1.42    header[XN_HDR_SIZE + 11] = 0;
     2.1 --- a/xennet/xennet_rx.c	Tue Feb 19 15:11:49 2013 +1100
     2.2 +++ b/xennet/xennet_rx.c	Tue Feb 19 15:12:35 2013 +1100
     2.3 @@ -131,7 +131,7 @@ get_hb_from_freelist(struct xennet_info 
     2.4  static __inline VOID
     2.5  put_hb_on_freelist(struct xennet_info *xi, shared_buffer_t *hb)
     2.6  {
     2.7 -  NT_ASSERT(xi);
     2.8 +  XN_ASSERT(xi);
     2.9    hb->mdl->ByteCount = sizeof(shared_buffer_t) + MAX_ETH_HEADER_LENGTH + MAX_LOOKAHEAD_LENGTH;
    2.10    hb->mdl->Next = NULL;
    2.11    hb->next = NULL;
    2.12 @@ -172,12 +172,12 @@ XenNet_FillRing(struct xennet_info *xi)
    2.13  
    2.14      /* Give to netback */
    2.15      id = (USHORT)((req_prod + i) & (NET_RX_RING_SIZE - 1));
    2.16 -    NT_ASSERT(xi->rx_ring_pbs[id] == NULL);
    2.17 +    XN_ASSERT(xi->rx_ring_pbs[id] == NULL);
    2.18      xi->rx_ring_pbs[id] = page_buf;
    2.19      req = RING_GET_REQUEST(&xi->rx_ring, req_prod + i);
    2.20      req->id = id;
    2.21      req->gref = page_buf->gref;
    2.22 -    NT_ASSERT(req->gref != INVALID_GRANT_REF);
    2.23 +    XN_ASSERT(req->gref != INVALID_GRANT_REF);
    2.24    }
    2.25    KeMemoryBarrier();
    2.26    xi->rx_ring.req_prod_pvt = req_prod + i;
    2.27 @@ -239,7 +239,7 @@ XenNet_SumPacketData(
    2.28      FUNCTION_MSG("NdisGetFirstBufferFromPacketSafe failed, buffer == NULL\n");
    2.29      return FALSE;
    2.30    }
    2.31 -  ASSERT(mdl);
    2.32 +  XN_ASSERT(mdl);
    2.33  
    2.34    ip4_length = GET_NET_PUSHORT(&buffer[XN_HDR_SIZE + 2]);
    2.35    data_length = ip4_length + XN_HDR_SIZE;
    2.36 @@ -251,11 +251,11 @@ XenNet_SumPacketData(
    2.37  
    2.38    switch (pi->ip_proto) {
    2.39    case 6:
    2.40 -    ASSERT(buffer_length >= (USHORT)(XN_HDR_SIZE + pi->ip4_header_length + 17));
    2.41 +    XN_ASSERT(buffer_length >= (USHORT)(XN_HDR_SIZE + pi->ip4_header_length + 17));
    2.42      csum_ptr = (USHORT *)&buffer[XN_HDR_SIZE + pi->ip4_header_length + 16];
    2.43      break;
    2.44    case 17:
    2.45 -    ASSERT(buffer_length >= (USHORT)(XN_HDR_SIZE + pi->ip4_header_length + 7));
    2.46 +    XN_ASSERT(buffer_length >= (USHORT)(XN_HDR_SIZE + pi->ip4_header_length + 7));
    2.47      csum_ptr = (USHORT *)&buffer[XN_HDR_SIZE + pi->ip4_header_length + 6];
    2.48      break;
    2.49    default:
    2.50 @@ -288,7 +288,7 @@ XenNet_SumPacketData(
    2.51      }
    2.52      if (csum_span) {
    2.53        /* the other half of the next bit */
    2.54 -      ASSERT(buffer_offset == 0);
    2.55 +      XN_ASSERT(buffer_offset == 0);
    2.56        csum += (USHORT)buffer[buffer_offset];
    2.57        csum_span = FALSE;
    2.58        i += 1;
    2.59 @@ -311,7 +311,7 @@ XenNet_SumPacketData(
    2.60          return FALSE; // should never happen
    2.61        }
    2.62        NdisQueryBufferSafe(mdl, &buffer, &buffer_length, NormalPagePriority);
    2.63 -      ASSERT(buffer_length);
    2.64 +      XN_ASSERT(buffer_length);
    2.65        buffer_offset = 0;
    2.66      }
    2.67    }
    2.68 @@ -393,7 +393,7 @@ XenNet_MakePacket(struct xennet_info *xi
    2.69      #endif
    2.70      ref_pb(xi, pi->first_pb);
    2.71    } else {
    2.72 -    NT_ASSERT(ndis_os_minor_version >= 1);
    2.73 +    XN_ASSERT(ndis_os_minor_version >= 1);
    2.74      header_buf = get_hb_from_freelist(xi);
    2.75      if (!header_buf) {
    2.76        FUNCTION_MSG("No free header buffers\n");
    2.77 @@ -414,7 +414,7 @@ XenNet_MakePacket(struct xennet_info *xi
    2.78      /* make sure only the header is in the first buffer (or the entire packet, but that is done in the above case) */
    2.79      XenNet_BuildHeader(pi, header_va, MAX_ETH_HEADER_LENGTH + pi->ip4_header_length + pi->tcp_header_length);
    2.80      header_extra = pi->header_length - (MAX_ETH_HEADER_LENGTH + pi->ip4_header_length + pi->tcp_header_length);
    2.81 -    NT_ASSERT(pi->header_length <= MAX_ETH_HEADER_LENGTH + MAX_LOOKAHEAD_LENGTH);
    2.82 +    XN_ASSERT(pi->header_length <= MAX_ETH_HEADER_LENGTH + MAX_LOOKAHEAD_LENGTH);
    2.83      header_buf->mdl->ByteCount = pi->header_length;
    2.84      mdl_head = mdl_tail = curr_mdl = header_buf->mdl;
    2.85      #if NTDDI_VERSION < NTDDI_VISTA
    2.86 @@ -442,10 +442,10 @@ XenNet_MakePacket(struct xennet_info *xi
    2.87        pi->tcp_remaining = (USHORT)(pi->tcp_remaining - tcp_length);
    2.88        /* part of the packet is already present in the header buffer for lookahead */
    2.89        out_remaining = tcp_length - header_extra;
    2.90 -      NT_ASSERT((LONG)out_remaining >= 0);
    2.91 +      XN_ASSERT((LONG)out_remaining >= 0);
    2.92      } else {
    2.93        out_remaining = pi->total_length - pi->header_length;
    2.94 -      NT_ASSERT((LONG)out_remaining >= 0);
    2.95 +      XN_ASSERT((LONG)out_remaining >= 0);
    2.96      }
    2.97  
    2.98      while (out_remaining != 0) {
    2.99 @@ -466,7 +466,7 @@ XenNet_MakePacket(struct xennet_info *xi
   2.100        in_buffer_length = MmGetMdlByteCount(pi->curr_mdl);
   2.101        out_length = min(out_remaining, in_buffer_length - pi->curr_mdl_offset);
   2.102        curr_mdl = IoAllocateMdl((PUCHAR)MmGetMdlVirtualAddress(pi->curr_mdl) + pi->curr_mdl_offset, out_length, FALSE, FALSE, NULL);
   2.103 -      NT_ASSERT(curr_mdl);
   2.104 +      XN_ASSERT(curr_mdl);
   2.105        IoBuildPartialMdl(pi->curr_mdl, curr_mdl, (PUCHAR)MmGetMdlVirtualAddress(pi->curr_mdl) + pi->curr_mdl_offset, out_length);
   2.106        mdl_tail->Next = curr_mdl;
   2.107        mdl_tail = curr_mdl;
   2.108 @@ -502,7 +502,7 @@ XenNet_MakePacket(struct xennet_info *xi
   2.109      #if NTDDI_VERSION < NTDDI_VISTA
   2.110      csum_info = (PNDIS_TCP_IP_CHECKSUM_PACKET_INFO)&NDIS_PER_PACKET_INFO_FROM_PACKET(
   2.111        packet, TcpIpChecksumPacketInfo);
   2.112 -    ASSERT(csum_info->Value == 0);
   2.113 +    XN_ASSERT(csum_info->Value == 0);
   2.114      if (pi->csum_blank || pi->data_validated) {
   2.115        BOOLEAN checksum_offload = FALSE;
   2.116        /* we know this is IPv4, and we know Linux always validates the IPv4 checksum for us */
   2.117 @@ -724,7 +724,7 @@ XenNet_ReturnPacket(NDIS_HANDLE adapter_
   2.118    
   2.119    while (buffer) {
   2.120      shared_buffer_t *next_buf;
   2.121 -    ASSERT(page_buf);
   2.122 +    XN_ASSERT(page_buf);
   2.123      next_buf = page_buf->next;
   2.124      if (!page_buf->virtual) {
   2.125        /* this is a hb not a pb because virtual is NULL (virtual is just the memory after the hb */
   2.126 @@ -757,7 +757,7 @@ XenNet_ReturnNetBufferLists(NDIS_HANDLE 
   2.127  
   2.128    //KdPrint((__DRIVER_NAME "     page_buf = %p\n", page_buf));
   2.129  
   2.130 -  NT_ASSERT(xi);
   2.131 +  XN_ASSERT(xi);
   2.132    while (curr_nbl)
   2.133    {
   2.134      PNET_BUFFER_LIST next_nbl;
   2.135 @@ -779,7 +779,7 @@ XenNet_ReturnNetBufferLists(NDIS_HANDLE 
   2.136          shared_buffer_t *next_buf;
   2.137          PMDL next_mdl;
   2.138          
   2.139 -        NT_ASSERT(page_buf); /* make sure that there is a pb to match this mdl */
   2.140 +        XN_ASSERT(page_buf); /* make sure that there is a pb to match this mdl */
   2.141          next_mdl = curr_mdl->Next;
   2.142          next_buf = page_buf->next;
   2.143          if (!page_buf->virtual)
   2.144 @@ -892,7 +892,7 @@ XenNet_RxBufferCheck(struct xennet_info 
   2.145      for (cons = xi->rx_ring.rsp_cons; cons != prod && packet_count < MAXIMUM_PACKETS_PER_INTERRUPT && packet_data < MAXIMUM_DATA_PER_INTERRUPT; cons++) {
   2.146        id = (USHORT)(cons & (NET_RX_RING_SIZE - 1));
   2.147        page_buf = xi->rx_ring_pbs[id];
   2.148 -      NT_ASSERT(page_buf);
   2.149 +      XN_ASSERT(page_buf);
   2.150        xi->rx_ring_pbs[id] = NULL;
   2.151        xi->rx_id_free++;
   2.152        memcpy(&page_buf->rsp, RING_GET_RESPONSE(&xi->rx_ring, cons), max(sizeof(struct netif_rx_response), sizeof(struct netif_extra_info)));
   2.153 @@ -900,7 +900,7 @@ XenNet_RxBufferCheck(struct xennet_info 
   2.154          if (page_buf->rsp.status <= 0 || page_buf->rsp.offset + page_buf->rsp.status > PAGE_SIZE) {
   2.155            KdPrint((__DRIVER_NAME "     Error: rsp offset %d, size %d\n",
   2.156              page_buf->rsp.offset, page_buf->rsp.status));
   2.157 -          NT_ASSERT(!extra_info_flag);
   2.158 +          XN_ASSERT(!extra_info_flag);
   2.159            put_pb_on_freelist(xi, page_buf);
   2.160            continue;
   2.161          }
   2.162 @@ -998,7 +998,7 @@ XenNet_RxBufferCheck(struct xennet_info 
   2.163          switch (ei->u.gso.type) {
   2.164          case XEN_NETIF_GSO_TYPE_TCPV4:
   2.165            pi->mss = ei->u.gso.size;
   2.166 -          // TODO - put this assertion somewhere NT_ASSERT(header_len + pi->mss <= PAGE_SIZE); // this limits MTU to PAGE_SIZE - XN_HEADER_LEN
   2.167 +          // TODO - put this assertion somewhere XN_ASSERT(header_len + pi->mss <= PAGE_SIZE); // this limits MTU to PAGE_SIZE - XN_HEADER_LEN
   2.168            break;
   2.169          default:
   2.170            KdPrint((__DRIVER_NAME "     Unknown GSO type (%d) detected\n", ei->u.gso.type));
   2.171 @@ -1011,7 +1011,7 @@ XenNet_RxBufferCheck(struct xennet_info 
   2.172        }
   2.173        put_pb_on_freelist(xi, page_buf);
   2.174      } else {
   2.175 -      NT_ASSERT(!page_buf->rsp.offset);
   2.176 +      XN_ASSERT(!page_buf->rsp.offset);
   2.177        if (!more_data_flag) { // handling the packet's 1st buffer
   2.178          if (page_buf->rsp.flags & NETRXF_csum_blank)
   2.179            pi->csum_blank = TRUE;
   2.180 @@ -1022,11 +1022,11 @@ XenNet_RxBufferCheck(struct xennet_info 
   2.181        mdl->ByteCount = page_buf->rsp.status; //NdisAdjustBufferLength(mdl, page_buf->rsp.status);
   2.182        //KdPrint((__DRIVER_NAME "     buffer = %p, pb = %p\n", buffer, page_buf));
   2.183        if (pi->first_pb) {
   2.184 -        NT_ASSERT(pi->curr_pb);
   2.185 +        XN_ASSERT(pi->curr_pb);
   2.186          //KdPrint((__DRIVER_NAME "     additional buffer\n"));
   2.187          pi->curr_pb->next = page_buf;
   2.188          pi->curr_pb = page_buf;
   2.189 -        NT_ASSERT(pi->curr_mdl);
   2.190 +        XN_ASSERT(pi->curr_mdl);
   2.191          pi->curr_mdl->Next = mdl;
   2.192          pi->curr_mdl = mdl;
   2.193        } else {
   2.194 @@ -1050,7 +1050,7 @@ XenNet_RxBufferCheck(struct xennet_info 
   2.195  
   2.196      page_buf = next_buf;
   2.197    }
   2.198 -  NT_ASSERT(!more_data_flag && !extra_info_flag);
   2.199 +  XN_ASSERT(!more_data_flag && !extra_info_flag);
   2.200  
   2.201    #if NTDDI_VERSION < NTDDI_VISTA
   2.202    packet_count = 0;
   2.203 @@ -1062,7 +1062,7 @@ XenNet_RxBufferCheck(struct xennet_info 
   2.204      NDIS_STATUS status;
   2.205  
   2.206      packet = rc.first_packet;
   2.207 -    ASSERT(PACKET_FIRST_PB(packet));
   2.208 +    XN_ASSERT(PACKET_FIRST_PB(packet));
   2.209      rc.first_packet = PACKET_NEXT_PACKET(packet);
   2.210      status = NDIS_GET_PACKET_STATUS(packet);
   2.211      if (status == NDIS_STATUS_RESOURCES) {
     3.1 --- a/xennet/xennet_tx.c	Tue Feb 19 15:11:49 2013 +1100
     3.2 +++ b/xennet/xennet_tx.c	Tue Feb 19 15:12:35 2013 +1100
     3.3 @@ -24,7 +24,7 @@ Foundation, Inc., 51 Franklin Street, Fi
     3.4  static USHORT
     3.5  get_id_from_freelist(struct xennet_info *xi)
     3.6  {
     3.7 -  NT_ASSERT(xi->tx_id_free);
     3.8 +  XN_ASSERT(xi->tx_id_free);
     3.9    xi->tx_id_free--;
    3.10  
    3.11    return xi->tx_id_list[xi->tx_id_free];
    3.12 @@ -47,15 +47,15 @@ XenNet_PutCbOnRing(struct xennet_info *x
    3.13    xi->tx_ring.req_prod_pvt++;
    3.14    xi->tx_ring_free--;
    3.15    tx->id = get_id_from_freelist(xi);
    3.16 -  NT_ASSERT(xi->tx_shadows[tx->id].gref == INVALID_GRANT_REF);
    3.17 -  NT_ASSERT(!xi->tx_shadows[tx->id].cb);
    3.18 +  XN_ASSERT(xi->tx_shadows[tx->id].gref == INVALID_GRANT_REF);
    3.19 +  XN_ASSERT(!xi->tx_shadows[tx->id].cb);
    3.20    xi->tx_shadows[tx->id].cb = coalesce_buf;
    3.21    tx->gref = XnGrantAccess(xi->handle, (ULONG)(MmGetPhysicalAddress(coalesce_buf).QuadPart >> PAGE_SHIFT), FALSE, gref, (ULONG)'XNTX');
    3.22    xi->tx_shadows[tx->id].gref = tx->gref;
    3.23    tx->offset = 0;
    3.24    tx->size = (USHORT)length;
    3.25 -  NT_ASSERT(tx->offset + tx->size <= PAGE_SIZE);
    3.26 -  NT_ASSERT(tx->size);
    3.27 +  XN_ASSERT(tx->offset + tx->size <= PAGE_SIZE);
    3.28 +  XN_ASSERT(tx->size);
    3.29    return tx;
    3.30  }
    3.31  
    3.32 @@ -228,7 +228,7 @@ XenNet_HWSendPacket(struct xennet_info *
    3.33  
    3.34    /* (A) */
    3.35    tx0 = XenNet_PutCbOnRing(xi, coalesce_buf, pi.header_length, gref);
    3.36 -  NT_ASSERT(tx0); /* this will never happen */
    3.37 +  XN_ASSERT(tx0); /* this will never happen */
    3.38    tx0->flags = flags;
    3.39    tx_length += pi.header_length;
    3.40  
    3.41 @@ -246,7 +246,7 @@ XenNet_HWSendPacket(struct xennet_info *
    3.42  
    3.43    /* (B) */
    3.44    if (xen_gso) {
    3.45 -    NT_ASSERT(flags & NETTXF_extra_info);
    3.46 +    XN_ASSERT(flags & NETTXF_extra_info);
    3.47      ei = (struct netif_extra_info *)RING_GET_REQUEST(&xi->tx_ring, xi->tx_ring.req_prod_pvt);
    3.48      //KdPrint((__DRIVER_NAME "     pos = %d\n", xi->tx_ring.req_prod_pvt));
    3.49      xi->tx_ring.req_prod_pvt++;
    3.50 @@ -259,7 +259,7 @@ XenNet_HWSendPacket(struct xennet_info *
    3.51      ei->u.gso.features = 0;
    3.52    }
    3.53  
    3.54 -  NT_ASSERT(xi->current_sg_supported || !remaining);
    3.55 +  XN_ASSERT(xi->current_sg_supported || !remaining);
    3.56    
    3.57    /* (C) - only if data is remaining */
    3.58    coalesce_buf = NULL;
    3.59 @@ -267,7 +267,7 @@ XenNet_HWSendPacket(struct xennet_info *
    3.60      ULONG length;
    3.61      PFN_NUMBER pfn;
    3.62  
    3.63 -    NT_ASSERT(pi.curr_mdl);
    3.64 +    XN_ASSERT(pi.curr_mdl);
    3.65      if (coalesce_required) {
    3.66        PVOID va;
    3.67        if (!coalesce_buf) {
    3.68 @@ -306,7 +306,7 @@ XenNet_HWSendPacket(struct xennet_info *
    3.69      if (coalesce_buf) {
    3.70        if (remaining) {
    3.71          txN = XenNet_PutCbOnRing(xi, coalesce_buf, min(PAGE_SIZE, remaining), gref);
    3.72 -        NT_ASSERT(txN);
    3.73 +        XN_ASSERT(txN);
    3.74          coalesce_buf = NULL;
    3.75          tx_length += min(PAGE_SIZE, remaining);
    3.76          remaining -= min(PAGE_SIZE, remaining);
    3.77 @@ -323,18 +323,18 @@ XenNet_HWSendPacket(struct xennet_info *
    3.78        xi->tx_ring.req_prod_pvt++;
    3.79        xi->tx_ring_free--;
    3.80        txN->id = get_id_from_freelist(xi);
    3.81 -      NT_ASSERT(!xi->tx_shadows[txN->id].cb);
    3.82 +      XN_ASSERT(!xi->tx_shadows[txN->id].cb);
    3.83        offset = MmGetMdlByteOffset(pi.curr_mdl) + pi.curr_mdl_offset;
    3.84        pfn = MmGetMdlPfnArray(pi.curr_mdl)[offset >> PAGE_SHIFT];
    3.85        txN->offset = (USHORT)offset & (PAGE_SIZE - 1);
    3.86        txN->gref = XnGrantAccess(xi->handle, (ULONG)pfn, FALSE, gref, (ULONG)'XNTX');
    3.87 -      NT_ASSERT(xi->tx_shadows[txN->id].gref == INVALID_GRANT_REF);
    3.88 +      XN_ASSERT(xi->tx_shadows[txN->id].gref == INVALID_GRANT_REF);
    3.89        xi->tx_shadows[txN->id].gref = txN->gref;
    3.90        //ASSERT(sg->Elements[sg_element].Length > sg_offset);
    3.91        txN->size = (USHORT)length;
    3.92 -      NT_ASSERT(txN->offset + txN->size <= PAGE_SIZE);
    3.93 -      NT_ASSERT(txN->size);
    3.94 -      NT_ASSERT(txN->gref != INVALID_GRANT_REF);
    3.95 +      XN_ASSERT(txN->offset + txN->size <= PAGE_SIZE);
    3.96 +      XN_ASSERT(txN->size);
    3.97 +      XN_ASSERT(txN->gref != INVALID_GRANT_REF);
    3.98        remaining -= length;
    3.99        tx_length += length;
   3.100      }
   3.101 @@ -343,8 +343,8 @@ XenNet_HWSendPacket(struct xennet_info *
   3.102      XenNet_EatData(&pi, length);
   3.103    }
   3.104    txN->flags &= ~NETTXF_more_data;
   3.105 -  NT_ASSERT(tx0->size == pi.total_length);
   3.106 -  NT_ASSERT(!xi->tx_shadows[txN->id].packet);
   3.107 +  XN_ASSERT(tx0->size == pi.total_length);
   3.108 +  XN_ASSERT(!xi->tx_shadows[txN->id].packet);
   3.109    xi->tx_shadows[txN->id].packet = packet;
   3.110  
   3.111    #if NTDDI_VERSION < NTDDI_VISTA
   3.112 @@ -414,7 +414,7 @@ XenNet_TxBufferGC(struct xennet_info *xi
   3.113    #endif
   3.114    ULONG tx_packets = 0;
   3.115  
   3.116 -  NT_ASSERT(KeGetCurrentIrql() == DISPATCH_LEVEL);
   3.117 +  XN_ASSERT(KeGetCurrentIrql() == DISPATCH_LEVEL);
   3.118  
   3.119    KeAcquireSpinLockAtDpcLevel(&xi->tx_lock);
   3.120  
   3.121 @@ -570,7 +570,7 @@ XenNet_SendPackets(NDIS_HANDLE MiniportA
   3.122  
   3.123    for (i = 0; i < NumberOfPackets; i++) {
   3.124      packet = PacketArray[i];
   3.125 -    ASSERT(packet);
   3.126 +    XN_ASSERT(packet);
   3.127      entry = &PACKET_LIST_ENTRY(packet);
   3.128      InsertTailList(&xi->tx_waiting_pkt_list, entry);
   3.129    }