Skip to content

Commit

Permalink
Stop adapter on Rx cancel. Ensure working S3 sleep/wake
Browse files Browse the repository at this point in the history
  • Loading branch information
coolstar committed Mar 12, 2024
1 parent a5082c4 commit 262dd17
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
6 changes: 6 additions & 0 deletions rxqueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,12 @@ EvtRxQueueCancel(

RT_RXQUEUE* rx = RtGetRxQueueContext(rxQueue);

WdfSpinLockAcquire(rx->Adapter->Lock);

re_stop(&rx->Adapter->bsdData);

WdfSpinLockRelease(rx->Adapter->Lock);

// try (but not very hard) to grab anything that may have been
// indicated during rx disable. advance will continue to be called
// after cancel until all packets are returned to the framework.
Expand Down
13 changes: 0 additions & 13 deletions txqueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -641,18 +641,5 @@ EvtTxQueueCancel(
// the queue will continue to be drained like normal.
//

NET_RING* pr = NetRingCollectionGetPacketRing(tx->Rings);

while (pr->BeginIndex != pr->EndIndex)
{
NET_PACKET* packet = NetRingGetPacketAtIndex(pr, pr->BeginIndex);
packet->Ignore = 1;

pr->BeginIndex = NetRingIncrementIndex(pr, pr->BeginIndex);
}

NET_RING* fr = NetRingCollectionGetFragmentRing(tx->Rings);
fr->BeginIndex = fr->EndIndex;

TraceExit();
}

0 comments on commit 262dd17

Please sign in to comment.