480 |
480 |
481 static int ec_tty_write_room(struct tty_struct *tty) |
481 static int ec_tty_write_room(struct tty_struct *tty) |
482 { |
482 { |
483 ec_tty_t *t = (ec_tty_t *) tty->driver_data; |
483 ec_tty_t *t = (ec_tty_t *) tty->driver_data; |
484 int ret = ec_tty_tx_space(t); |
484 int ret = ec_tty_tx_space(t); |
485 |
485 |
486 #if EC_TTY_DEBUG >= 2 |
486 #if EC_TTY_DEBUG >= 2 |
487 printk(KERN_INFO PFX "%s() = %i.\n", __func__, ret); |
487 printk(KERN_INFO PFX "%s() = %i.\n", __func__, ret); |
488 #endif |
488 #endif |
489 |
489 |
490 return ret; |
490 return ret; |
494 |
494 |
495 static int ec_tty_chars_in_buffer(struct tty_struct *tty) |
495 static int ec_tty_chars_in_buffer(struct tty_struct *tty) |
496 { |
496 { |
497 ec_tty_t *t = (ec_tty_t *) tty->driver_data; |
497 ec_tty_t *t = (ec_tty_t *) tty->driver_data; |
498 int ret; |
498 int ret; |
499 |
499 |
500 #if EC_TTY_DEBUG >= 2 |
500 #if EC_TTY_DEBUG >= 2 |
501 printk(KERN_INFO PFX "%s().\n", __func__); |
501 printk(KERN_INFO PFX "%s().\n", __func__); |
502 #endif |
502 #endif |
503 |
503 |
504 ret = ec_tty_tx_size(t); |
504 ret = ec_tty_tx_size(t); |
505 |
505 |
506 #if EC_TTY_DEBUG >= 2 |
506 #if EC_TTY_DEBUG >= 2 |
507 printk(KERN_INFO PFX "%s() = %i.\n", __func__, ret); |
507 printk(KERN_INFO PFX "%s() = %i.\n", __func__, ret); |
508 #endif |
508 #endif |
509 |
509 |
510 return ret; |
510 return ret; |
511 } |
511 } |
512 |
512 |
513 /*****************************************************************************/ |
513 /*****************************************************************************/ |
514 |
514 |
526 static int ec_tty_ioctl(struct tty_struct *tty, struct file *file, |
526 static int ec_tty_ioctl(struct tty_struct *tty, struct file *file, |
527 unsigned int cmd, unsigned long arg) |
527 unsigned int cmd, unsigned long arg) |
528 { |
528 { |
529 ec_tty_t *t = (ec_tty_t *) tty->driver_data; |
529 ec_tty_t *t = (ec_tty_t *) tty->driver_data; |
530 int ret = -ENOTTY; |
530 int ret = -ENOTTY; |
531 |
531 |
532 #if EC_TTY_DEBUG >= 2 |
532 #if EC_TTY_DEBUG >= 2 |
533 printk(KERN_INFO PFX "%s(tty=%p, file=%p, cmd=%08x, arg=%08lx).\n", |
533 printk(KERN_INFO PFX "%s(tty=%p, file=%p, cmd=%08x, arg=%08lx).\n", |
534 __func__, tty, file, cmd, arg); |
534 __func__, tty, file, cmd, arg); |
535 printk(KERN_INFO PFX "decoded: type=%02x nr=%u\n", |
535 printk(KERN_INFO PFX "decoded: type=%02x nr=%u\n", |
536 _IOC_TYPE(cmd), _IOC_NR(cmd)); |
536 _IOC_TYPE(cmd), _IOC_NR(cmd)); |