提交 f1d23ed8 编写于 作者: C Claudio Scordino 提交者: Jesper Nilsson

CRIS: ioctl for getting RS485 information

Add ioctl to CRIS serial driver to get RS485 data from user-space.
Signed-off-by: NClaudio Scordino <claudio@evidence.eu.com>
Signed-off-by: NJesper Nilsson <jesper.nilsson@axis.com>
上级 9fe6206f
...@@ -77,6 +77,7 @@ ...@@ -77,6 +77,7 @@
#define TIOCSERSETRS485 0x5461 /* enable rs-485 (deprecated) */ #define TIOCSERSETRS485 0x5461 /* enable rs-485 (deprecated) */
#define TIOCSERWRRS485 0x5462 /* write rs-485 */ #define TIOCSERWRRS485 0x5462 /* write rs-485 */
#define TIOCSRS485 0x5463 /* enable rs-485 */ #define TIOCSRS485 0x5463 /* enable rs-485 */
#define TIOCGRS485 0x542E /* get rs-485 */
/* Used for packet mode */ /* Used for packet mode */
#define TIOCPKT_DATA 0 #define TIOCPKT_DATA 0
......
...@@ -3724,6 +3724,17 @@ rs_ioctl(struct tty_struct *tty, struct file * file, ...@@ -3724,6 +3724,17 @@ rs_ioctl(struct tty_struct *tty, struct file * file,
return e100_enable_rs485(tty, &rs485data); return e100_enable_rs485(tty, &rs485data);
} }
case TIOCGRS485:
{
struct serial_rs485 *rs485data =
&(((struct e100_serial *)tty->driver_data)->rs485);
/* This is the ioctl to get RS485 data from user-space */
if (copy_to_user((struct serial_rs485 *) arg,
rs485data,
sizeof(serial_rs485)))
return -EFAULT;
break;
}
case TIOCSERWRRS485: case TIOCSERWRRS485:
{ {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册