PCHAR Buffer;
XenbusState State;
ULONG Attempt;
+ BOOLEAN WaitForBackend;
NTSTATUS status;
Transmitter = Ring->Transmitter;
Buffer);
}
+ //
+ // If the we are disabling during an eject then the backend will still be
+ // be there, but it will be in XenbusStateClosing state, not
+ // XenbusStateConnected.
+ //
+ WaitForBackend = (State == XenbusStateConnected) || (State == XenbusStateClosing);
+
Attempt = 0;
ASSERT3U(Ring->RequestsPushed, ==, Ring->RequestsPosted);
while (Ring->ResponsesProcessed != Ring->RequestsPushed) {
__TransmitterRingSend(Ring);
(VOID) TransmitterRingPoll(Ring);
- if ((Attempt >= 100) || (State != XenbusStateConnected))
+ if ((Attempt >= 100) || !WaitForBackend)
break;
// We are waiting for a watch event at DISPATCH_LEVEL so