win-pvdrivers

changeset 148:4c4b14a2d516

xennet: check offload struct headers always, instead of with asserts. Caught by ndistest.
Clean up some warnings.
author Andy Grover <andy.grover@oracle.com>
date Wed Jan 23 11:58:03 2008 -0800 (2008-01-23)
parents af3f6972fe54
children c3f70f8c913e
files xennet/xennet.c
line diff
     1.1 --- a/xennet/xennet.c	Tue Jan 22 20:02:17 2008 +1100
     1.2 +++ b/xennet/xennet.c	Wed Jan 23 11:58:03 2008 -0800
     1.3 @@ -423,8 +423,8 @@ XenNet_ReturnPacket(
     1.4    struct xennet_info *xi = MiniportAdapterContext;
     1.5    PNDIS_BUFFER buffer;
     1.6  //  PNDIS_BUFFER next_buffer;
     1.7 -  PVOID buff_va;
     1.8 -  UINT buff_len;
     1.9 +  // PVOID buff_va;
    1.10 +  // UINT buff_len;
    1.11    UINT tot_buff_len;
    1.12    buffer_entry_t *buffer_entry;
    1.13  
    1.14 @@ -1167,9 +1167,13 @@ XenNet_QueryInformation(
    1.15        }
    1.16  
    1.17        ntoh = (PNDIS_TASK_OFFLOAD_HEADER)InformationBuffer;
    1.18 -      ASSERT(ntoh->Version == NDIS_TASK_OFFLOAD_VERSION);
    1.19 -      ASSERT(ntoh->Size == sizeof(*ntoh));
    1.20 -      ASSERT(ntoh->EncapsulationFormat.Encapsulation == IEEE_802_3_Encapsulation);
    1.21 +      if (ntoh->Version != NDIS_TASK_OFFLOAD_VERSION
    1.22 +        || ntoh->Size != sizeof(*ntoh)
    1.23 +        || ntoh->EncapsulationFormat.Encapsulation != IEEE_802_3_Encapsulation)
    1.24 +      {
    1.25 +        status = NDIS_STATUS_NOT_SUPPORTED;
    1.26 +        break;
    1.27 +      }
    1.28        ntoh->OffsetFirstTask = ntoh->Size;
    1.29  
    1.30        /* fill in first nto */