Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

NetDev_Stop() is called to shutdown a network interface hardware by disabling the receiver and transmitter, disabling receive and transmit interrupts, free all receive descriptors and deallocate all transmit buffers. When the interface is stopped, you must deallocate the DMA descriptor ring. To do that, a sub-function is called NetDev_RxDescFreeAll() where each descriptor’s buffer is freed and the DMA controller control is disabled:

Code Block
linenumberstrue
pdesc  = pdev_data->RxBufDescPtrStart;                                       (1)
for (i = 0; i < pdev_cfg->RxDescNbr; i++) {                                  (2)
    pdesc_data = (CPU_INT08U *)(pdesc->Addr);                                (3)
    NetBuf_FreeBufDataAreaRx(pif->Nbr, pdesc_data);                          (4)
    pdesc->Status = Not owned by the controller                              (5)
    pdesc++;                                                                 (6)
}

...