|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH 2/2] Call AdapterDisable during NdisDevicePnPEventSurpriseRemoved
During a surprise removal, NDIS performs the following sequence:
1. Call MiniportDevicePnPEventNotify(NdisDevicePnPEventSurpriseRemoved)
2. Pause protocol and filter drivers
3. Only then pause the miniport
Since MiniportPause is not called until after the protocols have been
paused, in the absence of hang detection, step 2 will hang indefinitely
while NDIS waits for transmitted packets to be returned even though the
backend's already gone.
MiniportDevicePnPEventNotify is currently the last opportunity for us to
disable the adapter, so do that here.
Signed-off-by: Tu Dinh <ngoc-tu.dinh@xxxxxxxxxx>
---
src/xennet/miniport.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/src/xennet/miniport.c b/src/xennet/miniport.c
index 3ec76a9..9f3a8c6 100644
--- a/src/xennet/miniport.c
+++ b/src/xennet/miniport.c
@@ -230,10 +230,16 @@ MiniportDevicePnPEventNotify(
IN PNET_DEVICE_PNP_EVENT NetDevicePnPEvent
)
{
- UNREFERENCED_PARAMETER(MiniportAdapterContext);
- UNREFERENCED_PARAMETER(NetDevicePnPEvent);
+ PXENNET_ADAPTER Adapter =
(PXENNET_ADAPTER)MiniportAdapterContext;
- Trace("<===>\n");
+ if (NetDevicePnPEvent->DevicePnPEvent != NdisDevicePnPEventSurpriseRemoved)
+ return;
+
+ Trace("====>\n");
+
+ AdapterDisable(Adapter);
+
+ Trace("<====\n");
}
static
--
2.53.0.windows.2
--
Ngoc Tu Dinh | Vates XCP-ng Developer
XCP-ng & Xen Orchestra - Vates solutions
web: https://vates.tech
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |