/* Receive a series of bytes over the spi link.  */
static void KSZ8851SNL_SPI_Receive(int numBytes, uint8_t *buffer)
/* Receive a series of bytes over the spi link.  */
static void KSZ8851SNL_SPI_Receive(int numBytes, uint8_t *buffer)
{
  Ecode_t result;
  int remaining = numBytes;
  do {
    int count  = SL_MIN(remaining, DMADRV_MAX_XFER_COUNT);
    result     = SPIDRV_MReceiveB(spiHandle, buffer, count);
    remaining -= count;
    buffer    += count;
  } while (result == ECODE_EMDRV_SPIDRV_OK && remaining > 0);
  EFM_ASSERT(result == ECODE_EMDRV_SPIDRV_OK);
}