/* Read data from the ethernet controller RX FIFO. 
When reading data from the controller the first 4 bytes is always dummy data and is skipped by this function. */
void KSZ8851SNL_SPI_ReadFifo(int numBytes, uint8_t *data)
/* Read data from the ethernet controller RX FIFO. 
When reading data from the controller the first 4 bytes is always dummy data and is skipped by this function. */
void KSZ8851SNL_SPI_ReadFifo(int numBytes, uint8_t *data)
{
  EFM_ASSERT(numBytes >= 0 && numBytes < 12000);
  EFM_ASSERT(data != NULL);
  uint8_t cmd = OPCODE_FIFO_READ;
  uint8_t dummy[4];
  KSZ8851SNL_SPI_SetChipSelect(true);
  KSZ8851SNL_SPI_Transmit(1, &cmd);
  KSZ8851SNL_SPI_Receive(4, dummy);
  KSZ8851SNL_SPI_Receive(numBytes, data);
  KSZ8851SNL_SPI_SetChipSelect(false);
}