34 #include <linux/tty.h>
35 #include <linux/serial.h>
37 #include <asm/uaccess.h>
47 #define RELEVANT_IFLAG(iflag) (iflag & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK))
55 static void ircomm_tty_change_speed(
struct ircomm_tty_cb *
self,
58 unsigned int cflag, cval;
66 cflag = tty->termios.c_cflag;
69 switch (cflag &
CSIZE) {
89 self->settings.data_rate =
baud;
98 IRDA_WARNING(
"%s(), enabling RTS/CTS on link that doesn't support it (3-wire-raw)\n", __func__);
120 driver->ignore_status_mask = 0;
125 self->ignore_status_mask |=
LSR_BI;
131 self->ignore_status_mask |=
LSR_OE;
134 self->settings.data_format = cval;
152 unsigned int cflag = tty->termios.c_cflag;
163 ircomm_tty_change_speed(
self, tty);
173 if (!(old_termios->
c_cflag & CBAUD) &&
176 if (!(tty->termios.c_cflag &
CRTSCTS) ||
185 !(tty->termios.c_cflag &
CRTSCTS))
224 unsigned int set,
unsigned int clear)
246 if ((
set|clear) & TIOCM_RTS)
248 if ((
set|clear) & TIOCM_DTR)
262 static int ircomm_tty_get_serial_info(
struct ircomm_tty_cb *
self,
273 info.line =
self->line;
274 info.flags =
self->port.flags;
275 info.baud_base =
self->settings.data_rate;
276 info.close_delay =
self->port.close_delay;
277 info.closing_wait =
self->port.closing_wait;
283 info.xmit_fifo_size = 0;
285 info.custom_divisor = 0;
299 static int ircomm_tty_set_serial_info(
struct ircomm_tty_cb *
self,
316 if ((new_serial.baud_base != state->
settings.data_rate) ||
317 (new_serial.close_delay != state->close_delay) ||
334 if (self->settings.data_rate != new_serial.baud_base) {
335 self->
settings.data_rate = new_serial.baud_base;
339 self->close_delay = new_serial.close_delay *
HZ/100;
340 self->closing_wait = new_serial.closing_wait *
HZ/100;
352 (old_driver.custom_divisor !=
driver->custom_divisor)) {
354 driver->tty->alt_speed = 57600;
356 driver->tty->alt_speed = 115200;
358 driver->tty->alt_speed = 230400;
360 driver->tty->alt_speed = 460800;
361 ircomm_tty_change_speed(
driver);
375 unsigned int cmd,
unsigned long arg)
401 IRDA_DEBUG(0,
"%s(), TIOCGICOUNT not impl!\n", __func__ );
403 save_flags(
flags); cli();
405 restore_flags(
flags);
407 if (
put_user(cnow.cts, &p_cuser->cts) ||
408 put_user(cnow.dsr, &p_cuser->dsr) ||
409 put_user(cnow.rng, &p_cuser->rng) ||
410 put_user(cnow.dcd, &p_cuser->dcd) ||
413 put_user(cnow.frame, &p_cuser->frame) ||
414 put_user(cnow.overrun, &p_cuser->overrun) ||
415 put_user(cnow.parity, &p_cuser->parity) ||
416 put_user(cnow.brk, &p_cuser->brk) ||
417 put_user(cnow.buf_overrun, &p_cuser->buf_overrun))