/* This reads all available data from the mux's fifo and pushes the data to the tty layer.  */
static void mux_read(struct uart_port *port)
/* This reads all available data from the mux's fifo and pushes the data to the tty layer.  */
static void mux_read(struct uart_port *port)
{
	int data;
	struct tty_struct *tty = port->state->port.tty;
	__u32 start_count = port->icount.rx;
	while(1) {
		data = __raw_readl(port->membase + IO_DATA_REG_OFFSET);
		if (MUX_STATUS(data))
			continue;
		if (MUX_EOFIFO(data))
			break;
		port->icount.rx++;
		if (MUX_BREAK(data)) {
			port->icount.brk++;
			if(uart_handle_break(port))
				continue;
		}
		if (uart_handle_sysrq_char(port, data & 0xffu))
			continue;
		tty_insert_flip_char(tty, data & 0xFF, TTY_NORMAL);
	}
	if (start_count != port->icount.rx) {
		tty_flip_buffer_push(tty);
	}
}