Skip to content

Commit

Permalink
nvnetdrv: Disable RX dma in stop_txrx function
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryzee119 committed Dec 29, 2024
1 parent 270bc8e commit 15aabd8
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions lib/net/nvnetdrv/nvnetdrv.c
Original file line number Diff line number Diff line change
Expand Up @@ -639,15 +639,6 @@ void nvnetdrv_stop (void)

KeDisconnectInterrupt(&g_interrupt);

// Disable DMA and wait for it to idle, re-checking every 50 microseconds
reg32(NvRegTxRxControl) = NVREG_TXRXCTL_DISABLE;
for (int i = 0; i < 10000; i++) {
if (reg32(NvRegTxRxControl) & NVREG_TXRXCTL_IDLE) {
break;
}
KeDelayExecutionThread(KernelMode, FALSE, FIFTY_MICRO);
}

// Stop NIC processing rings
nvnetdrv_stop_txrx();

Expand Down Expand Up @@ -716,6 +707,15 @@ void nvnetdrv_stop_txrx (void)
KeDelayExecutionThread(KernelMode, FALSE, TEN_MICRO);
}

// Disable DMA and wait for it to idle, re-checking every 50 microseconds
reg32(NvRegTxRxControl) = NVREG_TXRXCTL_DISABLE;
for (int i = 0; i < 10000; i++) {
if (reg32(NvRegTxRxControl) & NVREG_TXRXCTL_IDLE) {
break;
}
KeDelayExecutionThread(KernelMode, FALSE, FIFTY_MICRO);
}

reg32(NvRegLinkSpeed) = 0;
reg32(NvRegTransmitPoll) = 0;
}
Expand Down

0 comments on commit 15aabd8

Please sign in to comment.