/* Z8530 transmit interrupt handler for the PIO mode. The basic idea is to attempt to keep the FIFO fed. We fill as many bytes in as possible, its quite possible that we won't keep up with the data rate otherwise.  */
static void z8530_tx(struct z8530_channel *c)
/* Z8530 transmit interrupt handler for the PIO mode. The basic idea is to attempt to keep the FIFO fed. We fill as many bytes in as possible, its quite possible that we won't keep up with the data rate otherwise.  */
static void z8530_tx(struct z8530_channel *c)
{
	while(c->txcount) {
		if(!(read_zsreg(c, R0)&4))
			return;
		c->txcount--;
		write_zsreg(c, R8, *c->tx_ptr++);
		write_zsctrl(c, RES_H_IUS);
		if(c->txcount==0)
		{
			write_zsctrl(c, RES_EOM_L);
			write_zsreg(c, R10, c->regs[10]&~ABUNDER);
		}
	}
	write_zsctrl(c, RES_Tx_P);
	z8530_tx_done(c);	 
	write_zsctrl(c, RES_H_IUS);
}