--- linuxppc_2_4_ORI/arch/ppc/5xxx_io/psc.c 2007-11-26 13:31:39.000000000 +0100 +++ linuxppc_2_4_devel/arch/ppc/5xxx_io/psc.c 2007-11-23 16:13:25.000000000 +0100 @@ -662,12 +662,22 @@ static void rs_hungup(void *ptr) func_exit(); } +#ifdef CONFIG_BC3450 +static int get_tx_fifo_status(struct rs_port *port, unsigned int *value) +{ + struct mpc5xxx_psc *psc = port->psc; + unsigned int result; + + /* reads and returns Tx-FIFO-Status register */ + result = in_be16(&psc->tfstat); + return put_user(result,value); +} +#endif + static int get_modem_info(struct rs_port *port, unsigned int *value) { - struct tty_struct *tty = port->gs.tty; struct mpc5xxx_psc *psc = port->psc; unsigned int result; - unsigned long flags; result = ((in_8(&psc->ip) & MPC5xxx_PSC_CTS) ? 0 : TIOCM_CTS) | ((in_8(&psc->ip) & MPC5xxx_PSC_DCD) ? 0 : TIOCM_CAR); @@ -682,13 +692,11 @@ static int get_modem_info(struct rs_port static int set_modem_info(struct rs_port *port, unsigned int cmd, unsigned int *value) { - struct tty_struct *tty = port->gs.tty; struct mpc5xxx_psc *psc = port->psc; int error = 0; unsigned int arg; - unsigned long flags; - if (copy_from_user(&arg, value, sizeof(int))) + if (get_user(arg,value)) return -EFAULT; // We only support setting/reseting the RTS bit, nothing else. @@ -754,6 +762,10 @@ static int rs_ioctl(struct tty_struct * case TIOCMBIS: rc = set_modem_info(port, cmd, (unsigned int *) arg); break; +#ifdef CONFIG_BC3450 + case TIOCGTXFIFOST: + return get_tx_fifo_status(port, (unsigned int *) arg); +#endif default: rc = -ENOIOCTLCMD; break; --- linuxppc_2_4_ORI/include/asm-ppc/ioctls.h 2007-11-26 13:31:54.000000000 +0100 +++ linuxppc_2_4_devel/include/asm-ppc/ioctls.h 2007-11-22 13:23:14.000000000 +0100 @@ -105,4 +105,6 @@ #define TIOCMIWAIT 0x545C /* wait for a change on serial input line(s) */ #define TIOCGICOUNT 0x545D /* read serial port inline interrupt counts */ +#define TIOCGTXFIFOST 0x5460 /* Get TX FIFO STatus */ + #endif /* _ASM_PPC_IOCTLS_H */