s->chr_event(s->handler_opaque, event);
}
-static void qemu_chr_reset_bh(void *opaque)
+static void qemu_chr_generic_open_bh(void *opaque)
{
CharDriverState *s = opaque;
qemu_chr_event(s, CHR_EVENT_OPENED);
s->bh = NULL;
}
-void qemu_chr_reset(CharDriverState *s)
+void qemu_chr_generic_open(CharDriverState *s)
{
if (s->bh == NULL) {
- s->bh = qemu_bh_new(qemu_chr_reset_bh, s);
+ s->bh = qemu_bh_new(qemu_chr_generic_open_bh, s);
qemu_bh_schedule(s->bh);
}
}
chr->chr_update_read_handler = fd_chr_update_read_handler;
chr->chr_close = fd_chr_close;
- qemu_chr_reset(chr);
+ qemu_chr_generic_open(chr);
return chr;
}
qemu_mod_timer(s->timer, qemu_get_clock(rt_clock) + 1000);
} else {
if (!s->connected)
- qemu_chr_reset(chr);
+ qemu_chr_generic_open(chr);
s->connected = 1;
}
}
return NULL;
}
chr->chr_ioctl = tty_serial_ioctl;
- qemu_chr_reset(chr);
+ qemu_chr_generic_open(chr);
return chr;
}
#else /* ! __linux__ && ! __sun__ */
chr->chr_close = pp_close;
chr->opaque = drv;
- qemu_chr_reset(chr);
+ qemu_chr_generic_open(chr);
return chr;
}
free(chr);
return NULL;
}
- qemu_chr_reset(chr);
+ qemu_chr_generic_open(chr);
return chr;
}
free(chr);
return NULL;
}
- qemu_chr_reset(chr);
+ qemu_chr_generic_open(chr);
return chr;
}
s->hcom = fd_out;
chr->opaque = s;
chr->chr_write = win_chr_write;
- qemu_chr_reset(chr);
+ qemu_chr_generic_open(chr);
return chr;
}
s->connected = 1;
qemu_set_fd_handler2(s->fd, tcp_chr_read_poll,
tcp_chr_read, NULL, chr);
- qemu_chr_reset(chr);
+ qemu_chr_generic_open(chr);
}
#define IACSET(x,a,b,c) x[0] = a; x[1] = b; x[2] = c;
IOEventHandler *fd_event,
void *opaque);
int qemu_chr_ioctl(CharDriverState *s, int cmd, void *arg);
-void qemu_chr_reset(CharDriverState *s);
+void qemu_chr_generic_open(CharDriverState *s);
int qemu_chr_can_read(CharDriverState *s);
void qemu_chr_read(CharDriverState *s, uint8_t *buf, int len);
int qemu_chr_get_msgfd(CharDriverState *s);