Commit f1d23ed8218ca5afaf178a6495253dbb7fc98f57
Committed by
Jesper Nilsson
1 parent
9fe6206f40
Exists in
master
and in
39 other branches
CRIS: ioctl for getting RS485 information
Add ioctl to CRIS serial driver to get RS485 data from user-space. Signed-off-by: Claudio Scordino <claudio@evidence.eu.com> Signed-off-by: Jesper Nilsson <jesper.nilsson@axis.com>
Showing 2 changed files with 12 additions and 0 deletions Side-by-side Diff
arch/cris/include/asm/ioctls.h
... | ... | @@ -77,6 +77,7 @@ |
77 | 77 | #define TIOCSERSETRS485 0x5461 /* enable rs-485 (deprecated) */ |
78 | 78 | #define TIOCSERWRRS485 0x5462 /* write rs-485 */ |
79 | 79 | #define TIOCSRS485 0x5463 /* enable rs-485 */ |
80 | +#define TIOCGRS485 0x542E /* get rs-485 */ | |
80 | 81 | |
81 | 82 | /* Used for packet mode */ |
82 | 83 | #define TIOCPKT_DATA 0 |
drivers/serial/crisv10.c
... | ... | @@ -3724,6 +3724,17 @@ |
3724 | 3724 | return e100_enable_rs485(tty, &rs485data); |
3725 | 3725 | } |
3726 | 3726 | |
3727 | + case TIOCGRS485: | |
3728 | + { | |
3729 | + struct serial_rs485 *rs485data = | |
3730 | + &(((struct e100_serial *)tty->driver_data)->rs485); | |
3731 | + /* This is the ioctl to get RS485 data from user-space */ | |
3732 | + if (copy_to_user((struct serial_rs485 *) arg, | |
3733 | + rs485data, | |
3734 | + sizeof(serial_rs485))) | |
3735 | + return -EFAULT; | |
3736 | + break; | |
3737 | + } | |
3727 | 3738 | |
3728 | 3739 | case TIOCSERWRRS485: |
3729 | 3740 | { |