win-pvdrivers

changeset 525:91195e6cdb5d

Worked around xennet 'out of resource' hang under XP. Change Isr handling.
author James Harper <james.harper@bendigoit.com.au>
date Fri Jan 16 22:32:40 2009 +1100 (2009-01-16)
parents abde14807545
children 08f3662b6807
files xennet/xennet.c xennet/xennet.inx xennet/xennet_rx.c xennet/xennet_tx.c
line diff
     1.1 --- a/xennet/xennet.c	Wed Jan 07 11:08:08 2009 +1100
     1.2 +++ b/xennet/xennet.c	Fri Jan 16 22:32:40 2009 +1100
     1.3 @@ -247,41 +247,6 @@ XenNet_SuspendResume(PKDPC dpc, PVOID co
     1.4    FUNCTION_EXIT();
     1.5  }
     1.6  
     1.7 -static DDKAPI VOID
     1.8 -XenNet_InterruptIsr(
     1.9 -  PBOOLEAN InterruptRecognized,
    1.10 -  PBOOLEAN QueueMiniportHandleInterrupt,
    1.11 -  NDIS_HANDLE MiniportAdapterContext)
    1.12 -{
    1.13 -  struct xennet_info *xi = MiniportAdapterContext;
    1.14 -  
    1.15 -  //FUNCTION_ENTER();
    1.16 -  *InterruptRecognized = FALSE;
    1.17 -  *QueueMiniportHandleInterrupt = FALSE;
    1.18 -  if (!xi->vectors.EvtChn_AckEvent(xi->vectors.context, xi->event_channel))
    1.19 -  {
    1.20 -    KdPrint((__DRIVER_NAME "     Interrupt NOT for me\n"));
    1.21 -    /* interrupt was not for us */
    1.22 -  }
    1.23 -  else
    1.24 -  {
    1.25 -    KdPrint((__DRIVER_NAME "     Interrupt for me\n"));
    1.26 -    //*QueueMiniportHandleInterrupt = (BOOLEAN)!!xi->connected;
    1.27 -    if (xi->device_state->resume_state != xi->device_state->resume_state_ack)
    1.28 -    {
    1.29 -      KeInsertQueueDpc(&xi->suspend_dpc, NULL, NULL);
    1.30 -    }
    1.31 -    else if (xi->connected && !xi->inactive && xi->device_state->resume_state == RESUME_STATE_RUNNING)
    1.32 -    {
    1.33 -      KdPrint((__DRIVER_NAME "     Queuing DPC's\n"));
    1.34 -      KeInsertQueueDpc(&xi->tx_dpc, NULL, NULL);
    1.35 -      KeInsertQueueDpc(&xi->rx_dpc, UlongToPtr(FALSE), NULL);
    1.36 -    }
    1.37 -  }
    1.38 -
    1.39 -  //FUNCTION_EXIT();
    1.40 -}
    1.41 -
    1.42  static DDKAPI BOOLEAN
    1.43  XenNet_HandleEvent(PVOID context)
    1.44  {
     2.1 --- a/xennet/xennet.inx	Wed Jan 07 11:08:08 2009 +1100
     2.2 +++ b/xennet/xennet.inx	Fri Jan 16 22:32:40 2009 +1100
     2.3 @@ -109,7 +109,7 @@ AddReg = XenNet_Service_AddReg
     2.4  
     2.5  [XenNet_Service_AddReg]
     2.6  ; 5 = PciBus, 0 = Internal, 15 = PnpBus
     2.7 -HKR,"Parameters\PnpInterface", "0", 0x00010001, 0x00000001
     2.8 +HKR,"Parameters\PnpInterface", "15", 0x00010001, 0x00000001
     2.9  HKLM,SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318},UpperFilters,0x00010008,XenHide
    2.10  
    2.11  [Strings]
     3.1 --- a/xennet/xennet_rx.c	Wed Jan 07 11:08:08 2009 +1100
     3.2 +++ b/xennet/xennet_rx.c	Fri Jan 16 22:32:40 2009 +1100
     3.3 @@ -35,8 +35,8 @@ XenNet_RxBufferAlloc(struct xennet_info 
     3.4  
     3.5    batch_target = xi->rx_target - (req_prod - xi->rx.rsp_cons);
     3.6  
     3.7 -  //if (batch_target < (xi->rx_target >> 2))
     3.8 -  //  return NDIS_STATUS_SUCCESS; /* only refill if we are less than 3/4 full already */
     3.9 +  if (batch_target < (xi->rx_target >> 2))
    3.10 +    return NDIS_STATUS_SUCCESS; /* only refill if we are less than 3/4 full already */
    3.11  
    3.12    for (i = 0; i < batch_target; i++)
    3.13    {
    3.14 @@ -200,7 +200,6 @@ XenNet_MakePacket(struct xennet_info *xi
    3.15    }
    3.16  
    3.17    //FUNCTION_EXIT();
    3.18 -  
    3.19    return packet;
    3.20  }
    3.21  
    3.22 @@ -338,7 +337,7 @@ XenNet_MakePackets(
    3.23    //FUNCTION_ENTER();
    3.24  
    3.25    parse_result = XenNet_ParsePacketHeader(&xi->rxpi);
    3.26 -  
    3.27 +
    3.28    if ((xi->packet_filter & NDIS_PACKET_TYPE_MULTICAST)
    3.29      && !(xi->packet_filter & NDIS_PACKET_TYPE_ALL_MULTICAST)
    3.30      && (xi->rxpi.header[0] & 0x01)
    3.31 @@ -790,6 +789,8 @@ XenNet_ReturnPacket(
    3.32    if (!xi->rx_outstanding && xi->rx_shutting_down)
    3.33      KeSetEvent(&xi->packet_returned_event, IO_NO_INCREMENT, FALSE);
    3.34  
    3.35 +  XenNet_RxBufferAlloc(xi);
    3.36 +
    3.37    KeReleaseSpinLockFromDpcLevel(&xi->rx_lock);
    3.38  
    3.39    //FUNCTION_EXIT();
     4.1 --- a/xennet/xennet_tx.c	Wed Jan 07 11:08:08 2009 +1100
     4.2 +++ b/xennet/xennet_tx.c	Fri Jan 16 22:32:40 2009 +1100
     4.3 @@ -127,7 +127,7 @@ XenNet_HWSendPacket(struct xennet_info *
     4.4      KdPrint((__DRIVER_NAME "     NdisGetFirstBufferFromPacketSafe failed\n"));
     4.5      return FALSE;
     4.6    }
     4.7 -  
     4.8 +
     4.9    if (!total_length)
    4.10    {
    4.11      KdPrint((__DRIVER_NAME "     Zero length packet\n"));