REG_FIFO_COUNT
while ((len = inw(fd->base + REG_FIFO_COUNT)) > 0) {
while ((len = FIFO_Size - inw(fd->base + REG_FIFO_COUNT)) > 512) {