/* Called by the driver when there's room for more data. If we have more packets to send, we send them here.  */
static void x25_asy_write_wakeup(struct tty_struct *tty)
/* Called by the driver when there's room for more data. If we have more packets to send, we send them here.  */
static void x25_asy_write_wakeup(struct tty_struct *tty)
{
	int actual;
	struct x25_asy *sl = tty->disc_data;
	if (!sl || sl->magic != X25_ASY_MAGIC || !netif_running(sl->dev))
		return;
	if (sl->xleft <= 0) {
		sl->dev->stats.tx_packets++;
		clear_bit(TTY_DO_WRITE_WAKEUP, &tty->flags);
		x25_asy_unlock(sl);
		return;
	}
	actual = tty->ops->write(tty, sl->xhead, sl->xleft);
	sl->xleft -= actual;
	sl->xhead += actual;
}