Exemple #1
0
/*
 * String write routine for 3215 ttys
 */
static int tty3215_write(struct tty_struct * tty,
			 const unsigned char *buf, int count)
{
	struct raw3215_info *raw;
	int i, written;

	if (!tty)
		return 0;
	raw = (struct raw3215_info *) tty->driver_data;
	written = count;
	while (count > 0) {
		for (i = 0; i < count; i++)
			if (buf[i] == '\t' || buf[i] == '\n')
				break;
		raw3215_write(raw, buf, i);
		count -= i;
		buf += i;
		if (count > 0) {
			raw3215_putchar(raw, *buf);
			count--;
			buf++;
		}
	}
	return written;
}
/*
 * Put character routine for 3215 ttys
 */
static void tty3215_put_char(struct tty_struct *tty, unsigned char ch)
{
	raw3215_info *raw;

	if (!tty)
		return;
	raw = (raw3215_info *) tty->driver_data;
	raw3215_putchar(raw, ch);
}
Exemple #3
0
/*
 * Put character routine for 3215 ttys
 */
static int tty3215_put_char(struct tty_struct *tty, unsigned char ch)
{
	struct raw3215_info *raw;

	if (!tty)
		return 0;
	raw = (struct raw3215_info *) tty->driver_data;
	raw3215_putchar(raw, ch);
	return 1;
}
Exemple #4
0
/*
 * Write a string to the 3215 console
 */
static void con3215_write(struct console *co, const char *str,
			  unsigned int count)
{
	struct raw3215_info *raw;
	int i;

	if (count <= 0)
		return;
	raw = raw3215[0];	/* console 3215 is the first one */
	while (count > 0) {
		for (i = 0; i < count; i++)
			if (str[i] == '\t' || str[i] == '\n')
				break;
		raw3215_write(raw, str, i);
		count -= i;
		str += i;
		if (count > 0) {
			raw3215_putchar(raw, *str);
			count--;
			str++;
		}
	}
}